org.mmtk.vm.gcspy
Class IntStream

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

public abstract class IntStream
extends Stream

Set up a GCspy Stream with data type INT_TYPE.


Field Summary
private  int[] data
          The stream data
private  int defaultValue
          The default value for the data items
 
Fields inherited from class org.mmtk.vm.gcspy.Stream
DEBUG, presentation, serverSpace, stream, streamId, summary0, summary1, summaryEnabled, summaryLen
 
Constructor Summary
IntStream(AbstractDriver driver, 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 of INT_TYPE
 
Method Summary
 void distribute(int start, int remainder, int blockSize, int value)
          Distribute a value across a sequence of tiles.
 void increment(int index, int value)
          Increment the value of a tile.
 void resetData()
          Reset all data in this stream to default values.
 void send(int event, int numTiles)
          Send the data for this stream.
 
Methods inherited from class org.mmtk.vm.gcspy.Stream
getMaxValue, getMinValue, sendSummary, setStream, setSummary, setSummary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

private int[] data
The stream data


defaultValue

private int defaultValue
The default value for the data items

Constructor Detail

IntStream

public IntStream(AbstractDriver driver,
                 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 of INT_TYPE

Parameters:
driver - The driver that owns this Stream
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 of the maximum stream if the presentation is *_VAR.
colour - The default colour for tiles of this stream
Method Detail

resetData

public void resetData()
Reset all data in this stream to default values.


distribute

public void distribute(int start,
                       int remainder,
                       int blockSize,
                       int value)
Distribute a value across a sequence of tiles. This handles the case when when an object spans two or more tiles and its value is to be attributed to each tile proportionally.

Parameters:
start - the index of the starting tile
remainder - the value left in the starting tile
blockSize - the size of each tile
value - the value to distribute

increment

public void increment(int index,
                      int value)
Increment the value of a tile.

Parameters:
index - the index
value - the increment

send

public void send(int event,
                 int numTiles)
Description copied from class: Stream
Send the data for this stream.

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