コード例 #1
0
 public boolean equals(Object other) {
   if (!(other instanceof TCharShortMap)) {
     return false;
   }
   TCharShortMap that = (TCharShortMap) other;
   if (that.size() != size()) {
     return false;
   }
   short[] values = this._values;
   byte[] states = this._states;
   short this_no_entry_value = getNoEntryValue();
   short that_no_entry_value = that.getNoEntryValue();
   for (int i = values.length; i-- > 0; ) {
     if (states[i] == 1) {
       char key = this._set[i];
       short that_value = that.get(key);
       short this_value = values[i];
       if ((this_value != that_value)
           && (this_value != this_no_entry_value)
           && (that_value != that_no_entry_value)) {
         return false;
       }
     }
   }
   return true;
 }
コード例 #2
0
 public void putAll(TCharShortMap map) {
   ensureCapacity(map.size());
   TCharShortIterator iter = map.iterator();
   while (iter.hasNext()) {
     iter.advance();
     put(iter.key(), iter.value());
   }
 }
コード例 #3
0
 public TCharShortHashMap(TCharShortMap map) {
   super(map.size());
   if ((map instanceof TCharShortHashMap)) {
     TCharShortHashMap hashmap = (TCharShortHashMap) map;
     this._loadFactor = hashmap._loadFactor;
     this.no_entry_key = hashmap.no_entry_key;
     this.no_entry_value = hashmap.no_entry_value;
     if (this.no_entry_key != 0) {
       Arrays.fill(this._set, this.no_entry_key);
     }
     if (this.no_entry_value != 0) {
       Arrays.fill(this._values, this.no_entry_value);
     }
     setUp((int) Math.ceil(10.0F / this._loadFactor));
   }
   putAll(map);
 }