javax.lang
クラス Variant

java.lang.Object
  拡張javax.lang.Variant
直系の既知のサブクラス:
Atom, BooleanExpression, Command, Event, Expression, LeftValue, MemoryData, Pattern, Term, Value

public class Variant
extends java.lang.Object

A base-class for variant-like data structure
Variant is also known as 'union'. A variant value can represent one value among multiple choices. From the functional viewpoint, variants are dual to records, or 'structs'.

作成者:
Toshihiro YOSHINO

入れ子クラスの概要
static class Variant.InvalidTypeException
          An exception class thrown when the type (tag) of a variant is not the one which the program requires.
 
コンストラクタの概要
protected Variant(int type)
          Constructs a Variant object.
 
メソッドの概要
protected  void assertType(int type)
          Assure the type of this object.
 int getType()
          Obtain the tag.
 java.lang.String toString()
          Pretty-print this object.
protected  Variant.InvalidTypeException unsupportedException(java.lang.String where)
          Helper method for generating InvalidTypeException
protected  Variant.InvalidTypeException unsupportedException(java.lang.String where, java.lang.String message)
          Helper method for generating InvalidTypeException
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

Variant

protected Variant(int type)
Constructs a Variant object.

パラメータ:
type - Tag
メソッドの詳細

getType

public final int getType()
Obtain the tag.

戻り値:
tag

assertType

protected final void assertType(int type)
Assure the type of this object. If the tag is not equal to type, InvalidTypeException is thrown.

パラメータ:
type - Tag
例外:
Variant.InvalidTypeException - when the assertion getType() == type failed.

unsupportedException

protected final Variant.InvalidTypeException unsupportedException(java.lang.String where)
Helper method for generating InvalidTypeException

パラメータ:
where - Place identifier.
戻り値:
InvalidTypeException object.

unsupportedException

protected final Variant.InvalidTypeException unsupportedException(java.lang.String where,
                                                                  java.lang.String message)
Helper method for generating InvalidTypeException

パラメータ:
where - Place identifier.
戻り値:
InvalidTypeException object.

toString

public java.lang.String toString()
Pretty-print this object.

戻り値:
string representation of this object.