Class ReasonerDescriptor
- java.lang.Object
-
- net.ssehub.easy.reasoning.core.reasoner.ReasonerDescriptor
-
- Direct Known Subclasses:
AbstractChainedReasoner.DerivedReasonerDescriptor,Descriptor
public class ReasonerDescriptor extends java.lang.ObjectRepresents descriptive information about a reasoner. This class is intended to be subclassed in order to provide information about specific licensing mechanisms.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<IReasonerCapability>capabilitiesprivate java.net.URLdownloadSourceprivate java.lang.Stringlicenseprivate java.lang.StringlicenseRestrictionprivate java.lang.Stringnameprivate java.lang.Stringversion
-
Constructor Summary
Constructors Constructor Description ReasonerDescriptor(java.lang.String name, java.lang.String version, java.lang.String license, java.lang.String licenseRestriction, java.net.URL downloadSource)Creates a new reasoner descriptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddCapabilities(java.util.Collection<IReasonerCapability> capabilities)Adds a collection of capabilities.protected voidaddCapability(IReasonerCapability capability)Adds a capability.IReasonerCapability[]getCapabilities()Returns the supported capabilities.intgetCapabilityCount()Returns the number of provided capabilities.java.net.URLgetDownloadSource()Returns the source for downloading a licensed version.java.lang.StringgetLicense()Returns a textual form of the license of the reasoner.java.lang.StringgetLicenseRestriction()Returns a license restriction in textual form, e.g.java.lang.StringgetName()Returns the name of the reasoner.java.lang.StringgetVersion()Returns a textual form of the currently integrated version.booleanhasCapability(IReasonerCapability capability)Returns whether the described reasoner has the given capability.booleanisReadyForUse()Returns whether this reasoner is licensed and valid so that it may be used.booleanprovidesAffectedVariables()Returns whether the reasoner provides information about the affected variables viaReasoningResult.getAffectedVariable(int).
-
-
-
Field Detail
-
downloadSource
private java.net.URL downloadSource
-
name
private java.lang.String name
-
version
private java.lang.String version
-
license
private java.lang.String license
-
licenseRestriction
private java.lang.String licenseRestriction
-
capabilities
private java.util.Set<IReasonerCapability> capabilities
-
-
Constructor Detail
-
ReasonerDescriptor
public ReasonerDescriptor(java.lang.String name, java.lang.String version, java.lang.String license, java.lang.String licenseRestriction, java.net.URL downloadSource)Creates a new reasoner descriptor.- Parameters:
name- the name of the reasonerversion- a version description of the integrated reasoner (may be null)license- the license (may be null)licenseRestriction- a restriction of the license to be displayed, e.g. "valid until March 2020" (may be null)downloadSource- the source for downloading a licensed version (may be null if the implementation is complete)
-
-
Method Detail
-
addCapability
protected void addCapability(IReasonerCapability capability)
Adds a capability.- Parameters:
capability- the capability to add (null is ignored)
-
addCapabilities
protected void addCapabilities(java.util.Collection<IReasonerCapability> capabilities)
Adds a collection of capabilities.- Parameters:
capabilities- the capabilities to be added (null is ignored)
-
getDownloadSource
public java.net.URL getDownloadSource()
Returns the source for downloading a licensed version.- Returns:
- the source (may be null), this may point to a file, an Eclipse update site or just a web site describing how to obtain the implementation
-
getName
public java.lang.String getName()
Returns the name of the reasoner.- Returns:
- the name of the reasoner
-
getVersion
public java.lang.String getVersion()
Returns a textual form of the currently integrated version.- Returns:
- the version (may be null)
-
getLicense
public java.lang.String getLicense()
Returns a textual form of the license of the reasoner.- Returns:
- the license as text (may be empty or null if there is none)
-
getLicenseRestriction
public java.lang.String getLicenseRestriction()
Returns a license restriction in textual form, e.g. "valid until March 2020".- Returns:
- the license restriction (or null if there is none)
-
isReadyForUse
public boolean isReadyForUse()
Returns whether this reasoner is licensed and valid so that it may be used.- Returns:
trueif it is licensed and ready for use,trueif it is not ready, e.g., due to license restriction and a version shall be obtained viagetDownloadSource()
-
providesAffectedVariables
public boolean providesAffectedVariables()
Returns whether the reasoner provides information about the affected variables viaReasoningResult.getAffectedVariable(int).- Returns:
trueif the reasoner provides this information,falseelse
-
hasCapability
public boolean hasCapability(IReasonerCapability capability)
Returns whether the described reasoner has the given capability.- Parameters:
capability- the capability to search for (null is ignored)- Returns:
- the capability
-
getCapabilityCount
public int getCapabilityCount()
Returns the number of provided capabilities.- Returns:
- the number of provided capabilities
-
getCapabilities
public IReasonerCapability[] getCapabilities()
Returns the supported capabilities.- Returns:
- the supported capabilities
-
-