Package smile.data.type
Record Class StructField
java.lang.Object
java.lang.Record
smile.data.type.StructField
- All Implemented Interfaces:
Serializable
public record StructField(String name, DataType dtype, Measure measure)
extends Record
implements Serializable
A field in a Struct data type.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionStructField
(String name, DataType dtype) Constructor.StructField
(String name, DataType dtype, Measure measure) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiondtype()
Returns the value of thedtype
record component.boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
Returns true if the field is of integer or floating but not nominal scale.measure()
Returns the value of themeasure
record component.name()
Returns the value of thename
record component.static StructField
of
(PropertyDescriptor prop) Returns the struct field of a class property.static StructField
of
(RecordComponent comp) Returns the struct field of a record component.toString()
Returns a string representation of this record class.Returns the string representation of the field object.Returns the object value of string.Returns the StructField with the new name.
-
Constructor Details
-
StructField
Constructor.- Parameters:
name
- the field name.dtype
- the field data type.measure
- the level of measurement.
-
StructField
Constructor.- Parameters:
name
- the field name.dtype
- the field data type.
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
toString
Returns the string representation of the field object.- Parameters:
o
- the object.- Returns:
- the string representation.
-
valueOf
Returns the object value of string.- Parameters:
s
- the string.- Returns:
- the object value.
-
withName
Returns the StructField with the new name.- Parameters:
name
- the new name.- Returns:
- the StructField with the new name.
-
isNumeric
public boolean isNumeric()Returns true if the field is of integer or floating but not nominal scale.- Returns:
- true if the field is of integer or floating but not nominal scale.
-
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)
. -
of
Returns the struct field of a class property.- Parameters:
prop
- the property descriptor.- Returns:
- the struct field.
-
of
Returns the struct field of a record component.- Parameters:
comp
- the record component.- Returns:
- the struct field.
-
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
dtype
Returns the value of thedtype
record component.- Returns:
- the value of the
dtype
record component
-
measure
Returns the value of themeasure
record component.- Returns:
- the value of the
measure
record component
-