|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgcspy.interpreter.Stream
public class Stream
Represents a stream
Field Summary | |
---|---|
static int |
BYTE_TYPE
Data type is byte |
static int |
INT_TYPE
Data type is int |
static int |
PAINT_STYLE_PLAIN
Plain paint style |
static int |
PAINT_STYLE_ZERO
Present zeor values specially (by showing them as light frames) |
static int |
PRESENTATION_ENUM
Select presentation from enumNames |
static int |
PRESENTATION_MAX_VAR
Maximum value calclated by iterating over the stream |
static int |
PRESENTATION_PERCENT
Present as a percentage of a fixed maximum |
static int |
PRESENTATION_PERCENT_VAR
Present as a percentage but use the value of the corresponding tile in stream maxStreamIndex for its maximum |
static int |
PRESENTATION_PLAIN
Present a tiles as is |
static int |
PRESENTATION_PLUS
Present a tile as maximum+ if its value exceeds the maximum for the stream |
static int |
SHORT_TYPE
Data type is short |
Constructor Summary | |
---|---|
Stream()
|
|
Stream(java.lang.String name,
int dataType,
int minValue,
int maxValue,
int zeroValue,
int defaultValue,
java.lang.String stringPre,
java.lang.String stringPost,
int presentation,
int paintStyle,
int maxStreamIndex,
java.awt.Color color,
java.lang.String[] enumNames)
Create a new stream |
|
Stream(java.lang.String name,
int dataType,
int minValue,
int maxValue,
int zeroValue,
int defaultValue,
java.lang.String stringPre,
java.lang.String stringPost,
int presentation,
int paintStyle,
int maxStreamIndex,
java.awt.Color color,
java.lang.String[] enumNames,
int tileNum)
Create a new stream |
Method Summary | |
---|---|
int |
adjustValue(int val)
Adjust a tile value according to the stream's presentation style. |
void |
calcMaxIfNecessary()
Calculate the maximum value found in this stream if its presentation style is PRESENTATION_MAX_VAR |
void |
deserialise(BufferedInput input)
Deserialise the stream |
void |
dump()
|
DataAccessor |
getAccessor()
Get the data accessor for this stream |
byte[] |
getByteData()
Get the data for this stream (assumed to be bytes) |
java.awt.Color |
getColor()
Get the colour used for this stream |
java.lang.Object |
getData()
Get the data for this stream |
int |
getDataType()
Get the type of this stream |
int |
getDefaultValue()
Get the default value for this stream |
int[] |
getIntData()
Get the data for this stream (assumed to be ints) |
int |
getMaxValue()
Get the maximum value for this stream |
int |
getMaxValue(int i)
Get the maximum value for a tile (neede for the PRESENTATION_PERCENT_VAR style. |
int |
getMinValue()
Get the minimum value for this stream |
java.lang.String |
getName()
Get the name of this stream |
int |
getPaintStyle()
Get the paint style for this stream |
java.lang.String |
getPrefix()
Get the the prefix string for tiles in this stream (e.g. |
int |
getPresentation()
Get the presentation style for this stream |
short[] |
getShortData()
Get the data for this stream (assumed to be shorts) |
java.lang.String |
getSuffix()
Get the suffix string for tiles in this stream (e.g. |
int[] |
getSummary()
Get the summary value(s) for this stream |
int |
getZeroValue()
Get the zero value for this stream |
boolean |
isOverflow(int val)
Does a tile value zero exceed the maximum |
boolean |
isZero(int val)
Is a tile value zero |
java.lang.String |
presentData(int i)
Present a tile value as a string |
java.lang.String |
presentDataSmall(int val)
Present a tile value as a short string |
java.lang.String |
presentFullSummary(java.lang.String prefix1,
java.lang.String prefix2)
Present a full summary |
void |
reset()
Reset the data values to their defaults |
void |
serialise(BufferedOutput output)
Serialise the stream |
void |
setByteData(byte[] bData)
Set the data for this stream as a byte array |
void |
setData(int len)
Create the array for this stream's the data according to the stream's dataType>/code> |
void |
setData(java.lang.Object data)
Set the data for this stream according to the stream's dataType>/code> |
void |
setID(int id)
Set the ID for this stream |
void |
setIntData(int[] iData)
Set the data for this stream as an int array |
void |
setShortData(short[] sData)
Set the data for this stream as a short array |
void |
setSpace(Space space)
Set the space for this stream |
void |
setSummary(int[] summary)
Set the summary values for this stream |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PRESENTATION_PLAIN
public static final int PRESENTATION_PLUS
maximum+
if its value exceeds the maximum for the stream
public static final int PRESENTATION_MAX_VAR
public static final int PRESENTATION_PERCENT
public static final int PRESENTATION_PERCENT_VAR
maxStreamIndex
for its maximum
public static final int PRESENTATION_ENUM
enumNames
public static final int PAINT_STYLE_PLAIN
public static final int PAINT_STYLE_ZERO
public static final int BYTE_TYPE
public static final int SHORT_TYPE
public static final int INT_TYPE
Constructor Detail |
---|
public Stream()
public Stream(java.lang.String name, int dataType, int minValue, int maxValue, int zeroValue, int defaultValue, java.lang.String stringPre, java.lang.String stringPost, int presentation, int paintStyle, int maxStreamIndex, java.awt.Color color, java.lang.String[] enumNames, int tileNum)
name
- Its namedataType
- Its data type
(one of BYTE_TYPE
, SHORT_TYPE
, INT_TYPE
)minValue
- The minimum value for the streammaxValue
- The maximum value for the streamzeroValue
- The zero value for the streamdefaultValue
- The default value for the streamstringPre
- Text to prefix tile values in string representationsstringPost
- Text to prefix tile values in string representationspresentation
- The presentation style (see PRESENTATION_*
)paintStyle
- The presentation style (
(one of PAINT_STYLE_PLAIN
or PAINT_STYLE_ZERO
)maxStreamIndex
- The ID of the stream to use as a maximum if the
presentation style is PRESENTATION_PERCENT_VAR
.color
- The tile colourenumNames
- A list of name to use if the presentation style is PRESENTATION_ENUM
.tileNum
- The number of tiles in the streampublic Stream(java.lang.String name, int dataType, int minValue, int maxValue, int zeroValue, int defaultValue, java.lang.String stringPre, java.lang.String stringPost, int presentation, int paintStyle, int maxStreamIndex, java.awt.Color color, java.lang.String[] enumNames)
name
- Its namedataType
- Its data type
(one of BYTE_TYPE
, SHORT_TYPE
, INT_TYPE
)minValue
- The minimum value for the streammaxValue
- The maximum value for the streamzeroValue
- The zero value for the streamdefaultValue
- The default value for the streamstringPre
- Text to prefix tile values in string representationsstringPost
- Text to prefix tile values in string representationspresentation
- The presentation style (see PRESENTATION_*
)paintStyle
- The presentation style (
(one of PAINT_STYLE_PLAIN
or PAINT_STYLE_ZERO
)maxStreamIndex
- The ID of the stream to use as a maximum if the
presentation style is PRESENTATION_PERCENT_VAR
.color
- The tile colourenumNames
- A list of name to use if the presentation style is PRESENTATION_ENUM
.Method Detail |
---|
public void setSpace(Space space)
space
- the spacepublic void setID(int id)
id
- the IDpublic void setByteData(byte[] bData)
bData
- the datapublic void setShortData(short[] sData)
sData
- the datapublic void setIntData(int[] iData)
iData
- the datapublic void setData(java.lang.Object data)
dataType>/code>
- Parameters:
data
- the data
public void setData(int len)
dataType>/code>
- Parameters:
len
- The lenght of the data
public void setSummary(int[] summary)
summary
- The summary valuespublic java.lang.String getName()
public int getDataType()
public int getMinValue()
public int getMaxValue()
public int getZeroValue()
public int getDefaultValue()
public int getPresentation()
public int getPaintStyle()
public java.awt.Color getColor()
public byte[] getByteData()
public short[] getShortData()
public int[] getIntData()
public java.lang.Object getData()
public int[] getSummary()
public DataAccessor getAccessor()
public java.lang.String getPrefix()
public java.lang.String getSuffix()
public void calcMaxIfNecessary()
PRESENTATION_MAX_VAR
public int getMaxValue(int i)
PRESENTATION_PERCENT_VAR
style.
i
- The tile's index
public void reset()
public int adjustValue(int val)
PERCENT_VAR
val
- The tile value
BAD_PRESENTATION_PERCENT
if the style is
PRESENTATION_PERCENT_VAR
or BAD_PRESENTATION
if the style is bad.public boolean isZero(int val)
val
- The tile value
public boolean isOverflow(int val)
val
- The tile value
public java.lang.String presentDataSmall(int val)
val
- The value
public java.lang.String presentData(int i)
i
- The tiel index
public java.lang.String presentFullSummary(java.lang.String prefix1, java.lang.String prefix2)
prefix1
- A string to prefix the summaryprefix2
- A string to prefix the summary if the style is PRESENTATION_ENUM
public void serialise(BufferedOutput output)
output
- The BufferedOutput to usepublic void deserialise(BufferedInput input)
input
- The BufferedInput to usepublic void dump()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |