Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

mlsub.typing
Class TypeConstructor  view TypeConstructor download TypeConstructor.java

java.lang.Object
  extended bymlsub.typing.TypeConstructor
All Implemented Interfaces:
mlsub.typing.lowlevel.Element, TypeSymbol

public class TypeConstructor
extends java.lang.Object
implements mlsub.typing.lowlevel.Element, TypeSymbol

A class. It "needs" type parameters to become a Monotype


Field Summary
private  boolean concrete
           
 int enumerateTagIndex
          Fields
private  int id
          Kinding
private  mlsub.typing.lowlevel.Kind kind
           
(package private)  java.lang.String name
           
private  boolean rigid
           
 AtomicKind variance
           
 
Constructor Summary
TypeConstructor(AtomicKind v)
          Creates an anonymous non-concrete TypeConstructor with a known variance.
TypeConstructor(java.lang.String name)
          Creates a non rigid type constructor.
TypeConstructor(java.lang.String name, AtomicKind v, boolean concrete, boolean rigid)
          Creates a TypeConstructor.
 
Method Summary
 int arity()
           
 TypeSymbol cloneTypeSymbol()
           
static TypeConstructor fromTypeSymbol(TypeSymbol s)
           
 int getId()
           
 mlsub.typing.lowlevel.Kind getKind()
           
 boolean isConcrete()
          Returns true if this element can exist at runtime.
 boolean isMinimal()
           
 boolean isRigid()
           
 void setId(int value)
           
 void setKind(mlsub.typing.lowlevel.Kind value)
           
 void setMinimal()
           
 void setVariance(AtomicKind v)
          Tell which variance this TypeConstructor has.
 java.lang.String toString()
          Misc
 java.lang.String toString(Monotype[] parameters)
          Create a string representing the monotype build by application of this type constructor to the given parameters.
 java.lang.String toString(Monotype[] parameters, boolean isNull, java.lang.String suffix)
          Print the monotype when it can be null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

private int id
Kinding


kind

private mlsub.typing.lowlevel.Kind kind

enumerateTagIndex

public int enumerateTagIndex
Fields


variance

public AtomicKind variance

concrete

private boolean concrete

rigid

private boolean rigid

name

java.lang.String name
Constructor Detail

TypeConstructor

public TypeConstructor(java.lang.String name,
                       AtomicKind v,
                       boolean concrete,
                       boolean rigid)
Creates a TypeConstructor. A concrete TC is a TC that can tag runtime objects.


TypeConstructor

public TypeConstructor(java.lang.String name)
Creates a non rigid type constructor.


TypeConstructor

public TypeConstructor(AtomicKind v)
Creates an anonymous non-concrete TypeConstructor with a known variance.

Method Detail

setMinimal

public void setMinimal()

isMinimal

public boolean isMinimal()

cloneTypeSymbol

public TypeSymbol cloneTypeSymbol()
Specified by:
cloneTypeSymbol in interface TypeSymbol

fromTypeSymbol

public static TypeConstructor fromTypeSymbol(TypeSymbol s)

setVariance

public void setVariance(AtomicKind v)
Tell which variance this TypeConstructor has. Can be called from ImplementsCst.


arity

public int arity()

isConcrete

public boolean isConcrete()
Description copied from interface: mlsub.typing.lowlevel.Element
Returns true if this element can exist at runtime.

Specified by:
isConcrete in interface mlsub.typing.lowlevel.Element

getId

public int getId()
Specified by:
getId in interface mlsub.typing.lowlevel.Element

setId

public void setId(int value)
Specified by:
setId in interface mlsub.typing.lowlevel.Element

getKind

public mlsub.typing.lowlevel.Kind getKind()
Specified by:
getKind in interface mlsub.typing.lowlevel.Element

setKind

public void setKind(mlsub.typing.lowlevel.Kind value)
Specified by:
setKind in interface mlsub.typing.lowlevel.Element

toString

public java.lang.String toString()
Misc


toString

public java.lang.String toString(Monotype[] parameters)
Create a string representing the monotype build by application of this type constructor to the given parameters. This default implementation returns "tc". It should be overriden by type constructors that print differently. For instance, the array tape constructor could return "p1[]".


toString

public java.lang.String toString(Monotype[] parameters,
                                 boolean isNull,
                                 java.lang.String suffix)
Print the monotype when it can be null.


isRigid

public final boolean isRigid()