Side of Software
Dated Collections Library 2.0

sos.dated.util
Interface DatedMap.Entry<K,V,D>

Enclosing interface:
DatedMap<K,V,D>

public static interface DatedMap.Entry<K,V,D>

An entry in a dated map. This interface is an adaptation of the interface java.util.Map.Entry. The only difference is that the setValue method has been enhanced to take a date range.

Since:
1.0
See Also:
DatedMap.entrySet()

Method Summary
 boolean equals(java.lang.Object object)
          Indicates if this entry is equivalent to the specified object.
 K getKey()
          Returns this entry's key.
 V getValue()
          Returns this entry's value.
 int hashCode()
          Returns the hash code value for this entry.
 V setValue(V value, D from, D to)
          Sets the value to be associated with the key in the specified date range (optional operation).
 

Method Detail

equals

boolean equals(java.lang.Object object)
Indicates if this entry is equivalent to the specified object. Equality for a dated map entry is defined to be the equality of the keys and the values, using their equals method.

Overrides:
equals in class java.lang.Object
Parameters:
object - object to test for equality to this entry
Returns:
true if this entry is equal to the specified object

getKey

K getKey()
Returns this entry's key.

Returns:
the key

getValue

V getValue()
Returns this entry's value.

Returns:
the value associated with the key

hashCode

int hashCode()
Returns the hash code value for this entry. The hash code for a dated map entry is defined to be the bitwise XOR of the key's hash code and the value's hash code. If the key or value is null, then 0 is used instead of the hash code.

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code value for this entry.

setValue

V setValue(V value,
           D from,
           D to)
Sets the value to be associated with the key in the specified date range (optional operation).

Parameters:
value - object to map to this entry's key
from - starting date (inclusive) at which to map to value
to - ending date (exclusive) to map to value
Returns:
the object previously mapped to this entry's key in the specified date range
Throws:
java.lang.ClassCastException - if the underlying type of value prevents it from being stored in this dated map
DateOutOfRangeException - if the specified range does not include the date at which this entry is being viewed or if the underlying map is not static throughout the specified range
java.lang.IllegalArgumentException - if from does not precede to or if some property of value prevents it from being stored in this dated map
java.lang.NullPointerException - if from or to is null or if value is null and this dated collection cannot hold null values
java.lang.UnsupportedOperationException - if this entry does not support setValue

Side of Software
Dated Collections Library 2.0

Copyright 2003-09 Side of Software (SOS). All rights reserved.