| | |
| | | |
| | | @Override |
| | | Iterator<EntryID> iterator(); |
| | | |
| | | Iterator<EntryID> iterator(EntryID begin); |
| | | } |
| | | |
| | | /** Define serialization contract for EntryIDSet. */ |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Iterator<EntryID> iterator(EntryID begin) |
| | | { |
| | | return new IDSetIterator(entryIDs, begin == null ? 0 : begin.longValue()); |
| | | } |
| | | |
| | | @Override |
| | | public long[] getRange() |
| | | { |
| | | if (entryIDs.length != 0) |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Iterator<EntryID> iterator(EntryID begin) |
| | | { |
| | | return Iterators.emptyIterator(); |
| | | } |
| | | |
| | | @Override |
| | | public long[] getRange() |
| | | { |
| | | return NO_ENTRY_IDS_RANGE; |
| | |
| | | this.entryIDSet = entryIDSet; |
| | | } |
| | | |
| | | IDSetIterator(long[] entryIDSet, long begin) |
| | | { |
| | | this(entryIDSet); |
| | | currentIndex = Math.max(0, Arrays.binarySearch(entryIDSet, begin)); |
| | | } |
| | | |
| | | @Override |
| | | public boolean hasNext() |
| | | { |
| | |
| | | return concreteImpl.iterator(); |
| | | } |
| | | |
| | | /** |
| | | * Creates an iterator over the set or an empty iterator if the set is not defined. |
| | | * |
| | | * @param begin |
| | | * The entry ID of the first entry to return in the list. |
| | | * @return An EntryID iterator. |
| | | */ |
| | | public Iterator<EntryID> iterator(EntryID begin) |
| | | { |
| | | return concreteImpl.iterator(begin); |
| | | } |
| | | |
| | | private long[] getIDs() |
| | | { |
| | | return concreteImpl.getIDs(); |