Package org.roaringbitmap
Class BitmapContainer
java.lang.Object
org.roaringbitmap.Container
org.roaringbitmap.BitmapContainer
- All Implemented Interfaces:
Externalizable
,Serializable
,Cloneable
,Iterable<Character>
,WordStorage<Container>
Simple bitset-like container.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final long[]
private static final int
(package private) int
static final int
private final int
private static final long
private static final boolean
optimization flag: whether the cardinality of the bitmaps is maintained through branchless operationsFields inherited from class org.roaringbitmap.Container
ContainerNames
-
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate a bitmap container with all bits set to falseBitmapContainer
(int firstOfRun, int lastOfRun) Create a bitmap container with a run of ones from firstOfRun to lastOfRun.private
BitmapContainer
(int newCardinality, long[] newBitmap) BitmapContainer
(long[] newBitmap, int newCardinality) Create a new container, no copy is made.Creates a new non-mappeable container from a mappeable one. -
Method Summary
Modifier and TypeMethodDescriptionadd
(char i) Add a short to the container.add
(int begin, int end) Return a new container with all shorts in [begin,end) added using an unsigned interpretation.private void
addWholeWordToRangeConsumer
(long word, int bufferWordStart, int bufferWordEnd, RelativeRangeConsumer rrc) and
(ArrayContainer value2) Computes the bitwise AND of this container with another (intersection).and
(BitmapContainer value2) Computes the bitwise AND of this container with another (intersection).and
(RunContainer x) Computes the bitwise AND of this container with another (intersection).int
andCardinality
(ArrayContainer value2) int
andCardinality
(BitmapContainer value2) int
andNot
(ArrayContainer value2) Computes the bitwise ANDNOT of this container with another (difference).andNot
(BitmapContainer value2) Computes the bitwise ANDNOT of this container with another (difference).Computes the bitwise ANDNOT of this container with another (difference).(package private) int
bitValue
(char i) (package private) int
cardinalityInRange
(int start, int end) void
clear()
Empties the containerclone()
(package private) void
Recomputes the cardinality of the bitmap.boolean
contains
(char i) Checks whether the contain contains the provided valueboolean
contains
(int minimum, int supremum) Checks whether the container contains the entire rangeprotected boolean
contains
(ArrayContainer arrayContainer) protected boolean
contains
(BitmapContainer bitmapContainer) protected boolean
contains
(RunContainer runContainer) void
deserialize
(DataInput in) Deserialize (recover) the container.boolean
(package private) void
fillArray
(char[] array) Fill the array with set bitsvoid
fillLeastSignificant16bits
(int[] x, int i, int mask) Fill the least significant 16 bits of the integer array, starting at index i, with the short values from this container.int
first()
Get the first integer held in the containerflip
(char i) Add a short to the container if it is not present, otherwise remove it.void
forAll
(int offset, RelativeRangeConsumer rrc) Consume presence information for all values in this container.void
forAllFrom
(char startValue, RelativeRangeConsumer rrc) Consume presence information for all values greater or equal to startValue in this container.void
forAllInRange
(char startValue, char endValue, RelativeRangeConsumer rrc) Consumer presence information for all values in the range [startValue, endValue) in this container.void
forAllUntil
(int offset, char endValue, RelativeRangeConsumer rrc) Consume presence information for all values smaller than endValue in this container.void
forEach
(char msb, IntConsumer ic) Iterate through the values of this container and pass them along to the IntConsumer, using msb as the 16 most significant bits.int
Size of the underlying arrayGets an iterator to visit the contents of the container in batchesint
Computes the distinct number of char values in the container.Iterator to visit the char values in the container in ascending order.Iterator to visit the short values in container and pre-compute ranksIterator to visit the char values in the container in descending order.static CharIterator
getReverseShortIterator
(long[] bitmap) Return a bitmap iterator over this arraystatic PeekableCharIterator
getShortIterator
(long[] bitmap) Return a bitmap iterator over this arrayint
Computes an estimate of the memory usage of this container.int
hashCode()
iadd
(int begin, int end) Add all shorts in [begin,end) using an unsigned interpretation.iand
(ArrayContainer b2) Computes the in-place bitwise AND of this container with another (intersection).iand
(BitmapContainer b2) Computes the in-place bitwise AND of this container with another (intersection).iand
(RunContainer x) Computes the in-place bitwise AND of this container with another (intersection).Computes the in-place bitwise ANDNOT of this container with another (difference).Computes the in-place bitwise ANDNOT of this container with another (difference).Computes the in-place bitwise ANDNOT of this container with another (difference).(package private) Container
ilazyor
(ArrayContainer value2) (package private) Container
(package private) Container
inot
(int firstOfRange, int lastOfRange) Computes the in-place bitwise NOT of this container (complement).boolean
intersects
(int minimum, int supremum) Checks if the container intersects with a rangeboolean
intersects
(ArrayContainer value2) Returns true if the current container intersects the other container.boolean
intersects
(BitmapContainer value2) Returns true if the current container intersects the other container.boolean
Returns true if the current container intersects the other container.ior
(ArrayContainer value2) Computes the in-place bitwise OR of this container with another (union).ior
(BitmapContainer b2) Computes the in-place bitwise OR of this container with another (union).ior
(RunContainer x) Computes the in-place bitwise OR of this container with another (union).iremove
(int begin, int end) Remove shorts in [begin,end) using an unsigned interpretation.boolean
isEmpty()
Checks whether the container is empty or not.boolean
isFull()
Checks whether the container is full or not.iterator()
ixor
(ArrayContainer value2) Computes the in-place bitwise XOR of this container with another (symmetric difference).ixor
(BitmapContainer b2) Computes the in-place bitwise XOR of this container with another (symmetric difference).ixor
(RunContainer x) Computes the in-place bitwise XOR of this container with another (symmetric difference).int
last()
Get the last integer held in the containerprotected Container
lazyor
(ArrayContainer value2) protected Container
protected Container
limit
(int maxcardinality) Create a new Container containing at most maxcardinality integers.(package private) void
loadData
(ArrayContainer arrayContainer) int
nextAbsentValue
(char fromValue) Gets the first absent value greater than or equal to the lower bound.private int
nextClearBit
(int i) Find the index of the next clear bit greater or equal to i.int
nextSetBit
(int i) Find the index of the next set bit greater or equal to i, returns -1 if none found.int
nextValue
(char fromValue) Gets the first value greater than or equal to the lower bound, or -1 if no such value exists.not
(int firstOfRange, int lastOfRange) Computes the bitwise NOT of this container (complement).(package private) int
int
Computes the number of runsint
numberOfRunsLowerBound
(int mustNotExceed) Counts how many runs there is in the bitmap, up to a maximumor
(ArrayContainer value2) Computes the bitwise OR of this container with another (union).or
(BitmapContainer value2) Computes the bitwise OR of this container with another (union).or
(RunContainer x) Computes the bitwise OR of this container with another (union).private int
prevClearBit
(int i) Find the index of the previous clear bit less than or equal to i.int
previousAbsentValue
(char fromValue) Gets the last value less than or equal to the upper bound.int
previousValue
(char fromValue) Gets the last value less than or equal to the upper bound, or -1 if no such value exists.(package private) int
prevSetBit
(int i) Find the index of the previous set bit less than or equal to i, returns -1 if none found.int
rank
(char lowbits) Rank returns the number of integers that are smaller or equal to x (Rank(infinity) would be GetCardinality()).void
remove
(char i) Remove the char from this container.remove
(int begin, int end) Return a new container with all chars in [begin,end) remove using an unsigned interpretation.The output of a lazyOR or lazyIOR might be an invalid container, this should be called on it.Convert to RunContainers, when the result is smaller.char
select
(int j) Return the jth valuevoid
serialize
(DataOutput out) Serialize the container.int
Report the number of bytes required to serialize this container.protected static int
serializedSizeInBytes
(int unusedCardinality) (package private) ArrayContainer
Copies the data to an array containerConvert the current container to a BitmapContainer, if a conversion is needed.Return the content of this container as a LongBuffer.Convert to a mappeable container.toString()
void
trim()
If possible, recover wasted memory.(package private) void
updateCardinality
(int prevOnes, int newOnes) void
writeArray
(DataOutput out) Write just the underlying array.void
writeArray
(ByteBuffer buffer) Write just the underlying array.void
xor
(ArrayContainer value2) Computes the bitwise XOR of this container with another (symmetric difference).xor
(BitmapContainer value2) Computes the bitwise XOR of this container with another (symmetric difference).xor
(RunContainer x) Computes the bitwise XOR of this container with another (symmetric difference).Methods inherited from class org.roaringbitmap.Container
and, andCardinality, andNot, assertNonEmpty, contains, getContainerName, iand, iandNot, intersects, ior, iorNot, ixor, lazyIOR, lazyOR, or, orNot, rangeOfOnes, xor, xorCardinality
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
MAX_CAPACITY
public static final int MAX_CAPACITY- See Also:
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
BLOCKSIZE
private static final int BLOCKSIZE- See Also:
-
USE_BRANCHLESS
private static final boolean USE_BRANCHLESSoptimization flag: whether the cardinality of the bitmaps is maintained through branchless operations- See Also:
-
bitmap
final long[] bitmap -
cardinality
int cardinality -
MAXRUNS
private final int MAXRUNS
-
-
Constructor Details
-
BitmapContainer
public BitmapContainer()Create a bitmap container with all bits set to false -
BitmapContainer
public BitmapContainer(int firstOfRun, int lastOfRun) Create a bitmap container with a run of ones from firstOfRun to lastOfRun. Caller must ensure that the range isn't so small that an ArrayContainer should have been created instead- Parameters:
firstOfRun
- first indexlastOfRun
- last index (range is exclusive)
-
BitmapContainer
private BitmapContainer(int newCardinality, long[] newBitmap) -
BitmapContainer
public BitmapContainer(long[] newBitmap, int newCardinality) Create a new container, no copy is made.- Parameters:
newBitmap
- contentnewCardinality
- desired cardinality.
-
BitmapContainer
Creates a new non-mappeable container from a mappeable one. This copies the data.- Parameters:
bc
- the original container
-
-
Method Details
-
getReverseShortIterator
Return a bitmap iterator over this array- Parameters:
bitmap
- array to be iterated over- Returns:
- an iterator
-
getShortIterator
Return a bitmap iterator over this array- Parameters:
bitmap
- array to be iterated over- Returns:
- an iterator
-
serializedSizeInBytes
protected static int serializedSizeInBytes(int unusedCardinality) -
add
Description copied from class:Container
Return a new container with all shorts in [begin,end) added using an unsigned interpretation. -
add
Description copied from class:Container
Add a short to the container. May generate a new container.- Specified by:
add
in interfaceWordStorage<Container>
- Specified by:
add
in classContainer
- Parameters:
i
- short to be added- Returns:
- the new container
-
and
Description copied from class:Container
Computes the bitwise AND of this container with another (intersection). This container as well as the provided container are left unaffected. -
and
Description copied from class:Container
Computes the bitwise AND of this container with another (intersection). This container as well as the provided container are left unaffected. -
and
Description copied from class:Container
Computes the bitwise AND of this container with another (intersection). This container as well as the provided container are left unaffected. -
andCardinality
- Specified by:
andCardinality
in classContainer
-
andCardinality
- Specified by:
andCardinality
in classContainer
-
andCardinality
- Specified by:
andCardinality
in classContainer
-
andNot
Description copied from class:Container
Computes the bitwise ANDNOT of this container with another (difference). This container as well as the provided container are left unaffected. -
andNot
Description copied from class:Container
Computes the bitwise ANDNOT of this container with another (difference). This container as well as the provided container are left unaffected. -
andNot
Description copied from class:Container
Computes the bitwise ANDNOT of this container with another (difference). This container as well as the provided container are left unaffected. -
clear
public void clear()Description copied from class:Container
Empties the container -
clone
-
isEmpty
public boolean isEmpty()Description copied from class:Container
Checks whether the container is empty or not.- Specified by:
isEmpty
in interfaceWordStorage<Container>
- Specified by:
isEmpty
in classContainer
- Returns:
- true if the container is empty.
-
computeCardinality
void computeCardinality()Recomputes the cardinality of the bitmap. -
cardinalityInRange
int cardinalityInRange(int start, int end) -
updateCardinality
void updateCardinality(int prevOnes, int newOnes) -
contains
public boolean contains(char i) Description copied from class:Container
Checks whether the contain contains the provided value -
contains
public boolean contains(int minimum, int supremum) Description copied from class:Container
Checks whether the container contains the entire range -
contains
-
contains
-
contains
-
bitValue
int bitValue(char i) -
deserialize
Description copied from class:Container
Deserialize (recover) the container.- Specified by:
deserialize
in classContainer
- Parameters:
in
- the DataInput stream- Throws:
IOException
- Signals that an I/O exception has occurred.
-
equals
-
fillArray
void fillArray(char[] array) Fill the array with set bits- Parameters:
array
- container (should be sufficiently large)
-
fillLeastSignificant16bits
public void fillLeastSignificant16bits(int[] x, int i, int mask) Description copied from class:Container
Fill the least significant 16 bits of the integer array, starting at index i, with the short values from this container. The caller is responsible to allocate enough room. The most significant 16 bits of each integer are given by the most significant bits of the provided mask.- Specified by:
fillLeastSignificant16bits
in classContainer
- Parameters:
x
- provided arrayi
- starting indexmask
- indicates most significant bits
-
flip
Description copied from class:Container
Add a short to the container if it is not present, otherwise remove it. May generate a new container. -
getArraySizeInBytes
public int getArraySizeInBytes()Description copied from class:Container
Size of the underlying array- Specified by:
getArraySizeInBytes
in classContainer
- Returns:
- size in bytes
-
getCardinality
public int getCardinality()Description copied from class:Container
Computes the distinct number of char values in the container. Can be expected to run in constant time.- Specified by:
getCardinality
in classContainer
- Returns:
- the cardinality
-
getReverseCharIterator
Description copied from class:Container
Iterator to visit the char values in the container in descending order.- Specified by:
getReverseCharIterator
in classContainer
- Returns:
- iterator
-
getCharIterator
Description copied from class:Container
Iterator to visit the char values in the container in ascending order.- Specified by:
getCharIterator
in classContainer
- Returns:
- iterator
-
getCharRankIterator
Description copied from class:Container
Iterator to visit the short values in container and pre-compute ranks- Specified by:
getCharRankIterator
in classContainer
- Returns:
- iterator
-
getBatchIterator
Description copied from class:Container
Gets an iterator to visit the contents of the container in batches- Specified by:
getBatchIterator
in classContainer
- Returns:
- iterator
-
getSizeInBytes
public int getSizeInBytes()Description copied from class:Container
Computes an estimate of the memory usage of this container. The estimate is not meant to be exact.- Specified by:
getSizeInBytes
in classContainer
- Returns:
- estimated memory usage in bytes
-
hashCode
public int hashCode() -
iadd
Description copied from class:Container
Add all shorts in [begin,end) using an unsigned interpretation. May generate a new container. -
iand
Description copied from class:Container
Computes the in-place bitwise AND of this container with another (intersection). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
iand
Description copied from class:Container
Computes the in-place bitwise AND of this container with another (intersection). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
iand
Description copied from class:Container
Computes the in-place bitwise AND of this container with another (intersection). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
iandNot
Description copied from class:Container
Computes the in-place bitwise ANDNOT of this container with another (difference). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
iandNot
Description copied from class:Container
Computes the in-place bitwise ANDNOT of this container with another (difference). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
iandNot
Description copied from class:Container
Computes the in-place bitwise ANDNOT of this container with another (difference). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
ilazyor
-
ilazyor
-
ilazyor
-
inot
Description copied from class:Container
Computes the in-place bitwise NOT of this container (complement). Only those bits within the range are affected. The current container is generally modified. May generate a new container. -
intersects
Description copied from class:Container
Returns true if the current container intersects the other container.- Specified by:
intersects
in classContainer
- Parameters:
value2
- other container- Returns:
- whether they intersect
-
intersects
Description copied from class:Container
Returns true if the current container intersects the other container.- Specified by:
intersects
in classContainer
- Parameters:
value2
- other container- Returns:
- whether they intersect
-
intersects
Description copied from class:Container
Returns true if the current container intersects the other container.- Specified by:
intersects
in classContainer
- Parameters:
x
- other container- Returns:
- whether they intersect
-
intersects
public boolean intersects(int minimum, int supremum) Description copied from class:Container
Checks if the container intersects with a range- Specified by:
intersects
in classContainer
- Parameters:
minimum
- the inclusive unsigned lower bound of the rangesupremum
- the exclusive unsigned upper bound of the range- Returns:
- true if the container intersects the range
-
ior
Description copied from class:Container
Computes the in-place bitwise OR of this container with another (union). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
ior
Description copied from class:Container
Computes the in-place bitwise OR of this container with another (union). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
ior
Description copied from class:Container
Computes the in-place bitwise OR of this container with another (union). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
iremove
Description copied from class:Container
Remove shorts in [begin,end) using an unsigned interpretation. May generate a new container. -
iterator
-
ixor
Description copied from class:Container
Computes the in-place bitwise XOR of this container with another (symmetric difference). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
ixor
Description copied from class:Container
Computes the in-place bitwise XOR of this container with another (symmetric difference). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
ixor
Description copied from class:Container
Computes the in-place bitwise XOR of this container with another (symmetric difference). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container. -
lazyor
-
lazyor
-
lazyor
-
limit
Description copied from class:Container
Create a new Container containing at most maxcardinality integers. -
loadData
-
nextSetBit
public int nextSetBit(int i) Find the index of the next set bit greater or equal to i, returns -1 if none found.- Parameters:
i
- starting index- Returns:
- index of the next set bit
-
nextClearBit
private int nextClearBit(int i) Find the index of the next clear bit greater or equal to i.- Parameters:
i
- starting index- Returns:
- index of the next clear bit
-
not
Description copied from class:Container
Computes the bitwise NOT of this container (complement). Only those bits within the range are affected. The current container is left unaffected. -
numberOfRuns
int numberOfRuns()- Specified by:
numberOfRuns
in classContainer
-
numberOfRunsAdjustment
public int numberOfRunsAdjustment()Computes the number of runs- Returns:
- the number of runs
-
numberOfRunsLowerBound
public int numberOfRunsLowerBound(int mustNotExceed) Counts how many runs there is in the bitmap, up to a maximum- Parameters:
mustNotExceed
- maximum of runs beyond which counting is pointless- Returns:
- estimated number of courses
-
or
Description copied from class:Container
Computes the bitwise OR of this container with another (union). This container as well as the provided container are left unaffected. -
isFull
public boolean isFull()Description copied from class:Container
Checks whether the container is full or not. -
or
Description copied from class:Container
Computes the bitwise OR of this container with another (union). This container as well as the provided container are left unaffected. -
or
Description copied from class:Container
Computes the bitwise OR of this container with another (union). This container as well as the provided container are left unaffected. -
prevSetBit
int prevSetBit(int i) Find the index of the previous set bit less than or equal to i, returns -1 if none found.- Parameters:
i
- starting index- Returns:
- index of the previous set bit
-
prevClearBit
private int prevClearBit(int i) Find the index of the previous clear bit less than or equal to i.- Parameters:
i
- starting index- Returns:
- index of the previous clear bit
-
rank
public int rank(char lowbits) Description copied from class:Container
Rank returns the number of integers that are smaller or equal to x (Rank(infinity) would be GetCardinality()). -
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
-
remove
Description copied from class:Container
Return a new container with all chars in [begin,end) remove using an unsigned interpretation. -
remove
Description copied from class:Container
Remove the char from this container. May create a new container. -
repairAfterLazy
Description copied from class:Container
The output of a lazyOR or lazyIOR might be an invalid container, this should be called on it.- Specified by:
repairAfterLazy
in classContainer
- Returns:
- a new valid container
-
runOptimize
Description copied from class:Container
Convert to RunContainers, when the result is smaller. Overridden by RunContainer to possibility switch from RunContainer to a smaller alternative. Overridden by BitmapContainer with a more efficient approach.- Specified by:
runOptimize
in interfaceWordStorage<Container>
- Specified by:
runOptimize
in classContainer
- Returns:
- the new container
-
select
public char select(int j) Description copied from class:Container
Return the jth value -
serialize
Description copied from class:Container
Serialize the container.- Specified by:
serialize
in classContainer
- Parameters:
out
- the DataOutput stream- Throws:
IOException
- Signals that an I/O exception has occurred.
-
serializedSizeInBytes
public int serializedSizeInBytes()Description copied from class:Container
Report the number of bytes required to serialize this container.- Specified by:
serializedSizeInBytes
in classContainer
- Returns:
- the size in bytes
-
toArrayContainer
ArrayContainer toArrayContainer()Copies the data to an array container- Returns:
- the array container
-
toLongBuffer
Return the content of this container as a LongBuffer. This creates a copy and might be relatively slow.- Returns:
- the LongBuffer
-
toMappeableContainer
Description copied from class:Container
Convert to a mappeable container.- Specified by:
toMappeableContainer
in classContainer
- Returns:
- the mappeable container
-
toString
-
trim
public void trim()Description copied from class:Container
If possible, recover wasted memory. -
writeArray
Description copied from class:Container
Write just the underlying array.- Specified by:
writeArray
in classContainer
- Parameters:
out
- output stream- Throws:
IOException
- in case of failure
-
writeArray
Description copied from class:Container
Write just the underlying array.- Specified by:
writeArray
in classContainer
- Parameters:
buffer
- ByteBuffer to write to
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
xor
Description copied from class:Container
Computes the bitwise XOR of this container with another (symmetric difference). This container as well as the provided container are left unaffected. -
xor
Description copied from class:Container
Computes the bitwise XOR of this container with another (symmetric difference). This container as well as the provided container are left unaffected. -
xor
Description copied from class:Container
Computes the bitwise XOR of this container with another (symmetric difference). This container as well as the provided container are left unaffected. -
forEach
Description copied from class:Container
Iterate through the values of this container and pass them along to the IntConsumer, using msb as the 16 most significant bits. -
forAll
Description copied from class:Container
Consume presence information for all values in this container. -
forAllFrom
Description copied from class:Container
Consume presence information for all values greater or equal to startValue in this container.- Specified by:
forAllFrom
in classContainer
- Parameters:
startValue
- First value to consume. Corresponds to relativePos=0 in the range consumer.rrc
- consumer
-
forAllUntil
Description copied from class:Container
Consume presence information for all values smaller than endValue in this container.- Specified by:
forAllUntil
in classContainer
- Parameters:
offset
- First value in this container corresponds to this relativePos in the range consumer.endValue
- First value greater than last value to consume.rrc
- consumer
-
forAllInRange
Description copied from class:Container
Consumer presence information for all values in the range [startValue, endValue) in this container.- Specified by:
forAllInRange
in classContainer
- Parameters:
startValue
- First value to consume. Corresponds to relativePos=0 in the range consumer.endValue
- First value greater than last value to consume.rrc
- consumer
-
addWholeWordToRangeConsumer
private void addWholeWordToRangeConsumer(long word, int bufferWordStart, int bufferWordEnd, RelativeRangeConsumer rrc) -
toBitmapContainer
Description copied from class:Container
Convert the current container to a BitmapContainer, if a conversion is needed. If the container is already a bitmap, the container is returned unchanged.- Specified by:
toBitmapContainer
in classContainer
- Returns:
- a bitmap container
-
nextValue
public int nextValue(char fromValue) Description copied from class:Container
Gets the first value greater than or equal to the lower bound, or -1 if no such value exists. -
previousValue
public int previousValue(char fromValue) Description copied from class:Container
Gets the last value less than or equal to the upper bound, or -1 if no such value exists.- Specified by:
previousValue
in classContainer
- Parameters:
fromValue
- the upper bound (inclusive)- Returns:
- the previous value
-
nextAbsentValue
public int nextAbsentValue(char fromValue) Description copied from class:Container
Gets the first absent value greater than or equal to the lower bound.- Specified by:
nextAbsentValue
in classContainer
- Parameters:
fromValue
- the lower bound (inclusive)- Returns:
- the next absent value
-
previousAbsentValue
public int previousAbsentValue(char fromValue) Description copied from class:Container
Gets the last value less than or equal to the upper bound.- Specified by:
previousAbsentValue
in classContainer
- Parameters:
fromValue
- the upper bound (inclusive)- Returns:
- the previous absent value
-
first
public int first()Description copied from class:Container
Get the first integer held in the container -
last
public int last()Description copied from class:Container
Get the last integer held in the container
-