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.
|
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(SourceRelativeURI expectedAssociatedPath, SourceRelativeURI myPath)
public Map<SourceRelativeURI,List<AbstractTraceRegion>> invertAll(SourceRelativeURI myPath)
protected Map<SourceRelativeURI,List<Pair<ILocationData,AbstractTraceRegion>>> collectMatchingLocations(SourceRelativeURI expectedAssociatedPath)
protected List<Pair<ILocationData,AbstractTraceRegion>> getCollectingList(SourceRelativeURI associatedPath, SourceRelativeURI expectedAssociatedPath, Map<SourceRelativeURI,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, SourceRelativeURI myPath)
public static AbstractTraceRegion mergedFrom(List<AbstractTraceRegion> regions)
public LocationData createLocationData(AbstractTraceRegion region, SourceRelativeURI 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 SourceRelativeURI getAssociatedSrcRelativePath()
public AbstractTraceRegion getParent()
public AbstractTraceRegion getRoot()
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 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.