Package org.roaringbitmap
Class RunContainer
- java.lang.Object
-
- org.roaringbitmap.Container
-
- org.roaringbitmap.RunContainer
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<java.lang.Character>
,WordStorage<Container>
public final class RunContainer extends Container implements java.lang.Cloneable
This container takes the form of runs of consecutive values (effectively, run-length encoding). Adding and removing content from this container might make it wasteful so regular calls to "runOptimize" might be warranted.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.roaringbitmap.Container
ContainerNames
-
-
Constructor Summary
Constructors Modifier Constructor Description RunContainer()
Create a container with default capacityRunContainer(char[] array, int numRuns)
Construct a new RunContainer backed by the provided array.RunContainer(int capacity)
Create an array container with specified capacityRunContainer(int firstOfRun, int lastOfRun)
Create an run container with a run of ones from firstOfRun to lastOfRun.protected
RunContainer(ArrayContainer arr, int nbrRuns)
protected
RunContainer(BitmapContainer bc, int nbrRuns)
RunContainer(MappeableRunContainer bc)
Creates a new non-mappeable container from a mappeable one.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Container
add(char k)
Add a short to the container.Container
add(int begin, int end)
Return a new container with all shorts in [begin,end) added using an unsigned interpretation.Container
and(ArrayContainer x)
Computes the bitwise AND of this container with another (intersection).Container
and(BitmapContainer x)
Computes the bitwise AND of this container with another (intersection).Container
and(RunContainer x)
Computes the bitwise AND of this container with another (intersection).int
andCardinality(ArrayContainer x)
int
andCardinality(BitmapContainer x)
int
andCardinality(RunContainer x)
Container
andNot(ArrayContainer x)
Computes the bitwise ANDNOT of this container with another (difference).Container
andNot(BitmapContainer x)
Computes the bitwise ANDNOT of this container with another (difference).Container
andNot(RunContainer x)
Computes the bitwise ANDNOT of this container with another (difference).void
clear()
Empties the containerContainer
clone()
boolean
contains(char x)
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(java.io.DataInput in)
Deserialize (recover) the container.boolean
equals(java.lang.Object o)
void
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 containerContainer
flip(char x)
Add a short to the container if it is not present, otherwise remove it.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.static RunContainer
full()
protected int
getArraySizeInBytes()
Size of the underlying arrayContainerBatchIterator
getBatchIterator()
Gets an iterator to visit the contents of the container in batchesint
getCardinality()
Computes the distinct number of char values in the container.PeekableCharIterator
getCharIterator()
Iterator to visit the char values in the container in ascending order.PeekableCharRankIterator
getCharRankIterator()
Iterator to visit the short values in container and pre-compute rankschar
getLength(int index)
Gets the length of the run at the index.CharIterator
getReverseCharIterator()
Iterator to visit the char values in the container in descending order.int
getSizeInBytes()
Computes an estimate of the memory usage of this container.char
getValue(int index)
Gets the value of the first element of the run at the index.int
hashCode()
Container
iadd(int begin, int end)
Add all shorts in [begin,end) using an unsigned interpretation.Container
iand(ArrayContainer x)
Computes the in-place bitwise AND of this container with another (intersection).Container
iand(BitmapContainer x)
Computes the in-place bitwise AND of this container with another (intersection).Container
iand(RunContainer x)
Computes the in-place bitwise AND of this container with another (intersection).Container
iandNot(ArrayContainer x)
Computes the in-place bitwise ANDNOT of this container with another (difference).Container
iandNot(BitmapContainer x)
Computes the in-place bitwise ANDNOT of this container with another (difference).Container
iandNot(RunContainer x)
Computes the in-place bitwise ANDNOT of this container with another (difference).Container
inot(int rangeStart, int rangeEnd)
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 x)
Returns true if the current container intersects the other container.boolean
intersects(BitmapContainer x)
Returns true if the current container intersects the other container.boolean
intersects(RunContainer x)
Returns true if the current container intersects the other container.Container
ior(ArrayContainer x)
Computes the in-place bitwise OR of this container with another (union).Container
ior(BitmapContainer x)
Computes the in-place bitwise OR of this container with another (union).Container
ior(RunContainer x)
Computes the in-place bitwise OR of this container with another (union).Container
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.java.util.Iterator<java.lang.Character>
iterator()
Container
ixor(ArrayContainer x)
Computes the in-place bitwise XOR of this container with another (symmetric difference).Container
ixor(BitmapContainer x)
Computes the in-place bitwise XOR of this container with another (symmetric difference).Container
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 x)
Container
limit(int maxcardinality)
Create a new Container containing at most maxcardinality integers.int
nextAbsentValue(char fromValue)
Gets the first absent value greater than or equal to the lower bound.int
nextValue(char fromValue)
Gets the first value greater than or equal to the lower bound, or -1 if no such value exists.Container
not(int rangeStart, int rangeEnd)
Computes the bitwise NOT of this container (complement).int
numberOfRuns()
Container
or(ArrayContainer x)
Computes the bitwise OR of this container with another (union).Container
or(BitmapContainer x)
Computes the bitwise OR of this container with another (union).Container
or(RunContainer x)
Computes the bitwise OR of this container with another (union).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.int
rank(char lowbits)
Rank returns the number of integers that are smaller or equal to x (Rank(infinity) would be GetCardinality()).void
readExternal(java.io.ObjectInput in)
Container
remove(char x)
Remove the char from this container.Container
remove(int begin, int end)
Return a new container with all chars in [begin,end) remove using an unsigned interpretation.Container
repairAfterLazy()
The output of a lazyOR or lazyIOR might be an invalid container, this should be called on it.Container
runOptimize()
Convert to Array or Bitmap container if the serialized form would be shorter.char
select(int j)
Return the jth valuevoid
serialize(java.io.DataOutput out)
Serialize the container.int
serializedSizeInBytes()
Report the number of bytes required to serialize this container.protected static int
serializedSizeInBytes(int numberOfRuns)
BitmapContainer
toBitmapContainer()
Convert the current container to a BitmapContainer, if a conversion is needed.java.nio.CharBuffer
toCharBuffer()
Return the content of this container as a ShortBuffer.MappeableContainer
toMappeableContainer()
Convert to a mappeable container.java.lang.String
toString()
void
trim()
If possible, recover wasted memory.protected void
writeArray(java.io.DataOutput out)
Write just the underlying array.protected void
writeArray(java.nio.ByteBuffer buffer)
Write just the underlying array.void
writeExternal(java.io.ObjectOutput out)
Container
xor(ArrayContainer x)
Computes the bitwise XOR of this container with another (symmetric difference).Container
xor(BitmapContainer x)
Computes the bitwise XOR of this container with another (symmetric difference).Container
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
-
-
-
-
Constructor Detail
-
RunContainer
public RunContainer()
Create a container with default capacity
-
RunContainer
protected RunContainer(ArrayContainer arr, int nbrRuns)
-
RunContainer
public RunContainer(int firstOfRun, int lastOfRun)
Create an run container with a run of ones from firstOfRun to lastOfRun.- Parameters:
firstOfRun
- first indexlastOfRun
- last index (range is exclusive)
-
RunContainer
protected RunContainer(BitmapContainer bc, int nbrRuns)
-
RunContainer
public RunContainer(int capacity)
Create an array container with specified capacity- Parameters:
capacity
- The capacity of the container
-
RunContainer
public RunContainer(MappeableRunContainer bc)
Creates a new non-mappeable container from a mappeable one. This copies the data.- Parameters:
bc
- the original container
-
RunContainer
public RunContainer(char[] array, int numRuns)
Construct a new RunContainer backed by the provided array. Note that if you modify the RunContainer a new array may be produced.- Parameters:
array
- array where the data is storednumRuns
- number of runs (each using 2 shorts in the buffer)
-
-
Method Detail
-
serializedSizeInBytes
protected static int serializedSizeInBytes(int numberOfRuns)
-
add
public Container add(int begin, int end)
Description copied from class:Container
Return a new container with all shorts in [begin,end) added using an unsigned interpretation.
-
add
public Container add(char k)
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:
k
- short to be added- Returns:
- the new container
-
and
public Container and(ArrayContainer x)
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
public Container and(BitmapContainer x)
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
public Container and(RunContainer x)
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
public int andCardinality(ArrayContainer x)
- Specified by:
andCardinality
in classContainer
-
andCardinality
public int andCardinality(BitmapContainer x)
- Specified by:
andCardinality
in classContainer
-
andCardinality
public int andCardinality(RunContainer x)
- Specified by:
andCardinality
in classContainer
-
andNot
public Container andNot(ArrayContainer x)
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
public Container andNot(BitmapContainer x)
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
public Container andNot(RunContainer x)
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
-
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.
-
contains
public boolean contains(char x)
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
protected boolean contains(RunContainer runContainer)
-
contains
protected boolean contains(ArrayContainer arrayContainer)
-
contains
protected boolean contains(BitmapContainer bitmapContainer)
-
deserialize
public void deserialize(java.io.DataInput in) throws java.io.IOException
Description copied from class:Container
Deserialize (recover) the container.- Specified by:
deserialize
in classContainer
- Parameters:
in
- the DataInput stream- Throws:
java.io.IOException
- Signals that an I/O exception has occurred.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
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
public Container flip(char x)
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
protected 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
-
getLength
public char getLength(int index)
Gets the length of the run at the index.- Parameters:
index
- the index of the run.- Returns:
- the length of the run at the index.
- Throws:
java.lang.ArrayIndexOutOfBoundsException
- if index is negative or larger than the index of the last run.
-
getReverseCharIterator
public CharIterator 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
public PeekableCharIterator 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
public PeekableCharRankIterator 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
public ContainerBatchIterator 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
-
getValue
public char getValue(int index)
Gets the value of the first element of the run at the index.- Parameters:
index
- the index of the run.- Returns:
- the value of the first element of the run at the index.
- Throws:
java.lang.ArrayIndexOutOfBoundsException
- if index is negative or larger than the index of the last run.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
iadd
public Container iadd(int begin, int end)
Description copied from class:Container
Add all shorts in [begin,end) using an unsigned interpretation. May generate a new container.
-
iand
public Container iand(ArrayContainer x)
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
public Container iand(BitmapContainer x)
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
public Container iand(RunContainer x)
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
public Container iandNot(ArrayContainer x)
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
public Container iandNot(BitmapContainer x)
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
public Container iandNot(RunContainer x)
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.
-
inot
public Container inot(int rangeStart, int rangeEnd)
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
public boolean intersects(ArrayContainer x)
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(BitmapContainer x)
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(RunContainer x)
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
public Container ior(ArrayContainer x)
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
public Container ior(BitmapContainer x)
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
public Container ior(RunContainer x)
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
public Container iremove(int begin, int end)
Description copied from class:Container
Remove shorts in [begin,end) using an unsigned interpretation. May generate a new container.
-
isFull
public boolean isFull()
Description copied from class:Container
Checks whether the container is full or not.
-
full
public static RunContainer full()
-
iterator
public java.util.Iterator<java.lang.Character> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<java.lang.Character>
-
ixor
public Container ixor(ArrayContainer x)
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
public Container ixor(BitmapContainer x)
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
public Container ixor(RunContainer x)
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
protected Container lazyor(ArrayContainer x)
-
limit
public Container limit(int maxcardinality)
Description copied from class:Container
Create a new Container containing at most maxcardinality integers.
-
not
public Container not(int rangeStart, int rangeEnd)
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
public int numberOfRuns()
-
or
public Container or(ArrayContainer x)
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
public Container or(BitmapContainer x)
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
public Container or(RunContainer x)
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.
-
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
public void readExternal(java.io.ObjectInput in) throws java.io.IOException
- Specified by:
readExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
-
remove
public Container remove(int begin, int end)
Description copied from class:Container
Return a new container with all chars in [begin,end) remove using an unsigned interpretation.
-
remove
public Container remove(char x)
Description copied from class:Container
Remove the char from this container. May create a new container.
-
repairAfterLazy
public 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
public Container runOptimize()
Convert to Array or Bitmap container if the serialized form would be shorter. Exactly the same functionality as toEfficientContainer.- 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
public void serialize(java.io.DataOutput out) throws java.io.IOException
Description copied from class:Container
Serialize the container.
-
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
-
toMappeableContainer
public MappeableContainer toMappeableContainer()
Description copied from class:Container
Convert to a mappeable container.- Specified by:
toMappeableContainer
in classContainer
- Returns:
- the mappeable container
-
toCharBuffer
public java.nio.CharBuffer toCharBuffer()
Return the content of this container as a ShortBuffer. This creates a copy and might be relatively slow.- Returns:
- the ShortBuffer
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
trim
public void trim()
Description copied from class:Container
If possible, recover wasted memory.
-
writeArray
protected void writeArray(java.io.DataOutput out) throws java.io.IOException
Description copied from class:Container
Write just the underlying array.- Specified by:
writeArray
in classContainer
- Parameters:
out
- output stream- Throws:
java.io.IOException
- in case of failure
-
writeArray
protected void writeArray(java.nio.ByteBuffer buffer)
Description copied from class:Container
Write just the underlying array.- Specified by:
writeArray
in classContainer
- Parameters:
buffer
- ByteBuffer to write to
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
- Specified by:
writeExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
-
xor
public Container xor(ArrayContainer x)
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
public Container xor(BitmapContainer x)
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
public Container xor(RunContainer x)
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
public void forEach(char msb, IntConsumer ic)
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.
-
toBitmapContainer
public BitmapContainer 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
-
-