|
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.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 TemporalSetStorage
value
- the values whose last period must be returned.
public Period firstPeriod(java.lang.Object value)
TemporalSetStorage
firstPeriod
in interface TemporalSetStorage
value
- the values whose first period must be returned.
public boolean isEmpty()
TemporalSetStorage
isEmpty
in interface TemporalSetStorage
public boolean isEmpty(Instant instant)
TemporalSetStorage
isEmpty
in interface TemporalSetStorage
instant
- the instant to be checked
public boolean containsValue(java.lang.Object value)
TemporalSetStorage
containsValue
in interface TemporalSetStorage
value
- value whose presence in this map is to be tested.
public boolean containsValue(Instant i, java.lang.Object value)
TemporalSetStorage
containsValue
in interface TemporalSetStorage
i
- 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 TemporalSetStorage
instant
- 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 TemporalSetStorage
instant
- 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 TemporalSetStorage
instant
- the instant the equals the entry endvalue
- of the entry starting at the given instant
public void beginAtomicOperation()
TemporalSetStorage
beginAtomicOperation
in interface TemporalSetStorage
TemporalSetStorage.endAtomicOperation()
public void endAtomicOperation()
TemporalSetStorage
endAtomicOperation
in interface TemporalSetStorage
TemporalSetStorage.beginAtomicOperation()
public void clear()
TemporalSetStorage
clear
in interface TemporalSetStorage
public int size()
TemporalSetStorage
size
in interface TemporalSetStorage
public int sizeFor(java.lang.Object value)
TemporalSetStorage
sizeFor
in interface TemporalSetStorage
value
- the value of the entries to be counted
public int sizeValues()
TemporalSetStorage
sizeValues
in interface TemporalSetStorage
public int sizeAt(Instant instant)
TemporalSetStorage
sizeAt
in interface TemporalSetStorage
instant
- the instant to be checked
public void put(Period p, java.lang.Object value)
TemporalSetStorage
put
in interface TemporalSetStorage
p
- 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 TemporalSetStorage
p
- 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 TemporalSetStorage
value
- 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 TemporalSetStorage
TimedObject
public CloseableIterator entryIterator(Instant instant)
TemporalSetStorage
entryIterator
in interface TemporalSetStorage
instant
- instant whose entries are to be returned
TimedObject
public CloseableIterator entryIterator(Period period)
TemporalSetStorage
entryIterator
in interface TemporalSetStorage
period
- the intersecting period.
TimedObject
public CloseableIterator entryIterator(Period period, java.lang.Object value)
TemporalSetStorage
entryIterator
in interface TemporalSetStorage
period
- the intersecting period.value
- the value to be iterated
TimedObject
public CloseableIterator periodIterator(java.lang.Object value)
TemporalSetStorage
periodIterator
in interface TemporalSetStorage
value
- the selected value
Period
public CloseableIterator valueIterator()
TemporalSetStorage
valueIterator
in interface TemporalSetStorage
public CloseableIterator valueIterator(Instant instant)
TemporalSetStorage
valueIterator
in interface TemporalSetStorage
instant
- 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 |