Class Type

java.lang.Object
org.fife.rsta.ac.java.rjc.lang.Type

public class Type extends Object
A type.
Type:
   Identifier [TypeArguments] { . Identifier [TypeArguments] } {[]}
   BasicType
Version:
1.0
  • Field Details

    • identifiers

      private List<String> identifiers
    • typeArguments

      private List<List<TypeArgument>> typeArguments
    • bracketPairCount

      private int bracketPairCount
  • Constructor Details

    • Type

      public Type()
    • Type

      public Type(String identifier)
    • Type

      public Type(String identifier, int bracketPairCount)
  • Method Details

    • addIdentifier

      public void addIdentifier(String identifier, List<TypeArgument> typeArgs)
      Adds an identifier to this type.
      Parameters:
      identifier - The identifier.
      typeArgs - The type arguments for the identifier. This may be null or an empty list if there are none.
    • getIdentifierCount

      public int getIdentifierCount()
    • getName

      public 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

      public 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:
    • getTypeArguments

      public 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 String toString()
      Returns a string representation of this type. The type name will be fully qualified.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this type.
      See Also: