20 package net.sf.gridarta.model.index;
22 import java.io.IOException;
23 import java.io.ObjectInputStream;
24 import java.io.ObjectOutputStream;
25 import java.util.Collection;
26 import org.jetbrains.annotations.NotNull;
27 import org.jetbrains.annotations.Nullable;
78 void add(@NotNull V value,
long timestamp);
85 void remove(@NotNull V value);
99 void setName(@NotNull V value,
long timestamp, @NotNull String name);
108 String
getName(@NotNull V value);
147 void save(@NotNull ObjectOutputStream objectOutputStream)
throws IOException;
155 void load(@NotNull ObjectInputStream objectInputStream)
throws IOException;
void removeIndexListener(@NotNull IndexListener< V > listener)
Removes an IndexListener to be notified of changes.
V removePending()
Returns one pending value.
void add(@NotNull V value, long timestamp)
Adds a value to the cache.
Interface for listeners interested in Index related events.
boolean isModified()
Returns whether the state was modified since last save.
boolean hasPending()
Returns whether at least one pending value exists.
void setPending(@NotNull V value)
Marks a value as pending.
String getName(@NotNull V value)
Returns the name associated with a value.
void indexingFinished()
Should be called after indexing has finished.
void setName(@NotNull V value, long timestamp, @NotNull String name)
Associates a value with a name.
void addIndexListener(@NotNull IndexListener< V > listener)
Adds an IndexListener to be notified of changes.
void load(@NotNull ObjectInputStream objectInputStream)
Restores the state from an ObjectInputStream.
void save(@NotNull ObjectOutputStream objectOutputStream)
Saves the state to an ObjectOutputStream.
void endUpdate()
Ends an update.
int size()
Returns the number of values in this cache.
Collection< V > findPartialName(@NotNull String name)
Returns all matching values for a (possibly partial) key name.
void beginUpdate()
Starts an update.
void clear()
Clears all values from the index.