public abstract class JavaProgramElement extends JavaSourceElement implements ProgramElement
ProgramElement.
taken from COMPOST and changed to achieve an immutable structure| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
JavaProgramElement.NameAbstractionTableDisabled
this class is used by method call.
|
| Modifier and Type | Field and Description |
|---|---|
private Comment[] |
comments |
private int |
hashCode |
private static Comment[] |
NO_COMMENTS |
| Constructor and Description |
|---|
JavaProgramElement() |
JavaProgramElement(ExtList list)
Java program element.
|
JavaProgramElement(ExtList children,
PositionInfo pos) |
JavaProgramElement(PositionInfo pos)
creates a java program element with the given position information
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
computeHashCode() |
boolean |
equals(java.lang.Object o) |
boolean |
equalsModRenaming(SourceElement se,
NameAbstractionTable nat)
commented in interface SourceElement.
|
private Comment[] |
extractComments(ExtList list)
collects comments contained in the given list
|
Comment[] |
getComments()
Get comments.
|
int |
hashCode()
if you need to customize the hashcode computation for a subclass
please override method
computeHashCode() |
MatchConditions |
match(SourceData source,
MatchConditions matchCond)
matches the source "text" (@link SourceData#getSource()) against the pattern represented
by this object.
|
void |
prettyPrint(PrettyPrinter w)
Pretty printing the source element.
|
protected void |
prettyPrintMain(PrettyPrinter w)
Prints main content of current node and all syntactical children.
|
java.lang.String |
reuseSignature(Services services,
ExecutionContext ec)
this is the default implementation of the signature, which is
used to determine program similarity.
|
getEndPosition, getFirstElement, getFirstElementIncludingBlocks, getLastElement, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetEndPosition, getFirstElement, getFirstElementIncludingBlocks, getLastElement, getPositionInfo, getRelativePosition, getStartPosition, visitprivate static final Comment[] NO_COMMENTS
private final Comment[] comments
private int hashCode
public JavaProgramElement()
public JavaProgramElement(ExtList list)
list - ExtList with commentspublic JavaProgramElement(PositionInfo pos)
pos - the PositionInfo where the Java program element occurs in
the sourcepublic JavaProgramElement(ExtList children, PositionInfo pos)
private Comment[] extractComments(ExtList list)
list - the ExtList with children and comments of this nodepublic Comment[] getComments()
getComments in interface ProgramElementpublic void prettyPrint(PrettyPrinter w) throws java.io.IOException
JavaSourceElementprettyPrint in interface SourceElementprettyPrint in class JavaSourceElementw - a pretty printer.java.io.IOException - occasionally thrown.protected void prettyPrintMain(PrettyPrinter w) throws java.io.IOException
java.io.IOExceptionpublic boolean equalsModRenaming(SourceElement se, NameAbstractionTable nat)
equalsModRenaming in interface SourceElementprotected int computeHashCode()
public final int hashCode()
computeHashCode()hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.lang.String reuseSignature(Services services, ExecutionContext ec)
ec - TODOpublic MatchConditions match(SourceData source, MatchConditions matchCond)
ProgramElementMatchConditions with
the found instantiations of the schemavariables. If the match
failed, null is returned instead.match in interface ProgramElementsource - the SourceData with the program element to matchmatchCond - the MatchConditions found up to this point