public static final class IndexCache.Index extends Object
Index instances are
accessed via IndexCache.getIndex(String). This
index is incremented by the method nextIndex().
This index can be reset to its initial value by the method
resetIndex().| Modifier and Type | Method and Description |
|---|---|
long |
currentIndex()
Returns the current cached index.
|
void |
currentIndex(long index)
Sets the current index to the given value.
|
boolean |
doesResetUponFinalIndex()
Returns
true if the cache automatically resets
to the initial index once the final index is reached. |
long |
finalIndex()
Returns the maximum cached index.
|
long |
increment()
Returns the increment used to obtain the next cached
index.
|
long |
initialIndex()
Returns the initial cache index.
|
String |
name()
Returns the index name.
|
long |
nextIndex()
Returns the current index value.
|
long |
resetIndex()
Resets the current index to the initial value and
returns the new current index.
|
String |
toString()
Returns the textual representation of this index.
|
public String name()
public long initialIndex()
public long increment()
public long finalIndex()
public long currentIndex()
public boolean doesResetUponFinalIndex()
true if the cache automatically resets
to the initial index once the final index is reached.true if the cache automatically resets
to the initial index.public long nextIndex()
throws IndexOutOfBoundsException
true, then
the initial index value is returned. If the flag is
false, an
IndexOutOfBoundsException is thrown.
Otherwise the current index is incremented prior to
returning but this incremented value is not
returned.IndexOutOfBoundsException - if the incremented index exceeds the final index value
and the index does not reset back to the initial
value.public void currentIndex(long index)
throws IllegalArgumentException
index - the new current index.IllegalArgumentException - if index is not between the index initial
and final values.public long resetIndex()
Copyright © 2020. All rights reserved.