Entry

public class Entry extends Union implements Data

A reference implementation for the Data interface. This class is used to specify a single data entry. This implementation uses a C-style union so as to save memory space.

Author:Philip Cho

Fields

fvalue

public Float32 fvalue

The value of the entry, in floating-point representation

missing

public Signed32 missing

If missing == -1, the entry is considered missing. Otherwise, the entry is not missing; check the other fields to obtain the actual value of the entry.

qvalue

public Signed32 qvalue

The value of the entry, in integer representation

Methods

byteOrder

public ByteOrder byteOrder()

The byte-order to use when serializing.

Returns:ByteOrder.LITTLE_ENDIAN, since this class will be serialized using the litte-endian byte order.

getFValue

public float getFValue()

Obtain the floating-point value stored by the entry.

Returns:floating-point value

getQValue

public int getQValue()

Obtain the integer value stored by the entry.

Returns:integer value

isMissing

public boolean isMissing()

Test whether the entry is missing.

Returns:whether the entry is missing

setFValue

public void setFValue(float val)

Assign a floating-point value to the entry.

Parameters:
  • val – value to set

setMissing

public void setMissing()

Designate the entry as missing.

setQValue

public void setQValue(int val)

Assign an integer value to the entry. This is useful when feature values and split thresholds are quantized into integers.

Parameters:
  • val – value to set