public abstract class JavaProgramElement extends JavaSourceElement implements ProgramElement
ProgramElement
.
taken from COMPOST and changed to achieve an immutable structureConstructor 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.
|
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, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getEndPosition, getFirstElement, getFirstElementIncludingBlocks, getLastElement, getPositionInfo, getRelativePosition, getStartPosition, visit
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)
public Comment[] getComments()
getComments
in interface ProgramElement
public void prettyPrint(PrettyPrinter w) throws java.io.IOException
JavaSourceElement
prettyPrint
in interface SourceElement
prettyPrint
in class JavaSourceElement
w
- a pretty printer.java.io.IOException
- occasionally thrown.protected void prettyPrintMain(PrettyPrinter w) throws java.io.IOException
java.io.IOException
public boolean equalsModRenaming(SourceElement se, NameAbstractionTable nat)
equalsModRenaming
in interface SourceElement
protected int computeHashCode()
public final int hashCode()
computeHashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.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 pointCopyright © 2003-2019 The KeY-Project.