|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.xtext.generator.trace.AbstractTraceRegion
@NonNullByDefault public abstract class AbstractTraceRegion
Abstract base class for trace regions. Implements the equals(Object)
and hashCode()
contract and delegates some functionality to the parent.
Constructor Summary | |
---|---|
protected |
AbstractTraceRegion(AbstractTraceRegion parent)
Creates a new trace region and adds it to the parent if a parent was given. |
Method Summary | |
---|---|
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,
java.lang.String myProjectName)
|
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()
|
java.lang.String |
getAssociatedProjectName()
|
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.lang.String myProjectName)
|
java.util.List<AbstractTraceRegion> |
invertFor(org.eclipse.emf.common.util.URI expectedAssociatedPath,
org.eclipse.emf.common.util.URI myPath,
java.lang.String myProjectName)
|
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,
java.lang.String myProjectName)
Produces trees from a sorted list of locations. |
java.lang.String |
toString()
|
org.eclipse.emf.common.util.TreeIterator<AbstractTraceRegion> |
treeIterator()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected AbstractTraceRegion(@Nullable AbstractTraceRegion parent)
Method Detail |
---|
protected boolean isConsistentWithParent()
public void setParent(@Nullable 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, java.lang.String myProjectName)
public java.util.Map<org.eclipse.emf.common.util.URI,java.util.List<AbstractTraceRegion>> invertAll(org.eclipse.emf.common.util.URI myPath, java.lang.String myProjectName)
protected java.util.Map<org.eclipse.emf.common.util.URI,java.util.List<Pair<ILocationData,AbstractTraceRegion>>> collectMatchingLocations(@Nullable org.eclipse.emf.common.util.URI expectedAssociatedPath)
@Nullable protected java.util.List<Pair<ILocationData,AbstractTraceRegion>> getCollectingList(@Nullable org.eclipse.emf.common.util.URI associatedPath, @Nullable 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, java.lang.String myProjectName)
public LocationData createLocationData(AbstractTraceRegion region, org.eclipse.emf.common.util.URI myPath, java.lang.String myProjectName)
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()
@Nullable public ILocationData getMergedAssociatedLocation()
null
is returned.
@Nullable public org.eclipse.emf.common.util.URI getAssociatedPath()
@Nullable public java.lang.String getAssociatedProjectName()
@Nullable 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(@Nullable 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 region
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |