|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xml.dtm.ref.ChunkedIntArray
final class ChunkedIntArray
ChunkedIntArray
is an extensible array of blocks of integers.
(I'd consider Vector, but it's unable to handle integers except by
turning them into Objects.)
Making this a separate class means some call-and-return overhead. But doing it all inline tends to be fragile and expensive in coder time, not to mention driving up code size. If you want to inline it, feel free. The Java text suggest that private and Final methods may be inlined, and one can argue that this beast need not be made subclassable...
%REVIEW% This has strong conceptual overlap with the IntVector class. It would probably be a good thing to merge the two, when time permits.
Nested Class Summary | |
---|---|
(package private) static class |
ChunkedIntArray.ChunksVector
|
Field Summary | |
---|---|
(package private) static int |
chunkalloc
|
(package private) ChunkedIntArray.ChunksVector |
chunks
|
(package private) int[] |
fastArray
|
(package private) int |
lastUsed
|
(package private) static int |
lowbits
|
(package private) static int |
lowmask
|
(package private) static int |
slotsize
|
Constructor Summary | |
---|---|
ChunkedIntArray(int slotsize)
Create a new CIA with specified record size. |
Method Summary | |
---|---|
(package private) int |
appendSlot(int w0,
int w1,
int w2,
int w3)
Append a 4-integer record to the CIA, starting with record 1. |
(package private) void |
discardLast()
Disard the highest-numbered record. |
(package private) int |
readEntry(int position,
int offset)
Retrieve an integer from the CIA by record number and column within the record, both 0-based (though position 0 is reserved for special purposes). |
(package private) void |
readSlot(int position,
int[] buffer)
Retrieve the contents of a record into a user-supplied buffer array. |
(package private) int |
slotsUsed()
|
(package private) int |
specialFind(int startPos,
int position)
|
(package private) void |
writeEntry(int position,
int offset,
int value)
Overwrite the integer found at a specific record and column. |
(package private) void |
writeSlot(int position,
int w0,
int w1,
int w2,
int w3)
Overwrite an entire (4-integer) record at the specified index. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final int slotsize
static final int lowbits
static final int chunkalloc
static final int lowmask
ChunkedIntArray.ChunksVector chunks
final int[] fastArray
int lastUsed
Constructor Detail |
---|
ChunkedIntArray(int slotsize)
Method Detail |
---|
int appendSlot(int w0, int w1, int w2, int w3)
int readEntry(int position, int offset) throws java.lang.ArrayIndexOutOfBoundsException
position
- int Record numberslotpos
- int Column number
java.lang.ArrayIndexOutOfBoundsException
int specialFind(int startPos, int position)
int slotsUsed()
void discardLast()
void writeEntry(int position, int offset, int value) throws java.lang.ArrayIndexOutOfBoundsException
position
- int Record numberoffset
- int Column numbervalue
- int New contents
java.lang.ArrayIndexOutOfBoundsException
void writeSlot(int position, int w0, int w1, int w2, int w3)
position
- integer Record numberw0
- intw1
- intw2
- intw3
- intvoid readSlot(int position, int[] buffer)
position
- int Record numberbuffer
- int[] Integer array provided by user, must be large enough
to hold a complete record.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |