public abstract class AbstractTraceRegion
extends java.lang.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 java.util.Map<org.eclipse.emf.common.util.URI,java.util.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(java.lang.Object obj)
Compares the specified object with this region for equality.
|
java.lang.String |
getAnnotatedString(java.lang.String input) |
abstract java.util.List<ILocationData> |
getAssociatedLocations() |
org.eclipse.emf.common.util.URI |
getAssociatedPath() |
protected java.util.List<Pair<ILocationData,AbstractTraceRegion>> |
getCollectingList(org.eclipse.emf.common.util.URI associatedPath,
org.eclipse.emf.common.util.URI expectedAssociatedPath,
java.util.Map<org.eclipse.emf.common.util.URI,java.util.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() |
java.util.List<AbstractTraceRegion> |
getNestedRegions()
Returns the nested trace regions.
|
AbstractTraceRegion |
getParent() |
protected java.util.List<AbstractTraceRegion> |
getWritableNestedRegions() |
int |
hashCode()
Returns the hash code value for this region.
|
protected void |
inplaceSortByOffset(java.util.List<Pair<ILocationData,AbstractTraceRegion>> locations) |
java.util.Map<org.eclipse.emf.common.util.URI,java.util.List<AbstractTraceRegion>> |
invertAll(org.eclipse.emf.common.util.URI myPath) |
java.util.List<AbstractTraceRegion> |
invertFor(org.eclipse.emf.common.util.URI expectedAssociatedPath,
org.eclipse.emf.common.util.URI myPath) |
protected boolean |
isConsistentWithParent() |
boolean |
isUseForDebugging() |
java.util.Iterator<AbstractTraceRegion> |
leafIterator()
Returns an iterator that will only offer leaf trace regions.
|
protected void |
setAsChildIn(AbstractTraceRegion parent) |
void |
setParent(AbstractTraceRegion parent)
Sets the parent (if any) and maintains the
nested regions
of the parent. |
protected java.util.List<AbstractTraceRegion> |
toInvertedTraceRegions(java.util.List<Pair<ILocationData,AbstractTraceRegion>> locations,
org.eclipse.emf.common.util.URI myPath)
Produces trees from a sorted list of locations.
|
java.lang.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 java.util.List<AbstractTraceRegion> getNestedRegions()
leafIterator()
.protected final java.util.List<AbstractTraceRegion> getWritableNestedRegions()
public java.util.List<AbstractTraceRegion> invertFor(org.eclipse.emf.common.util.URI expectedAssociatedPath, org.eclipse.emf.common.util.URI myPath)
public java.util.Map<org.eclipse.emf.common.util.URI,java.util.List<AbstractTraceRegion>> invertAll(org.eclipse.emf.common.util.URI myPath)
protected java.util.Map<org.eclipse.emf.common.util.URI,java.util.List<Pair<ILocationData,AbstractTraceRegion>>> collectMatchingLocations(org.eclipse.emf.common.util.URI expectedAssociatedPath)
protected java.util.List<Pair<ILocationData,AbstractTraceRegion>> getCollectingList(org.eclipse.emf.common.util.URI associatedPath, org.eclipse.emf.common.util.URI expectedAssociatedPath, java.util.Map<org.eclipse.emf.common.util.URI,java.util.List<Pair<ILocationData,AbstractTraceRegion>>> listsPerURI)
public org.eclipse.emf.common.util.TreeIterator<AbstractTraceRegion> treeIterator()
protected void inplaceSortByOffset(java.util.List<Pair<ILocationData,AbstractTraceRegion>> locations)
protected java.util.List<AbstractTraceRegion> toInvertedTraceRegions(java.util.List<Pair<ILocationData,AbstractTraceRegion>> locations, org.eclipse.emf.common.util.URI myPath)
public LocationData createLocationData(AbstractTraceRegion region, org.eclipse.emf.common.util.URI myPath)
public final java.util.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 java.util.List<ILocationData> getAssociatedLocations()
public ILocationData getMergedAssociatedLocation()
null
is returned.public org.eclipse.emf.common.util.URI getAssociatedPath()
public AbstractTraceRegion getParent()
public java.lang.String getAnnotatedString(java.lang.String input)
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 java.lang.Object
Object.hashCode()
,
Object.equals(Object)
,
equals(Object)
public boolean equals(java.lang.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.equals
in class java.lang.Object
obj
- object to be compared for equality with this trace regionpublic java.lang.String toString()
toString
in class java.lang.Object