|
JTemporal Home Tutorial |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
V
- the type of the valuepublic interface TemporalAttribute<V>
This is a map, whose key is a Period when adding mappings (entries)
and an Instant when getting mappings.
Associates periods to zero or one object (value).
This is typically used to implement temporal associations with unary cardinality,
for example Employee-Salary.
You can get the value valid at a given time by calling
get(Instant).
To add a mapping, you call put(Period, Object).
If another mapping already exists valid during the given period (or part of the period),
the mapping is overwritten for given period.
Method Summary | |
---|---|
void |
clear()
Removes all mappings from this map (optional operation). |
boolean |
containsInstant(Instant i)
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. |
Period |
extent()
Returns a period enclosing firstInstant() and lastInstant() |
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. |
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 |
putAll(TemporalAttribute<? extends V> tm)
Copies all of the mappings from the specified map to 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)
|
Method Detail |
---|
void clear()
java.lang.UnsupportedOperationException
- clear is not supported by this
map.int size()
boolean isEmpty()
V get(Instant instant)
get
in interface ReadableTemporalAttribute<V>
instant
- instant whose associated value is to be returned
Period getPeriod(Instant instant)
instant
- instant whose associated enclosing period is to be returned
TimedObject<V> getEntry(Instant instant)
instant
- instant whose associated entry is to be returned
boolean containsInstant(Instant i)
i
- instant whose presence in this map is to be tested.
boolean containsValue(java.lang.Object value)
value
- value whose presence in this map is to be tested.
boolean put(Period p, V value)
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.
java.lang.UnsupportedOperationException
- if the put operation is
not supported by this map.
java.lang.ClassCastException
- if the class of the specified value
prevents it from being stored in this map.
java.lang.IllegalArgumentException
- if some aspect of this period or value
prevents it from being stored in this map.
or if the period or the value is nullboolean remove(Period p)
p
- period whose mappings are to be removed from the map.
java.lang.UnsupportedOperationException
- if the remove method is
not supported by this map.boolean putAll(TemporalAttribute<? extends V> tm)
tm
- Mappings to be stored in this map.
java.lang.UnsupportedOperationException
- if the putAll method is
not supported by this map.
java.lang.ClassCastException
- if the class of a value in the
specified map prevents it from being stored in this map.
java.lang.IllegalArgumentException
- some aspect of a value in the
specified map prevents it from being stored in this map.java.util.Set<Period> periodSet()
java.util.Set<TimedObject<V>> entrySet()
TimedObject
Instant firstInstant()
java.util.NoSuchElementException
- TemporalAttribute is empty.Instant lastInstant()
java.util.NoSuchElementException
- TemporalAttribute is empty.Period firstPeriod()
java.util.NoSuchElementException
- TemporalAttribute is empty.Period lastPeriod()
java.util.NoSuchElementException
- TemporalAttribute is empty.Period extent()
java.util.NoSuchElementException
- TemporalAttribute is empty.firstInstant()
,
lastInstant()
TemporalAttribute<V> subMap(Period p)
|
JTemporal Home Tutorial |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |