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

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

public class Type
extends Object

A type.

 Type:
    Identifier [TypeArguments] { . Identifier [TypeArguments] } {[]}
    BasicType
 

Version:
1.0
Author:
Robert Futrell

Constructor Summary
Type()
           
Type(String identifier)
           
Type(String identifier, int bracketPairCount)
           
 
Method Summary
 void addIdentifier(String identifier, List typeArgs)
          Adds an identifier to this type.
 int getIdentifierCount()
           
 String getName(boolean fullyQualified)
          Returns the name of this type.
 String getName(boolean fullyQualified, boolean addTypeArgs)
          Returns the name of this type.
 List getTypeArguments(int index)
           
 void incrementBracketPairCount(int count)
           
 boolean isArray()
          Returns whether this type is an array.
 boolean isBasicType()
           
 void setBracketPairCount(int count)
           
 String toString()
          Returns a string representation of this type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Type

public Type()

Type

public Type(String identifier)

Type

public Type(String identifier,
            int bracketPairCount)
Method Detail

addIdentifier

public void addIdentifier(String identifier,
                          List 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(boolean, boolean)

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:
getName(boolean)

getTypeArguments

public List getTypeArguments(int index)

incrementBracketPairCount

public void incrementBracketPairCount(int count)

isArray

public boolean isArray()
Returns whether this type is an array.

Returns:
Whether this type is an array.

isBasicType

public boolean isBasicType()

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:
getName(boolean)


Copyright © 2003-2011. All Rights Reserved.