org.mmtk.vm.gcspy
Class Stream

java.lang.Object
  extended by org.mmtk.vm.gcspy.Stream
Direct Known Subclasses:
ByteStream, IntStream, ShortStream

public abstract class Stream
extends Object

Abstract class for a GCspy Stream. Implementing classes will mostly forward calls to the gcspy C library


Field Summary
protected static boolean DEBUG
           
private  int max
          The maximum value for tiles
private  int min
          The minimum value for tiles
protected  int presentation
          the presentation style
protected  ServerSpace serverSpace
          The owning GCspy space
protected  Address stream
          The address of the C stream, gcspy_gc_stream_t *stream, used in all calls to the C library
protected  int streamId
          The stream's ID
protected  int summary0
          The first summary value
protected  int summary1
          The second summary value (if any)
protected  boolean summaryEnabled
          use summaries?
protected  int summaryLen
          A summary has 1 or 2 values depending on presentation style (PERCENT* styles require 2 values).
 
Constructor Summary
protected Stream(AbstractDriver driver, int dataType, String name, int minValue, int maxValue, int zeroValue, int defaultValue, String stringPre, String stringPost, int presentation, int paintStyle, int indexMaxStream, Color colour, boolean summary)
          Construct a new GCspy stream.
 
Method Summary
 int getMaxValue()
          Return the maximum value expected for this stream.
 int getMinValue()
          Return the minimum value expected for this stream.
abstract  void send(int event, int numTiles)
          Send the data for this stream.
 void sendSummary()
          Send the summary data for this stream.
 void setStream(int id, Address str)
          Set the stream address and id (called by AbstractDriver.addStream).
 void setSummary(int value0)
          Set the summary value for presentation styles with just one value
 void setSummary(int value0, int value1)
          Set the summary values for presentation styles with two values (i.e.
private  void setupSummary(int presentation)
          Setup the summary array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stream

protected Address stream
The address of the C stream, gcspy_gc_stream_t *stream, used in all calls to the C library


serverSpace

protected ServerSpace serverSpace
The owning GCspy space


streamId

protected int streamId
The stream's ID


summaryLen

protected int summaryLen
A summary has 1 or 2 values depending on presentation style (PERCENT* styles require 2 values).


summary0

protected int summary0
The first summary value


summary1

protected int summary1
The second summary value (if any)


min

private int min
The minimum value for tiles


max

private int max
The maximum value for tiles


summaryEnabled

protected boolean summaryEnabled
use summaries?


presentation

protected int presentation
the presentation style


DEBUG

protected static final boolean DEBUG
See Also:
Constant Field Values
Constructor Detail

Stream

protected Stream(AbstractDriver driver,
                 int dataType,
                 String name,
                 int minValue,
                 int maxValue,
                 int zeroValue,
                 int defaultValue,
                 String stringPre,
                 String stringPost,
                 int presentation,
                 int paintStyle,
                 int indexMaxStream,
                 Color colour,
                 boolean summary)
Construct a new GCspy stream.

Parameters:
driver - The AbstractDriver that owns this Stream
dataType - The stream's data type, one of BYTE_TYPE, SHORT_TYPE or INT_TYPE
name - The name of the stream (e.g. "Used space")
minValue - The minimum value for any item in this stream. Values less than this will be represented as "minValue-"
maxValue - The maximum value for any item in this stream. Values greater than this will be represented as "maxValue+"
zeroValue - The zero value for this stream
defaultValue - The default value for this stream
stringPre - A string to prefix values (e.g. "Used: ")
stringPost - A string to suffix values (e.g. " bytes.")
presentation - How a stream value is to be presented.
paintStyle - How the value is to be painted.
indexMaxStream - The index for the maximum stream if the presentation is *_VAR.
colour - The default colour for tiles of this stream
summary - Is a summary enabled?
Method Detail

setStream

public void setStream(int id,
                      Address str)
Set the stream address and id (called by AbstractDriver.addStream).

Parameters:
id - the id
str - the address of the gcspy C gcspy_gc_stream_t *stream

getMinValue

public int getMinValue()
Return the minimum value expected for this stream.

Returns:
the minimum value

getMaxValue

public int getMaxValue()
Return the maximum value expected for this stream.

Returns:
the maximum value

setupSummary

private void setupSummary(int presentation)
Setup the summary array.

Parameters:
presentation - the presentation style

setSummary

public void setSummary(int value0)
Set the summary value for presentation styles with just one value

Parameters:
value0 - the value

setSummary

public void setSummary(int value0,
                       int value1)
Set the summary values for presentation styles with two values (i.e. PRESENTATION_PERCENT and PRESENTATION_PERCENT_VAR).

Parameters:
value0 - the numerator value
value1 - the denominator value

send

public abstract void send(int event,
                          int numTiles)
Send the data for this stream.

Parameters:
event - the event.
numTiles - the number of tiles to send (which may be less than maxTileNum)

sendSummary

public void sendSummary()
Send the summary data for this stream.