Package org.apache.wayang.basic.data
Class Record
java.lang.Object
org.apache.wayang.basic.data.Record
- All Implemented Interfaces:
Serializable,Comparable<Record>,Copyable<Record>
A Type that represents a record with a schema, might be replaced with
something standard like JPA entity.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAppend a field to this instance.intCompares the fields of this record to the fields of another record.copy()Create a (potentially shallow) copy of this instance.booleandoublegetDouble(int index) Retrieve a field as adouble.getField(int index) intgetInt(int index) Retrieve a field as aint.longgetLong(int index) Retrieve a field as along.getString(int index) Retrieve a field as aString.Object[]inthashCode()voidSet a field of this instance, at a given index.intsize()Retrieve the size of this instance.toString()
-
Constructor Details
-
Record
-
Record
-
-
Method Details
-
getValues
-
copy
Description copied from interface:CopyableCreate a (potentially shallow) copy of this instance. -
equals
-
hashCode
public int hashCode() -
toString
-
getField
-
getDouble
public double getDouble(int index) Retrieve a field as adouble. It must be castable as such.- Parameters:
index- the index of the field- Returns:
- the
doublerepresentation of the field
-
getLong
public long getLong(int index) Retrieve a field as along. It must be castable as such.- Parameters:
index- the index of the field- Returns:
- the
longrepresentation of the field
-
getInt
public int getInt(int index) Retrieve a field as aint. It must be castable as such.- Parameters:
index- the index of the field- Returns:
- the
intrepresentation of the field
-
getString
Retrieve a field as aString.- Parameters:
index- the index of the field- Returns:
- the field as a
String(obtained viaObject.toString()) ornullif the field isnull
-
setField
Set a field of this instance, at a given index.- Parameters:
index- the index of the fieldfield- the new value of the field to be set
-
addField
Append a field to this instance.- Parameters:
field- the field to add
-
size
public int size()Retrieve the size of this instance.- Returns:
- the number of fields in this instance
-
compareTo
Compares the fields of this record to the fields of another record.- Specified by:
compareToin interfaceComparable<Record>- Parameters:
that- another record not null- Returns:
- Throws:
IllegalStateException- if the two records do not have the same types invalues
-