org.sourceforge.beanindex.util
Class IntBuffer

java.lang.Object
  extended byorg.sourceforge.beanindex.util.IntBuffer

public class IntBuffer
extends java.lang.Object

This is an alternative for using ArrayList with Integer objects in it. This class uses a int[] as a buffer and adjusts the length

Author:
Sakthivel Muthusamy

Field Summary
static int INITIAL_CAPACITY
           
 
Constructor Summary
IntBuffer()
           
IntBuffer(int initialCapacity)
           
 
Method Summary
 void clear()
          Method to clear the buffer.
 int get(int index)
           
 int[] getData()
           
 void insert(int offset, int data)
          writes the int at the end of the buffer
 int length()
           
 int write(int data)
          writes the int at the end of the buffer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INITIAL_CAPACITY

public static final int INITIAL_CAPACITY
See Also:
Constant Field Values
Constructor Detail

IntBuffer

public IntBuffer()

IntBuffer

public IntBuffer(int initialCapacity)
Parameters:
initialCapacity -
Method Detail

write

public int write(int data)
writes the int at the end of the buffer

Parameters:
data -

insert

public void insert(int offset,
                   int data)
writes the int at the end of the buffer

Parameters:
offset -
data -

getData

public int[] getData()
Returns:
int[]

get

public int get(int index)
Parameters:
index -
Returns:
int

length

public int length()
Returns:
int

clear

public void clear()
Method to clear the buffer. Sets the initial capacity to 1