Package org.apache.sis.internal.util
Class AbstractMapEntry<K,V>
java.lang.Object
org.apache.sis.internal.util.AbstractMapEntry<K,V>
- Type Parameters:
K
- the type of keys maintained by the map.V
- the type of mapped values.
- All Implemented Interfaces:
Map.Entry<K,
V>
- Direct Known Subclasses:
CharacteristicMap.Entry
,DefaultRecord.Entry
,ValueMap.Property
- Since:
- 0.5
- Version:
- 0.5
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares the specified object with this entry for equality.(package private) static String
Returns only the first line of the string representation of the given value.int
hashCode()
Returns the hash code value for this map entry.Sets the value corresponding to this entry (optional operation).toString()
Returns a string representation of this entry.
-
Constructor Details
-
AbstractMapEntry
protected AbstractMapEntry()For subclasses constructors.
-
-
Method Details
-
setValue
Sets the value corresponding to this entry (optional operation). The default implementation throwsUnsupportedOperationException
for the convenience of unmodifiable map implementations.- Specified by:
setValue
in interfaceMap.Entry<K,
V> - Parameters:
value
- the new value to be stored in this entry.- Returns:
- the previous value (may be
null
). - Throws:
UnsupportedOperationException
- if this entry is unmodifiable.
-
equals
Compares the specified object with this entry for equality. Criterion are specified by theMap.Entry
contract. -
hashCode
public int hashCode()Returns the hash code value for this map entry. The formula is specified by theMap.Entry
contract. -
toString
Returns a string representation of this entry. If the string representation of the value uses more than one line, then only the first line is shown. This method is mostly for debugging purpose. -
firstLine
Returns only the first line of the string representation of the given value.- Parameters:
value
- the value for which to get a string representation.- Returns:
- the first line of the string representation of the given value.
-