com.veromodo.tempo.sem.type
Class TypeFunctionalGeneric

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.TypeFunctionalGeneric
All Implemented Interfaces:
java.lang.Comparable<Type>

public class TypeFunctionalGeneric
extends TypeFunctional

a specialized version of TypeGeneric which has the notion of a functional type. i.e it's aware of it's internal type's domain and codomain. idealy this class would be a subclass of both TypeGeneric and TypeFunctional the embedGeneric function was created to ensure that the correct type of generic wrapper is created with constructing a generic type


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 addParam(TypeParameter t)
           
 Type.Order compare(Type t)
          Determines how Type t is realted to this.
 boolean constructedWith(Type[] at)
           
 TypeFunctionalGeneric downCastFunctionalGeneric()
           
 Type getCoDom()
           
 TypeTuple getDom()
           
 java.lang.Iterable<TypeParameter> getFormals()
           
 java.lang.String getName()
           
 int hashCode()
           
 java.lang.String internalName()
           
 boolean is(Type.TypeKind kind)
          Determines if the currently instance is of given TypeKind.
 boolean isEqualTo(Type t)
           
 Type resolve()
          Replaces any bound type parameters with thier bound types.
 Type select(java.lang.String with)
          Returns the type of the given parameter with wrapped in a TypeFunction this ? FT, where FT is the type of the parameter being dereferenced.
 void setBase(TypeFunctional t)
           
 java.lang.String toString()
           
 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, downCastGeneric, downCastInstance, downCastInt, downCastInt32, downCastList, downCastMap, downCastMeta, downCastNat, downCastNumeric, downCastParameter, downCastReal, downCastSum, downCastTuple, downCastVoid, equals, equals, isArray, isAugmentedReal, isAutomaton, isBasicAutomaton, isBool, isChar, isCompositeAutomaton, isConstructor, isDiscreteReal, isEnum, isEnumValue, isError, isFloat, isFun, isFunctional, isFunctionalGeneric, isGeneric, isId, isIndexed, isInstance, isInt, isInt32, isList, isMap, isMeta, isNat, isNumeric, isParameter, isReal, isSum, isTuple, isVariable, isVoid, lub
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

select

public Type select(java.lang.String with)
Description copied from class: Type
Returns the type of the given parameter with wrapped in a TypeFunction this ? FT, where FT is the type of the parameter being dereferenced. If the parameter is not found, null it returned.

select returns a function instead of simply returning the type FT because it can more seamlessly integrate with the type checker.

Overrides:
select in class Type
Parameters:
with - the parameter to select
Returns:
a TypeFunction this ? TypeOf(with)

constructedWith

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

addParam

public void addParam(TypeParameter t)

setBase

public void setBase(TypeFunctional t)

getName

public java.lang.String getName()
Overrides:
getName in class Type

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

downCastFunctionalGeneric

public TypeFunctionalGeneric downCastFunctionalGeneric()
Overrides:
downCastFunctionalGeneric in class Type

resolve

public Type resolve()
Description copied from class: Type
Replaces any bound type parameters with thier bound types. If all parameters are bound, the resulting type is not generic. If no parameters are bounf, the resulting type is this.

Overrides:
resolve in class Type
Returns:
a resolved type

isEqualTo

public boolean isEqualTo(Type t)
Overrides:
isEqualTo 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:

toString

public java.lang.String toString()
Overrides:
toString in class Type

internalName

public java.lang.String internalName()

getFormals

public java.lang.Iterable<TypeParameter> getFormals()

visit

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

hashCode

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

getDom

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

getCoDom

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