C# Class Fan.Sys.Type

Type models a static type definition for an Obj class. A Type lifecycle: 1) Hollow: in this state we know basic identity of the type, and it's inheritance hierarchy. A type is setup to be hollow during Pod.load(). 2) Reflected: in this state we read all the slot definitions from the fcode to populate the slot tables used to for reflection. At this point clients can discover the signatures of the Type. 3) Emitted: the final state of loading a Type is to emit to a Java class called "fan.{pod}.{type}". Once emitted we can instantiate the type or call it's methods. 4) Finished: once we have reflected the slots into memory and emitted the Java class, the last stage is to bind the all the java.lang.reflect representations to the Slots for dynamic dispatch. We delay this until needed by Method or Field for a reflection invocation Type models sys::Type. Implementation classes are: - ClassType - GenericType (ListType, MapType, FuncType) - NullableType
Inheritance: FanObj, Literal
Afficher le fichier Open project: xored/f4 Class Usage Examples

Méthodes publiques

Méthode Description
@base ( ) : Type
@is ( Type type ) : bool
@params ( ) : Map
@typeof ( ) : Type
common ( object objs, int n ) : Type

Given a list of objects, compute the most specific type which they all share,or at worst return sys::Obj. This method does not take into account interfaces, only extends class inheritance.

doc ( ) : string
dotnetRepr ( ) : bool
emptyList ( ) : List
encode ( ObjEncoder @out ) : void
facet ( Type t ) : Facet
facet ( Type t, bool c ) : Facet
facets ( ) : List
field ( string name ) : Field
field ( string name, bool check ) : Field
fields ( ) : List
find ( string sig ) : Type
find ( string sig, bool check ) : Type
finish ( ) : void
fits ( Type type ) : bool
getRawType ( ) : Type

If this type is a generic parameter (V, L, etc), then return the actual type used in the Java method. For example V is Obj, and L is List. This is the type we actually use when constructing a signature for the invoke opcode.

hasFacet ( Type t ) : bool
inheritance ( ) : List
isAbstract ( ) : bool
isClass ( ) : bool
isConst ( ) : bool
isEnum ( ) : bool
isFacet ( ) : bool
isFinal ( ) : bool
isGeneric ( ) : bool
isGenericInstance ( ) : bool

A generic instance is a type which has "instantiated" a generic type and replaced all the generic parameter types with generic argument types. The type string[] is a generic instance of the generic type List (V is replaced with string). A generic instance always has a signature which different from the qname.

isGenericParameter ( ) : bool

Return if this type is a generic parameter (such as V or K) in a generic type (List, Map, or Method). Generic parameters serve as place holders for the parameterization of the generic type. Fantom has a predefined set of generic parameters which are always defined in the sys pod with a one character name.

isGenericType ( ) : bool

A generic type means that one or more of my slots contain signatures using a generic parameter (such as V or K). Fantom supports three built-in generic types: List, Map, and Method. A generic instance (such as string[]) is NOT a generic type (all of its generic parameters have been filled in). User defined generic types are not supported in Fan.

isInternal ( ) : bool
isMixin ( ) : bool
isNullable ( ) : bool
isPublic ( ) : bool
isSynthetic ( ) : bool
isVal ( ) : bool
make ( ) : object
make ( List args ) : object
method ( string name ) : Method
method ( string name, bool check ) : Method
methods ( ) : List
mixins ( ) : List
name ( ) : string
of ( object obj ) : Type
parameterize ( Map pars ) : Type
pod ( ) : Pod
qname ( ) : string
reflect ( ) : Type
signature ( ) : string
slot ( string name ) : Slot
slot ( string name, bool check ) : Slot
slots ( ) : List
toLocale ( ) : string
toNonNullable ( ) : Type
toNullable ( ) : Type
toStr ( ) : string
trap ( string name, List args ) : object

Private Methods

Méthode Description
flags ( ) : int
toListOf ( ) : Type

Method Details

@base() public abstract méthode

public abstract @base ( ) : Type
Résultat Type

@is() public abstract méthode

public abstract @is ( Type type ) : bool
type Type
Résultat bool

@params() public méthode

public @params ( ) : Map
Résultat Map

@typeof() public méthode

public @typeof ( ) : Type
Résultat Type

common() public static méthode

Given a list of objects, compute the most specific type which they all share,or at worst return sys::Obj. This method does not take into account interfaces, only extends class inheritance.
public static common ( object objs, int n ) : Type
objs object
n int
Résultat Type

doc() public abstract méthode

public abstract doc ( ) : string
Résultat string

dotnetRepr() public abstract méthode

public abstract dotnetRepr ( ) : bool
Résultat bool

emptyList() public méthode

public emptyList ( ) : List
Résultat List

encode() public méthode

public encode ( ObjEncoder @out ) : void
@out Fanx.Serial.ObjEncoder
Résultat void

facet() public méthode

