Ejemplo n.º 1
0
 /** {@inheritDoc} */
 @Override
 public boolean equals(Object other) {
   if (!(other instanceof TFloatObjectMap)) {
     return false;
   }
   TFloatObjectMap that = (TFloatObjectMap) other;
   if (that.size() != this.size()) {
     return false;
   }
   try {
     TFloatObjectIterator iter = this.iterator();
     while (iter.hasNext()) {
       iter.advance();
       float key = iter.key();
       Object value = iter.value();
       if (value == null) {
         if (!(that.get(key) == null && that.containsKey(key))) {
           return false;
         }
       } else {
         if (!value.equals(that.get(key))) {
           return false;
         }
       }
     }
   } catch (ClassCastException ex) {
     // unused.
   }
   return true;
 }
 public Collection<V> valueCollection() {
   synchronized (mutex) {
     if (values == null) {
       values = new SynchronizedCollection<V>(m.valueCollection(), mutex);
     }
     return values;
   }
 }
 public void putAll(Map<? extends Float, ? extends V> map) {
   synchronized (mutex) {
     m.putAll(map);
   }
 }
Ejemplo n.º 4
0
 /** {@inheritDoc} */
 @Override
 public void putAll(TFloatObjectMap<V> map) {
   map.forEachEntry(PUT_ALL_PROC);
 }
 public V put(float key, V value) {
   synchronized (mutex) {
     return m.put(key, value);
   }
 }
 public boolean containsValue(Object value) {
   synchronized (mutex) {
     return m.containsValue(value);
   }
 }
 public boolean isEmpty() {
   synchronized (mutex) {
     return m.isEmpty();
   }
 }
 public String toString() {
   synchronized (mutex) {
     return m.toString();
   }
 }
 public boolean equals(Object o) {
   synchronized (mutex) {
     return m.equals(o);
   }
 }
 public float[] keys(float[] array) {
   synchronized (mutex) {
     return m.keys(array);
   }
 }
 public float[] keys() {
   synchronized (mutex) {
     return m.keys();
   }
 }
 public TFloatSet keySet() {
   synchronized (mutex) {
     if (keySet == null) keySet = new TSynchronizedFloatSet(m.keySet(), mutex);
     return keySet;
   }
 }
 public void clear() {
   synchronized (mutex) {
     m.clear();
   }
 }
 public void putAll(TFloatObjectMap<? extends V> map) {
   synchronized (mutex) {
     m.putAll(map);
   }
 }
 public void transformValues(TObjectFunction<V, V> function) {
   synchronized (mutex) {
     m.transformValues(function);
   }
 }
 public boolean retainEntries(TFloatObjectProcedure<? super V> procedure) {
   synchronized (mutex) {
     return m.retainEntries(procedure);
   }
 }
 public Object[] values() {
   synchronized (mutex) {
     return m.values();
   }
 }
 public int hashCode() {
   synchronized (mutex) {
     return m.hashCode();
   }
 }
 public V[] values(V[] array) {
   synchronized (mutex) {
     return m.values(array);
   }
 }
 public int size() {
   synchronized (mutex) {
     return m.size();
   }
 }
 public TFloatObjectIterator<V> iterator() {
   return m.iterator(); // Must be manually synched by user!
 }
 public boolean containsKey(float key) {
   synchronized (mutex) {
     return m.containsKey(key);
   }
 }
 // unchanging over the life of the map, no need to lock
 public float getNoEntryKey() {
   return m.getNoEntryKey();
 }
 public V get(float key) {
   synchronized (mutex) {
     return m.get(key);
   }
 }
 public boolean forEachKey(TFloatProcedure procedure) {
   synchronized (mutex) {
     return m.forEachKey(procedure);
   }
 }
Ejemplo n.º 26
0
 /**
  * Creates a new <code>TFloatObjectHashMap</code> that contains the entries in the map passed to
  * it.
  *
  * @param map the <tt>TFloatObjectMap</tt> to be copied.
  */
 public TFloatObjectHashMap(TFloatObjectMap<V> map) {
   this(map.size(), 0.5f, map.getNoEntryKey());
   putAll(map);
 }
 public boolean forEachValue(TObjectProcedure<? super V> procedure) {
   synchronized (mutex) {
     return m.forEachValue(procedure);
   }
 }
 public boolean forEachEntry(TFloatObjectProcedure<? super V> procedure) {
   synchronized (mutex) {
     return m.forEachEntry(procedure);
   }
 }
 public V remove(float key) {
   synchronized (mutex) {
     return m.remove(key);
   }
 }