io.sarl.lang.typesystem
Class InheritanceHelper
@javax.inject.Singleton
class InheritanceHelper
extends java.lang.Object
Utilities for managing inheritance of JVM and SARL elements.

This class was introduced for computing the inheritance with JVM elements (with the LightweightTypeReference API) and with SARL elements, when the inferrer has not yet generated the JVM elements for the SARL elements.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
compiler
Constructor Summary
Constructor and description
new
Action Summary
Modifier and type Action and description
int getSarlElementEcoreType(JvmGenericType)
Extract and replies the Ecore type, provided by io.sarl.lang.sarl.SarlPackage for the given JvmElement.
int getSarlElementEcoreType(LightweightTypeReference)
Extract and replies the Ecore type, provided by io.sarl.lang.sarl.SarlPackage for the given JvmElement.
boolean isProxyOrSubTypeOf(JvmTypeReference,Class<T>,Class<T>)
Replies if the type candidate is a subtype of the given super type.
boolean isProxyOrSubTypeOf(LightweightTypeReference,Class<T>,Class<T>)
Replies if the type candidate is a proxy (unresolved type) or a subtype of the given super type.
boolean isProxyOrSubTypeOf(JvmTypeReference,Class<T>,Class<T>,boolean)
Replies if the type candidate is a proxy (unresolved type) or a subtype of the given super type.
boolean isSarlAgent(JvmGenericType)
Replies if the given JVM element is a SARL agent.
boolean isSarlAgent(LightweightTypeReference)
Replies if the given JVM element is a SARL agent.
boolean isSarlBehavior(JvmGenericType)
Replies if the given JVM element is a SARL behavior.
boolean isSarlBehavior(LightweightTypeReference)
Replies if the given JVM element is a SARL behavior.
boolean isSarlCapacity(JvmGenericType)
Replies if the given JVM element is a SARL capacity.
boolean isSarlCapacity(LightweightTypeReference)
Replies if the given JVM element is a SARL capacity.
boolean isSarlEvent(JvmGenericType)
Replies if the given JVM element is a SARL event.
boolean isSarlEvent(LightweightTypeReference)
Replies if the given JVM element is a SARL event.
boolean isSarlSkill(JvmGenericType)
Replies if the given JVM element is a SARL skill.
boolean isSarlSkill(LightweightTypeReference)
Replies if the given JVM element is a SARL skill.
boolean isSubTypeOf(JvmType,Class<T>,Class<T>)
Replies if the type candidate is a subtype of the given super type.
boolean isSubTypeOf(JvmTypeReference,Class<T>,Class<T>)
Replies if the type candidate is a subtype of the given super type.
boolean isSubTypeOf(LightweightTypeReference,Class<T>,Class<T>)
Replies if the type candidate is a subtype of the given super type.
boolean isSubTypeOf(JvmType,Class<T>,Class<T>,boolean)
Replies if the type candidate is a subtype of the given super type.
boolean isSubTypeOf(JvmTypeReference,Class<T>,Class<T>,boolean)
Replies if the type candidate is a subtype of the given super type.
Constructor Details
new
new
Action Details
getSarlElementEcoreType(JvmGenericType)
def getSarlElementEcoreType(JvmGenericType) : int
Extract and replies the Ecore type, provided by io.sarl.lang.sarl.SarlPackage for the given JvmElement.
Parameters:
type - the JVM type to test.
Returns:
the code of the type, see io.sarl.lang.sarl.SarlPackage ; or 0 if the code is unknown.
Since:
0.6
getSarlElementEcoreType(LightweightTypeReference)
def getSarlElementEcoreType(LightweightTypeReference) : int
Extract and replies the Ecore type, provided by io.sarl.lang.sarl.SarlPackage for the given JvmElement.
Parameters:
type - the JVM type to test.
Returns:
the code of the type, see io.sarl.lang.sarl.SarlPackage ; or 0 if the code is unknown.
Since:
0.8
isProxyOrSubTypeOf(JvmTypeReference,Class<T>,Class<T>)
def isProxyOrSubTypeOf(JvmTypeReference,Class<T>,Class<T>) : boolean
Replies if the type candidate is a subtype of the given super type.
Parameters:
candidate - the type to test.
jvmSuperType - the expected JVM super-type.
sarlSuperType - the expected SARL super-type.
Returns:
true if the candidate is a sub-type of the super-type.
isProxyOrSubTypeOf(LightweightTypeReference,Class<T>,Class<T>)
def isProxyOrSubTypeOf(LightweightTypeReference,Class<T>,Class<T>) : boolean
Replies if the type candidate is a proxy (unresolved type) or a subtype of the given super type.
Parameters:
candidate - the type to test.
jvmSuperType - the expected JVM super-type.
sarlSuperType - the expected SARL super-type.
Returns:
true if the candidate is a sub-type of the super-type.
isProxyOrSubTypeOf(JvmTypeReference,Class<T>,Class<T>,boolean)
def isProxyOrSubTypeOf(JvmTypeReference,Class<T>,Class<T>,boolean) : boolean
Replies if the type candidate is a proxy (unresolved type) or a subtype of the given super type.
Parameters:
candidate - the type to test.
jvmSuperType - the expected JVM super-type.
sarlSuperType - the expected SARL super-type.
onlyInterface - true if only interface types are matching; false if not-interface types are matching.
Returns:
true if the candidate is a sub-type of the super-type.
isSarlAgent(JvmGenericType)
def isSarlAgent(JvmGenericType) : boolean
Replies if the given JVM element is a SARL agent.
Parameters:
type - the JVM type to test.
Returns:
true if the given type is a SARL agent, or not.
Since:
0.6
isSarlAgent(LightweightTypeReference)
def isSarlAgent(LightweightTypeReference) : boolean
Replies if the given JVM element is a SARL agent.
Parameters:
type - the JVM type to test.
Returns:
true if the given type is a SARL agent, or not.
Since:
0.8
isSarlBehavior(JvmGenericType)
def isSarlBehavior(JvmGenericType) : boolean
Replies if the given JVM element is a SARL behavior.
Parameters:
type - the JVM type to test.
Returns:
true if the given type is a SARL behavior, or not.
Since:
0.6
isSarlBehavior(LightweightTypeReference)
def isSarlBehavior(LightweightTypeReference) : boolean
Replies if the given JVM element is a SARL behavior.
Parameters:
type - the JVM type to test.
Returns:
true if the given type is a SARL behavior, or not.
Since:
0.8
isSarlCapacity(JvmGenericType)
def isSarlCapacity(JvmGenericType) : boolean
Replies if the given JVM element is a SARL capacity.
Parameters:
type - the JVM type to test.
Returns:
true if the given type is a SARL capacity, or not.
Since:
0.6
isSarlCapacity(LightweightTypeReference)
def isSarlCapacity(LightweightTypeReference) : boolean
Replies if the given JVM element is a SARL capacity.
Parameters:
type - the JVM type to test.
Returns:
true if the given type is a SARL capacity, or not.
Since:
0.8
isSarlEvent(JvmGenericType)
def isSarlEvent(JvmGenericType) : boolean
Replies if the given JVM element is a SARL event.
Parameters:
type - the JVM type to test.
Returns:
true if the given type is a SARL event, or not.
Since:
0.6
isSarlEvent(LightweightTypeReference)
def isSarlEvent(LightweightTypeReference) : boolean
Replies if the given JVM element is a SARL event.
Parameters:
type - the JVM type to test.
Returns:
true if the given type is a SARL event, or not.
Since:
0.8
isSarlSkill(JvmGenericType)
def isSarlSkill(JvmGenericType) : boolean
Replies if the given JVM element is a SARL skill.
Parameters:
type - the JVM type to test.
Returns:
true if the given type is a SARL skill, or not.
Since:
0.6
isSarlSkill(LightweightTypeReference)
def isSarlSkill(LightweightTypeReference) : boolean
Replies if the given JVM element is a SARL skill.
Parameters:
type - the JVM type to test.
Returns:
true if the given type is a SARL skill, or not.
Since:
0.8
isSubTypeOf(JvmType,Class<T>,Class<T>)
def isSubTypeOf(JvmType,Class<T>,Class<T>) : boolean
Replies if the type candidate is a subtype of the given super type.
Parameters:
candidate - the type to test.
jvmSuperType - the expected JVM super-type.
sarlSuperType - the expected SARL super-type.
Returns:
true if the candidate is a sub-type of the super-type.
isSubTypeOf(JvmTypeReference,Class<T>,Class<T>)
def isSubTypeOf(JvmTypeReference,Class<T>,Class<T>) : boolean
Replies if the type candidate is a subtype of the given super type.
Parameters:
candidate - the type to test.
jvmSuperType - the expected JVM super-type.
sarlSuperType - the expected SARL super-type.
Returns:
true if the candidate is a sub-type of the super-type.
isSubTypeOf(LightweightTypeReference,Class<T>,Class<T>)
def isSubTypeOf(LightweightTypeReference,Class<T>,Class<T>) : boolean
Replies if the type candidate is a subtype of the given super type.
Parameters:
candidate - the type to test.
jvmSuperType - the expected JVM super-type.
sarlSuperType - the expected SARL super-type.
Returns:
true if the candidate is a sub-type of the super-type.
isSubTypeOf(JvmType,Class<T>,Class<T>,boolean)
def isSubTypeOf(JvmType,Class<T>,Class<T>,boolean) : boolean
Replies if the type candidate is a subtype of the given super type.
Parameters:
candidate - the type to test.
jvmSuperType - the expected JVM super-type.
sarlSuperType - the expected SARL super-type.
onlyInterface - true if only interface types are matching; false if not-interface types are matching.
Returns:
true if the candidate is a sub-type of the super-type.
isSubTypeOf(JvmTypeReference,Class<T>,Class<T>,boolean)
def isSubTypeOf(JvmTypeReference,Class<T>,Class<T>,boolean) : boolean
Replies if the type candidate is a subtype of the given super type.
Parameters:
candidate - the type to test.
jvmSuperType - the expected JVM super-type.
sarlSuperType - the expected SARL super-type.
onlyInterface - true if only interface types are matching; false if not-interface types are matching.
Returns:
true if the candidate is a sub-type of the super-type.