/** * Compares this map entry to another. * <p> * This implementation uses <code>isEqualKey</code> and * <code>isEqualValue</code> on the main map for comparison. * * @param obj the other map entry to compare to * @return true if equal, false if not */ public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof Map.Entry == false) { return false; } Map.Entry entry = (Map.Entry)obj; Object entryKey = entry.getKey(); // convert to hard reference Object entryValue = entry.getValue(); // convert to hard reference if ((entryKey == null) || (entryValue == null)) { return false; } // compare using map methods, aiding identity subclass // note that key is direct access and value is via method return parent.isEqualKey(entryKey, key) && parent.isEqualValue(entryValue, getValue()); }
/** * Compares this map entry to another. * <p> * This implementation uses <code>isEqualKey</code> and * <code>isEqualValue</code> on the main map for comparison. * * @param obj the other map entry to compare to * @return true if equal, false if not */ public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof Map.Entry == false) { return false; } Map.Entry entry = (Map.Entry)obj; Object entryKey = entry.getKey(); // convert to hard reference Object entryValue = entry.getValue(); // convert to hard reference if ((entryKey == null) || (entryValue == null)) { return false; } // compare using map methods, aiding identity subclass // note that key is direct access and value is via method return parent.isEqualKey(entryKey, key) && parent.isEqualValue(entryValue, getValue()); }
/** * Sets the value of the entry. * * @param obj the object to store * @return the previous value */ public Object setValue(Object obj) { Object old = getValue(); if (parent.valueType > HARD) { ((Reference)value).clear(); } value = toReference(parent.valueType, obj, hashCode); return old; }
/** * Gets the hashcode of the entry using temporary hard references. * <p> * This implementation uses <code>hashEntry</code> on the main map. * * @return the hashcode of the entry */ public int hashCode() { return parent.hashEntry(getKey(), getValue()); }
/** * Gets the hashcode of the entry using temporary hard references. * <p> * This implementation uses <code>hashEntry</code> on the main map. * * @return the hashcode of the entry */ public int hashCode() { return parent.hashEntry(getKey(), getValue()); }
public Object next() { return nextEntry().getValue(); } }
public Object next() { return nextEntry().getValue(); } }
/** * Gets the hashcode of the entry using temporary hard references. * <p> * This implementation uses <code>hashEntry</code> on the main map. * * @return the hashcode of the entry */ public int hashCode() { return parent.hashEntry(getKey(), getValue()); }
public Object next() { return nextEntry().getValue(); } }
public Object next() { return nextEntry().getValue(); } }
/** * Gets the hashcode of the entry using temporary hard references. * <p> * This implementation uses <code>hashEntry</code> on the main map. * * @return the hashcode of the entry */ public int hashCode() { return parent.hashEntry(getKey(), getValue()); }
/** * Gets the hashcode of the entry using temporary hard references. * <p> * This implementation uses <code>hashEntry</code> on the main map. * * @return the hashcode of the entry */ public int hashCode() { return parent.hashEntry(getKey(), getValue()); }
public boolean hasNext() { checkMod(); while (nextNull()) { ReferenceEntry e = entry; int i = index; while ((e == null) && (i > 0)) { i--; e = (ReferenceEntry) parent.data[i]; } entry = e; index = i; if (e == null) { currentKey = null; currentValue = null; return false; } nextKey = e.getKey(); nextValue = e.getValue(); if (nextNull()) { entry = entry.next(); } } return true; }
public boolean hasNext() { checkMod(); while (nextNull()) { ReferenceEntry e = entry; int i = index; while ((e == null) && (i > 0)) { i--; e = (ReferenceEntry) parent.data[i]; } entry = e; index = i; if (e == null) { currentKey = null; currentValue = null; return false; } nextKey = e.getKey(); nextValue = e.getValue(); if (nextNull()) { entry = entry.next(); } } return true; }
/** * Sets the value of the entry. * * @param obj the object to store * @return the previous value */ public Object setValue(Object obj) { Object old = getValue(); if (parent.valueType > HARD) { ((Reference)value).clear(); } value = toReference(parent.valueType, obj, hashCode); return old; }
public Object next() { return nextEntry().getValue(); } }
/** * Gets the hashcode of the entry using temporary hard references. * <p> * This implementation uses <code>hashEntry</code> on the main map. * * @return the hashcode of the entry */ public int hashCode() { return parent.hashEntry(getKey(), getValue()); }
public Object next() { return nextEntry().getValue(); } }
/** * Sets the value of the entry. * * @param obj the object to store * @return the previous value */ public Object setValue(Object obj) { Object old = getValue(); if (parent.valueType > HARD) { ((Reference)value).clear(); } value = toReference(parent.valueType, obj, hashCode); return old; }
/** * Gets the hashcode of the entry using temporary hard references. * <p> * This implementation uses <code>hashEntry</code> on the main map. * * @return the hashcode of the entry */ public int hashCode() { return parent.hashEntry(getKey(), getValue()); }