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, wait
getAllIidx, iidx2item, iidx2item, item2iidx, item2iidx
public boolean containsItem(I i)
ItemIndex
containsItem
in interface ItemIndex<I>
containsItem
in interface FastItemIndex<I>
i
- itempublic int numItems()
ItemIndex
public Stream<I> getAllItems()
ItemIndex
getAllItems
in interface ItemIndex<I>
getAllItems
in interface FastItemIndex<I>
public int item2iidx(I i)
FastItemIndex
item2iidx
in interface FastItemIndex<I>
i
- itempublic I iidx2item(int iidx)
FastItemIndex
iidx2item
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.