|
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.AbstractTemporalAttribute<V> net.sf.jtemporal.TemporalAttributeImpl<V>
V
- the type of the valuepublic class TemporalAttributeImpl<V>
Implements TemporalAttribute by using a TemporalAttributeStorage.
To achieve this goal, some temporal logic is added to the put and remove
methods, and some collection-oriented behaviour is provided on top of the storage.
Constructor Summary | |
---|---|
TemporalAttributeImpl(TemporalAttributeStorage storage)
|
Method Summary | |
---|---|
void |
clear()
Removes all mappings from this map (optional operation). |
boolean |
containsInstant(Instant instant)
Returns true if this map contains a mapping for the specified Instant. |
boolean |
containsValue(java.lang.Object value)
Returns true if this map maps one or more Periods to 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()
Returns the first (lowest) instant currently in this temporal map. |
Period |
firstPeriod()
Returns the first (lowest) period currently in this temporal map. |
V |
get(Instant instant)
Returns the value to which this map maps the specified Instant. |
TimedObject<V> |
getEntry(Instant instant)
Returns the entry active at the given instant. |
Period |
getPeriod(Instant instant)
Returns the period that has a value associated at specified instant. |
TemporalAttributeStorage |
getStorage()
Returns the storage that has been passed to the constructor to build this TemporalAttribute. |
boolean |
isEmpty()
Returns true if this map contains no Period-value mappings. |
Instant |
lastInstant()
Returns the last (highest) instant currently in this temporal map. |
Period |
lastPeriod()
Returns the last (highest) period currently in this temporal map. |
java.util.Set<Period> |
periodSet()
Returns a set view of the periods contained in this map. |
boolean |
put(Period _p,
V _value)
Associates the specified value with the specified Period in this map (optional operation). |
boolean |
remove(Period p)
Removes the mapping(s) for this period from this map if present (optional operation). |
int |
size()
Returns the number of Period-value mappings in this map. |
TemporalAttribute<V> |
subMap(Period p)
|
java.lang.String |
toString()
|
Methods inherited from class net.sf.jtemporal.AbstractTemporalAttribute |
---|
equals, extent, putAll |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TemporalAttributeImpl(TemporalAttributeStorage storage)
Method Detail |
---|
public TemporalAttributeStorage getStorage()
public void clear()
TemporalAttribute
clear
in interface TemporalAttribute<V>
public int size()
TemporalAttribute
size
in interface TemporalAttribute<V>
public boolean isEmpty()
TemporalAttribute
isEmpty
in interface TemporalAttribute<V>
public V get(Instant instant)
TemporalAttribute
get
in interface ReadableTemporalAttribute<V>
get
in interface TemporalAttribute<V>
instant
- instant whose associated value is to be returned
public Period getPeriod(Instant instant)
TemporalAttribute
getPeriod
in interface TemporalAttribute<V>
instant
- instant whose associated enclosing period is to be returned
public TimedObject<V> getEntry(Instant instant)
TemporalAttribute
getEntry
in interface TemporalAttribute<V>
getEntry
in class AbstractTemporalAttribute<V>
instant
- instant whose associated entry is to be returned
public boolean containsInstant(Instant instant)
TemporalAttribute
containsInstant
in interface TemporalAttribute<V>
instant
- instant whose presence in this map is to be tested.
public boolean containsValue(java.lang.Object value)
TemporalAttribute
containsValue
in interface TemporalAttribute<V>
value
- value whose presence in this map is to be tested.
public boolean put(Period _p, V _value)
TemporalAttribute
put
in interface TemporalAttribute<V>
_p
- period with which the specified value is to be associated._value
- value to be associated with the specified key. 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)
TemporalAttribute
remove
in interface TemporalAttribute<V>
p
- period whose mappings are to be removed from the map.
public java.util.Set<Period> periodSet()
TemporalAttribute
periodSet
in interface TemporalAttribute<V>
public java.util.Set<TimedObject<V>> entrySet()
TemporalAttribute
entrySet
in interface TemporalAttribute<V>
TimedObject
public Instant firstInstant()
TemporalAttribute
firstInstant
in interface TemporalAttribute<V>
public Instant lastInstant()
TemporalAttribute
lastInstant
in interface TemporalAttribute<V>
public Period firstPeriod()
TemporalAttribute
firstPeriod
in interface TemporalAttribute<V>
public Period lastPeriod()
TemporalAttribute
lastPeriod
in interface TemporalAttribute<V>
public TemporalAttribute<V> subMap(Period p)
subMap
in interface TemporalAttribute<V>
public java.lang.String toString()
toString
in class java.lang.Object
|
JTemporal Home Tutorial |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |