org.aspectj.org.eclipse.jdt.internal.core
Class Region

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.internal.core.Region
All Implemented Interfaces:
IRegion

public class Region
extends java.lang.Object
implements IRegion

See Also:
IRegion

Field Summary
protected  java.util.ArrayList rootElements
          A collection of the top level elements that have been added to the region
 
Constructor Summary
Region()
          Creates an empty region.
 
Method Summary
 void add(IJavaElement element)
          Adds the given element and all of its descendents to this region.
 boolean contains(IJavaElement element)
          Returns whether the given element is contained in this region.
 IJavaElement[] getElements()
          Returns the top level elements in this region.
 boolean remove(IJavaElement element)
          Removes the specified element from the region and returns true if successful, false if the remove fails.
protected  void removeAllChildren(IJavaElement element)
          Removes any children of this element that are contained within this region as this parent is about to be added to the region.
 java.lang.String toString()
          Returns a printable representation of this region.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rootElements

protected java.util.ArrayList rootElements
A collection of the top level elements that have been added to the region

Constructor Detail

Region

public Region()
Creates an empty region.

See Also:
IRegion
Method Detail

add

public void add(IJavaElement element)
Description copied from interface: IRegion
Adds the given element and all of its descendents to this region. If the specified element is already included, or one of its ancestors is already included, this has no effect. If the element being added is an ancestor of an element already contained in this region, the ancestor subsumes the descendent.

Specified by:
add in interface IRegion
Parameters:
element - the given element
See Also:
IRegion.add(IJavaElement)

contains

public boolean contains(IJavaElement element)
Description copied from interface: IRegion
Returns whether the given element is contained in this region.

Specified by:
contains in interface IRegion
Parameters:
element - the given element
Returns:
true if the given element is contained in this region, false otherwise
See Also:
IRegion

getElements

public IJavaElement[] getElements()
Description copied from interface: IRegion
Returns the top level elements in this region. All descendents of these elements are also included in this region.

Specified by:
getElements in interface IRegion
Returns:
the top level elements in this region
See Also:
IRegion

remove

public boolean remove(IJavaElement element)
Description copied from interface: IRegion
Removes the specified element from the region and returns true if successful, false if the remove fails. If an ancestor of the given element is included, the remove fails (in other words, it is not possible to selectively exclude descendants of included ancestors).

Specified by:
remove in interface IRegion
Parameters:
element - the given element
Returns:
true if successful, false if the remove fails
See Also:
IRegion.remove(IJavaElement)

removeAllChildren

protected void removeAllChildren(IJavaElement element)
Removes any children of this element that are contained within this region as this parent is about to be added to the region.

Children are all children, not just direct children.


toString

public java.lang.String toString()
Returns a printable representation of this region.

Overrides:
toString in class java.lang.Object