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

Field Summary
static int NA
           
static int NORMAL
           
static int RESET
           
static java.lang.Object SAME_DATA
           
static java.lang.Object SAME_SOURCE
           
static int SAME_TYPE
           
static java.lang.Object SAME_VISITED
           
static int TERMINATE
           
 
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)
           
 
Method Summary
 java.lang.Object getData()
           
 int getType()
           
 java.lang.Object getVisited()
           
 boolean isNormal()
           
 boolean isReset()
           
 boolean isTerminate()
           
 VisitEvent newCopy(java.lang.Object source, int type, java.lang.Object visited, java.lang.Object data)
          Duplicates the event replacing only the new elements.
static VisitEvent normal(java.lang.Object source, java.lang.Object visited, java.lang.Object data)
          Generates a normal event.
static VisitEvent reset(java.lang.Object source)
          Generates a reset event.
 void setType(int type)
           
static VisitEvent terminate(java.lang.Object source)
          Generates a terminate event.
 
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
 

Field Detail

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
Constructor Detail

VisitEvent

protected VisitEvent(java.lang.Object source,
                     int type,
                     java.lang.Object visited,
                     java.lang.Object data)
Method Detail

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_SOURCE
type - Kind of event or SAME_TYPE
visited - Object to visit or SAME_VISITED
data - 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