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 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, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetEndPosition, getFirstElement, getFirstElementIncludingBlocks, getLastElement, getPositionInfo, getRelativePosition, getStartPosition, visitprivate 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 ProgramElementpublic void prettyPrint(PrettyPrinter w) throws IOException
JavaSourceElementprettyPrint in interface SourceElementprettyPrint in class JavaSourceElementw - a pretty printer.IOException - occasionally thrown.protected void prettyPrintMain(PrettyPrinter w) throws IOException
IOExceptionpublic boolean equalsModRenaming(SourceElement se, NameAbstractionTable nat)
equalsModRenaming in interface SourceElementpublic 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