com.ibm.tuningfork.tracegen.types
Class EventType

java.lang.Object
  extended by com.ibm.tuningfork.tracegen.types.EventType

public final class EventType
extends Object

An EventType describes the types and attributes of the data values associated with a particular event index.


Field Summary
private  EventAttribute[] attributes
           
private static int currentIndex
           
private  String description
           
private  int index
           
private  String name
           
private  int numberOfDoubles
           
private  int numberOfInts
           
private  int numberOfLongs
           
private  int numberOfStrings
           
 
Constructor Summary
EventType(String name, String description)
          Create a new event type with no attributes.
EventType(String name, String description, EventAttribute attribute)
          Create a new event type with a single attribute.
EventType(String name, String description, EventAttribute[] attributes)
          Create a new event type with the supplied attributes.
 
Method Summary
 boolean admits(int numInt, int numLong, int numDouble, int numString)
          Does this event type accept the supplied number of attributes of each type.
private  void checkOrder(int others)
          Check that attributes are declared in the proper order
 EventAttribute getAttribute(int i)
          Return the ith attribute of this event type.
 String getDescription()
          Return the description of this event type.
 int getIndex()
           
 String getName()
          Return the name of this event type.
private static int getNextIndex()
           
 int getNumberOfAttributes()
          Return the number of attributes this event type accepts.
 int getNumberOfDoubles()
          Return the number of double attributes this event type accepts.
 int getNumberOfInts()
          Return the number of int attributes this event type accepts.
 int getNumberOfLongs()
          Return the number of long attributes this event type accepts.
 int getNumberOfStrings()
          Return the number of string attributes this event type accepts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

index

private final int index

name

private final String name

description

private final String description

attributes

private final EventAttribute[] attributes

numberOfInts

private final int numberOfInts

numberOfLongs

private final int numberOfLongs

numberOfDoubles

private final int numberOfDoubles

numberOfStrings

private final int numberOfStrings

currentIndex

private static int currentIndex
Constructor Detail

EventType

public EventType(String name,
                 String description)
Create a new event type with no attributes.

Parameters:
name - The name of the event type.
description - A description of the event type.

EventType

public EventType(String name,
                 String description,
                 EventAttribute attribute)
Create a new event type with a single attribute.

Parameters:
name - The name of the event type.
description - A description of the event type.
attribute - The event attribute for this event type.

EventType

public EventType(String name,
                 String description,
                 EventAttribute[] attributes)
Create a new event type with the supplied attributes.

Parameters:
name - The name of the event type.
description - A description of the event type.
attributes - The event attributes for this event type.
Method Detail

admits

public boolean admits(int numInt,
                      int numLong,
                      int numDouble,
                      int numString)
Does this event type accept the supplied number of attributes of each type.

Parameters:
numInt - The number of int attributes.
numLong - The number of long attributes.
numDouble - The number of double attributes.
numString - The number of String attributes.
Returns:
True if the event will accept attributes of the specified types.

getNextIndex

private static int getNextIndex()

checkOrder

private void checkOrder(int others)
Check that attributes are declared in the proper order

Parameters:
others - the sum of the attribute declarations that should come later but have already occurred

getIndex

public final int getIndex()

getName

public final String getName()
Return the name of this event type.

Returns:
The name of this event type.

getDescription

public final String getDescription()
Return the description of this event type.

Returns:
The description of this event type.

getNumberOfAttributes

public final int getNumberOfAttributes()
Return the number of attributes this event type accepts.

Returns:
The number of attributes.

getNumberOfInts

public final int getNumberOfInts()
Return the number of int attributes this event type accepts.

Returns:
The number of int attributes.

getNumberOfLongs

public final int getNumberOfLongs()
Return the number of long attributes this event type accepts.

Returns:
The number of long attributes.

getNumberOfDoubles

public final int getNumberOfDoubles()
Return the number of double attributes this event type accepts.

Returns:
The number of double attributes.

getNumberOfStrings

public final int getNumberOfStrings()
Return the number of string attributes this event type accepts.

Returns:
The number of string attributes.

getAttribute

public final EventAttribute getAttribute(int i)
Return the ith attribute of this event type.

Parameters:
i - The index of the attribute to return.
Returns:
The attribute.