Package ints
Interface IntArray
- All Known Implementing Classes:
AlleleRefGTRec,BasicGTRec,BitArrayGTRec,BitArrayRefGTRec,CharArray,HapRefGTRec,IndexArray,IntArrayRefGTRec,LowMafDiallelicGTRec,LowMafGTRec,PackedIntArray,TwoAlleleRefGTRec,UnsignedByteArray,VcfRec,WrappedIntArray
public interface IntArray
Interface IntArray represents an immutable int[] array.
IntArray are required to be immutable.-
Method Summary
Modifier and TypeMethodDescriptionstatic StringReturns a string representation of thisIntArrayby applyingjava.utils.Arrays.toString()to an equivalentint[]object.static IntArraycreate(int[] ia, int valueSize) Returns a newIntArrayinstance that has the same sequence of integers as the specified array of non-negative integers.static IntArrayReturns a newIntArrayinstance that has the same sequence of integers as the specified list of non-negative integers.static booleanReturnstrueif the specifiedIntArrayobjects represent the same sequence of integer values, and returnsfalseotherwise.intget(int index) Returns the specified array element.static intReturns the maximum element, orInteger.MIN_VALUEifthis.size() == 0.static intReturns the minimum element, orInteger.MAX_VALUEifthis.size() == 0.static IntArraypackedCreate(int[] ia, int valueSize) Returns a newIntArrayinstance that has the same sequence of integers as the specified array of non-negative integers.static IntArraypackedCreate(IntList il, int valueSize) Returns a newIntArrayinstance that has the same sequence of integers as the specified list of non-negative integers.intsize()Returns the number of elements in thisIntArray.static int[]Returns a copy of the specified array.
-
Method Details
-
size
int size()Returns the number of elements in thisIntArray.- Returns:
- the number of elements in this
IntArray
-
get
int get(int index) Returns the specified array element.- Parameters:
index- an array index- Returns:
- the specified array element
- Throws:
IndexOutOfBoundsException- ifindex < 0 || index >= this.size()
-
toArray
Returns a copy of the specified array.- Parameters:
ia- a list of integers- Returns:
- a copy of the specified array
- Throws:
NullPointerException- ifia == null
-
asString
Returns a string representation of thisIntArrayby applyingjava.utils.Arrays.toString()to an equivalentint[]object.- Parameters:
ia- a list of integers- Returns:
- a string representation of this
IntArray. - Throws:
NullPointerException- ifia == null
-
equals
Returnstrueif the specifiedIntArrayobjects represent the same sequence of integer values, and returnsfalseotherwise.- Parameters:
a- a sequence of integer valuesb- a sequence of integer values- Returns:
trueif the specifiedIntArrayobjects represent the same sequence of integer values
-
max
Returns the maximum element, orInteger.MIN_VALUEifthis.size() == 0.- Parameters:
ia- a list of integers- Returns:
- the maximum element
- Throws:
NullPointerException- ifia == null
-
min
Returns the minimum element, orInteger.MAX_VALUEifthis.size() == 0.- Parameters:
ia- a list of integers- Returns:
- the minimum element
- Throws:
NullPointerException- ifia == null
-
packedCreate
Returns a newIntArrayinstance that has the same sequence of integers as the specified array of non-negative integers.- Parameters:
ia- the array of non-negative integers to be copiedvalueSize- the exclusive end of the range of array values- Returns:
- a new
IntArrayinstance that has the same sequence of integers as the specified array - Throws:
IllegalArgumentException- ifvalueSize < 1IllegalArgumentException- if(ia[j] < 0 || ia[j] > valueSize)for any indexjsatisfying(j >= 0 && j < ia.length)NullPointerException- ifia == null
-
packedCreate
Returns a newIntArrayinstance that has the same sequence of integers as the specified list of non-negative integers.- Parameters:
il- the list of non-negative integers to be copiedvalueSize- the exclusive end of the range of list values- Returns:
- a new
IntArrayinstance that has the same sequence of integers as the specified list - Throws:
IllegalArgumentException- ifvalueSize < 1IllegalArgumentException- if(il.get(j) < 0 || il.get(j)> valueSize)for any indexjsatisfying(j >= 0 && j < il.size())NullPointerException- ifil == null
-
create
Returns a newIntArrayinstance that has the same sequence of integers as the specified array of non-negative integers. Each integer of the returned object is stored in 1, 2, or 4 bytes.- Parameters:
ia- the array of non-negative integers to be copiedvalueSize- the exclusive end of the range of array values- Returns:
- a new
IntArrayinstance that has the same sequence of integers as the specified array - Throws:
IllegalArgumentException- ifvalueSize < 1IllegalArgumentException- if(ia[j] < 0 || ia[j] > valueSize)for any indexjsatisfying(j >= 0 && j < ia.length)NullPointerException- ifia == null
-
create
Returns a newIntArrayinstance that has the same sequence of integers as the specified list of non-negative integers. Each integer of the returned object is stored in 1, 2, or 4 bytes.- Parameters:
il- the list of non-negative integers to be copiedvalueSize- the exclusive end of the range of list values- Returns:
- a new
IntArrayinstance that has the same sequence of integers as the specified list - Throws:
IllegalArgumentException- ifvalueSize < 1IllegalArgumentException- if(il.get(j) < 0 || il.get(j)> valueSize)for any indexjsatisfying(j >= 0 && j < il.size())NullPointerException- ifil == null
-