T
- type of objects in IndexedSet
public interface FieldIndex<T> extends Iterable<T>
IndexedSet
, each index for this set must
implement the interface to define how to get the value of the field chosen as the index. Users
must use the same instance of the implementation of this interface as the parameter in all
methods of IndexedSet
to represent the same index.Modifier and Type | Method and Description |
---|---|
boolean |
add(T o)
Adds an object o to the index.
|
void |
clear()
Removes all the entries in this index.
|
boolean |
containsField(Object fieldValue)
Returns whether there is an object with the specified index field value in the set.
|
boolean |
containsObject(T o)
Returns whether there is an object in the set.
|
Set<T> |
getByField(Object value)
Gets a subset of objects with the specified field value.
|
T |
getFirst(Object value)
Gets an object from the set of objects with the specified field value.
|
Iterator<T> |
iterator()
Returns an iterator over the elements in this index.
|
boolean |
remove(T o)
Removes the object o from the index.
|
int |
size() |
forEach, spliterator
boolean add(T o)
o
- the object to add to the indexboolean remove(T o)
o
- the object to remove from indexvoid clear()
boolean containsField(Object fieldValue)
fieldValue
- the field value to be satisfiedboolean containsObject(T o)
o
- the object to be checkedSet<T> getByField(Object value)
value
- the field value to be satisfiedT getFirst(Object value)
value
- the field value to be satisfiedIterator<T> iterator()
iterator
in interface Iterable<T>
FieldIndex
int size()
Copyright © 2023. All Rights Reserved.