| Constructor and Description |
|---|
AbstractIndex() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(V value,
long timestamp)
Adds a value to the cache.
|
void |
addIndexListener(@NotNull IndexListener<V> listener)
Adds an
IndexListener to be notified of changes. |
void |
beginUpdate()
Starts an update.
|
void |
clear()
Clears all values from the index.
|
void |
endUpdate()
Ends an update.
|
@NotNull java.util.Collection<V> |
findPartialName(@NotNull java.lang.String name)
Returns all matching values for a (possibly partial) key name.
|
@Nullable java.lang.String |
getName(V value)
Returns the name associated with a value.
|
boolean |
hasPending()
Returns whether at least one pending value exists.
|
void |
indexingFinished()
Should be called after indexing has finished.
|
boolean |
isModified()
Returns whether the state was modified since last save.
|
void |
load(@NotNull java.io.ObjectInputStream objectInputStream)
Restores the state from an
ObjectInputStream. |
void |
remove(V value)
Removes a value from the cache.
|
void |
removeIndexListener(@NotNull IndexListener<V> listener)
Removes an
IndexListener to be notified of changes. |
V |
removePending()
Returns one pending value.
|
void |
save(@NotNull java.io.ObjectOutputStream objectOutputStream)
Saves the state to an
ObjectOutputStream. |
void |
setName(V value,
long timestamp,
@NotNull java.lang.String name)
Associates a value with a name.
|
void |
setPending(V value)
Marks a value as pending.
|
int |
size()
Returns the number of values in this cache.
|
public int size()
Index@NotNull public @NotNull java.util.Collection<V> findPartialName(@NotNull @NotNull java.lang.String name)
IndexfindPartialName in interface Index<V extends java.io.Serializable>name - the partial name to look uppublic void beginUpdate()
IndexIndex.endUpdate() should be called from only a single thread.beginUpdate in interface Index<V extends java.io.Serializable>public void endUpdate()
Indexadded since the last call to Index.beginUpdate().
Must not be called unless a directly preceding call to beginUpdate() was made.public void add(@NotNull
V value,
long timestamp)
Indexpublic void remove(@NotNull
V value)
Indexpublic void setPending(@NotNull
V value)
IndexsetPending in interface Index<V extends java.io.Serializable>value - the value to mark pendingpublic void setName(@NotNull
V value,
long timestamp,
@NotNull
@NotNull java.lang.String name)
Index@Nullable
public @Nullable java.lang.String getName(@NotNull
V value)
Index@Nullable public V removePending()
IndexremovePending in interface Index<V extends java.io.Serializable>null if no pending values existpublic boolean hasPending()
IndexhasPending in interface Index<V extends java.io.Serializable>public boolean isModified()
IndexisModified in interface Index<V extends java.io.Serializable>public void addIndexListener(@NotNull
@NotNull IndexListener<V> listener)
IndexIndexListener to be notified of changes.addIndexListener in interface Index<V extends java.io.Serializable>listener - the index listener to addpublic void removeIndexListener(@NotNull
@NotNull IndexListener<V> listener)
IndexIndexListener to be notified of changes.removeIndexListener in interface Index<V extends java.io.Serializable>listener - the index listener to removepublic void save(@NotNull
@NotNull java.io.ObjectOutputStream objectOutputStream)
throws java.io.IOException
IndexObjectOutputStream. Pending maps are not
saved.public void load(@NotNull
@NotNull java.io.ObjectInputStream objectInputStream)
throws java.io.IOException
IndexObjectInputStream. The previous state
is overwritten.public void clear()
Indexpublic void indexingFinished()
IndexindexingFinished in interface Index<V extends java.io.Serializable>