Class KlvNumericalDataElement<T extends Number>
java.lang.Object
org.codice.ddf.libs.klv.KlvDataElement<T>
org.codice.ddf.libs.klv.data.numerical.KlvNumericalDataElement<T>
- Direct Known Subclasses:
KlvByte,KlvDouble,KlvFloat,KlvInt,KlvIntegerEncodedFloatingPoint,KlvLong,KlvShort,KlvUnsignedByte,KlvUnsignedShort
Represents a data element with a numerical value.
-
Field Summary
FieldsFields inherited from class org.codice.ddf.libs.klv.KlvDataElement
key, keyBytes, name, value -
Constructor Summary
ConstructorsConstructorDescriptionKlvNumericalDataElement(byte[] key, String name) Constructs aKlvNumericalDataElementthat describes how to interpret the value of a numerical element with the given key.KlvNumericalDataElement(byte[] key, String name, Optional<T> errorIndicatorValue) Constructs aKlvNumericalDataElementthat describes how to interpret the value of a numerical element with the given key. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract KlvNumericalDataElement<T>copy()protected abstract voiddecodeValue(Klv klv) booleanIf an error indicator value is present, then compare it to the decoded value.Methods inherited from class org.codice.ddf.libs.klv.KlvDataElement
getKey, getKeyAsString, getName, getValue
-
Field Details
-
errorIndicatorValue
-
-
Constructor Details
-
KlvNumericalDataElement
Constructs aKlvNumericalDataElementthat describes how to interpret the value of a numerical element with the given key.- Parameters:
key- the data element's keyname- a name describing the data element's value- Throws:
IllegalArgumentException- if any arguments are null
-
KlvNumericalDataElement
Constructs aKlvNumericalDataElementthat describes how to interpret the value of a numerical element with the given key.- Parameters:
key- the data element's keyname- a name describing the data element's valueerrorIndicatorValue- value that indicates an encoded error- Throws:
IllegalArgumentException- if any arguments are null
-
-
Method Details
-
decodeValue
- Specified by:
decodeValuein classKlvDataElement<T extends Number>
-
copy
- Specified by:
copyin classKlvDataElement<T extends Number>
-
isErrorIndicated
public boolean isErrorIndicated()If an error indicator value is present, then compare it to the decoded value.- Overrides:
isErrorIndicatedin classKlvDataElement<T extends Number>- Returns:
- true if error was encoded
-