public class SequenceLog64 extends Object implements DynamicSequence
| Modifier and Type | Field and Description |
|---|---|
protected long[] |
data |
protected long |
maxvalue |
protected int |
numbits |
protected long |
numentries |
protected static byte |
W |
| Constructor and Description |
|---|
SequenceLog64() |
SequenceLog64(int numbits) |
SequenceLog64(int numbits,
long capacity) |
SequenceLog64(int numbits,
long capacity,
boolean initialize) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Iterator<Long> elements)
Adds an element to the array
|
void |
addIntegers(List<Integer> elements) |
void |
aggressiveTrimToSize()
Trim the internal data structure to fit the actual number of elements.
|
void |
append(long value)
Append a new value after the last position, increasing the number of elements by one.
|
long |
binSearch(long element,
long fromIndex,
long toIndex) |
long |
binSearchExact(long element,
long begin,
long end) |
void |
close() |
long |
get(long position)
Gets the element in a specific position
|
long |
getNumberOfElements()
Gets the total number of elements in the array
|
int |
getNumBits() |
long |
getRealSize() |
String |
getType()
Type identifier of this Stream.
|
static int |
lastWordNumBits(int bitsField,
long total)
Number of bits required for last word
|
static int |
lastWordNumBytes(int bitsField,
long total)
Number of bits required for last word
|
void |
load(InputStream input,
ProgressListener listener)
Loads a array from an InputStream
|
static long |
numBytesFor(int bitsField,
long total)
Number of bytes required to represent n integers of e bits each
|
static long |
numWordsFor(int bitsField,
long total)
longs required to represent "total" integers of "bitsField" bits each
|
void |
resize(long numentries) |
void |
save(OutputStream output,
ProgressListener listener)
Saves the array to an OutputStream
|
void |
set(long position,
long value)
Set a new value at the specified position.
|
long |
size()
Return the size of the data structure in bytes
|
void |
trimToSize()
Trim the internal data structure to fit the actual number of elements.
|
protected static final byte W
protected long[] data
protected int numbits
protected long numentries
protected long maxvalue
public SequenceLog64()
public SequenceLog64(int numbits)
public SequenceLog64(int numbits,
long capacity)
public SequenceLog64(int numbits,
long capacity,
boolean initialize)
public static long numWordsFor(int bitsField,
long total)
public static int lastWordNumBits(int bitsField,
long total)
public static int lastWordNumBytes(int bitsField,
long total)
public static long numBytesFor(int bitsField,
long total)
public void add(Iterator<Long> elements)
Sequencepublic long get(long position)
Sequencepublic void set(long position,
long value)
DynamicSequenceset in interface DynamicSequencepublic void append(long value)
DynamicSequenceappend in interface DynamicSequencepublic void aggressiveTrimToSize()
DynamicSequenceaggressiveTrimToSize in interface DynamicSequencepublic void trimToSize()
DynamicSequencetrimToSize in interface DynamicSequencepublic void resize(long numentries)
public long getNumberOfElements()
SequencegetNumberOfElements in interface Sequencepublic void save(OutputStream output, ProgressListener listener) throws IOException
Sequencesave in interface Sequenceoutput - The OutputStream to be saved toIOExceptionpublic void load(InputStream input, ProgressListener listener) throws IOException
Sequenceload in interface Sequenceinput - The InputStream to load fromIOExceptionpublic long size()
Sequencepublic long getRealSize()
public int getNumBits()
public String getType()
Sequencepublic long binSearchExact(long element,
long begin,
long end)
throws NotFoundException
NotFoundExceptionpublic long binSearch(long element,
long fromIndex,
long toIndex)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2018 DataWeb Research. All rights reserved.