com.jrockit.mc.flightrecorder.provider
Class EventType

java.lang.Object
  extended by com.jrockit.mc.flightrecorder.provider.EventType
All Implemented Interfaces:
IEventType

public final class EventType
extends java.lang.Object
implements IEventType

Event type that holds static metadata about an event.

Author:
Erik Gahlin

Method Summary
 void addField(IField field)
          Adds a field to the event type
 IEvent createEvent(long startTime, long endTime, java.lang.Object... values)
          Creates an event for the event type.
 Field createNumericField(java.lang.String identifier)
          Creates a numeric field.
 Field createObjectField(java.lang.String identifier)
          Creates a object field.
 Field createStringField(java.lang.String identifier)
          Creates a String field.
 int getBitField()
          Gets the bit field for the event type.
 java.awt.Color getColor()
          Returns the color associated with the event type.
 java.lang.String getDescription()
          Return a description of the event type.
 IField getField(java.lang.String key)
          Returns a field for the event type, or null if not available.
 java.util.Collection<java.lang.String> getFieldIdentifiers()
          Returns the fields for the event type.
 java.util.Collection<IField> getFields()
          Returns the fields for the event type.
 java.lang.Integer getId()
          Returns an identifier for the event type.
 java.lang.String getName()
          Return a human readable name for the event type.
 java.lang.String getPath()
          Return a symbolic name for the event type.
 IProducer getProducer()
          Returns the producer for the event type.
 java.util.List<EventStorage> getStorages()
           
 boolean isVisible()
          Returns if the field should be visible for the user.
 void setBitField(int bitSet)
          Sets the the bit field for the event type.
 void setColor(java.awt.Color color)
           
 void setDescription(java.lang.String description)
           
 void setName(java.lang.String name)
           
 void setPath(java.lang.String path)
           
 void setVisible(boolean visible)
          Sets the visibility for the event type.
 java.lang.String toString()
          Returns a human readable description of the event type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

createNumericField

public Field createNumericField(java.lang.String identifier)
Creates a numeric field. Field suitable for event values that derives from Number

Parameters:
identifier - the identifier for the field
Returns:
a field of the numeric type
Throws:
java.lang.IllegalArgumentException - if the identifier is null or empty.

createStringField

public Field createStringField(java.lang.String identifier)
Creates a String field. Field suitable for event values that is Strings

Parameters:
identifier - the identifier for the field
Returns:
a field of the string type
Throws:
java.lang.IllegalArgumentException - if the identifier is null or empty.

createObjectField

public Field createObjectField(java.lang.String identifier)
Creates a object field. Field suitable for event values that is neither a Strings or an instance of Number

Parameters:
identifier - the identifier for the field
Returns:
a field of the object type
Throws:
java.lang.IllegalArgumentException - if the identifier is null or empty.

createEvent

public IEvent createEvent(long startTime,
                          long endTime,
                          java.lang.Object... values)
Creates an event for the event type. Once an event has been created for the event type, the number of fields can't be changed.

Parameters:
startTime - the start time of the event.
endTime - the end time of the event.
values - the values the event should hold on to.
Returns:
an event

getStorages

public java.util.List<EventStorage> getStorages()

addField

public void addField(IField field)
Adds a field to the event type

Parameters:
field - the field to add.

getColor

public java.awt.Color getColor()
Description copied from interface: IEventType
Returns the color associated with the event type.

Specified by:
getColor in interface IEventType
Returns:
the color for the event type.

getDescription

public java.lang.String getDescription()
Description copied from interface: IEventType
Return a description of the event type.

Specified by:
getDescription in interface IEventType
Returns:
a description of the event type.

getId

public java.lang.Integer getId()
Description copied from interface: IEventType
Returns an identifier for the event type. The identifier must be unique for the producer.

Specified by:
getId in interface IEventType
Returns:
the identifier

getName

public java.lang.String getName()
Description copied from interface: IEventType
Return a human readable name for the event type.

Specified by:
getName in interface IEventType
Returns:
the name

getPath

public java.lang.String getPath()
Description copied from interface: IEventType
Return a symbolic name for the event type. The path can be use used to identify the event type in hierarchal way.

Specified by:
getPath in interface IEventType
Returns:
the path for the event type.

getProducer

public IProducer getProducer()
Description copied from interface: IEventType
Returns the producer for the event type.

Specified by:
getProducer in interface IEventType
Returns:
the producer for the event type.

getField

public IField getField(java.lang.String key)
Description copied from interface: IEventType
Returns a field for the event type, or null if not available.

Specified by:
getField in interface IEventType
Parameters:
key - the identifier for the field
Returns:
a field

getBitField

public int getBitField()
Description copied from interface: IEventType
Gets the bit field for the event type.

Specified by:
getBitField in interface IEventType
Returns:
the bit field

setBitField

public void setBitField(int bitSet)
Description copied from interface: IEventType
Sets the the bit field for the event type.

Specified by:
setBitField in interface IEventType

getFields

public java.util.Collection<IField> getFields()
Description copied from interface: IEventType
Returns the fields for the event type.

Specified by:
getFields in interface IEventType
Returns:
all fields for the event type.

setName

public void setName(java.lang.String name)

setDescription

public void setDescription(java.lang.String description)

setColor

public void setColor(java.awt.Color color)

setPath

public void setPath(java.lang.String path)

toString

public java.lang.String toString()
Returns a human readable description of the event type.

Overrides:
toString in class java.lang.Object

setVisible

public void setVisible(boolean visible)
Sets the visibility for the event type.

Parameters:
visible - true if visible, false otherwise.

isVisible

public boolean isVisible()
Returns if the field should be visible for the user.

Returns:
true if the field should be visible, false otherwise.

getFieldIdentifiers

public java.util.Collection<java.lang.String> getFieldIdentifiers()
Description copied from interface: IEventType
Returns the fields for the event type.

Specified by:
getFieldIdentifiers in interface IEventType
Returns:
all fields for the event type.


Copyright © 1999, 2011, Oracle and/or its affiliates. All rights reserved.