コード例 #1
0
 /** {@inheritDoc} */
 @Override
 public boolean equals(Object other) {
   if (!(other instanceof TCharCharMap)) {
     return false;
   }
   TCharCharMap that = (TCharCharMap) other;
   if (that.size() != this.size()) {
     return false;
   }
   TCharOffheapArray values = _values;
   TByteOffheapArray states = _states;
   char this_no_entry_value = getNoEntryValue();
   char that_no_entry_value = that.getNoEntryValue();
   for (int i = capacity(); i-- > 0; ) {
     if (states.get(i) == FULL) {
       char key = _set.get(i);
       char that_value = that.get(key);
       char this_value = values.get(i);
       if ((this_value != that_value)
           && (this_value != this_no_entry_value)
           && (that_value != that_no_entry_value)) {
         return false;
       }
     }
   }
   return true;
 }
コード例 #2
0
 /** {@inheritDoc} */
 @Override
 public void putAll(TCharCharMap map) {
   ensureCapacity(map.size());
   TCharCharIterator iter = map.iterator();
   while (iter.hasNext()) {
     iter.advance();
     this.put(iter.key(), iter.value());
   }
 }