public class DoubleType extends NumberType
MagicMatcher.MutableOffset
endianConverter
Constructor and Description |
---|
DoubleType(EndianType endianType) |
Modifier and Type | Method and Description |
---|---|
int |
compare(boolean unsignedType,
Number extractedValue,
Number testValue)
Return -1 if extractedValue is < testValue, 1 if it is >, 0 if it is equals.
|
Number |
decodeValueString(String valueStr)
Decode the test string value.
|
Object |
extractValueFromBytes(int offset,
byte[] bytes,
boolean required)
Extract the value from the bytes either for doing the match or rendering it in the format.
|
int |
getBytesPerType()
Return the number of bytes in this type.
|
byte[] |
getStartingBytes(Object testValue)
Return the starting bytes of the pattern or null if none.
|
protected Object |
longToObject(Long value)
Convert a long to the type.
|
long |
maskValue(long value)
Return the value with the appropriate bytes masked off corresponding to the bytes in the type.
|
convertTestString, isMatch, renderValue
public DoubleType(EndianType endianType)
public Number decodeValueString(String valueStr) throws NumberFormatException
NumberType
decodeValueString
in class NumberType
NumberFormatException
public Object extractValueFromBytes(int offset, byte[] bytes, boolean required)
MagicMatcher
extractValueFromBytes
in interface MagicMatcher
extractValueFromBytes
in class NumberType
offset
- Number of bytes into the bytes array that we are extracting from.bytes
- Array of bytes we are extracting from.required
- Whether or not the extracted value is required for later. If it is not then the type may opt to not
extract the value and to do the matching directly.MagicMatcher.isMatch(Object, Long, boolean, Object, MutableOffset, byte[])
or null
if not enough bytes.public int compare(boolean unsignedType, Number extractedValue, Number testValue)
NumberType
compare
in class NumberType
public byte[] getStartingBytes(Object testValue)
MagicMatcher
public long maskValue(long value)
NumberType
maskValue
in class NumberType
public int getBytesPerType()
getBytesPerType
in class NumberType
This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.