edu.neu.ccs.beans.visitor.event
Class VisitEvent
java.lang.Object
|
+--java.util.EventObject
|
+--edu.neu.ccs.beans.visitor.event.VisitEvent
- Direct Known Subclasses:
- ClassEvent, ConstructorEvent, FieldEvent, MethodEvent
- public class VisitEvent
- extends java.util.EventObject
The mother of all visit events.
- See Also:
- Serialized Form
Fields inherited from class java.util.EventObject |
source |
Constructor Summary |
protected |
VisitEvent(java.lang.Object source,
int type,
java.lang.Object visited,
java.lang.Object data)
|
Methods inherited from class java.util.EventObject |
getSource,
toString |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
SAME_SOURCE
public static final java.lang.Object SAME_SOURCE
SAME_TYPE
public static final int SAME_TYPE
SAME_VISITED
public static final java.lang.Object SAME_VISITED
SAME_DATA
public static final java.lang.Object SAME_DATA
NA
public static final int NA
NORMAL
public static final int NORMAL
RESET
public static final int RESET
TERMINATE
public static final int TERMINATE
VisitEvent
protected VisitEvent(java.lang.Object source,
int type,
java.lang.Object visited,
java.lang.Object data)
getData
public java.lang.Object getData()
- Returns:
- Data passed along
getType
public int getType()
- Returns:
- Type of event
- See Also:
NORMAL
,
RESET
,
TERMINATE
getVisited
public java.lang.Object getVisited()
- Returns:
- Visited object
isNormal
public boolean isNormal()
- Returns:
- Whether or not this is a normal event
isReset
public boolean isReset()
- Returns:
- Whether or not this is a reset event
isTerminate
public boolean isTerminate()
- Returns:
- Whether or not this is a terminate event
newCopy
public VisitEvent newCopy(java.lang.Object source,
int type,
java.lang.Object visited,
java.lang.Object data)
- Duplicates the event replacing only the new elements.
- Parameters:
source
- Source or SAME_SOURCEtype
- Kind of event or SAME_TYPEvisited
- Object to visit or SAME_VISITEDdata
- Data to pass with the object or SAME_DATA- Returns:
- Duplicated event
- See Also:
SAME_SOURCE
,
SAME_TYPE
,
SAME_VISITED
,
SAME_DATA
normal
public static VisitEvent normal(java.lang.Object source,
java.lang.Object visited,
java.lang.Object data)
- Generates a normal event.
- Parameters:
source
- The source of the event- Returns:
- The event
reset
public static VisitEvent reset(java.lang.Object source)
- Generates a reset event.
- Parameters:
source
- The source of the event- Returns:
- Reset event
setType
public void setType(int type)
- Parameters:
Kind
- of event- See Also:
NORMAL
,
RESET
,
TERMINATE
terminate
public static VisitEvent terminate(java.lang.Object source)
- Generates a terminate event.
- Parameters:
source
- The source of the event- Returns:
- A terminate event