Class JavaTransitiveInstancesKey
java.lang.Object
tools.refinery.interpreter.matchers.context.common.BaseInputKeyWrapper<String>
tools.refinery.interpreter.matchers.context.common.JavaTransitiveInstancesKey
- All Implemented Interfaces:
IInputKey
Instance tuples are of form (x), where object x is an instance of the given Java class or its subclasses.
Fine print 1: classes with the same name are considered equivalent. Can be instantiated with class name, even if the class itself is not loaded yet; but if the class is available, passing it in the constructor is beneficial to avoid classloading troubles.
Fine print 2: primitive types (char, etc.) are transparently treated as their wrapper class (Character, etc.).
Non-enumerable type, can only be checked.
Stateless type (objects can't change their type)
-
Field Summary
Fields inherited from class tools.refinery.interpreter.matchers.context.common.BaseInputKeyWrapper
wrappedKey
-
Constructor Summary
ConstructorsConstructorDescriptionJavaTransitiveInstancesKey
(Class<?> instanceClass) Convenience constructor for the case where the JVM Class is available (already precompiled and loaded) in the context where this input key is built.JavaTransitiveInstancesKey
(String jvmClassName) Deprecated.JavaTransitiveInstancesKey
(String jvmClassName, String javaClassName) Call this constructor only in contexts where the class itself is not available for loading, e.g. -
Method Summary
Modifier and TypeMethodDescriptionClass
<?> Class
<?> int
getArity()
The width of tuples in this relation.Class
<?> A user-friendly name that can be shown on screen for debug purposes, included in exceptions, etc.An internal string identifier that can be used to uniquely identify to input key (relevant for distributed applications).Class
<?> boolean
Returns true iff instance tuples of the key can be enumerated.toString()
Methods inherited from class tools.refinery.interpreter.matchers.context.common.BaseInputKeyWrapper
equals, getWrappedKey, hashCode
-
Constructor Details
-
JavaTransitiveInstancesKey
Call this constructor only in contexts where the class itself is not available for loading, e.g. it has not yet been compiled.- Parameters:
jvmClassName
-Class.getName()
javaClassName
-Class.getCanonicalName()
- Since:
- 2.9
-
JavaTransitiveInstancesKey
Convenience constructor for the case where the JVM Class is available (already precompiled and loaded) in the context where this input key is built.- Parameters:
instanceClass
- a non-null class definition
-
JavaTransitiveInstancesKey
Deprecated.Call this constructor only as a last resort, if the Java canonical name of the class is unavailable.
-
-
Method Details
-
forceGetWrapperInstanceClass
- Returns:
- non-null instance class, wrapped if primitive class
- Throws:
ClassNotFoundException
-
forceGetInstanceClass
- Returns:
- non-null instance class, wrapped if primitive class
- Throws:
ClassNotFoundException
-
getWrapperInstanceClass
- Returns:
- instance class, wrapped if primitive class, null if class cannot be loaded
-
getInstanceClass
- Returns:
- instance class, wrapped if primitive class, null if class cannot be loaded
-
getPrettyPrintableName
Description copied from interface:IInputKey
A user-friendly name that can be shown on screen for debug purposes, included in exceptions, etc. -
getStringID
Description copied from interface:IInputKey
An internal string identifier that can be used to uniquely identify to input key (relevant for distributed applications). -
getArity
public int getArity()Description copied from interface:IInputKey
The width of tuples in this relation. -
isEnumerable
public boolean isEnumerable()Description copied from interface:IInputKey
Returns true iff instance tuples of the key can be enumerated.If false, the runtime can only test tuple membership in the extensional relation identified by the key, but not enumerate member tuples in general.
-
toString
-
JavaTransitiveInstancesKey(Class)
orJavaTransitiveInstancesKey(String, String)
instead