Package smile.data.vector
Interface LongVector
- All Superinterfaces:
BaseVector<Long,
,Long, LongStream> Serializable
An immutable long vector.
-
Method Summary
Modifier and TypeMethodDescriptionlong[]
array()
Returns the array that backs this vector.get
(int... index) Returns a new vector with selected entries.default boolean
getBoolean
(int i) Returns the boolean value at position i.default byte
getByte
(int i) Returns the byte value at position i.default char
getChar
(int i) Returns the character value at position i.default double
getDouble
(int i) Returns the double value at position i.default float
getFloat
(int i) Returns the float value at position i.default int
getInt
(int i) Returns the integer value at position i.default short
getShort
(int i) Returns the short value at position i.static LongVector
Creates a named long vector.static LongVector
of
(String name, LongStream stream) Creates a named long integer vector.static LongVector
of
(StructField field, long[] vector) Creates a named long integer vector.static LongVector
of
(StructField field, LongStream stream) Creates a named long integer vector.default String
toString
(int n) Returns the string representation of vector.default DataType
type()
Returns the data type of elements.Methods inherited from interface smile.data.vector.BaseVector
apply, apply, field, get, getLong, measure, name, size, stream, toDoubleArray, toDoubleArray, toIntArray, toIntArray, toStringArray, toStringArray
-
Method Details
-
type
Description copied from interface:BaseVector
Returns the data type of elements.- Specified by:
type
in interfaceBaseVector<Long,
Long, LongStream> - Returns:
- the data type of elements.
-
array
long[] array()Description copied from interface:BaseVector
Returns the array that backs this vector. This is mostly for smile internal use for high performance. The application developers should not use this method.- Specified by:
array
in interfaceBaseVector<Long,
Long, LongStream> - Returns:
- the array that backs this vector.
-
get
Description copied from interface:BaseVector
Returns a new vector with selected entries.- Specified by:
get
in interfaceBaseVector<Long,
Long, LongStream> - Parameters:
index
- the index of selected entries.- Returns:
- the new vector of selected entries.
-
getBoolean
default boolean getBoolean(int i) Description copied from interface:BaseVector
Returns the boolean value at position i.- Specified by:
getBoolean
in interfaceBaseVector<Long,
Long, LongStream> - Parameters:
i
- the index.- Returns:
- the value.
-
getChar
default char getChar(int i) Description copied from interface:BaseVector
Returns the character value at position i.- Specified by:
getChar
in interfaceBaseVector<Long,
Long, LongStream> - Parameters:
i
- the index.- Returns:
- the value.
-
getByte
default byte getByte(int i) Description copied from interface:BaseVector
Returns the byte value at position i.- Specified by:
getByte
in interfaceBaseVector<Long,
Long, LongStream> - Parameters:
i
- the index.- Returns:
- the value.
-
getShort
default short getShort(int i) Description copied from interface:BaseVector
Returns the short value at position i.- Specified by:
getShort
in interfaceBaseVector<Long,
Long, LongStream> - Parameters:
i
- the index.- Returns:
- the value.
-
getInt
default int getInt(int i) Description copied from interface:BaseVector
Returns the integer value at position i.- Specified by:
getInt
in interfaceBaseVector<Long,
Long, LongStream> - Parameters:
i
- the index.- Returns:
- the value.
-
getFloat
default float getFloat(int i) Description copied from interface:BaseVector
Returns the float value at position i.- Specified by:
getFloat
in interfaceBaseVector<Long,
Long, LongStream> - Parameters:
i
- the index.- Returns:
- the value.
-
getDouble
default double getDouble(int i) Description copied from interface:BaseVector
Returns the double value at position i.- Specified by:
getDouble
in interfaceBaseVector<Long,
Long, LongStream> - Parameters:
i
- the index.- Returns:
- the value.
-
toString
Returns the string representation of vector.- Parameters:
n
- the number of elements to show.- Returns:
- the string representation of vector.
-
of
Creates a named long vector.- Parameters:
name
- the name of vector.vector
- the data of vector.- Returns:
- the vector.
-
of
Creates a named long integer vector.- Parameters:
name
- the name of vector.stream
- the data stream of vector.- Returns:
- the vector.
-
of
Creates a named long integer vector.- Parameters:
field
- the struct field of vector.vector
- the data of vector.- Returns:
- the vector.
-
of
Creates a named long integer vector.- Parameters:
field
- the struct field of vector.stream
- the data stream of vector.- Returns:
- the vector.
-