antlraux package
v0.2.1

antlraux.context.types
Class CommonType

java.lang.Object
  |
  +--antlraux.context.types.CommonType
All Implemented Interfaces:
Type
Direct Known Subclasses:
DeclaredType

public class CommonType
extends java.lang.Object
implements Type

A very basic implementation of Type. This class can be used to modelize the basic types of a languaje (like int or float). For more complex types, use a subclass, for example DeclaredType

Author:
Enrique José García Cota

Field Summary
protected  java.lang.String name
           
protected  int tag
           
 
Fields inherited from interface antlraux.context.types.Type
DEFAULT_NAME, DEFAULT_TAG
 
Constructor Summary
CommonType()
           
CommonType(int tag, java.lang.String name)
           
 
Method Summary
 boolean equals(java.lang.Object other)
           
 java.lang.String getName()
          Returns the Type's name
 int getTag()
          Returns the Type's tag
 void setName(java.lang.String s)
          Sets the Type's name.
 void setTag(int tag)
          Sets the Type's tag
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

tag

protected int tag
Constructor Detail

CommonType

public CommonType()

CommonType

public CommonType(int tag,
                  java.lang.String name)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: Type
Returns the Type's name

Specified by:
getName in interface Type

getTag

public int getTag()
Description copied from interface: Type
Returns the Type's tag

Specified by:
getTag in interface Type

setName

public void setName(java.lang.String s)
Description copied from interface: Type
Sets the Type's name. It is recommended to check if the new name is null or empty string ("") and throw IllegalArgumentException in that case.

Specified by:
setName in interface Type

setTag

public void setTag(int tag)
Description copied from interface: Type
Sets the Type's tag

Specified by:
setTag in interface Type

equals

public boolean equals(java.lang.Object other)
Specified by:
equals in interface Type
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Specified by:
toString in interface Type
Overrides:
toString in class java.lang.Object

antlraux package
v0.2.1

Created by Enrique José García Cota