org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite
Class ListRewriteEvent

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.RewriteEvent
      extended by org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.ListRewriteEvent

public class ListRewriteEvent
extends RewriteEvent


Field Summary
static int BOTH
           
static int NEW
           
static int OLD
           
 
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.RewriteEvent
CHILDREN_CHANGED, INSERTED, REMOVED, REPLACED, UNCHANGED
 
Constructor Summary
ListRewriteEvent(java.util.List originalNodes)
          Creates a ListRewriteEvent from the original ASTNodes.
ListRewriteEvent(RewriteEvent[] children)
          Creates a ListRewriteEvent from existing rewrite events.
 
Method Summary
 int getChangeKind()
           
 int getChangeKind(int index)
           
 RewriteEvent[] getChildren()
           
 int getIndex(ASTNode node, int kind)
           
 java.lang.Object getNewValue()
           
 java.lang.Object getOriginalValue()
           
 RewriteEvent insert(ASTNode insertedNode, int insertIndex)
           
 boolean isListRewrite()
           
 RewriteEvent removeEntry(ASTNode originalEntry)
           
 RewriteEvent replaceEntry(ASTNode entry, ASTNode newEntry)
           
 void revertChange(NodeRewriteEvent event)
           
 void setNewValue(ASTNode newValue, int insertIndex)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NEW

public static final int NEW
See Also:
Constant Field Values

OLD

public static final int OLD
See Also:
Constant Field Values

BOTH

public static final int BOTH
See Also:
Constant Field Values
Constructor Detail

ListRewriteEvent

public ListRewriteEvent(java.util.List originalNodes)
Creates a ListRewriteEvent from the original ASTNodes. The resulting event represents the unmodified list.

Parameters:
originalNodes - The original nodes (type ASTNode)

ListRewriteEvent

public ListRewriteEvent(RewriteEvent[] children)
Creates a ListRewriteEvent from existing rewrite events.

Parameters:
children - The rewrite events for this list.
Method Detail

getChangeKind

public int getChangeKind()
Specified by:
getChangeKind in class RewriteEvent
Returns:
Returns the event's change kind.

isListRewrite

public boolean isListRewrite()
Specified by:
isListRewrite in class RewriteEvent
Returns:
Returns true if the given event is a list event.

getChildren

public RewriteEvent[] getChildren()
Specified by:
getChildren in class RewriteEvent
Returns:
Return the events describing the changes in a list. returns null if the event is not a list event.

getOriginalValue

public java.lang.Object getOriginalValue()
Specified by:
getOriginalValue in class RewriteEvent
Returns:
Returns the original value. For lists this is a List of ASTNode's, for non-list events this can be an ASTNode (for node properties), Integer (for an integer property), Boolean (for boolean node properties) or properties like Operator. null is returned if the event is a insert event.

getNewValue

public java.lang.Object getNewValue()
Specified by:
getNewValue in class RewriteEvent
Returns:
Returns the new value. For lists this is a List of ASTNode's, for non-list events this can be an ASTNode (for node properties), Integer (for an integer property), Boolean (for boolean node properties) or properties like Operator. null is returned if the event is a remove event.

removeEntry

public RewriteEvent removeEntry(ASTNode originalEntry)

replaceEntry

public RewriteEvent replaceEntry(ASTNode entry,
                                 ASTNode newEntry)

revertChange

public void revertChange(NodeRewriteEvent event)

getIndex

public int getIndex(ASTNode node,
                    int kind)

insert

public RewriteEvent insert(ASTNode insertedNode,
                           int insertIndex)

setNewValue

public void setNewValue(ASTNode newValue,
                        int insertIndex)

getChangeKind

public int getChangeKind(int index)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object