com.veromodo.tempo.sem.type
Class TypeBasicAutomaton

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.TypeAutomaton
              extended by com.veromodo.tempo.sem.type.TypeBasicAutomaton
All Implemented Interfaces:
java.lang.Comparable<Type>

public class TypeBasicAutomaton
extends TypeAutomaton

Defines the type of a basic automaton In addition to the properties defined in {@link TypeAutomaton) this type adds,
1) State types
2) Signature types
This type is similar to a Class type in OOP languages, where states are attributes and signatures a methods.

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
 
Constructor Summary
TypeBasicAutomaton(java.lang.String s)
           
 
Method Summary
 void addState(java.lang.String s, Type t)
           
 Type.Order compare(Type t)
          Determines how Type t is realted to this.
 TypeBasicAutomaton downCastBasicAutomaton()
           
 Type getCoDom()
           
 TypeTuple getDom()
           
 Type getState(java.lang.String s)
           
 java.util.Set<java.lang.String> getStateNames()
           
 int hashCode()
           
 boolean is(Type.TypeKind kind)
          Determines if the currently instance is of given TypeKind.
 Type resolve()
          Replaces any bound type parameters with thier bound types.
 Type select(java.lang.String with)
          Create a function type -> FT which correspond to the application of the dereference operator 'with'.
 java.lang.String toString()
           
 void visit(TypeVisitor v)
           
 
Methods inherited from class com.veromodo.tempo.sem.type.TypeAutomaton
addParameter, downCastAutomaton, getParameter
 
Methods inherited from class com.veromodo.tempo.sem.type.TypeFunctional
downCastFunctional
 
Methods inherited from class com.veromodo.tempo.sem.type.Type
accept, acceptable, compareTo, constructedWith, downCastArray, downCastAugmentedReal, 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
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TypeBasicAutomaton

public TypeBasicAutomaton(java.lang.String s)
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 TypeAutomaton
Parameters:
kind - the type of class to compare to
Returns:
true if this is of given TypeKind

downCastBasicAutomaton

public TypeBasicAutomaton downCastBasicAutomaton()
Overrides:
downCastBasicAutomaton in class Type

compare

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

Overrides:
compare in class TypeAutomaton
Parameters:
t - to compare to this
Returns:

getState

public Type getState(java.lang.String s)

addState

public void addState(java.lang.String s,
                     Type t)

getStateNames

public java.util.Set<java.lang.String> getStateNames()

toString

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

select

public Type select(java.lang.String with)
Create a function type -> FT which correspond to the application of the dereference operator 'with'. 'with' must be a field of the tuple and the dereference operator is seen as a curried function from the tuple type to the field type. returns If no field named 'with' exist, no function type is returned (i.e., return null)

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

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

visit

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

hashCode

public int hashCode()
Overrides:
hashCode in class TypeAutomaton

getDom

public TypeTuple getDom()
Overrides:
getDom in class TypeAutomaton

getCoDom

public Type getCoDom()
Overrides:
getCoDom in class TypeAutomaton