Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jtemporal
Interface TemporalMultiMap  view TemporalMultiMap download TemporalMultiMap.java

All Known Implementing Classes:
AbstractTemporalMultiMap

public interface TemporalMultiMap

Associates at any time an object (the map holder) to zero to many objects (values), for example: Employee-Skill.
You can get the set of values valid at a given time by calling the method Set valueSet(Instant key).
To add a mapping, you do not specify an Instant, but a Period specifying the validity of the object.

Note: the Object value (passed to many methods) must have equals and hashCode defined consistently, as described in the java.lang.Object documentation.


Method Summary
 void clear()
          Removes all the mappings from this map (optional operation).
 boolean contains(Instant instant, java.lang.Object value)
          Returns true if there is a mapping for this value at the given instant.
 boolean containsValue(java.lang.Object value)
          Returns true if if ther is a mapping for the specified value.
 Period extent(java.lang.Object value)
          Return a period enclosing firstInstant(value) and lastInstantvalue()
 Instant firstInstant(java.lang.Object value)
          Returns the first (lowest) instant currently defined for the given value.
 Period firstPeriod(java.lang.Object value)
          Returns the first (lowest) period currently defined for the given value.
 Period getPeriod(Instant instant, java.lang.Object value)
          Returns the period of the mapping valid at the specified instant for the value.
 boolean isEmpty()
          Returns true if this map contains no Period-value mappings.
 Instant lastInstant(java.lang.Object value)
          Returns the last (highest) instant currently defined for the given value.
 Period lastPeriod(java.lang.Object value)
          Returns the last (highest) period currently defined for the given value.
 java.util.Set periodSet(java.lang.Object value)
          Returns a set view of the periods contained in this map for the give value.
 boolean put(Period p, java.lang.Object value)
          Associates the specified value to the specified Period in this map.
 boolean putAll(TemporalMultiMap mtm)
          Copies all of the mappings from the specified map to this map (optional operation).
 boolean remove(Period p, java.lang.Object value)
          Removes the mapping(s) for this period and value from this map if present (optional operation).
 boolean removePeriod(Period p)
          Removes all the mapping(s) for this period from this map if present (optional operation).
 void removeValue(java.lang.Object value)
          Removes all the mapping(s) for this value from this map if present (optional operation).
 int size(java.lang.Object value)
          Returns the number of Period-value mappings in this map.
 java.util.Set valueSet()
          Returns a read-only Set containing the values defined somewhen in this map.
 java.util.Set valueSet(Instant instant)
          Returns a read-only Set containing the values defined in this map at the specified instant.
 

Method Detail

clear

public void clear()
Removes all the mappings from this map (optional operation).


size

public int size(java.lang.Object value)
Returns the number of Period-value mappings in this map. If the map contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.


isEmpty

public boolean isEmpty()
Returns true if this map contains no Period-value mappings.


valueSet

public java.util.Set valueSet(Instant instant)
Returns a read-only Set containing the values defined in this map at the specified instant. Returns an empty set if the map contains no mapping at this Instant.


valueSet

public java.util.Set valueSet()
Returns a read-only Set containing the values defined somewhen in this map.


getPeriod

public Period getPeriod(Instant instant,
                        java.lang.Object value)
Returns the period of the mapping valid at the specified instant for the value.


contains

public boolean contains(Instant instant,
                        java.lang.Object value)
Returns true if there is a mapping for this value at the given instant. Same as containsValue(Instant instant, Object value)


containsValue

public boolean containsValue(java.lang.Object value)
Returns true if if ther is a mapping for the specified value.


put

public boolean put(Period p,
                   java.lang.Object value)
Associates the specified value to the specified Period in this map. If the map previously contained a mapping to the same value, during a period overlapping this period, the periods are merged.


remove

public boolean remove(Period p,
                      java.lang.Object value)
Removes the mapping(s) for this period and value from this map if present (optional operation).


removeValue

public void removeValue(java.lang.Object value)
Removes all the mapping(s) for this value from this map if present (optional operation).


removePeriod

public boolean removePeriod(Period p)
Removes all the mapping(s) for this period from this map if present (optional operation).


putAll

public boolean putAll(TemporalMultiMap mtm)
Copies all of the mappings from the specified map to this map (optional operation). These mappings will replace any mappings that this map had for any of the periods currently in the specified map.


periodSet

public java.util.Set periodSet(java.lang.Object value)
Returns a set view of the periods contained in this map for the give value. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress, the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll retainAll, and clear operations. It does not support the add or addAll operations.


firstInstant

public Instant firstInstant(java.lang.Object value)
Returns the first (lowest) instant currently defined for the given value.


lastInstant

public Instant lastInstant(java.lang.Object value)
Returns the last (highest) instant currently defined for the given value.


firstPeriod

public Period firstPeriod(java.lang.Object value)
Returns the first (lowest) period currently defined for the given value.


lastPeriod

public Period lastPeriod(java.lang.Object value)
Returns the last (highest) period currently defined for the given value.


extent

public Period extent(java.lang.Object value)
Return a period enclosing firstInstant(value) and lastInstantvalue()