frysk.value
Class Value

java.lang.Object
  extended by frysk.value.Value

public class Value
extends Object

Stores the type and location of a variable


Field Summary
private  Location location
           
private  Type type
           
 
Constructor Summary
Value(Type type)
          Create a scratch TYPE value.
Value(Type type, Location location)
          Create Value with TYPE and LOCATION.
 
Method Summary
 BigFloatingPoint asBigFloatingPoint()
           
 BigInteger asBigInteger()
           
 long asLong()
          Quick and dirty conversion of the value into a long.
 Value assign(Value value)
          Assign VALUE to THIS; perform type conversion if necessary.
 double doubleValue()
          Quick and dirty conversion to a floating-point.
 Location getLocation()
          Return the Value's Location.
 Type getType()
          Return the Value's Type.
 String toPrint()
          Return this as a printable string using the default formatting.
 String toPrint(Format format)
          Return this as a printable string using the specified FORMAT.
 String toPrint(Format format, ByteBuffer memory)
          Return this as a printable string; if need be and when non-NULL, use MEMORY for dereferencing pointers.
 void toPrint(PrintWriter writer, ByteBuffer memory, Format format, int indent)
          Write THIS value to WRITER, formatted according to FORMAT after indenting INDENT spaces.
 void toPrint(PrintWriter writer, Format format)
          Write THIS value to WRITER; using the specified format.
 String toString()
          Dump this object into a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

private final Type type

location

private final Location location
Constructor Detail

Value

public Value(Type type,
             Location location)
Create Value with TYPE and LOCATION.


Value

public Value(Type type)
Create a scratch TYPE value.

Method Detail

getLocation

public Location getLocation()
Return the Value's Location.


getType

public Type getType()
Return the Value's Type.


assign

public Value assign(Value value)
Assign VALUE to THIS; perform type conversion if necessary.


asLong

public long asLong()
Quick and dirty conversion of the value into a long. Useful for code wanting to use the raw value as a pointer for instance. Code wanting to access the value's raw bytes using different formats should get the location and manipulate that; and shouldn't add more methods here.


asBigInteger

public BigInteger asBigInteger()

doubleValue

public double doubleValue()
Quick and dirty conversion to a floating-point.


asBigFloatingPoint

public BigFloatingPoint asBigFloatingPoint()

toString

public String toString()
Dump this object into a string.

Overrides:
toString in class Object

toPrint

public String toPrint(Format format,
                      ByteBuffer memory)
Return this as a printable string; if need be and when non-NULL, use MEMORY for dereferencing pointers.


toPrint

public String toPrint(Format format)
Return this as a printable string using the specified FORMAT.


toPrint

public String toPrint()
Return this as a printable string using the default formatting.


toPrint

public void toPrint(PrintWriter writer,
                    ByteBuffer memory,
                    Format format,
                    int indent)
Write THIS value to WRITER, formatted according to FORMAT after indenting INDENT spaces.


toPrint

public void toPrint(PrintWriter writer,
                    Format format)
Write THIS value to WRITER; using the specified format.