java.nonstandard.RuntimeTraits

Provides runtime traits, which provide much of the functionality of tango.core.Traits and is-expressions, as well as some functionality that is only available at runtime, using runtime type information.

Members

Aliases

ConstClassInfo
alias ConstClassInfo = ClassInfo
Undocumented in source.
ConstTypeInfo
alias ConstTypeInfo = TypeInfo
Undocumented in source.

Classes

A
class A
Undocumented in source.
B
class B
Undocumented in source.
C
class C
Undocumented in source.
D
class D
Undocumented in source.

Functions

asClass
ConstClassInfo asClass(TypeInfo type)

If the given type represents a class, return its ClassInfo; else return null;

baseClasses
ConstClassInfo[] baseClasses(ClassInfo type)
baseInterfaces
ConstClassInfo[] baseInterfaces(ClassInfo type)

Returns a list of all interfaces that this type implements, directly * or indirectly. This includes base interfaces of types the class implements, * and interfaces that base classes implement, and base interfaces of interfaces * that base classes implement. This is an expensive operation.

baseTypes
ConstClassInfo[] baseTypes(ClassInfo type)
derivedTypes
ConstClassInfo[] derivedTypes(ClassInfo type)

Returns a list of all types that are derived from the given type. This does not * count interfaces; that is, if type is an interface, you will only get derived * interfaces back. It is an expensive operations.

directInterfaces
ConstClassInfo[] directInterfaces(ClassInfo type)

Returns a list of interfaces that this class directly implements.

getInterfaces
TypeInfo_Interface[] getInterfaces(ClassInfo ci)
Undocumented in source. Be warned that the author may not have intended to support it.
getInterfaces
TypeInfo_Interface[] getInterfaces(TypeInfo ti)
Undocumented in source. Be warned that the author may not have intended to support it.
getName
String getName(ClassInfo ci)
Undocumented in source. Be warned that the author may not have intended to support it.
getName
String getName(TypeInfo ti)
Undocumented in source. Be warned that the author may not have intended to support it.
getSuperclass
TypeInfo_Class getSuperclass(ClassInfo ci)
Undocumented in source. Be warned that the author may not have intended to support it.
getSuperclass
TypeInfo_Class getSuperclass(TypeInfo ti)
Undocumented in source. Be warned that the author may not have intended to support it.
getTypeInfo
TypeInfo_Class getTypeInfo(ClassInfo ci)
Undocumented in source. Be warned that the author may not have intended to support it.
implements
bool implements(ClassInfo implementor, ClassInfo iface)

Returns true iff implementor implements the interface described by iface. This is an expensive operation (linear in the number of interfaces and base classes).

interfaceGraph
ConstClassInfo[] interfaceGraph(ClassInfo type)

Returns all the interfaces that this type directly implements, including inherited interfaces. This is an expensive operation.

isArray
bool isArray(TypeInfo type)

Returns true iff the given type is a dynamic or static array (false for associative * arrays and non-arrays).

isAssociativeArray
bool isAssociativeArray(TypeInfo type)
isBool
bool isBool(TypeInfo type)
isCharacter
bool isCharacter(TypeInfo type)
isClass
bool isClass(TypeInfo type)

Returns true iff the type represents a class (false for interfaces).

isDerived
bool isDerived(ClassInfo derived, ClassInfo base)

Returns true iff one type is an ancestor of the other, or if the types are the same. * If either is null, returns false.

isDynamicArray
bool isDynamicArray(TypeInfo type)
isFloat
bool isFloat(TypeInfo type)
isFunction
bool isFunction(TypeInfo type)
isImplicitly
bool isImplicitly(ClassInfo test, ClassInfo target)

Returns true iff an instance of class test is implicitly castable to target. * This is an expensive operation (isDerived + implements).

isImplicitly
bool isImplicitly(TypeInfo test, TypeInfo target)

Returns true iff an instance of type test is implicitly castable to target. * If the types describe classes or interfaces, this is an expensive operation.

isInteger
bool isInteger(TypeInfo type)
isInterface
bool isInterface(TypeInfo type)

Returns true iff the given type represents an interface.

isJavaPrimitive
bool isJavaPrimitive(TypeInfo type)
Undocumented in source. Be warned that the author may not have intended to support it.
isPointer
bool isPointer(TypeInfo type)
isPrimitive
bool isPrimitive(TypeInfo type)
isReferenceType
bool isReferenceType(TypeInfo type)

Returns true iff the given type is a reference type.

isSignedInteger
bool isSignedInteger(TypeInfo type)
isStaticArray
bool isStaticArray(TypeInfo type)
isString
bool isString(TypeInfo type)
isStruct
bool isStruct(TypeInfo type)
isUnsignedInteger
bool isUnsignedInteger(TypeInfo type)
isUserDefined
bool isUserDefined(TypeInfo type)

Returns true iff the given type represents a user-defined type. * This does not include functions, delegates, aliases, or typedefs.

isValueType
bool isValueType(TypeInfo type)

Returns true for all value types, false for all reference types. * For functions and delegates, returns false (is this the way it should be?).

keyType
ConstTypeInfo keyType(TypeInfo type)

The key type of the given type. For an array, size_t; for an associative * array TU, U.

moduleOf
ModuleInfo moduleOf(ClassInfo type)
moduleOf
ModuleInfo* moduleOf(ClassInfo type)
Undocumented in source. Be warned that the author may not have intended to support it.
realType
ConstTypeInfo realType(TypeInfo type)

If the given type represents a typedef, return the actual type.

returnType
ConstTypeInfo returnType(TypeInfo type)

If the given type represents a delegate or function, the return type * of that function. Otherwise, null.

valueType
ConstTypeInfo valueType(TypeInfo type)

The value type of the given type -- given T[] or Tn, T; given TU, * T; given T*, T; anything else, null.

Interfaces

I1
interface I1
Undocumented in source.
I2
interface I2
Undocumented in source.
I3
interface I3
Undocumented in source.
I4
interface I4
Undocumented in source.

Structs

S1
struct S1
Undocumented in source.
applyInterfaces
struct applyInterfaces

Iterate through all interfaces that type implements, directly or indirectly, including base interfaces.

Meta

Authors

Chris Wright (dhasenan) <dhasenan@gmail.com>

License

tango license, apache 2.0 Copyright (c) 2009, CHRISTOPHER WRIGHT