com.ximpleware
Class FastLongBuffer

java.lang.Object
  extended by com.ximpleware.FastLongBuffer
All Implemented Interfaces:
com.ximpleware.ILongBuffer

public class FastLongBuffer
extends java.lang.Object
implements com.ximpleware.ILongBuffer

A fast, unsynchronized, chunk-based long buffer for storing LCs and VTD. Creation date: (7/17/03 6:07:46 PM)


Constructor Summary
FastLongBuffer()
          FastLongBuffer constructor comment.
FastLongBuffer(int e)
          Construct a FastLongBuffer instance with specified page size
FastLongBuffer(int e, int c)
          Construct a FastLongBuffer instance with specified page size
 
Method Summary
 void append(long i)
          Append an integer to the end of this array buffer
 void append(long[] long_array)
          Append single long to the end of array buffer.
 void clear()
          set teh size of long buffer to zero, capacity untouched so long buffer can be reused without any unnecessary and additional allocation
 int getCapacity()
          Get the capacity of the buffer.
 long[] getLongArray(int startingOffset, int len)
          Return a selected chuck of long buffer as a long array.
 int getPageSize()
          Get the buffer page size.
 long longAt(int index)
          Get the long val at given index value.
 int lower32At(int index)
          Get the lower 32 bit of the integer at the given index.
 void modifyEntry(int index, long newValue)
          Modify the value at the index to a new val.
 int size()
          Get the total number of longs in the buffer.
 long[] toLongArray()
          Convert all longs into a long array.
 int upper32At(int index)
          Return the upper 32 bit of the long at the index.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FastLongBuffer

public FastLongBuffer()
FastLongBuffer constructor comment.


FastLongBuffer

public FastLongBuffer(int e)
Construct a FastLongBuffer instance with specified page size

Parameters:
e - int (so that pageSize = (1<

FastLongBuffer

public FastLongBuffer(int e,
                      int c)
Construct a FastLongBuffer instance with specified page size

Parameters:
e - int (so that pageSize = (1<c - int (suggest initial capacity of ArrayList
Method Detail

append

public final void append(long i)
Append an integer to the end of this array buffer

Parameters:
i - long

append

public void append(long[] long_array)
Append single long to the end of array buffer.

Parameters:
long_array - long[]

clear

public final void clear()
set teh size of long buffer to zero, capacity untouched so long buffer can be reused without any unnecessary and additional allocation


getCapacity

public int getCapacity()
Get the capacity of the buffer.

Returns:
int

getLongArray

public long[] getLongArray(int startingOffset,
                           int len)
Return a selected chuck of long buffer as a long array.

Parameters:
startingOffset - int
len - int
Returns:
long[]

getPageSize

public int getPageSize()
Get the buffer page size.

Returns:
int

longAt

public final long longAt(int index)
Get the long val at given index value.

Specified by:
longAt in interface com.ximpleware.ILongBuffer
Parameters:
index - int
Returns:
long

lower32At

public final int lower32At(int index)
Get the lower 32 bit of the integer at the given index.

Specified by:
lower32At in interface com.ximpleware.ILongBuffer
Parameters:
index - int
Returns:
int

modifyEntry

public final void modifyEntry(int index,
                              long newValue)
Modify the value at the index to a new val.

Specified by:
modifyEntry in interface com.ximpleware.ILongBuffer
Parameters:
index - int
newValue - long

size

public final int size()
Get the total number of longs in the buffer.

Specified by:
size in interface com.ximpleware.ILongBuffer
Returns:
int

toLongArray

public long[] toLongArray()
Convert all longs into a long array.

Returns:
long[]

upper32At

public int upper32At(int index)
Return the upper 32 bit of the long at the index.

Specified by:
upper32At in interface com.ximpleware.ILongBuffer
Parameters:
index - int
Returns:
int