uk.ac.man.cs.rainbow.datamodel
Interface Data.Union.T

All Known Implementing Classes:
Type.Union
Enclosing class:
Data.Union

public static interface Data.Union.T

What special operations must the type of a union implement?


Method Summary
 int countTags()
          How many tags are there?
 int getIndex(String tag)
          Convert a tag string to the corresponding tag index.
 String getTag(int idx)
          Get the name of the idxth tag.
 Type getTagEnumeration()
          Get an enumeration of the tags.
 Type getType(int idx)
          Get the type of the idxth tag.
 String render(Expression contents, int index)
          Render a union, given the value and tag that the union is defined by.
 

Method Detail

render

public String render(Expression contents,
                     int index)
Render a union, given the value and tag that the union is defined by.

getIndex

public int getIndex(String tag)
             throws TypeException
Convert a tag string to the corresponding tag index.
Throws:
TypeException - If the tag string is unknown in the type.

countTags

public int countTags()
How many tags are there?

getType

public Type getType(int idx)
Get the type of the idxth tag.

getTag

public String getTag(int idx)
              throws TypeException
Get the name of the idxth tag.
Throws:
TypeException - If the index is out of range.

getTagEnumeration

public Type getTagEnumeration()
                       throws TypeException
Get an enumeration of the tags.