xtc.type
Class IntegerT

java.lang.Object
  extended by xtc.tree.Node
      extended by xtc.type.Type
          extended by xtc.type.NumberT
              extended by xtc.type.IntegerT
All Implemented Interfaces:
java.lang.Iterable<java.lang.Object>, Locatable

public class IntegerT
extends NumberT

An integer type.

Version:
$Revision: 1.36 $
Author:
Robert Grimm

Nested Class Summary
 
Nested classes/interfaces inherited from class xtc.type.NumberT
NumberT.Kind
 
Nested classes/interfaces inherited from class xtc.type.Type
Type.Tag
 
Field Summary
 
Fields inherited from class xtc.type.NumberT
BYTE, CHAR, DOUBLE, DOUBLE_COMPLEX, FLOAT, FLOAT_COMPLEX, INT, kind, LONG, LONG_DOUBLE, LONG_DOUBLE_COMPLEX, LONG_LONG, S_CHAR, S_INT, SHORT, U_CHAR, U_INT, U_LONG, U_LONG_LONG, U_SHORT
 
Constructor Summary
IntegerT(NumberT.Kind kind)
          Create a new integer type.
IntegerT(Type template, NumberT.Kind kind)
          Create a new integer type.
 
Method Summary
 IntegerT copy()
          Create a deep copy of this type.
static NumberT.Kind fromRank(int rank, boolean signed)
          Convert the specified rank to the corresponding integer kind.
 boolean isInteger()
          Determine whether this type is an integer.
 Type.Tag tag()
          Get this type's tag.
 IntegerT toInteger()
          Get this type as an integer.
 
Methods inherited from class xtc.type.NumberT
equal, equalIgnoringSign, equals, getKind, hashCode, hasKind, isNumber, isSigned, toNumber, toString, write
 
Methods inherited from class xtc.type.Type
addAttribute, annotate, attribute, attribute, attribute, attributes, cast, checkNotSealed, constant, constant, copy, deannotate, getAttribute, getAttribute, getConstant, getConstant, getLanguage, getLanguage, getLocation, getLocation, getScope, getScope, getShape, getShape, hasAlias, hasAnnotated, hasAttribute, hasAttribute, hasAttribute, hasAttribute, hasAttributes, hasConstant, hasConstant, hasEnum, hasEnumerator, hasError, hasInstantiated, hasLanguage, hasLanguage, hasLocation, hasLocation, hasParameterized, hasScope, hasScope, hasShape, hasShape, hasStructOrUnion, hasTag, hasTagged, hasVariable, hasWTag, isAlias, isAnnotated, isArray, isBoolean, isClass, isConcrete, isDerived, isEnum, isEnumerator, isError, isFloat, isFunction, isInstantiated, isInterface, isInternal, isInternalParameter, isLabel, isMethod, isNamedParameter, isPackage, isParameter, isParameterized, isPointer, isSealed, isStruct, isTuple, isUnion, isUnit, isVariable, isVariant, isVoid, isWildcard, isWrapped, language, locate, locate, mark, properties, removeAttribute, removeProperty, resolve, resolve, scope, seal, seal, setLocation, setLocation, setProperty, shape, shape, toAlias, toAnnotated, toArray, toBoolean, toClass, toEnum, toEnumerator, toFloat, toFunction, toInstantiated, toInterface, toInternal, toInternalParameter, toLabel, toMethod, toNamedParameter, toPackage, toParameter, toParameterized, toPointer, toStruct, toStructOrUnion, toTagged, toTuple, toUnion, toUnit, toVariable, toVariant, toVoid, toWildcard, toWrapped, trace, wtag
 
Methods inherited from class xtc.tree.Node
add, add, addAll, addAll, addAll, addAll, addAllTo, addNode, contains, get, getBoolean, getBooleanProperty, getGeneric, getList, getName, getNode, getProperty, getString, getStringProperty, getTokenText, hasName, hasProperty, hasTraversal, indexOf, isAnnotation, isEmpty, isGeneric, isList, isToken, iterator, lastIndexOf, remove, set, size, strip, toAnnotation, toList, toToken
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntegerT

public IntegerT(NumberT.Kind kind)
Create a new integer type.

Parameters:
kind - The kind.
Throws:
java.lang.IllegalArgumentException - Signals an invalid kind.

IntegerT

public IntegerT(Type template,
                NumberT.Kind kind)
Create a new integer type.

Parameters:
template - The type whose annotations to copy.
kind - The kind.
Throws:
java.lang.IllegalArgumentException - Signals an invalid kind.
Method Detail

copy

public IntegerT copy()
Description copied from class: Type
Create a deep copy of this type. The resulting type is not sealed.

Specified by:
copy in class Type
Returns:
A deep copy of this type.

tag

public Type.Tag tag()
Description copied from class: Type
Get this type's tag. Invocations to this method are forwarded across wrapped types.

Specified by:
tag in class Type
Returns:
This type's tag.
See Also:
Type.wtag()

isInteger

public boolean isInteger()
Description copied from class: Type
Determine whether this type is an integer.

Overrides:
isInteger in class Type
Returns:
true if this type is an integer.

toInteger

public IntegerT toInteger()
Description copied from class: Type
Get this type as an integer.

Overrides:
toInteger in class Type
Returns:
This type as an integer.

fromRank

public static NumberT.Kind fromRank(int rank,
                                    boolean signed)
Convert the specified rank to the corresponding integer kind. The rank reflects the ordering char, short, int, long, and long long, starting at 1 and ignoring the sign.

Parameters:
rank - The rank.
signed - The flag for a signed integer.
Returns:
The corresponding kind.
Throws:
java.lang.IllegalArgumentException - Signals an invalid rank.


Copyright © 2012. All Rights Reserved.