Top Description Inners Fields Constructors Methods
org.graalvm.polyglot.tck

public final Class TypeDescriptor

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Arrays, .BitSet, .Collection, .Collections, .HashMap, .HashSet, .Iterator, .List, .Map, .NoSuchElementException, .Objects, .Set, java.util.stream.Collectors, org.graalvm.polyglot.Value

Represents a type of a polyglot value. Types include primitive types, null type, object type, array type with an optional content type and union type.
Since
0.30

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private abstract static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private abstract static class
private static class
private static enum
private abstract static class
private static class

Field Summary

Modifier and TypeField and Description
public static final TypeDescriptor
ANY

Represents all types.

public static final TypeDescriptor
ARRAY

Represents an array with any content type.

public static final TypeDescriptor
BOOLEAN

Represents a boolean type.

public static final TypeDescriptor
DATE

Type descriptor for date.

public static final TypeDescriptor
DURATION

Type descriptor for duration.

public static final TypeDescriptor
EXCEPTION

Type descriptor for exception.

public static final TypeDescriptor
EXECUTABLE

Represents an executable type returning any type and accepting any number of parameters of any type.

public static final TypeDescriptor
EXECUTABLE_ANY

Represents a raw executable type.

public static final TypeDescriptor
HASH

Represents a hash map with any key type and any value type.

public static final TypeDescriptor
HOST_OBJECT

Represents a host object.

private final TypeDescriptor.TypeDescriptorImpl
public static final TypeDescriptor
INSTANTIABLE

Represents an instantiable type accepting any number of parameters of any type.

public static final TypeDescriptor
INSTANTIABLE_ANY

Represents a raw instantiable type.

public static final TypeDescriptor
ITERABLE

Represents an iterable with any content type.

public static final TypeDescriptor
ITERATOR

Represents an iterator with any content type.

public static final TypeDescriptor
META_OBJECT

Type descriptor for metaobjects.

public static final TypeDescriptor
NATIVE_POINTER

Represents a native pointer.

private static final TypeDescriptor
public static final TypeDescriptor
NULL

The NULL type represents a type of null or undefined value.

public static final TypeDescriptor
NUMBER

Represents a numeric type.

public static final TypeDescriptor
OBJECT

Represents an object created by a guest language.

private static final TypeDescriptor[]
public static final TypeDescriptor
STRING

Represents a string type.

public static final TypeDescriptor
TIME

Type descriptor for time.

public static final TypeDescriptor
TIME_ZONE

Type descriptor for time zone.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static TypeDescriptor

Returns:

an array type with given component
array
(TypeDescriptor
the required component type.
componentType
)

Creates a new array type with given component type.

private static TypeDescriptor.ArrayImpl
private static TypeDescriptor.ParameterizedTypeDescriptorImpl
private static void
collectDNFComponents(final TypeDescriptor.TypeDescriptorImpl[][]
the union types
unionTypes
,
final Collection<? extends TypeDescriptor.TypeDescriptorImpl>
the non union types
tail
,
int[] indexes, int currentIndex, final Collection<? super TypeDescriptor.TypeDescriptorImpl>
the result collector
collector
)

Collects all disjunctive normal form components.

private static TypeDescriptor
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public static TypeDescriptor

Returns:

an executable type
executable
(TypeDescriptor
the required return type, use ANY as any type
returnType
,
TypeDescriptor...
the required parameter types
parameterTypes
)

Creates a new executable type with a given return type and parameter types.

public static TypeDescriptor

Returns:

an executable type
executable
(TypeDescriptor
the required return type, use ANY as any type
returnType
,
boolean
the executable has variable length arguments or ignores additional parameters. For executables created by the LanguageProvider#createValueConstructors(org.graalvm.polyglot.Context) set to false if the language neither ignores extra parameters nor the executable has variable arguments length.
vararg
,
TypeDescriptor...
the required parameter types
parameterTypes
)

Creates a new executable type with a given return type and parameter types.

private static void
public static TypeDescriptor

Returns:

the type of value, may by an union type containing more primitive or array types.
forValue
(final Value
the value to create TypeDescriptor for
value
)

Creates a type for given Value.

public static TypeDescriptor

Returns:

a new hash map type with given key and value types
hash
(TypeDescriptor
the required key type.
keyType
,
TypeDescriptor
the required value type.
valueType
)

Creates a new hash map type with given key type and value type.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.

public static TypeDescriptor

Returns:

an instantiable type
instantiable
(TypeDescriptor
the type of an instance, use ANY as any type
instanceType
,
boolean
the instantiable has variable length arguments or ignores additional parameters. For instantiables created by the LanguageProvider#createValueConstructors(org.graalvm.polyglot.Context) set to false if the language neither ignores extra parameters nor the instantiable has variable arguments length.
vararg
,
TypeDescriptor...
the required parameter types
parameterTypes
)

Creates a new instantiable type with a given parameter types.

public static TypeDescriptor

Returns:

the intersection type containing the given types
intersection
(TypeDescriptor...
the types to include in the intersection
types
)

Creates a new intersection type.

private static TypeDescriptor.TypeDescriptorImpl

Returns:

new TypeDescriptorImpl may not be a IntersectionImpl
intersectionImpl
(final Collection<? extends TypeDescriptor.TypeDescriptorImpl>
the intersection components
typeImpls
)

Normalization of a newly created IntersectionImpl.

private static boolean
private static boolean
public boolean

Returns:

true if the fromType is assignable to this type
isAssignable
(final TypeDescriptor
the type to assign
fromType
)

Checks if the given type is assignable to this type.

private static boolean
public boolean

Returns:

true if this type represents an intersection type
isIntersection
()

Checks if this TypeDescriptor represent an intersection type.

private static TypeDescriptor
public boolean

Returns:

true if this type represents an union type
isUnion
()

Checks if this TypeDescriptor represent an union type.

public static TypeDescriptor

Returns:

an iterable type with given component
iterable
(TypeDescriptor
the required component type.
componentType
)

Creates a new iterable type with given component type.

public static TypeDescriptor

Returns:

an iterator type with given component
iterator
(TypeDescriptor
the required component type.
componentType
)

Creates a new iterator type with given component type.

public TypeDescriptor
subtract(TypeDescriptor
the type to remove.
toRemove
)

Creates a new type by removing the given type from this type.

private static TypeDescriptor.TypeDescriptorImpl
private static TypeDescriptor.TypeDescriptorImpl
private static Set<TypeDescriptor.TypeDescriptorImpl>
private static TypeDescriptor.TypeDescriptorImpl
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public static TypeDescriptor

Returns:

the union type containing the given types
union
(TypeDescriptor...
the types to include in the union
types
)

Creates a new union type.

private static TypeDescriptor.TypeDescriptorImpl
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait