Record Class RowIndex
java.lang.Object
java.lang.Record
smile.data.RowIndex
- Record Components:
values- the row index values.loc- the map of row index value to ordinal index.
- All Implemented Interfaces:
Serializable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the row index.booleancontainsKey(Object label) Returns true if the index contains the given label.final booleanIndicates whether some other object is "equal to" this one.Returns a slice of the index.intgetOrDefault(Object label) Returns the row index, or -1 if not found.final inthashCode()Returns a hash code value for this object.loc()Returns the value of thelocrecord component.intsize()Returns the number of elements in the index.final StringtoString()Returns a string representation of this record class.Object[]values()Returns the value of thevaluesrecord component.
-
Constructor Details
-
RowIndex
-
RowIndex
-
-
Method Details
-
size
public int size()Returns the number of elements in the index.- Returns:
- the number of elements in the index.
-
apply
Returns the row index.- Parameters:
label- the row label.- Returns:
- the row index.
-
containsKey
Returns true if the index contains the given label.- Parameters:
label- the row label.- Returns:
- true if the label exists in the index.
-
getOrDefault
Returns the row index, or -1 if not found.- Parameters:
label- the row label.- Returns:
- the row index, or -1 if not found.
-
get
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
values
-
loc
-