Class GeneratorLendingImpl<T>
java.lang.Object
org.aksw.commons.collections.generator.GeneratorForwarding<T>
org.aksw.commons.collections.generator.GeneratorLendingImpl<T>
- Type Parameters:
T-
- All Implemented Interfaces:
Generator<T>,GeneratorLending<T>
Generator which allows giving ids back for re-use.
- Author:
- raven
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Supplier<? extends Collection<T>>protected Tprotected Collection<T>Fields inherited from class org.aksw.commons.collections.generator.GeneratorForwarding
delegate -
Constructor Summary
ConstructorsConstructorDescriptionGeneratorLendingImpl(Generator<T> delegate, Collection<T> freeIds, Supplier<? extends Collection<T>> collectionSupplier) GeneratorLendingImpl(Generator<T> delegate, Supplier<? extends Collection<T>> collectionSupplier) -
Method Summary
Modifier and TypeMethodDescriptionclone()Clones should independently yield the same sequences of items as the original objectstatic GeneratorLendingImpl<Integer>static GeneratorLendingImpl<Integer>createInt(int initialNext) static GeneratorLending<String>createPrefixedInt(String prefix, int offset) static <T extends Comparable<T>>
GeneratorLendingImpl<T>createSorted(Generator<T> delegate) current()booleannext()Methods inherited from class org.aksw.commons.collections.generator.GeneratorForwarding
getDelegateMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.aksw.commons.collections.generator.Generator
filterDrop, filterKeep, map
-
Field Details
-
collectionSupplier
-
freeIds
-
current
-
-
Constructor Details
-
GeneratorLendingImpl
public GeneratorLendingImpl(Generator<T> delegate, Supplier<? extends Collection<T>> collectionSupplier) -
GeneratorLendingImpl
public GeneratorLendingImpl(Generator<T> delegate, Collection<T> freeIds, Supplier<? extends Collection<T>> collectionSupplier)
-
-
Method Details
-
giveBack
- Specified by:
giveBackin interfaceGeneratorLending<T>
-
next
-
current
-
clone
Description copied from interface:GeneratorClones should independently yield the same sequences of items as the original object -
createSorted
-
createInt
-
createInt
-
createPrefixedInt
-