ClassType (class)
public sealed ClassType {inherits NamedType, ClassEnv}
Package: CURL.LANGUAGE.CORE-TYPES
Direct Known Subclasses: ParameterizedType

The concrete representation of a Curl class.


Properties
direct-superclasses:An array containing a ClassType for each direct superclass of this class.
accessor public final ClassType.direct-superclasses:{FastArray-of ClassType}
package:Returns the package of the type.
accessor public final ClassType.package:Package
Properties inherited from NamedType: name
Properties inherited from ClassEnv: abstract?, access, final?, public?, sealed?, serializable?, shared?, value-class?
Properties inherited from Type: can-be-null?, class?, keyword-type-parameters, kind-of-units, non-null-variant, null-variant, positional-type-parameters, primitive?, takes-rest-args?, template
Properties inherited from TypeInfo: parameterized-class?

Methods
for-each-base-class:Calls thunk on each superclass of the type.
public {ClassType.for-each-base-class
thunk:{proc-type {ClassType}:bool}
}:void
for-each-option:Calls thunk on each option binding of the type.
public {ClassType.for-each-option
thunk:{proc-type {OptionBinding}:bool}
}:void
get-class-proc:Return the ClassProc named name in this class. Return null if there isn't one.
public final {ClassType.get-class-proc name:String}:#ClassProc
get-class-variable:Return the ClassVariable named name in this class. Return null if there isn't one.
public final {ClassType.get-class-variable name:String}:#ClassVariable
get-constructor:Return the Constructor named name for this class. Return null if there isn't one.
public final {ClassType.get-constructor name:String}:#Constructor
get-factory:Return the Factory named name for this class. Return null if there isn't one.
public final {ClassType.get-factory name:String}:#Factory
get-field:Return the Field named name in this class. Return null if there isn't one.
public final {ClassType.get-field
name:String,
search-superclasses?:bool = true
}:#Field
get-getter:Return the Getter named name in this class. Return null if there isn't one.
public final {ClassType.get-getter
name:String,
search-superclasses?:bool = true
}:#Getter
get-instance-maker:Return the constructor or factory named name in this class. Return null if there isn't one.
public final {ClassType.get-instance-maker name:String}:#InstanceMaker
get-members:Return the public members of this class for which the predicate filter is true.
public final {ClassType.get-members
search-superclasses?:bool = true,
filter:{proc-type {ClassMember}:bool} = ClassMember.get-all-filter
}:{FastArray-of ClassMember}
get-method:Return the Method named name in this class. Return null if there isn't one.
public final {ClassType.get-method
name:String,
search-superclasses?:bool = true
}:#Method
get-option:Return the Option named name in this class. Return null if there isn't one.
public final {ClassType.get-option
name:String,
search-superclasses?:bool = true,
package:Package = {get-current-package}
}:#Option
get-property-for-get:Return a Property named name for this class that the caller can use to get its value. Search for name inherited from superclasses unless search-superclasses? is false.
public final {ClassType.get-property-for-get
name:String,
search-superclasses?:bool = true,
package:Package = {get-current-package}
}:#Property
get-property-for-set:Return a Property named name for this class that the caller can use to set its value. Search for name inherited from superclasses unless search-superclasses? is false.
public final {ClassType.get-property-for-set
name:String,
search-superclasses?:bool = true,
package:Package = {get-current-package}
}:#Property
get-setter:Return the Setter named name in this class. Return null if there isn't one.
public final {ClassType.get-setter
name:String,
search-superclasses?:bool = true
}:#Setter
subtype-of?:Return true if this class is a subclass of t. Otherwise return false.
public sealed {ClassType.subtype-of? t:Type}:bool
Methods inherited from Object: object-describe, object-describe-for-debugging, object-serialize




Property Details
direct-superclasses (accessor)
accessor public final ClassType.direct-superclasses:{FastArray-of ClassType}

An array containing a ClassType for each direct superclass of this class.



package (accessor)
accessor public final ClassType.package:Package

Returns the package of the type.






Method Details
for-each-base-class (method)
public {ClassType.for-each-base-class
thunk:{proc-type {ClassType}:bool}
}:void

Calls thunk on each superclass of the type.

Description

If thunk returns false, then iteration is terminated.


for-each-option (method)
public {ClassType.for-each-option
thunk:{proc-type {OptionBinding}:bool}
}:void

Calls thunk on each option binding of the type.

Description

If thunk returns false, then iteration is terminated.


get-class-proc (method)
public final {ClassType.get-class-proc name:String}:#ClassProc

Return the ClassProc named name in this class. Return null if there isn't one.

name: The name of a class procedure to look up in the class environment.

Description

The named ClassProc must have some public access or this method will return null.


get-class-variable (method)
public final {ClassType.get-class-variable name:String}:#ClassVariable

Return the ClassVariable named name in this class. Return null if there isn't one.

name: The name of a class variable to look up in the class environment.

Description

The named ClassVariable must have some public access or this method will return null.


