Package org.exbin.xbup.core.ubnumber
Interface UBRatio
-
- All Superinterfaces:
java.io.Serializable
,UBStreamable
,XBAttribute
,XBEditableAttribute
public interface UBRatio extends java.io.Serializable, UBStreamable, XBEditableAttribute
Interface for LRUB-encoded real value limited to range [0, 1].
-
-
Field Summary
Fields Modifier and Type Field Description static long[]
XBUP_BLOCKREV_CATALOGPATH
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description double
getDouble()
Gets double value.float
getFloat()
Gets float value.int
getInt()
Gets short integer value.long
getLong()
Gets long integer value.boolean
isZero()
Returns if value is zero.void
setValue(double value)
Sets double value.void
setValue(float value)
Sets float value.void
setValue(int value)
Sets integer value.void
setValue(long value)
Sets long integer value.-
Methods inherited from interface org.exbin.xbup.core.ubnumber.UBStreamable
fromStreamUB, getSizeUB, toStreamUB
-
Methods inherited from interface org.exbin.xbup.core.parser.token.XBAttribute
convertToNatural, getNaturalInt, getNaturalLong, isNaturalZero
-
Methods inherited from interface org.exbin.xbup.core.parser.token.XBEditableAttribute
convertFromNatural, setNaturalInt, setNaturalLong, setNaturalZero
-
-
-
-
Method Detail
-
getInt
int getInt() throws UBOverFlowException
Gets short integer value.- Returns:
- integer value
- Throws:
UBOverFlowException
- if value is out of range
-
getLong
long getLong() throws UBOverFlowException
Gets long integer value.- Returns:
- long integer value
- Throws:
UBOverFlowException
- if value is out of range
-
getFloat
float getFloat() throws UBOverFlowException
Gets float value.- Returns:
- float value
- Throws:
UBOverFlowException
- if value is out of range
-
getDouble
double getDouble() throws UBOverFlowException
Gets double value.- Returns:
- double value
- Throws:
UBOverFlowException
- if value is out of range
-
isZero
boolean isZero()
Returns if value is zero.- Returns:
- true if value equals zero
-
setValue
void setValue(int value) throws UBOverFlowException
Sets integer value.- Parameters:
value
- integer value- Throws:
UBOverFlowException
-
setValue
void setValue(long value) throws UBOverFlowException
Sets long integer value.- Parameters:
value
- long integer value- Throws:
UBOverFlowException
-
setValue
void setValue(float value) throws UBOverFlowException
Sets float value.- Parameters:
value
- float value- Throws:
UBOverFlowException
-
setValue
void setValue(double value) throws UBOverFlowException
Sets double value.- Parameters:
value
- double value- Throws:
UBOverFlowException
-
-