Package qilin.util
Class ArrayNumberer<E extends Numberable>
java.lang.Object
qilin.util.ArrayNumberer<E>
- All Implemented Interfaces:
- Iterable<E>,- IterableNumberer<E>,- Numberer<E>
- Direct Known Subclasses:
- StringNumberer
A class that numbers objects, so they can be placed in bitsets.
- Author:
- Ondrej Lhotak, xiao, generalize it.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidTells the numberer that a new object needs to be assigned a number.get(long number) Should return the object that was assigned the number.longShould return the number that was assigned to object o that was previously passed as an argument to add().iterator()Returns an iterator over all objects added to the numberer.booleanRemoves the number for a given object.intsize()Should return the number of objects that have been assigned numbers.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Field Details- 
numberToObj
- 
lastNumberprotected int lastNumber
- 
freeNumbers
 
- 
- 
Constructor Details- 
ArrayNumbererpublic ArrayNumberer()
- 
ArrayNumberer
 
- 
- 
Method Details- 
addDescription copied from interface:NumbererTells the numberer that a new object needs to be assigned a number.- Specified by:
- addin interface- Numberer<E extends Numberable>
 
- 
getDescription copied from interface:NumbererShould return the number that was assigned to object o that was previously passed as an argument to add().- Specified by:
- getin interface- Numberer<E extends Numberable>
 
- 
getDescription copied from interface:NumbererShould return the object that was assigned the number.- Specified by:
- getin interface- Numberer<E extends Numberable>
 
- 
sizepublic int size()Description copied from interface:NumbererShould return the number of objects that have been assigned numbers.- Specified by:
- sizein interface- Numberer<E extends Numberable>
 
- 
iteratorDescription copied from interface:IterableNumbererReturns an iterator over all objects added to the numberer.- Specified by:
- iteratorin interface- Iterable<E extends Numberable>
- Specified by:
- iteratorin interface- IterableNumberer<E extends Numberable>
 
- 
removeDescription copied from interface:NumbererRemoves the number for a given object.- Specified by:
- removein interface- Numberer<E extends Numberable>
- Parameters:
- o- the element
- Returns:
- true if the removal was successful, false when not
 
 
-