public class MixedDatum extends Datum
Constructor and Description |
---|
MixedDatum(Datum d)
Copy Constructor creates a copy of the argument datum.
|
MixedDatum(Datum[] datums)
This constructor creates a single MixedDatum from an array of Datums.
|
MixedDatum(float[] vals)
Deprecated.
|
MixedDatum(int numvalues)
Deprecated.
|
MixedDatum(int[] vals)
Deprecated.
|
MixedDatum(MixedDatum d)
Copy Constructor creates a copy of the argument datum.
|
MixedDatum(MixedDatum[] datums)
This constructor creates a single MixedDatum from an array of datums.
|
MixedDatum(RecordDescriptor rd)
Creates a Datum based on a RecordDescriptor.
|
MixedDatum(RecordDescriptor rd,
byte[] values,
int startIndex)
Creates a datum by copying a subset of values from an array.
|
Modifier and Type | Method and Description |
---|---|
void |
assign(byte[] data)
Copy the values in the argument to this datum.
|
void |
assign(byte[] data,
int startIndex)
Assigns values to an existing datum by copying values from a portion of an array.
|
void |
assign(byte[] values,
int startIndex,
int numAttributes)
Assigns values to an existing datum by copying values from a portion of an array.
|
int |
byteSize()
Return the size in bytes needed to store the data for the attributes.
|
java.lang.Object |
clone()
Return a copy of this datum.
|
void |
copyTo(Datum d)
Copy the values of this MixedDatum object into the argument datum.
|
void |
copyTo(MixedDatum d)
Copy the values of this MixedDatum object into the argument datum.
|
boolean |
equals(java.lang.Object o)
Determine if the argument is a MixedDatum with the same set of data values.
|
byte |
getByte(int i)
Return the field specified by the argument as a byte.
|
double |
getDouble(int i)
Return the field specified by the argument as a double.
|
float |
getFloat(int i)
Return the field specified by the argument as a float.
|
int |
getInt(int i)
Return the field specified by the argument as a int.
|
RecordDescriptor |
getRecordDescriptor()
Return the RecordDescriptor associated with MixedDatum.
|
short |
getShort(int i)
Return the field specified by the argument as a short.
|
int |
getStorageType()
Return the StorageType for this Datum
|
Values |
getValues()
Return all attributes of the Datum as a Values object
|
void |
setByte(int i,
byte v)
Set the attribute indicated by the first argument to the value of the
second argument.
|
void |
setBytes(byte[] newVals)
Copy the values in the argument array to this datum.
|
void |
setDouble(int i,
double v)
Set the attribute indicated by the first argument to the value of the
second argument.
|
void |
setFloat(int i,
float v)
Set the attribute indicated by the first argument to the value of the
second argument.
|
void |
setInt(int i,
int v)
Set the attribute indicated by the first argument to the value of the
second argument.
|
void |
setShort(int i,
short v)
Set the attribute indicated by the first argument to the value of the
second argument.
|
int |
size()
Return the number of attributes in the datum.
|
void |
subset(Datum d,
RecordSpec spec)
Copy the attributes specified by the RecordSpec into the argument datum.
|
void |
subset(MixedDatum d,
RecordSpec spec)
Copy the attributes specified by the RecordSpec into the argument datum.
|
Datum |
subset(RecordSpec spec)
Return a new datum with the attributes indicated by the RecordSpec.
|
java.lang.String |
toString()
Return a string representation of the datum.
|
create, create, create, create, create, create, create, create, create, create, create, create, getBytes, getBytes, getBytes, getDoubles, getDoubles, getFloats, getFloats, getInts, getInts, getNumAttributes, getShorts, getShorts, setBytes, setBytes, setDoubles, setDoubles, setDoubles, setFloats, setFloats, setFloats, setInts, setInts, setInts, setShorts, setShorts, setShorts
public MixedDatum(RecordDescriptor rd)
rd
- A RecordDescriptor describing all the fields of the Datumpublic MixedDatum(int numvalues)
public MixedDatum(float[] vals)
public MixedDatum(RecordDescriptor rd, byte[] values, int startIndex)
public MixedDatum(int[] vals)
public MixedDatum(MixedDatum d)
public MixedDatum(Datum d)
public MixedDatum(MixedDatum[] datums)
public MixedDatum(Datum[] datums)
public java.lang.Object clone()
public void copyTo(MixedDatum d)
public void copyTo(Datum d)
public void assign(byte[] data)
public void assign(byte[] data, int startIndex)
public void assign(byte[] values, int startIndex, int numAttributes)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public void setDouble(int i, double v)
public void setFloat(int i, float v)
public void setInt(int i, int v)
public void setShort(int i, short v)
public void setByte(int i, byte v)
public double getDouble(int i)
public float getFloat(int i)
public int getInt(int i)
public short getShort(int i)
public byte getByte(int i)
public void setBytes(byte[] newVals)
Datum
public Values getValues()
public Datum subset(RecordSpec spec)
public void subset(MixedDatum d, RecordSpec spec)
public void subset(Datum d, RecordSpec spec)
public java.lang.String toString()
toString
in class java.lang.Object
public int size()
public int byteSize()
public int getStorageType()
getStorageType
in class Datum
public RecordDescriptor getRecordDescriptor()