Class NumberVectorAdapter
- java.lang.Object
-
- elki.utilities.datastructures.arraylike.NumberVectorAdapter
-
- All Implemented Interfaces:
ArrayAdapter<java.lang.Number,NumberVector>,NumberArrayAdapter<java.lang.Number,NumberVector>
public class NumberVectorAdapter extends java.lang.Object implements NumberArrayAdapter<java.lang.Number,NumberVector>
Adapter to use a feature vector as an array of features.Use the static instance
STATIC!- Since:
- 0.5.0
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description static NumberVectorAdapterSTATICStatic adapter class.
-
Constructor Summary
Constructors Modifier Constructor Description privateNumberVectorAdapter()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.Numberget(NumberVector array, int off)Deprecated.bytegetByte(NumberVector array, int off)Get the off'th item from the array as byte.doublegetDouble(NumberVector array, int off)Get the off'th item from the array as double.floatgetFloat(NumberVector array, int off)Get the off'th item from the array as float.intgetInteger(NumberVector array, int off)Get the off'th item from the array as integer.longgetLong(NumberVector array, int off)Get the off'th item from the array as long.shortgetShort(NumberVector array, int off)Get the off'th item from the array as short.intsize(NumberVector array)Get the size of the array.
-
-
-
Field Detail
-
STATIC
public static final NumberVectorAdapter STATIC
Static adapter class.
-
-
Constructor Detail
-
NumberVectorAdapter
private NumberVectorAdapter()
Constructor. Use the static instanceSTATIC!
-
-
Method Detail
-
size
public int size(NumberVector array)
Description copied from interface:ArrayAdapterGet the size of the array.- Specified by:
sizein interfaceArrayAdapter<java.lang.Number,NumberVector>- Specified by:
sizein interfaceNumberArrayAdapter<java.lang.Number,NumberVector>- Parameters:
array- Array-like thing- Returns:
- Size
-
get
@Deprecated public java.lang.Number get(NumberVector array, int off)
Deprecated.Description copied from interface:ArrayAdapterGet the off'th item from the array.- Specified by:
getin interfaceArrayAdapter<java.lang.Number,NumberVector>- Specified by:
getin interfaceNumberArrayAdapter<java.lang.Number,NumberVector>- Parameters:
array- Array to get fromoff- Offset- Returns:
- Item at offset off
-
getDouble
public double getDouble(NumberVector array, int off)
Description copied from interface:NumberArrayAdapterGet the off'th item from the array as double.- Specified by:
getDoublein interfaceNumberArrayAdapter<java.lang.Number,NumberVector>- Parameters:
array- Array to get fromoff- Offset- Returns:
- Item at offset off
-
getFloat
public float getFloat(NumberVector array, int off)
Description copied from interface:NumberArrayAdapterGet the off'th item from the array as float.- Specified by:
getFloatin interfaceNumberArrayAdapter<java.lang.Number,NumberVector>- Parameters:
array- Array to get fromoff- Offset- Returns:
- Item at offset off
-
getInteger
public int getInteger(NumberVector array, int off)
Description copied from interface:NumberArrayAdapterGet the off'th item from the array as integer.- Specified by:
getIntegerin interfaceNumberArrayAdapter<java.lang.Number,NumberVector>- Parameters:
array- Array to get fromoff- Offset- Returns:
- Item at offset off
-
getShort
public short getShort(NumberVector array, int off)
Description copied from interface:NumberArrayAdapterGet the off'th item from the array as short.- Specified by:
getShortin interfaceNumberArrayAdapter<java.lang.Number,NumberVector>- Parameters:
array- Array to get fromoff- Offset- Returns:
- Item at offset off
-
getLong
public long getLong(NumberVector array, int off)
Description copied from interface:NumberArrayAdapterGet the off'th item from the array as long.- Specified by:
getLongin interfaceNumberArrayAdapter<java.lang.Number,NumberVector>- Parameters:
array- Array to get fromoff- Offset- Returns:
- Item at offset off
-
getByte
public byte getByte(NumberVector array, int off)
Description copied from interface:NumberArrayAdapterGet the off'th item from the array as byte.- Specified by:
getBytein interfaceNumberArrayAdapter<java.lang.Number,NumberVector>- Parameters:
array- Array to get fromoff- Offset- Returns:
- Item at offset off
-
-