Class IntList.Array
- java.lang.Object
-
- com.biomatters.geneious.publicapi.utilities.IntList
-
- com.biomatters.geneious.publicapi.utilities.IntList.Array
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.biomatters.geneious.publicapi.utilities.IntList
IntList.Array
-
-
Constructor Summary
Constructors Constructor Description Array(int initialCapacity)
Construct a new empty IntList with the given intial capacity
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int value)
Adds a new element to the end of the listvoid
addAll(IntList values)
Adds all values from another IntList to this IntListvoid
compact()
Compacts the underlying storage array to only big as big as it needs to be to hold the current data.int
get(int index)
Gets the value at this index.boolean
isEmpty()
Returns true if this list is emptyIntList.size()
==0)int
set(int index, int newValue)
sets the value of the list at the given indexint
size()
Returns the size of this list likeList.size()
void
sort()
sorts the values in this list in increasing orderIntList
subList(int minIndex, int maxIndexExclusive)
Creates a sub listint[]
toIntArray()
int[]
toIntArray(int minIndex, int maxIndexExclusive)
returns a copy of a sub-list of the elements in this list as an array-
Methods inherited from class com.biomatters.geneious.publicapi.utilities.IntList
contains, equals, forValues, forValues, fromString, hashCode, readObject, toString, writeObject
-
-
-
-
Method Detail
-
get
public int get(int index)
Description copied from class:IntList
Gets the value at this index. (likeList.get(int)
-
set
public int set(int index, int newValue)
sets the value of the list at the given index- Parameters:
index
- the index in the range 0->size()-1newValue
- the new value- Returns:
- the previous value at this index
-
add
public void add(int value)
Adds a new element to the end of the list- Parameters:
value
- the new value to add
-
size
public int size()
Description copied from class:IntList
Returns the size of this list likeList.size()
-
compact
public void compact()
Compacts the underlying storage array to only big as big as it needs to be to hold the current data.
-
toIntArray
public int[] toIntArray()
- Overrides:
toIntArray
in classIntList
- Returns:
- a copy of the elements in this list as an array
-
toIntArray
public int[] toIntArray(int minIndex, int maxIndexExclusive)
returns a copy of a sub-list of the elements in this list as an array- Parameters:
minIndex
- the first index for the sublistmaxIndexExclusive
- the last index (exclusive) for the sublist- Returns:
- a new array
-
sort
public void sort()
sorts the values in this list in increasing order
-
isEmpty
public boolean isEmpty()
Description copied from class:IntList
Returns true if this list is emptyIntList.size()
==0)- Overrides:
isEmpty
in classIntList
- Returns:
- true if this list is empty
IntList.size()
==0)
-
subList
public IntList subList(int minIndex, int maxIndexExclusive)
Description copied from class:IntList
Creates a sub list
-
addAll
public void addAll(IntList values)
Adds all values from another IntList to this IntList- Parameters:
values
- the values to add- Since:
- API 4.1110 (Geneious 11.1.0)
-
-