|
JTemporal Home Tutorial |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jtemporal.AbstractTemporalSet<V> net.sf.jtemporal.TemporalSetImpl<V>
V
- the type of the valuepublic class TemporalSetImpl<V>
The standard implementation of TemporalSet.
Takes care about temporal logic, and delegates all the data storage
and retrieval to a TemporalSetStorage.
Constructor Summary | |
---|---|
TemporalSetImpl(TemporalSetStorage storage)
Creates a new TemporalSet using the give storage. |
Method Summary | |
---|---|
void |
clear()
Removes all the mappings from this map. |
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 there is a mapping for the specified value. |
java.util.Set<TimedObject<V>> |
entrySet()
Returns a set view of the entries (instances of TimedObject) contained in this map. |
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 given value. |
boolean |
isEmpty()
Returns true if this map contains no Period-value mappings. |
boolean |
isEmpty(Instant i)
Returns true if this map does not contain mappings valid at the given intant. |
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<Period> |
periodSet(java.lang.Object value)
Returns a set view of the periods contained in this map for the give value. |
boolean |
put(Period _p,
V _value)
Associates the specified value with the specified Period in this map. |
boolean |
remove(Period p,
java.lang.Object value)
Removes the mapping(s) for this period and value from this map if present. |
boolean |
removePeriod(Period p)
Removes all the mapping(s) for this period from this map if present. |
boolean |
removeValue(java.lang.Object value)
Removes all the mapping(s) for this value from this map if present. |
int |
size()
Returns the number of Period-value mappings in this map. |
int |
sizeAt(Instant instant)
Returns the number values in this map valid at the given instant. |
int |
sizeFor(java.lang.Object value)
Returns the number of Period-value mappings in this map for the given value. |
int |
sizeValues()
Returns the number of distinct values in this map. |
java.util.Set<V> |
valueSet()
Returns a read-only Set containing the distinct values defined somewhen in this map. |
java.util.Set<V> |
valueSet(Instant instant)
Returns a read-only Set containing the values defined in this map at the specified instant. |
Methods inherited from class net.sf.jtemporal.AbstractTemporalSet |
---|
equals, extent, putAll |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TemporalSetImpl(TemporalSetStorage storage)
storage
- the storage containing all the data.Method Detail |
---|
public void clear()
TemporalSet
public int size()
TemporalSet
public int sizeFor(java.lang.Object value)
TemporalSet
value
- the number of entries for the given value
public int sizeAt(Instant instant)
TemporalSet
instant
- the instant at which the counted entries are valid
public int sizeValues()
TemporalSet
public boolean isEmpty()
TemporalSet
public boolean isEmpty(Instant i)
TemporalSet
i
- when this temporal set is empty
public java.util.Set<V> valueSet(Instant instant)
TemporalSet
instant
- instant whose associated value is to be returned
public java.util.Set<V> valueSet()
TemporalSet
public java.util.Set<TimedObject<V>> entrySet()
TemporalSet
TimedObject
public Period getPeriod(Instant instant, java.lang.Object value)
TemporalSet
instant
- when the given value is validvalue
- the value of the entry valid during the returned period
public boolean contains(Instant instant, java.lang.Object value)
TemporalSet
instant
- instant whose presence in this map is to be tested.value
- value whose presence in this map is to be tested.
public boolean containsValue(java.lang.Object value)
TemporalSet
value
- value whose presence in this map is to be tested.
public boolean put(Period _p, V _value)
TemporalSet
_p
- period with which the specified value is to be associated._value
- value to be associated with the specified period. Be careful
at the equals implementation of the value object: the result of the equals
method is supposed to be immutable while it is stored in this collection.
public boolean remove(Period p, java.lang.Object value)
TemporalSet
p
- period whose mappings are to be removed from the map.value
- value whose mapping are to be removed from the map.
public boolean removeValue(java.lang.Object value)
TemporalSet
value
- value whose mapping are to be removed from the map.
true
if the TemporalSet contained the specified element.public boolean removePeriod(Period p)
TemporalSet
p
- period whose mappings are to be removed from the map.
public java.util.Set<Period> periodSet(java.lang.Object value)
TemporalSet
public Instant firstInstant(java.lang.Object value)
TemporalSet
public Instant lastInstant(java.lang.Object value)
TemporalSet
public Period firstPeriod(java.lang.Object value)
TemporalSet
public Period lastPeriod(java.lang.Object value)
TemporalSet
|
JTemporal Home Tutorial |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |