Package org.apache.jena.util
Class OneToManyMap.Entry<From,To>
- java.lang.Object
-
- org.apache.jena.util.OneToManyMap.Entry<From,To>
-
- All Implemented Interfaces:
java.util.Map.Entry<From,To>
- Enclosing class:
- OneToManyMap<From,To>
public static class OneToManyMap.Entry<From,To> extends java.lang.Object implements java.util.Map.Entry<From,To>
Helper class to implement the Map.Entry interface to enumerate entries in the map
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object x)
Compares the specified object with this entry for equality.From
getKey()
Answer the key for the entryTo
getValue()
Answer the value for the entryint
hashCode()
Returns the hash code value for this map entry.To
setValue(To value)
Set the value, which writes through to the map.
-
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object x)
Compares the specified object with this entry for equality. Returns true if the given object is also a map entry and the two entries represent the same mapping. More formally, two entries e1 and e2 represent the same mapping if
This ensures that the equals method works properly across different implementations of the Map.Entry interface.(e1.getKey()==null ? e2.getKey()==null : e1.getKey().equals(e2.getKey())) && (e1.getValue()==null ? e2.getValue()==null : e1.getValue().equals(e2.getValue()))
-
getKey
public From getKey()
Answer the key for the entry
-
getValue
public To getValue()
Answer the value for the entry
-
setValue
public To setValue(To value) throws java.lang.UnsupportedOperationException
Set the value, which writes through to the map. Not implemented.
-
hashCode
public int hashCode()
Returns the hash code value for this map entry. The hash code of a map entry e is defined to be: (e.getKey()==null ? 0 : e.getKey().hashCode()) ^ (e.getValue()==null ? 0 : e.getValue().hashCode()) This ensures that e1.equals(e2) implies that e1.hashCode()==e2.hashCode() for any two Entries e1 and e2, as required by the general contract of Object.hashCode.
-
-