|
JTemporal Home Tutorial |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.jtemporal.spi.CompactTemporalSetStorage
public class CompactTemporalSetStorage
Uses a HashMap
containing CompactPeriodStorages
Note: this implementation is not synchronized. If multiple
threads access the map concurrently, and at least one of the threads modifies
the map structurally, it must be synchronized externally.
| Constructor Summary | |
|---|---|
CompactTemporalSetStorage()
|
|
| 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 instant)
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 instant)
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. |
java.lang.String |
toString()
|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CompactTemporalSetStorage()
| Method Detail |
|---|
public Period lastPeriod(java.lang.Object value)
TemporalSetStorage
lastPeriod in interface TemporalSetStoragevalue - the values whose last period must be returned.
public Period firstPeriod(java.lang.Object value)
TemporalSetStorage
firstPeriod in interface TemporalSetStoragevalue - the values whose first period must be returned.
public boolean isEmpty()
TemporalSetStorage
isEmpty in interface TemporalSetStoragepublic boolean isEmpty(Instant instant)
TemporalSetStorage
isEmpty in interface TemporalSetStorageinstant - the instant to be checked
public boolean containsValue(java.lang.Object value)
TemporalSetStorage
containsValue in interface TemporalSetStoragevalue - value whose presence in this map is to be tested.
public boolean containsValue(Instant i,
java.lang.Object value)
TemporalSetStorage
containsValue in interface TemporalSetStoragei - the instant to be checkedvalue - value whose presence in this map is to be checked.
public Period getPeriod(Instant instant,
java.lang.Object value)
TemporalSetStorage
getPeriod in interface TemporalSetStorageinstant - the instant where the value is validvalue - valid for the returned period. The returned period
contains the passed instant.
public Period getPeriodEndingAt(Instant instant,
java.lang.Object value)
TemporalSetStorage
getPeriodEndingAt in interface TemporalSetStorageinstant - the instant the equals the entry endvalue - of the entry finishing at the given instant
public Period getPeriodStartingAt(Instant instant,
java.lang.Object value)
TemporalSetStorage
getPeriodStartingAt in interface TemporalSetStorageinstant - the instant the equals the entry endvalue - of the entry starting at the given instant
public void beginAtomicOperation()
TemporalSetStorage
beginAtomicOperation in interface TemporalSetStorageTemporalSetStorage.endAtomicOperation()public void endAtomicOperation()
TemporalSetStorage
endAtomicOperation in interface TemporalSetStorageTemporalSetStorage.beginAtomicOperation()public void clear()
TemporalSetStorage
clear in interface TemporalSetStoragepublic int size()
TemporalSetStorage
size in interface TemporalSetStoragepublic int sizeFor(java.lang.Object value)
TemporalSetStorage
sizeFor in interface TemporalSetStoragevalue - the value of the entries to be counted
public int sizeValues()
TemporalSetStorage
sizeValues in interface TemporalSetStoragepublic int sizeAt(Instant instant)
TemporalSetStorage
sizeAt in interface TemporalSetStorageinstant - the instant to be checked
public void put(Period p,
java.lang.Object value)
TemporalSetStorage
put in interface TemporalSetStoragep - period with which the specified value is associated. Cannot be null.value - value to be associated with the specified key. Cannot be null.
public void remove(Period p,
java.lang.Object value)
TemporalSetStorage
remove in interface TemporalSetStoragep - the period of the entry to be removedvalue - the value of the entry to be removedpublic boolean removeValue(java.lang.Object value)
TemporalSetStorage
removeValue in interface TemporalSetStoragevalue - the value of the entry to be removed
true if the storage contained at least one entry
for the given valuepublic CloseableIterator entryIterator()
TemporalSetStorage
entryIterator in interface TemporalSetStorageTimedObjectpublic CloseableIterator entryIterator(Instant instant)
TemporalSetStorage
entryIterator in interface TemporalSetStorageinstant - instant whose entries are to be returned
TimedObjectpublic CloseableIterator entryIterator(Period period)
TemporalSetStorage
entryIterator in interface TemporalSetStorageperiod - the intersecting period.
TimedObject
public CloseableIterator entryIterator(Period period,
java.lang.Object value)
TemporalSetStorage
entryIterator in interface TemporalSetStorageperiod - the intersecting period.value - the value to be iterated
TimedObjectpublic CloseableIterator periodIterator(java.lang.Object value)
TemporalSetStorage
periodIterator in interface TemporalSetStoragevalue - the selected value
Periodpublic CloseableIterator valueIterator()
TemporalSetStorage
valueIterator in interface TemporalSetStoragepublic CloseableIterator valueIterator(Instant instant)
TemporalSetStorage
valueIterator in interface TemporalSetStorageinstant - the instant where all the returned value are valid
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 | ||||||||