frysk.value
Class ByteBufferLocation

java.lang.Object
  extended by frysk.value.Location
      extended by frysk.value.ByteBufferLocation
Direct Known Subclasses:
ScratchLocation

public class ByteBufferLocation
extends Location

A value's Location, implemented using a ByteBuffer. Largely used for testing (well should be); DWARF code proper uses the PieceLocation.


Field Summary
private  ByteBuffer buffer
           
private  long offset
           
 
Constructor Summary
ByteBufferLocation(ByteBuffer buffer)
           
ByteBufferLocation(ByteBuffer memory, long offset, long length)
           
 
Method Summary
 long getAddress()
           
protected  byte getByte(long offset)
          Return the byte at OFFSET.
 long length()
          The length of the location, in bytes.
protected  void putByte(long offset, byte value)
          Stores the byte VALUE at OFFSET.
protected  Location slice(long offset, long length)
          Return a slice of this Location starting at byte OFFSET, and going for LENGTH bytes.
 void toPrint(PrintWriter writer)
          Print this Location.
 String toString()
           
 
Methods inherited from class frysk.value.Location
get, put, toByteArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

buffer

private final ByteBuffer buffer

offset

private final long offset
Constructor Detail

ByteBufferLocation

public ByteBufferLocation(ByteBuffer memory,
                          long offset,
                          long length)

ByteBufferLocation

public ByteBufferLocation(ByteBuffer buffer)
Method Detail

toString

public String toString()
Overrides:
toString in class Location

getAddress

public long getAddress()
Specified by:
getAddress in class Location

toPrint

public void toPrint(PrintWriter writer)
Description copied from class: Location
Print this Location.

Specified by:
toPrint in class Location

slice

protected Location slice(long offset,
                         long length)
Return a slice of this Location starting at byte OFFSET, and going for LENGTH bytes.

Specified by:
slice in class Location

getByte

protected byte getByte(long offset)
Return the byte at OFFSET.

Specified by:
getByte in class Location

putByte

protected void putByte(long offset,
                       byte value)
Stores the byte VALUE at OFFSET.

Specified by:
putByte in class Location

length

public long length()
Description copied from class: Location
The length of the location, in bytes. This MUST be a long (or BigInteger) as a value's size could be bigger than 32-bits.

Specified by:
length in class Location