Class RealValue
java.lang.Object
svm.value.Value
svm.value.RealValue
RealValue.
real_value ::= c-real real_literal:string
A real literal is a string:
<sign>? <digit>* < . <digit>+ >? < & <sign>? <digit>+ >?
Note that a real literal may not contain spaces.
Link to GitHub: Source File.
- Author:
- S-Port: Definition of S-code, Øystein Myhre Andersen
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the result of: this value + other valuebooleanCompare this Value with the given Value according to the given relation.Returns the result of: this value / other valuevoidemit(DataSegment dseg) Add this value to the given DataSegmentReturns the result of: this value * other valueneg()Returns the negative value of this Value object.static RealValueof(float value) Create a new RealValue with the given parameterstatic RealValueofScode()Scans the remaining S-Code belonging to this real_value.static RealValueread(AttributeInputStream inpt) Reads a BooleanValue from the given input.Returns the result of: this value - other valuedoubletoDouble()Returns the double value of this Value object.floattoFloat()Returns the float value of this Value object.toString()voidwrite(AttributeOutputStream oupt) Writes this Value to the given output.
-
Field Details
-
value
public float valueThe float value
-
-
Constructor Details
-
RealValue
public RealValue()Default Constructor -
RealValue
private RealValue(float value) Construct a new LongRealValue- Parameters:
value- the float value
-
-
Method Details
-
of
Create a new RealValue with the given parameter- Parameters:
value- the double value- Returns:
- an RealValue or null
-
ofScode
Scans the remaining S-Code belonging to this real_value. Then construct a new RealValue object.- Returns:
- that RealValue object or null.
-
emit
Description copied from class:ValueAdd this value to the given DataSegment -
neg
-
toFloat
-
toDouble
-
add
-
sub
-
mult
-
div
-
compare
Description copied from class:ValueCompare this Value with the given Value according to the given relation. -
toString
-
write
Description copied from class:ValueWrites this Value to the given output.- Overrides:
writein classValue- Parameters:
oupt- the output stream- Throws:
IOException- if IOException occur
-
read
Reads a BooleanValue from the given input.- Parameters:
inpt- the AttributeInputStream- Returns:
- the BooleanValue read
- Throws:
IOException- if IOException occur
-