|
Parsing Engine | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MutableEvent
Provides additional methods to those of Event that
permit modification of the event object. For efficiency, it is
recommended that implementations of this interface implement the
optional ensureCapacity methods, which will allow
efficient re-use of one MutableEvent object for
lookups in a collection of Event objects.
| Method Summary | |
|---|---|
MutableEvent |
add(int type,
Object obj)
Adds the specified object of the specified type to this event. |
MutableEvent |
add(Object obj)
Adds the specified object to this event. |
void |
clear()
Clears all components from this event. |
void |
ensureCapacity(int size)
Pre-allocates space for all abstract lists in this event (optional operation). |
void |
ensureCapacity(int type,
int size)
Pre-allocates space for the abstract list of the specified type (optional operation). |
| Methods inherited from interface danbikel.parser.Event |
|---|
canonicalize, copy, equals, get, getClass, hashCode, numComponents, numComponents, numTypes, typeIndex |
| Method Detail |
|---|
MutableEvent add(Object obj)
this.typeIndex(obj.getClass())must not return -1.
If an implementation of this interface collects components that
are primitive type values, then these values should be wrapped
in their corresponding wrapper classes. For example, if an
implementation of this interface accepts int values,
they should be passed as Integer objects to this method.
At present, an Event implementation cannot be
designed accept both a primitive type and its associated wrapper
class' type (this is, of course, not a serious limitation).
ClassCastException - if this event does not support the
run-time type of the specified object
MutableEvent add(int type,
Object obj)
this.typeIndex(obj.getClass()) == typemust be true.
If an implementation of this interface collects components that
are primitive type values, then these values should be wrapped
in their corresponding wrapper classes. For example, if an
implementation of this interface accepts int values,
they should be passed as an Integer objects to this method.
At present, an Event implementation cannot be
designed accept both a primitive type and its associated wrapper
class' type (this is, of course, not a serious limitation).
ClassCastException - if this event does not support the
run-time type of the specified object or if the specified object
is not of the specified typevoid ensureCapacity(int size)
size - the size to pre-allocate for all abstract lists of this event
void ensureCapacity(int type,
int size)
type - the type of underlying abstract list for which to pre-allocate
spacesize - the size to pre-allocate for the specified type of abstract
listvoid clear()
|
Parsing Engine | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||