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<SourceRelativeURI,java.util.List<Pair<ILocationData,AbstractTraceRegion>>> |
collectMatchingLocations(SourceRelativeURI expectedAssociatedPath) |
LocationData |
createLocationData(AbstractTraceRegion region,
SourceRelativeURI 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() |
SourceRelativeURI |
getAssociatedSrcRelativePath() |
protected java.util.List<Pair<ILocationData,AbstractTraceRegion>> |
getCollectingList(SourceRelativeURI associatedPath,
SourceRelativeURI expectedAssociatedPath,
java.util.Map<SourceRelativeURI,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() |
AbstractTraceRegion |
getRoot() |
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<SourceRelativeURI,java.util.List<AbstractTraceRegion>> |
invertAll(SourceRelativeURI myPath) |
java.util.List<AbstractTraceRegion> |
invertFor(SourceRelativeURI expectedAssociatedPath,
SourceRelativeURI myPath) |
protected boolean |
isConsistentWithParent() |
abstract boolean |
isUseForDebugging() |
java.util.Iterator<AbstractTraceRegion> |
leafIterator()
Returns an iterator that will only offer leaf trace regions.
|
static AbstractTraceRegion |
mergedFrom(java.util.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 java.util.List<AbstractTraceRegion> |
toInvertedTraceRegions(java.util.List<Pair<ILocationData,AbstractTraceRegion>> locations,
SourceRelativeURI 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(SourceRelativeURI expectedAssociatedPath, SourceRelativeURI myPath)
public java.util.Map<SourceRelativeURI,java.util.List<AbstractTraceRegion>> invertAll(SourceRelativeURI myPath)
protected java.util.Map<SourceRelativeURI,java.util.List<Pair<ILocationData,AbstractTraceRegion>>> collectMatchingLocations(SourceRelativeURI expectedAssociatedPath)
protected java.util.List<Pair<ILocationData,AbstractTraceRegion>> getCollectingList(SourceRelativeURI associatedPath, SourceRelativeURI expectedAssociatedPath, java.util.Map<SourceRelativeURI,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, SourceRelativeURI myPath)
public static AbstractTraceRegion mergedFrom(java.util.List<AbstractTraceRegion> regions)
public LocationData createLocationData(AbstractTraceRegion region, SourceRelativeURI 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 SourceRelativeURI getAssociatedSrcRelativePath()
public AbstractTraceRegion getParent()
public AbstractTraceRegion getRoot()
public java.lang.String getAnnotatedString(java.lang.String input)
public abstract 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