Class IntNumber
- java.lang.Object
-
- ru.ispras.testbase.knowledge.integer.IntNumber
-
public final class IntNumber extends java.lang.Object
IntNumber
implements an integer number of a given length (less than or equal to 64).
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntNumber
clone()
boolean
equals(java.lang.Object obj)
IntFormat
getFormat()
Returns the format of the number.long
getValue(boolean signExtend)
Returns the value.int
hashCode()
boolean
isNegative()
Checks whether the number is negative.boolean
isPositive()
Checks whether the number is positive.boolean
isZero()
Checks whether the number is zero.void
setValue(long value)
Sets the number.java.lang.String
toString()
-
-
-
Constructor Detail
-
IntNumber
public IntNumber(IntFormat format, long value)
Constructs an integer number.- Parameters:
format
- the format.value
- the number.
-
-
Method Detail
-
getFormat
public IntFormat getFormat()
Returns the format of the number.- Returns:
- the number format.
-
getValue
public long getValue(boolean signExtend)
Returns the value.- Parameters:
signExtend
- the sign-extension flag.- Returns:
- the value.
-
setValue
public void setValue(long value)
Sets the number.- Parameters:
value
- the number to be set.
-
isZero
public boolean isZero()
Checks whether the number is zero.- Returns:
true
if the number is zero;false
otherwise.
-
isPositive
public boolean isPositive()
Checks whether the number is positive.- Returns:
true
if the number is positive;false
otherwise.
-
isNegative
public boolean isNegative()
Checks whether the number is negative.- Returns:
true
if the number is negative;false
otherwise.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
clone
public IntNumber clone()
- Overrides:
clone
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-