Package org.fife.rsta.ac.java.rjc.lang
Class Type
- java.lang.Object
-
- org.fife.rsta.ac.java.rjc.lang.Type
-
public class Type extends java.lang.ObjectA type.Type: Identifier [TypeArguments] { . Identifier [TypeArguments] } {[]} BasicType- Version:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private intbracketPairCountprivate java.util.List<java.lang.String>identifiersprivate java.util.List<java.util.List<TypeArgument>>typeArguments
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddIdentifier(java.lang.String identifier, java.util.List<TypeArgument> typeArgs)Adds an identifier to this type.intgetIdentifierCount()java.lang.StringgetName(boolean fullyQualified)Returns the name of this type.java.lang.StringgetName(boolean fullyQualified, boolean addTypeArgs)Returns the name of this type.java.util.List<TypeArgument>getTypeArguments(int index)Returns a set of type arguments by index.voidincrementBracketPairCount(int count)Increments an internally-used count of bracket pairs.booleanisArray()Returns whether this type is an array.booleanisBasicType()Returns whether this is a basic type (e.g.voidsetBracketPairCount(int count)java.lang.StringtoString()Returns a string representation of this type.
-
-
-
Field Detail
-
identifiers
private java.util.List<java.lang.String> identifiers
-
typeArguments
private java.util.List<java.util.List<TypeArgument>> typeArguments
-
bracketPairCount
private int bracketPairCount
-
-
Method Detail
-
addIdentifier
public void addIdentifier(java.lang.String identifier, java.util.List<TypeArgument> typeArgs)Adds an identifier to this type.- Parameters:
identifier- The identifier.typeArgs- The type arguments for the identifier. This may benullor an empty list if there are none.
-
getIdentifierCount
public int getIdentifierCount()
-
getName
public java.lang.String getName(boolean fullyQualified)
Returns the name of this type.- Parameters:
fullyQualified- Whether the returned value should be fully qualified.- Returns:
- The name of this type. This will include type arguments, if any.
- See Also:
getName(boolean, boolean)
-
getName
public java.lang.String getName(boolean fullyQualified, boolean addTypeArgs)Returns the name of this type.- Parameters:
fullyQualified- Whether the returned value should be fully qualified.addTypeArgs- Whether type arguments should be at the end of the returned string, if any.- Returns:
- The name of this type.
- See Also:
getName(boolean)
-
getTypeArguments
public java.util.List<TypeArgument> getTypeArguments(int index)
Returns a set of type arguments by index.- Parameters:
index- The index.- Returns:
- The type arguments.
-
incrementBracketPairCount
public void incrementBracketPairCount(int count)
Increments an internally-used count of bracket pairs.- Parameters:
count- The amount to increment by.
-
isArray
public boolean isArray()
Returns whether this type is an array.- Returns:
- Whether this type is an array.
-
isBasicType
public boolean isBasicType()
Returns whether this is a basic type (e.g. a primitive type).- Returns:
- Whther this is a basic type.
-
setBracketPairCount
public void setBracketPairCount(int count)
-
toString
public java.lang.String toString()
Returns a string representation of this type. The type name will be fully qualified.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of this type.
- See Also:
getName(boolean)
-
-