com.veromodo.tempo.sem.type
Class TypeIndexed

java.lang.Object
  extended by com.veromodo.tempo.sem.type.Type
      extended by com.veromodo.tempo.sem.type.TypeFunctional
          extended by com.veromodo.tempo.sem.type.TypeIndexed
All Implemented Interfaces:
java.lang.Comparable<Type>
Direct Known Subclasses:
TypeArray, TypeMap

public abstract class TypeIndexed
extends TypeFunctional

Represents types which are indexed with the [] operator TypeArray, TypeMap In TIOA indexed types are specified with their base type as the last type in their parameter list

Author:
Carleton

Nested Class Summary
 
Nested classes/interfaces inherited from class com.veromodo.tempo.sem.type.Type
Type.Order, Type.TypeKind
 
Field Summary
 
Fields inherited from class com.veromodo.tempo.sem.type.Type
_name, DEFAULT_NAME
 
Method Summary
 void addIndex(int p, Type t)
           
 Type.Order compare(Type t)
          Determines how Type t is realted to this.
 boolean constructedWith(Type[] at)
           
 int getArity()
           
 Type getBase()
           
 Type getCoDom()
           
 TypeTuple getDom()
           
 TypeFunction getFunction()
           
 Type getIndex(int p)
           
 int hashCode()
           
 boolean is(Type.TypeKind kind)
          Determines if the currently instance is of given TypeKind.
 void visit(TypeVisitor v)
           
 
Methods inherited from class com.veromodo.tempo.sem.type.TypeFunctional
downCastFunctional
 
Methods inherited from class com.veromodo.tempo.sem.type.Type
accept, acceptable, compareTo, downCastArray, downCastAugmentedReal, downCastAutomaton, downCastBasicAutomaton, downCastBool, downCastChar, downCastCompositeAutomaton, downCastConstructor, downCastDiscreteReal, downCastEnum, downCastEnumValue, downCastFloat, downCastFunction, downCastFunctionalGeneric, downCastGeneric, downCastInstance, downCastInt, downCastInt32, downCastList, downCastMap, downCastMeta, downCastNat, downCastNumeric, downCastParameter, downCastReal, downCastSum, downCastTuple, downCastVoid, equals, equals, getName, isArray, isAugmentedReal, isAutomaton, isBasicAutomaton, isBool, isChar, isCompositeAutomaton, isConstructor, isDiscreteReal, isEnum, isEnumValue, isEqualTo, isError, isFloat, isFun, isFunctional, isFunctionalGeneric, isGeneric, isId, isIndexed, isInstance, isInt, isInt32, isList, isMap, isMeta, isNat, isNumeric, isParameter, isReal, isSum, isTuple, isVariable, isVoid, lub, resolve, select, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

is

public boolean is(Type.TypeKind kind)
Description copied from class: Type
Determines if the currently instance is of given TypeKind.

Overrides:
is in class TypeFunctional
Parameters:
kind - the type of class to compare to
Returns:
true if this is of given TypeKind

getArity

public int getArity()

getBase

public Type getBase()

addIndex

public void addIndex(int p,
                     Type t)

getIndex

public Type getIndex(int p)

constructedWith

public boolean constructedWith(Type[] at)
Overrides:
constructedWith in class Type

compare

public Type.Order compare(Type t)
Description copied from class: Type
Determines how Type t is realted to this.

Specified by:
compare in class TypeFunctional
Parameters:
t - to compare to this
Returns:

getDom

public TypeTuple getDom()
Specified by:
getDom in class TypeFunctional

getCoDom

public Type getCoDom()
Specified by:
getCoDom in class TypeFunctional

getFunction

public TypeFunction getFunction()

visit

public void visit(TypeVisitor v)
Overrides:
visit in class TypeFunctional

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object