|
JTemporal Home Tutorial |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TemporalAttributeStorage
Defines the contract the storage must fulfil to store and retrieve
values.
You typically implement this interface when you want to provide
persistence.
TemporalAttributeImpl talks to the storage using
this interface, in order to provide a TemporalAttribute implementation.
TemporalSetImpl
Method Summary | |
---|---|
void |
beginAtomicOperation()
Tells the storage that the JTemporal client is calling a method that can result in multiples updates in the storage. |
void |
clear()
Removes all the stored mappings. |
boolean |
containsValue(java.lang.Object value)
Returns true if this map maps one or more Periods to the specified value. |
boolean |
containsValue(java.lang.Object value,
Period range)
Returns true if this map maps one or more Periods to the specified value, during the specified period. |
void |
endAtomicOperation()
Tells the storage that an atomic operation has finished. |
CloseableIterator |
entryIterator()
Iterates over all the entries of the storage. |
CloseableIterator |
entryIterator(Period p)
Iterates over all the entries of the storage that intersects the period P. |
Period |
firstPeriod()
Returns the first (lowest) period currently in this storage. |
Period |
firstPeriod(Period p)
Returns the first (lowest) period currently in this storage, that intersects the given period. |
TimedObject |
getEntry(Instant instant)
Returns the entry valid at the given instant, if any is found. |
TimedObject |
getEntryEndingAt(Instant instant)
Returns the entry finishing exactly at the given instant, if any is found. |
TimedObject |
getEntryStartingAt(Instant instant)
Returns the entry starting exactly at the given instant, if any is found. |
Period |
getPeriod(Instant instant)
Returns the period that encloses the given instant, if any is found. |
java.lang.Object |
getValue(Instant instant)
Returns the value to which this map maps the specified Instant. |
boolean |
isEmpty()
Returns true if this storage does not contain objects. |
boolean |
isEmpty(Period p)
Returns true if this storage does not contain objects intersecting the given period. |
Period |
lastPeriod()
Returns the last (highest) period currently in this storage. |
Period |
lastPeriod(Period p)
Returns the last (highest) period currently in this storage, that intersects the given period. |
CloseableIterator |
periodIterator()
Iterates over all the periods of the storage. |
CloseableIterator |
periodIterator(Period p)
Iterates over all the periods of the storage that intersects the period P. |
void |
put(Period p,
java.lang.Object value)
Stores a mapping (entry, tuple, row) composed by period and value. |
void |
removeEntry(Period p)
Removes an entry composed by period and value previously stored. |
int |
removeRange(Period p)
Removes all the entries whose period indersects the given period. |
int |
size()
Returns the number of Period-value mappings in this map. |
int |
size(Period p)
Returns the number of Period-value mappings in this map, for the given priod. |
Method Detail |
---|
Period lastPeriod()
java.util.NoSuchElementException
- if the storage is empty.Period lastPeriod(Period p)
p
- the intersecting period
java.util.NoSuchElementException
- if none.Period firstPeriod()
java.util.NoSuchElementException
- if this storage is empty.Period firstPeriod(Period p)
p
- the intersecting period
java.util.NoSuchElementException
- if none.boolean isEmpty()
boolean isEmpty(Period p)
p
- the intersecting period
boolean containsValue(java.lang.Object value)
value
- value whose presence in this map is to be tested.
boolean containsValue(java.lang.Object value, Period range)
value
- value whose presence in this map is to be tested.range
- the period intersecting the value mappings
java.lang.Object getValue(Instant instant)
instant
- instant whose associated value is to be returned
Period getPeriod(Instant instant)
instant
- instant whose associated value is to be returned
TimedObject getEntry(Instant instant)
instant
- instant whose associated value is to be returned
TimedObject getEntryEndingAt(Instant instant)
instant
- the instant the equals the entry end
TimedObject getEntryStartingAt(Instant instant)
instant
- the instant the equals the entry end
void beginAtomicOperation()
endAtomicOperation()
void endAtomicOperation()
beginAtomicOperation()
void clear()
java.lang.UnsupportedOperationException
- clear is not supported by this
map.
java.lang.RuntimeException
- (or any other subclass) if the operation could not be performed.int size()
int size(Period p)
p
- the intersecting period
void put(Period p, java.lang.Object value)
p
- period with which the specified value is associated. Cannot be null.value
- value to be associated with the specified key. Cannot be null.
java.lang.UnsupportedOperationException
- if the put operation is
not supported by this storage.
java.lang.IllegalArgumentException
- if some aspect of this period or value
prevents it from being stored.
java.lang.RuntimeException
- (or any other subclass) if the tuple could not be stored
for other reasons.void removeEntry(Period p)
p
- period whose mapping is to be removed from the storage. It
must exactly match the key of an existing entry.
java.lang.UnsupportedOperationException
- if the remove method is
not supported by this storage.
java.util.NoSuchElementException
- if the entry is not found
java.lang.IllegalArgumentException
- if p is nullint removeRange(Period p)
p
- the period specifying that range whose interecting entries are
to be deleted.
java.lang.UnsupportedOperationException
- if the remove method is
not supported by this storage.
java.lang.IllegalArgumentException
- if p is nullCloseableIterator entryIterator()
TimedObject
CloseableIterator entryIterator(Period p)
p
- the intersecting period.
TimedObject
CloseableIterator periodIterator()
Period
CloseableIterator periodIterator(Period p)
p
- the intersecting period.
Period
|
JTemporal Home Tutorial |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |