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 NumberVectorAdapter
STATIC
Static adapter class.
-
Constructor Summary
Constructors Modifier Constructor Description private
NumberVectorAdapter()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.Number
get(NumberVector array, int off)
Deprecated.byte
getByte(NumberVector array, int off)
Get the off'th item from the array as byte.double
getDouble(NumberVector array, int off)
Get the off'th item from the array as double.float
getFloat(NumberVector array, int off)
Get the off'th item from the array as float.int
getInteger(NumberVector array, int off)
Get the off'th item from the array as integer.long
getLong(NumberVector array, int off)
Get the off'th item from the array as long.short
getShort(NumberVector array, int off)
Get the off'th item from the array as short.int
size(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:ArrayAdapter
Get the size of the array.- Specified by:
size
in interfaceArrayAdapter<java.lang.Number,NumberVector>
- Specified by:
size
in 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:ArrayAdapter
Get the off'th item from the array.- Specified by:
get
in interfaceArrayAdapter<java.lang.Number,NumberVector>
- Specified by:
get
in 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:NumberArrayAdapter
Get the off'th item from the array as double.- Specified by:
getDouble
in 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:NumberArrayAdapter
Get the off'th item from the array as float.- Specified by:
getFloat
in 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:NumberArrayAdapter
Get the off'th item from the array as integer.- Specified by:
getInteger
in 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:NumberArrayAdapter
Get the off'th item from the array as short.- Specified by:
getShort
in 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:NumberArrayAdapter
Get the off'th item from the array as long.- Specified by:
getLong
in 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:NumberArrayAdapter
Get the off'th item from the array as byte.- Specified by:
getByte
in interfaceNumberArrayAdapter<java.lang.Number,NumberVector>
- Parameters:
array
- Array to get fromoff
- Offset- Returns:
- Item at offset off
-
-