org.sourceforge.beanindex.util
Class IntBuffer
java.lang.Object
org.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
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 |
INITIAL_CAPACITY
public static final int INITIAL_CAPACITY
- See Also:
- Constant Field Values
IntBuffer
public IntBuffer()
IntBuffer
public IntBuffer(int initialCapacity)
- Parameters:
initialCapacity
-
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