I - type of the itemspublic class SimpleFastItemIndex<I> extends Object implements FastItemIndex<I>, Serializable
| Modifier | Constructor and Description |
|---|---|
protected |
SimpleFastItemIndex()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
add(I i)
Add a new item to the index.
|
boolean |
containsItem(I i)
Checks whether the index contains an item.
|
Stream<I> |
getAllItems()
Retrieves a stream of the indexed items.
|
I |
iidx2item(int iidx)
Returns the item represented with the index.
|
int |
item2iidx(I i)
Returns the index assigned to the item.
|
static <I> SimpleFastItemIndex<I> |
load(Stream<I> items)
Creates an item index from a stream of item objects.
|
int |
numItems()
Counts the number of indexed items.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAllIidx, iidx2item, iidx2item, item2iidx, item2iidxpublic boolean containsItem(I i)
ItemIndexcontainsItem in interface ItemIndex<I>containsItem in interface FastItemIndex<I>i - itempublic int numItems()
ItemIndexpublic Stream<I> getAllItems()
ItemIndexgetAllItems in interface ItemIndex<I>getAllItems in interface FastItemIndex<I>public int item2iidx(I i)
FastItemIndexitem2iidx in interface FastItemIndex<I>i - itempublic I iidx2item(int iidx)
FastItemIndexiidx2item in interface FastItemIndex<I>iidx - item indexprotected int add(I i)
i - id of the itempublic static <I> SimpleFastItemIndex<I> load(Stream<I> items)
I - type of the itemsitems - stream of item objectsCopyright © 2016. All rights reserved.