Interface NumberArrayAdapter<N extends java.lang.Number,A>
-
- Type Parameters:
N
- Number typeA
- Array type
- All Superinterfaces:
ArrayAdapter<N,A>
- All Known Implementing Classes:
DoubleArray
,DoubleArrayAdapter
,FeatureSelection.ProjectedNumberFeatureVectorAdapter
,FloatArrayAdapter
,IntegerArray
,NumberVectorAdapter
public interface NumberArrayAdapter<N extends java.lang.Number,A> extends ArrayAdapter<N,A>
Adapter for arrays of numbers, to avoid boxing.- Since:
- 0.5.0
- Author:
- Erich Schubert
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description N
get(A array, int off)
Get the off'th item from the array.default byte
getByte(A array, int off)
Get the off'th item from the array as byte.double
getDouble(A array, int off)
Get the off'th item from the array as double.default float
getFloat(A array, int off)
Get the off'th item from the array as float.default int
getInteger(A array, int off)
Get the off'th item from the array as integer.long
getLong(A array, int off)
Get the off'th item from the array as long.default short
getShort(A array, int off)
Get the off'th item from the array as short.int
size(A array)
Get the size of the array.
-
-
-
Method Detail
-
size
int size(A array)
Description copied from interface:ArrayAdapter
Get the size of the array.- Specified by:
size
in interfaceArrayAdapter<N extends java.lang.Number,A>
- Parameters:
array
- Array-like thing- Returns:
- Size
-
get
N get(A array, int off)
Description copied from interface:ArrayAdapter
Get the off'th item from the array.- Specified by:
get
in interfaceArrayAdapter<N extends java.lang.Number,A>
- Parameters:
array
- Array to get fromoff
- Offset- Returns:
- Item at offset off
-
getDouble
double getDouble(A array, int off)
Get the off'th item from the array as double.- Parameters:
array
- Array to get fromoff
- Offset- Returns:
- Item at offset off
- Throws:
java.lang.IndexOutOfBoundsException
- for an invalid index.
-
getFloat
default float getFloat(A array, int off)
Get the off'th item from the array as float.- Parameters:
array
- Array to get fromoff
- Offset- Returns:
- Item at offset off
- Throws:
java.lang.IndexOutOfBoundsException
- for an invalid index.
-
getInteger
default int getInteger(A array, int off)
Get the off'th item from the array as integer.- Parameters:
array
- Array to get fromoff
- Offset- Returns:
- Item at offset off
- Throws:
java.lang.IndexOutOfBoundsException
- for an invalid index.
-
getShort
default short getShort(A array, int off)
Get the off'th item from the array as short.- Parameters:
array
- Array to get fromoff
- Offset- Returns:
- Item at offset off
- Throws:
java.lang.IndexOutOfBoundsException
- for an invalid index.
-
getLong
long getLong(A array, int off)
Get the off'th item from the array as long.- Parameters:
array
- Array to get fromoff
- Offset- Returns:
- Item at offset off
- Throws:
java.lang.IndexOutOfBoundsException
- for an invalid index.
-
getByte
default byte getByte(A array, int off)
Get the off'th item from the array as byte.- Parameters:
array
- Array to get fromoff
- Offset- Returns:
- Item at offset off
- Throws:
java.lang.IndexOutOfBoundsException
- for an invalid index.
-
-