public abstract class AbstractTraceRegion extends Object
equals(Object)
and hashCode() contract and delegates some functionality to the parent.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractTraceRegion(AbstractTraceRegion parent)
Creates a new trace region and adds it to the parent if a parent was given.
|
| Modifier and Type | Method and Description |
|---|---|
protected Map<org.eclipse.emf.common.util.URI,List<Pair<ILocationData,AbstractTraceRegion>>> |
collectMatchingLocations(org.eclipse.emf.common.util.URI expectedAssociatedPath) |
LocationData |
createLocationData(AbstractTraceRegion region,
org.eclipse.emf.common.util.URI myPath) |
boolean |
equals(Object obj)
Compares the specified object with this region for equality.
|
String |
getAnnotatedString(String input) |
abstract List<ILocationData> |
getAssociatedLocations() |
org.eclipse.emf.common.util.URI |
getAssociatedPath() |
protected List<Pair<ILocationData,AbstractTraceRegion>> |
getCollectingList(org.eclipse.emf.common.util.URI associatedPath,
org.eclipse.emf.common.util.URI expectedAssociatedPath,
Map<org.eclipse.emf.common.util.URI,List<Pair<ILocationData,AbstractTraceRegion>>> listsPerURI) |
ILocationData |
getMergedAssociatedLocation()
Returns the merged location of all associated locations if
they belong to the same resource.
|
abstract int |
getMyEndLineNumber() |
abstract int |
getMyLength() |
abstract int |
getMyLineNumber() |
abstract int |
getMyOffset() |
ITextRegionWithLineInformation |
getMyRegion() |
List<AbstractTraceRegion> |
getNestedRegions()
Returns the nested trace regions.
|
AbstractTraceRegion |
getParent() |
protected List<AbstractTraceRegion> |
getWritableNestedRegions() |
int |
hashCode()
Returns the hash code value for this region.
|
protected void |
inplaceSortByOffset(List<Pair<ILocationData,AbstractTraceRegion>> locations) |
Map<org.eclipse.emf.common.util.URI,List<AbstractTraceRegion>> |
invertAll(org.eclipse.emf.common.util.URI myPath) |
List<AbstractTraceRegion> |
invertFor(org.eclipse.emf.common.util.URI expectedAssociatedPath,
org.eclipse.emf.common.util.URI myPath) |
protected boolean |
isConsistentWithParent() |
boolean |
isUseForDebugging() |
Iterator<AbstractTraceRegion> |
leafIterator()
Returns an iterator that will only offer leaf trace regions.
|
static AbstractTraceRegion |
mergedFrom(List<AbstractTraceRegion> regions) |
protected void |
setAsChildIn(AbstractTraceRegion parent) |
void |
setParent(AbstractTraceRegion parent)
Sets the parent (if any) and maintains the
nested regions
of the parent. |
protected List<AbstractTraceRegion> |
toInvertedTraceRegions(List<Pair<ILocationData,AbstractTraceRegion>> locations,
org.eclipse.emf.common.util.URI myPath)
Produces trees from a sorted list of locations.
|
String |
toString() |
org.eclipse.emf.common.util.TreeIterator<AbstractTraceRegion> |
treeIterator() |
protected AbstractTraceRegion(AbstractTraceRegion parent)
protected boolean isConsistentWithParent()
public void setParent(AbstractTraceRegion parent)
nested regions
of the parent.parent - the parent or null if none.setAsChildIn(AbstractTraceRegion)protected void setAsChildIn(AbstractTraceRegion parent)
public final List<AbstractTraceRegion> getNestedRegions()
leafIterator().protected final List<AbstractTraceRegion> getWritableNestedRegions()
public List<AbstractTraceRegion> invertFor(org.eclipse.emf.common.util.URI expectedAssociatedPath, org.eclipse.emf.common.util.URI myPath)
public Map<org.eclipse.emf.common.util.URI,List<AbstractTraceRegion>> invertAll(org.eclipse.emf.common.util.URI myPath)
protected Map<org.eclipse.emf.common.util.URI,List<Pair<ILocationData,AbstractTraceRegion>>> collectMatchingLocations(org.eclipse.emf.common.util.URI expectedAssociatedPath)
protected List<Pair<ILocationData,AbstractTraceRegion>> getCollectingList(org.eclipse.emf.common.util.URI associatedPath, org.eclipse.emf.common.util.URI expectedAssociatedPath, Map<org.eclipse.emf.common.util.URI,List<Pair<ILocationData,AbstractTraceRegion>>> listsPerURI)
public org.eclipse.emf.common.util.TreeIterator<AbstractTraceRegion> treeIterator()
protected void inplaceSortByOffset(List<Pair<ILocationData,AbstractTraceRegion>> locations)
protected List<AbstractTraceRegion> toInvertedTraceRegions(List<Pair<ILocationData,AbstractTraceRegion>> locations, org.eclipse.emf.common.util.URI myPath)
public static AbstractTraceRegion mergedFrom(List<AbstractTraceRegion> regions)
public LocationData createLocationData(AbstractTraceRegion region, org.eclipse.emf.common.util.URI myPath)
public final Iterator<AbstractTraceRegion> leafIterator()
null.public abstract int getMyLength()
public abstract int getMyOffset()
public abstract int getMyLineNumber()
public abstract int getMyEndLineNumber()
public ITextRegionWithLineInformation getMyRegion()
public abstract List<ILocationData> getAssociatedLocations()
public ILocationData getMergedAssociatedLocation()
null is returned.public org.eclipse.emf.common.util.URI getAssociatedPath()
public AbstractTraceRegion getParent()
public boolean isUseForDebugging()
public int hashCode()
r is defined to be:
r.getMyOffset()
^ r.getMyLength()
^ r.getAssociatedOffset()
^ r.getAssociatedLength()
^ (r.getParent() == null ? 0 : r.getParent().hashCode())
This ensures that r1.equals(r2) implies that
r1.hashCode()==r2.hashCode() for any two AbstractTraceRegion
r1 and r2, as required by the general
contract of Object.hashCode.hashCode in class ObjectObject.hashCode(),
Object.equals(Object),
equals(Object)public boolean equals(Object obj)
true if the given object is also
an AbstractTraceRegion and the two regions represent the same data. More formally, two regions r1
and r2 are considered to be equal if
(r1.getMyOffset() == r2.getMyOffset())
&& (r1.getMyLength() == r2.getMyLength())
&& (r1.getAssociatedOffset() == r2.getAssociatedOffset())
&& (r1.getAssociatedLength() == r2.getAssociatedLength())
&& (r1.getParent()==null ?
r2.getParent()==null : r1.getParent().equals(r2.getParent()))
This ensures that the equals(Object) method works properly across different implementations of the
AbstractTraceRegion interface.Copyright © 2015. All Rights Reserved.