Package org.cytoscape.equations
Class AbstractFunction
java.lang.Object
org.cytoscape.equations.AbstractFunction
- All Implemented Interfaces:
Function
Base class for all
Function
implementations.Cytoscape Backwards Compatibility (Abstract Class): This class is abstract and meant to be extended by users. This means that we may add methods for minor version updates. Methods will only be removed for major version updates.
Module: equations-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>equations-api</artifactId> </dependency>
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractFunction(ArgDescriptor[] argDescriptors)
Base class constructor for easy creation ofFunction
s from function argument descriptors. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
argTypesAreValid(Class[] argTypes)
Returns the usage descriptions for the function's arguments.getPossibleArgTypes(Class[] leadingArgs)
Used with the equation builder.Used to provide help for users.validateArgTypes(Class[] argTypes)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.cytoscape.equations.Function
evaluateFunction, getCategoryName, getFunctionSummary, getName, getReturnType
-
Constructor Details
-
AbstractFunction
Base class constructor for easy creation ofFunction
s from function argument descriptors.- Parameters:
argDescriptors
- an array describing theFunction
argument list
-
-
Method Details
-
getArgumentDescriptors
Returns the usage descriptions for the function's arguments. Used to provide help for users. This is an optional operation, may return null.- Specified by:
getArgumentDescriptors
in interfaceFunction
-
getUsageDescription
Used to provide help for users. Unlike getFunctionSummary(), this describes how to call this function, like "Call with SIN(number)."- Specified by:
getUsageDescription
in interfaceFunction
- Returns:
- a description of how to use this function
-
argTypesAreValid
-
validateArgTypes
- Specified by:
validateArgTypes
in interfaceFunction
- Returns:
- the return type for this function (Double.cLass, String.class, or Boolean.class) or null if the args passed in had the wrong arity or a type mismatch Note that this is different from getReturnType() in that it will never return the wildcard Object.class. It is used by the parser which knows the actual type of the arguments in any given call to this function.
-
getPossibleArgTypes
Used with the equation builder.- Specified by:
getPossibleArgTypes
in interfaceFunction
- Parameters:
leadingArgs
- the types of the arguments that have already been selected by the user.- Returns:
- the set of arguments (must be a collection of String.class, Long.class, Double.class, Boolean.class and List.class) that are candidates for the next argument. A null return indicates that no further arguments are valid. Please note that if the returned set contains a null, this indicates an optional additional argument.
-