Package org.yamcs.studio.data.vtype
Class BufferInt
java.lang.Object
org.yamcs.studio.data.vtype.ListInt
org.yamcs.studio.data.vtype.BufferInt
- All Implemented Interfaces:
CollectionInt
,CollectionNumber
,ListNumber
An implementation of a list on top of buffer. The buffer will start at the initial capacity (default 10) and will
continue to grow.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addInt
(int value) Adds a new value.void
clear()
Removes all values from the buffer.int
The maximum capacity for this buffer.int
getInt
(int index) Returns the element at the specified position in this list casted to an int.int
size()
Returns the number of elements in the collection.
-
Constructor Details
-
BufferInt
public BufferInt()Creates a new buffer. -
BufferInt
public BufferInt(int initialCapacity) Creates a new buffer.- Parameters:
initialCapacity
- initial capacity
-
-
Method Details
-
getInt
public int getInt(int index) Description copied from interface:ListNumber
Returns the element at the specified position in this list casted to an int.- Parameters:
index
- position of the element to return- Returns:
- the element at the specified position in this list
-
size
public int size()Description copied from interface:CollectionNumber
Returns the number of elements in the collection. -
addInt
public void addInt(int value) Adds a new value.- Parameters:
value
- new value
-
clear
public void clear()Removes all values from the buffer. -
getCurrentCapacity
public int getCurrentCapacity()The maximum capacity for this buffer.- Returns:
- maximum capacity
-