Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
private final int index
private final String description
private final EventAttribute[] attributes
private final int numberOfInts
private final int numberOfLongs
private final int numberOfDoubles
private final int numberOfStrings
private static int currentIndex
public EventType(String name, String description)
name
- The name of the event type.description
- A description of the event type.public EventType(String name, String description, EventAttribute attribute)
name
- The name of the event type.description
- A description of the event type.attribute
- The event attribute for this event type.public EventType(String name, String description, EventAttribute[] attributes)
name
- The name of the event type.description
- A description of the event type.attributes
- The event attributes for this event type.public boolean admits(int numInt, int numLong, int numDouble, int numString)
numInt
- The number of int attributes.numLong
- The number of long attributes.numDouble
- The number of double attributes.numString
- The number of String attributes.private static int getNextIndex()
private void checkOrder(int others)
others
- the sum of the attribute declarations that should come
later but have already occurredpublic final int getIndex()
public final String getName()
public final String getDescription()
public final int getNumberOfAttributes()
public final int getNumberOfInts()
public final int getNumberOfLongs()
public final int getNumberOfDoubles()
public final int getNumberOfStrings()
public final EventAttribute getAttribute(int i)
i
- The index of the attribute to return.