public abstract class JavaProgramElement extends JavaSourceElement implements ProgramElement
ProgramElement
.
taken from COMPOST and changed to achieve an immutable structureModifier 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 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 |
---|---|
boolean |
equals(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() |
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.
|
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, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getEndPosition, getFirstElement, getFirstElementIncludingBlocks, getLastElement, getPositionInfo, getRelativePosition, getStartPosition, visit
private static final Comment[] NO_COMMENTS
private final Comment[] comments
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 ProgramElement
public void prettyPrint(PrettyPrinter w) throws IOException
JavaSourceElement
prettyPrint
in interface SourceElement
prettyPrint
in class JavaSourceElement
w
- a pretty printer.IOException
- occasionally thrown.protected void prettyPrintMain(PrettyPrinter w) throws IOException
IOException
public boolean equalsModRenaming(SourceElement se, NameAbstractionTable nat)
equalsModRenaming
in interface SourceElement
public String reuseSignature(Services services, ExecutionContext ec)
ec
- TODOpublic MatchConditions match(SourceData source, MatchConditions matchCond)
ProgramElement
MatchConditions
with
the found instantiations of the schemavariables. If the match
failed, null is returned instead.match
in interface ProgramElement
source
- the SourceData with the program element to matchmatchCond
- the MatchConditions found up to this point