public facet ( Type t ) : Facet
t Type
Résultat Facet

facet() public abstract méthode

public abstract facet ( Type t, bool c ) : Facet
t Type
c bool
Résultat Facet

facets() public abstract méthode

public abstract facets ( ) : List
Résultat List

field() public méthode

public field ( string name ) : Field
name string
Résultat Field

field() public méthode

public field ( string name, bool check ) : Field
name string
check bool
Résultat Field

fields() public abstract méthode

public abstract fields ( ) : List
Résultat List

find() public static méthode

public static find ( string sig ) : Type
sig string
Résultat Type

find() public static méthode

public static find ( string sig, bool check ) : Type
sig string
check bool
Résultat Type

finish() public méthode

public finish ( ) : void
Résultat void

fits() public méthode

public fits ( Type type ) : bool
type Type
Résultat bool

getRawType() public méthode

If this type is a generic parameter (V, L, etc), then return the actual type used in the Java method. For example V is Obj, and L is List. This is the type we actually use when constructing a signature for the invoke opcode.
public getRawType ( ) : Type
Résultat Type

hasFacet() public méthode

public hasFacet ( Type t ) : bool
t Type
Résultat bool

inheritance() public abstract méthode

public abstract inheritance ( ) : List
Résultat List

isAbstract() public méthode

public isAbstract ( ) : bool
Résultat bool

isClass() public méthode

public isClass ( ) : bool
Résultat bool

isConst() public méthode

public isConst ( ) : bool
Résultat bool

isEnum() public méthode

public isEnum ( ) : bool
Résultat bool

isFacet() public méthode

public isFacet ( ) : bool
Résultat bool

isFinal() public méthode

public isFinal ( ) : bool
Résultat bool

isGeneric() public méthode

public isGeneric ( ) : bool
Résultat bool

isGenericInstance() public méthode

A generic instance is a type which has "instantiated" a generic type and replaced all the generic parameter types with generic argument types. The type string[] is a generic instance of the generic type List (V is replaced with string). A generic instance always has a signature which different from the qname.
public isGenericInstance ( ) : bool
Résultat bool

isGenericParameter() public méthode

Return if this type is a generic parameter (such as V or K) in a generic type (List, Map, or Method). Generic parameters serve as place holders for the parameterization of the generic type. Fantom has a predefined set of generic parameters which are always defined in the sys pod with a one character name.
public isGenericParameter ( ) : bool
Résultat bool

isGenericType() public méthode

A generic type means that one or more of my slots contain signatures using a generic parameter (such as V or K). Fantom supports three built-in generic types: List, Map, and Method. A generic instance (such as string[]) is NOT a generic type (all of its generic parameters have been filled in). User defined generic types are not supported in Fan.
public isGenericType ( ) : bool
Résultat bool

isInternal() public méthode

public isInternal ( ) : bool
Résultat bool

isMixin() public méthode

public isMixin ( ) : bool
Résultat bool

isNullable() public méthode

public isNullable ( ) : bool
Résultat bool

isPublic() public méthode

public isPublic ( ) : bool
Résultat bool

isSynthetic() public méthode

public isSynthetic ( ) : bool
Résultat bool

isVal() public méthode

public isVal ( ) : bool
Résultat bool

make() public méthode

public make ( ) : object
Résultat object

make() public méthode

public make ( List args ) : object
args List
Résultat object

method() public méthode

public method ( string name ) : Method
name string
Résultat Method

method() public méthode

public method ( string name, bool check ) : Method
name string
check bool
Résultat Method

methods() public abstract méthode

public abstract methods ( ) : List
Résultat List

mixins() public abstract méthode

public abstract mixins ( ) : List
Résultat List

name() public abstract méthode

public abstract name ( ) : string
Résultat string

of() public static méthode

public static of ( object obj ) : Type
obj object
Résultat Type

parameterize() public méthode

public parameterize ( Map pars ) : Type
pars Map
Résultat Type

pod() public abstract méthode

public abstract pod ( ) : Pod
Résultat Pod

qname() public abstract méthode

public abstract qname ( ) : string
Résultat string

reflect() public méthode

public reflect ( ) : Type
Résultat Type

signature() public abstract méthode

public abstract signature ( ) : string
Résultat string

slot() public méthode

public slot ( string name ) : Slot
name string
Résultat Slot

slot() public abstract méthode

public abstract slot ( string name, bool check ) : Slot
name string
check bool
Résultat Slot

slots() public abstract méthode

public abstract slots ( ) : List
Résultat List

toLocale() public méthode

public toLocale ( ) : string
Résultat string

toNonNullable() public méthode

public toNonNullable ( ) : Type
Résultat Type

toNullable() public abstract méthode

public abstract toNullable ( ) : Type
Résultat Type

toStr() public méthode

public toStr ( ) : string
Résultat string

trap() public méthode

public trap ( string name, List args ) : object
name string
args List
Résultat object