org.qtitools.qti.value
Enum BaseType

java.lang.Object
  extended by java.lang.Enum<BaseType>
      extended by org.qtitools.qti.value.BaseType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<BaseType>

public enum BaseType
extends java.lang.Enum<BaseType>

This class describes single data types.

Supported single data types: identifier, boolean, integer, float, string, point, pair, directedPair, duration, file, uri.

Author:
Jiri Kajaba
See Also:
IdentifierValue, BooleanValue, IntegerValue, FloatValue, StringValue, PointValue, PairValue, DirectedPairValue, DurationValue, FileValue, UriValue

Enum Constant Summary
BOOLEAN
          Boolean baseType.
DIRECTED_PAIR
          DirectedPair baseType.
DURATION
          Duration baseType.
FILE
          File baseType.
FLOAT
          Float baseType.
IDENTIFIER
          Identifier baseType.
INTEGER
          Integer baseType.
PAIR
          Pair baseType.
POINT
          Point baseType.
STRING
          String baseType.
URI
          URI baseType.
 
Field Summary
static java.lang.String CLASS_TAG
          Name of this class in xml schema.
 
Method Summary
static BaseType[] intersection(BaseType[] firstSet, BaseType[] secondSet)
          Returns intersection of two given baseTypes sets (order is not important).
 boolean isBoolean()
          Returns true if this baseType is boolean; false otherwise.
 boolean isDirectedPair()
          Returns true if this baseType is directedPair; false otherwise.
 boolean isDuration()
          Returns true if this baseType is duration; false otherwise.
 boolean isFile()
          Returns true if this baseType is file; false otherwise.
 boolean isFloat()
          Returns true if this baseType is float; false otherwise.
 boolean isIdentifier()
          Returns true if this baseType is identifier; false otherwise.
 boolean isInteger()
          Returns true if this baseType is integer; false otherwise.
 boolean isNumeric()
          Returns true if this baseType is integer or float; false otherwise.
 boolean isPair()
          Returns true if this baseType is pair; false otherwise.
 boolean isPoint()
          Returns true if this baseType is point; false otherwise.
 boolean isString()
          Returns true if this baseType is string; false otherwise.
 boolean isUri()
          Returns true if this baseType is uri; false otherwise.
static BaseType parseBaseType(java.lang.String baseType)
          Returns parsed BaseType from given String.
abstract  SingleValue parseSingleValue(java.lang.String singleValue)
          Parses the String argument as A SingleValue.
 java.lang.String toString()
           
static BaseType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static BaseType[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
static BaseType[] values(BaseType[] exclude)
          Returns all supported baseTypes except of baseTypes in given parameter.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

IDENTIFIER

public static final BaseType IDENTIFIER
Identifier baseType.

See Also:
IdentifierValue

BOOLEAN

public static final BaseType BOOLEAN
Boolean baseType.

See Also:
BooleanValue

INTEGER

public static final BaseType INTEGER
Integer baseType.

See Also:
IntegerValue

FLOAT

public static final BaseType FLOAT
Float baseType.

See Also:
FloatValue

STRING

public static final BaseType STRING
String baseType.

See Also:
StringValue

POINT

public static final BaseType POINT
Point baseType.

See Also:
PointValue

PAIR

public static final BaseType PAIR
Pair baseType.

See Also:
PairValue

DIRECTED_PAIR

public static final BaseType DIRECTED_PAIR
DirectedPair baseType.

See Also:
DirectedPairValue

DURATION

public static final BaseType DURATION
Duration baseType.

See Also:
DurationValue

FILE

public static final BaseType FILE
File baseType.

See Also:
FileValue

URI

public static final BaseType URI
URI baseType.

See Also:
UriValue
Field Detail

CLASS_TAG

public static final java.lang.String CLASS_TAG
Name of this class in xml schema.

See Also:
Constant Field Values
Method Detail

values

public static final BaseType[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(BaseType c : BaseType.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static BaseType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

isIdentifier

public boolean isIdentifier()
Returns true if this baseType is identifier; false otherwise.

Returns:
true if this baseType is identifier; false otherwise

isBoolean

public boolean isBoolean()
Returns true if this baseType is boolean; false otherwise.

Returns:
true if this baseType is boolean; false otherwise

isNumeric

public boolean isNumeric()
Returns true if this baseType is integer or float; false otherwise.

Returns:
true if this baseType is integer or float; false otherwise

isInteger

public boolean isInteger()
Returns true if this baseType is integer; false otherwise.

Returns:
true if this baseType is integer; false otherwise

isFloat

public boolean isFloat()
Returns true if this baseType is float; false otherwise.

Returns:
true if this baseType is float; false otherwise

isString

public boolean isString()
Returns true if this baseType is string; false otherwise.

Returns:
true if this baseType is string; false otherwise

isPoint

public boolean isPoint()
Returns true if this baseType is point; false otherwise.

Returns:
true if this baseType is point; false otherwise

isPair

public boolean isPair()
Returns true if this baseType is pair; false otherwise.

Returns:
true if this baseType is pair; false otherwise

isDirectedPair

public boolean isDirectedPair()
Returns true if this baseType is directedPair; false otherwise.

Returns:
true if this baseType is directedPair; false otherwise

isDuration

public boolean isDuration()
Returns true if this baseType is duration; false otherwise.

Returns:
true if this baseType is duration; false otherwise

isFile

public boolean isFile()
Returns true if this baseType is file; false otherwise.

Returns:
true if this baseType is file; false otherwise

isUri

public boolean isUri()
Returns true if this baseType is uri; false otherwise.

Returns:
true if this baseType is uri; false otherwise

parseSingleValue

public abstract SingleValue parseSingleValue(java.lang.String singleValue)
                                      throws QTIParseException
Parses the String argument as A SingleValue.

Parameters:
singleValue - String representation of SingleValue
Returns:
parsed SingleValue
Throws:
QTIParseException - if String representation of SingleValue is not valid

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Enum<BaseType>

parseBaseType

public static BaseType parseBaseType(java.lang.String baseType)
                              throws QTIParseException
Returns parsed BaseType from given String.

Parameters:
baseType - String representation of BaseType
Returns:
parsed BaseType from given String
Throws:
QTIParseException - if given String is not valid BaseType

values

public static BaseType[] values(BaseType[] exclude)
Returns all supported baseTypes except of baseTypes in given parameter. Result is baseType.values() - exclude.

Parameters:
exclude - excluded baseTypes
Returns:
all supported baseTypes except of baseTypes in given parameter

intersection

public static BaseType[] intersection(BaseType[] firstSet,
                                      BaseType[] secondSet)
Returns intersection of two given baseTypes sets (order is not important).

Parameters:
firstSet - first set of baseTypes
secondSet - second set of baseType
Returns:
intersection of two given baseTypes sets


Copyright © 2009. All Rights Reserved.