get-constructor (method)
public final {ClassType.get-constructor name:String}:#Constructor

Return the Constructor named name for this class. Return null if there isn't one.

name: The name of a constructor to look up in the class environment.

Description

The named Constructor must have some public access or this method will return null.


get-factory (method)
public final {ClassType.get-factory name:String}:#Factory

Return the Factory named name for this class. Return null if there isn't one.

name: The name of a factory to look up in the class environment.

Description

The named Factory must have some public access or this method will return null.


get-field (method)
public final {ClassType.get-field
name:String,
search-superclasses?:bool = true
}:#Field

Return the Field named name in this class. Return null if there isn't one.

name: The name of a field to look up in the class environment.
search-superclasses?: Look up name in superclasses of this class unless false.

Description

The named Field must have some public access or this method will return null.


get-getter (method)
public final {ClassType.get-getter
name:String,
search-superclasses?:bool = true
}:#Getter

Return the Getter named name in this class. Return null if there isn't one.

name: The name of a getter to look up in the class environment.
search-superclasses?: Look up name in superclasses of this class unless false.

Description

The named Getter must have some public access or this method will return null.


get-instance-maker (method)
public final {ClassType.get-instance-maker name:String}:#InstanceMaker

Return the constructor or factory named name in this class. Return null if there isn't one.

name: The name of a constructor or factory to look up in the class environment.

Description

The named InstanceMaker must have some public access or this method will return null.


get-members (method)
public final {ClassType.get-members
search-superclasses?:bool = true,
filter:{proc-type {ClassMember}:bool} = ClassMember.get-all-filter
}:{FastArray-of ClassMember}

Return the public members of this class for which the predicate filter is true.

search-superclasses?: Apply filter to members inherited from superclasses of this class unless false.
filter: A proc on ClassMember that returns bool. The default, ClassMember.get-all-filter, always returns true.


get-method (method)
public final {ClassType.get-method
name:String,
search-superclasses?:bool = true
}:#Method

Return the Method named name in this class. Return null if there isn't one.

name: The name of a method to look up in the class environment.
search-superclasses?: Look up name in superclasses of this class unless false.

Description

The named Method must have some public access or this method will return null.


get-option (method)
public final {ClassType.get-option
name:String,
search-superclasses?:bool = true,
package:Package = {get-current-package}
}:#Option

Return the Option named name in this class. Return null if there isn't one.

name: The name of an option to look up in the class environment.
search-superclasses?: Look up name in superclasses of this class unless false.
package: Specify package to search for non-local options. Note that the default value of this parameter is provided for backwards compatibility and it's not optimal for general use. The user is encouraged to specify the class's package as the value of this parameter, which is reasonable in most cases.

Description

The named Option must have some public access or this method will return null.


get-property-for-get (method)
public final {ClassType.get-property-for-get
name:String,
search-superclasses?:bool = true,
package:Package = {get-current-package}
}:#Property

Return a Property named name for this class that the caller can use to get its value. Search for name inherited from superclasses unless search-superclasses? is false.

name: The name of a class property: field, getter, or option.
search-superclasses?: Look up name in superclasses of this class unless false.
package: Specify package to search for non-local options. Note that the default value of this parameter is provided for backwards compatibility and it's not optimal for general use. The user is encouraged to specify the class's package as the value of this parameter, which is reasonable in most cases.

Description

This method first looks for a field named name with public-get access. If none is found, it looks for a public getter, then an option with name.

The named Property must have public get access or this method will return null.


get-property-for-set (method)
public final {ClassType.get-property-for-set
name:String,
search-superclasses?:bool = true,
package:Package = {get-current-package}
}:#Property

Return a Property named name for this class that the caller can use to set its value. Search for name inherited from superclasses unless search-superclasses? is false.

name: The name of a field, setter, or option.
search-superclasses?: Look up name in superclasses of this class unless false.
package: Specify package to search for non-local options. Note that the default value of this parameter is provided for backwards compatibility and it's not optimal for general use. The user is encouraged to specify the class's package as the value of this parameter, which is reasonable in most cases.

Description

This method first looks for a field named name with public-set access. If none is found, it looks for a public getter, then an option with name.

The named Property must have public set access or this method will return null.


get-setter (method)
public final {ClassType.get-setter
name:String,
search-superclasses?:bool = true
}:#Setter

Return the Setter named name in this class. Return null if there isn't one.

name: The name of a setter to look up in the class environment.
search-superclasses?: Look up name in superclasses of this class unless false.

Description

The named Setter must have some public access or this method will return null.


subtype-of? (method)
public sealed {ClassType.subtype-of? t:Type}:bool

Return true if this class is a subclass of t. Otherwise return false.

t: The type to test against this class for a subtype relation.

Description

B is a subclass of A if a B can be used in any expression that admits an A.

C is a subtype of #C for all classes C.

{C.subtype-of? C} is true for all classes C.

Notes

See the isa operator.