|
JTemporal Home Tutorial |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TemporalSetStorage
Defines the contract the storage must fulfil to store and retrieve
values.
You typically implement this interface to provide persistence.
TemporalSetImpl talks to the storage using
this interface, in order to provide a TemporalSet implementation.
TemporalAttributeImpl
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(Instant i,
java.lang.Object value)
Returns true if this storage contains a mapping for the specified value at the given instant. |
boolean |
containsValue(java.lang.Object value)
Returns true if this storage contains one or more mappings for the specified value. |
void |
endAtomicOperation()
Tells the storage that an atomic operation has finished. |
CloseableIterator |
entryIterator()
Iterates over all the entries of the storage. |
CloseableIterator |
entryIterator(Instant instant)
Returns an iterator looping over the entries contained et the given instant. |
CloseableIterator |
entryIterator(Period period)
Iterates over all the entries of the storage that intersects the period P. |
CloseableIterator |
entryIterator(Period period,
java.lang.Object value)
Iterates over all the entries of the storage for the given value that intersects the given period. |
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. |
Period |
getPeriodEndingAt(Instant instant,
java.lang.Object value)
Returns the period finishing exactly at the given instant, for the given value, if any is found. |
Period |
getPeriodStartingAt(Instant instant,
java.lang.Object value)
Returns the period starting exactly at the given instant, for the given value, if any is found. |
boolean |
isEmpty()
Returns true if this storage does not contain entries. |
boolean |
isEmpty(Instant i)
Returns true if this storage does not contain entries at the given instant. |
Period |
lastPeriod(java.lang.Object value)
Returns the last (highest) period currently defined for the given value. |
CloseableIterator |
periodIterator(java.lang.Object value)
Iterates over all the periods of the entries having the given value. |
void |
put(Period p,
java.lang.Object value)
Stores a mapping (entry, tuple, row) composed by period and value. |
void |
remove(Period p,
java.lang.Object value)
Removes a mapping (entry, tuple, row) composed by period and value previously stored. |
boolean |
removeValue(java.lang.Object value)
Removes all the entries having the given value. |
int |
size()
Returns the number of Period-value mappings in this map. |
int |
sizeAt(Instant i)
Returns the number of entries, at the given instant. |
int |
sizeFor(java.lang.Object value)
Returns the number of entries in this map whose value equals the given one. |
int |
sizeValues()
Returns the number of distinct values in this storage. |
CloseableIterator |
valueIterator()
Iterates over all the distinct values of the entries in the storage. |
CloseableIterator |
valueIterator(Instant instant)
Iterates over the set of values valid at the given instant. |
Method Detail |
---|
Period lastPeriod(java.lang.Object value)
value
- the values whose last period must be returned.
java.util.NoSuchElementException
- if the value is not found.Period firstPeriod(java.lang.Object value)
value
- the values whose first period must be returned.
java.util.NoSuchElementException
- if the value is not found.boolean isEmpty()
boolean isEmpty(Instant i)
i
- the instant to be checked
boolean containsValue(java.lang.Object value)
value
- value whose presence in this map is to be tested.
boolean containsValue(Instant i, java.lang.Object value)
i
- the instant to be checkedvalue
- value whose presence in this map is to be checked.
Period getPeriod(Instant instant, java.lang.Object value)
instant
- the instant where the value is validvalue
- valid for the returned period. The returned period
contains the passed instant.
Period getPeriodEndingAt(Instant instant, java.lang.Object value)
instant
- the instant the equals the entry endvalue
- of the entry finishing at the given instant
Period getPeriodStartingAt(Instant instant, java.lang.Object value)
instant
- the instant the equals the entry endvalue
- of the entry starting at the given instant
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 sizeFor(java.lang.Object value)
value
- the value of the entries to be counted
int sizeValues()
int sizeAt(Instant i)
i
- the instant to be checked
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 remove(Period p, java.lang.Object value)
p
- the period of the entry to be removedvalue
- the value of the entry to be removed
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 nullboolean removeValue(java.lang.Object value)
value
- the value of the entry to be removed
true
if the storage contained at least one entry
for the given value
java.lang.IllegalArgumentException
- if value is nullCloseableIterator entryIterator()
TimedObject
CloseableIterator entryIterator(Instant instant)
instant
- instant whose entries are to be returned
TimedObject
CloseableIterator entryIterator(Period period)
period
- the intersecting period.
TimedObject
CloseableIterator entryIterator(Period period, java.lang.Object value)
period
- the intersecting period.value
- the value to be iterated
TimedObject
CloseableIterator periodIterator(java.lang.Object value)
value
- the selected value
Period
CloseableIterator valueIterator()
CloseableIterator valueIterator(Instant instant)
instant
- the instant where all the returned value are valid
|
JTemporal Home Tutorial |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |