Package org.fife.rsta.ac.java.rjc.ast
Class NormalClassDeclaration
- java.lang.Object
-
- org.fife.rsta.ac.java.rjc.ast.AbstractASTNode
-
- org.fife.rsta.ac.java.rjc.ast.AbstractTypeDeclarationNode
-
- org.fife.rsta.ac.java.rjc.ast.NormalClassDeclaration
-
- All Implemented Interfaces:
ASTNode,TypeDeclaration,TypeDeclarationContainer
public class NormalClassDeclaration extends AbstractTypeDeclarationNode
A class declaration. Its structure is as follows:NormalClassDeclaration: 'class' Identifier [TypeParameters] ['extends' Type] ['implements' TypeList] ClassBody- Version:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private TypeextendedTypeprivate java.util.List<Type>implementedListprivate java.util.List<TypeParameter>typeParams
-
Constructor Summary
Constructors Constructor Description NormalClassDeclaration(Scanner s, int offs, java.lang.String className)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddImplemented(Type implemented)Adds an implemented type to this class declaration.TypegetExtendedType()intgetImplementedCount()java.util.Iterator<Type>getImplementedIterator()MethodgetMethodContainingOffset(int offs)Gets the method in this class that contains a given offset.java.util.List<TypeParameter>getTypeParameters()java.lang.StringgetTypeString()Returns the type of this type declaration, as a string.private booleanisTypeCompatible(Type type, java.lang.String typeName)Returns whether aTypeand a type name are type compatible.voidsetExtendedType(Type type)voidsetTypeParameters(java.util.List<TypeParameter> typeParams)-
Methods inherited from class org.fife.rsta.ac.java.rjc.ast.AbstractTypeDeclarationNode
addMember, addTypeDeclaration, getBodyContainsOffset, getBodyEndOffset, getBodyStartOffset, getChildType, getChildTypeAtOffset, getChildTypeCount, getDocComment, getFieldIterator, getMember, getMemberCount, getMemberIterator, getMethodIterator, getMethodsByName, getModifiers, getName, getPackage, getParentType, isDeprecated, isStatic, setBodyEndOffset, setBodyStartOffset, setDeprecated, setDocComment, setModifiers, setPackage, setParentType, toString
-
Methods inherited from class org.fife.rsta.ac.java.rjc.ast.AbstractASTNode
getName, getNameEndOffset, getNameStartOffset, setDeclarationEndOffset, setDeclarationOffsets
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.fife.rsta.ac.java.rjc.ast.ASTNode
getNameEndOffset, getNameStartOffset
-
Methods inherited from interface org.fife.rsta.ac.java.rjc.ast.TypeDeclaration
getName
-
-
-
-
Field Detail
-
typeParams
private java.util.List<TypeParameter> typeParams
-
extendedType
private Type extendedType
-
implementedList
private java.util.List<Type> implementedList
-
-
Constructor Detail
-
NormalClassDeclaration
public NormalClassDeclaration(Scanner s, int offs, java.lang.String className)
-
-
Method Detail
-
addImplemented
public void addImplemented(Type implemented)
Adds an implemented type to this class declaration.- Parameters:
implemented- The implemented type.
-
getExtendedType
public Type getExtendedType()
-
getImplementedCount
public int getImplementedCount()
-
getImplementedIterator
public java.util.Iterator<Type> getImplementedIterator()
-
getMethodContainingOffset
public Method getMethodContainingOffset(int offs)
Gets the method in this class that contains a given offset.- Parameters:
offs- The offset.- Returns:
- The method containing the offset, or
nullif no method in this class contains the offset.
-
getTypeParameters
public java.util.List<TypeParameter> getTypeParameters()
-
getTypeString
public java.lang.String getTypeString()
Description copied from interface:TypeDeclarationReturns the type of this type declaration, as a string.- Returns:
- The type.
-
isTypeCompatible
private boolean isTypeCompatible(Type type, java.lang.String typeName)
Returns whether aTypeand a type name are type compatible. This method currently is a sham!- Parameters:
type- The type to check against.typeName- The type name to also check.- Returns:
- Whether they are type-compatible.
-
setExtendedType
public void setExtendedType(Type type)
-
setTypeParameters
public void setTypeParameters(java.util.List<TypeParameter> typeParams)
-
-