Package coneforest.psylla.core
Class PsyOperator
- java.lang.Object
-
- coneforest.psylla.core.PsyOperator
-
- All Implemented Interfaces:
PsyAtomic,PsyConvertableToName,PsyConvertableToString,PsyExecutable,PsyObject
- Direct Known Subclasses:
PsyOperator.Action,PsyOperator.Arity00,PsyOperator.Arity01,PsyOperator.Arity10,PsyOperator.Arity11,PsyOperator.Arity20,PsyOperator.Arity21,PsyOperator.Arity30,PsyOperator.Arity31,PsyOperator.Method
public abstract class PsyOperator extends Object implements PsyAtomic, PsyExecutable
A representation of Ψ-operatorobject.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPsyOperator.Actionstatic classPsyOperator.Arity00static classPsyOperator.Arity01static classPsyOperator.Arity10<T extends PsyObject>static classPsyOperator.Arity11<T extends PsyObject>static classPsyOperator.Arity20<T1 extends PsyObject,T2 extends PsyObject>static classPsyOperator.Arity21<T1 extends PsyObject,T2 extends PsyObject>static classPsyOperator.Arity30<T1 extends PsyObject,T2 extends PsyObject,T3 extends PsyObject>static classPsyOperator.Arity31<T1 extends PsyObject,T2 extends PsyObject,T3 extends PsyObject>static classPsyOperator.Method
-
Constructor Summary
Constructors Constructor Description PsyOperator(String name)PsyOperator(String name, PsyOperator.Action action)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidaction(PsyContext oContext)voidexecute(PsyContext oContext)Execute this object in the context of the interpreter.StringgetName()Returns a name of this operator.StringgetPrefix()StringgetSimpleName()voidinvoke(PsyContext oContext)Invoke this object in the context of the interpreter performing an action associated with it.StringtoSyntaxString()Returns a syntatctic string representation of this operator.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface coneforest.psylla.core.PsyExecutable
asBinaryOperator, asComparator, asFunction, asPredicate, asSupplier, asUnaryOperator
-
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, psyClone, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, typeName
-
-
-
-
Constructor Detail
-
PsyOperator
public PsyOperator(String name)
-
PsyOperator
public PsyOperator(String name, PsyOperator.Action action)
-
-
Method Detail
-
execute
public void execute(PsyContext oContext)
Execute this object in the context of the interpreter. Callsinvoke(coneforest.psylla.core.PsyContext)method.
-
invoke
public void invoke(PsyContext oContext)
Invoke this object in the context of the interpreter performing an action associated with it.- Specified by:
invokein interfacePsyExecutable- Specified by:
invokein interfacePsyObject- Parameters:
oContext-
-
action
public abstract void action(PsyContext oContext) throws ClassCastException, PsyException
- Throws:
ClassCastExceptionPsyException
-
toSyntaxString
public String toSyntaxString()
Returns a syntatctic string representation of this operator. A syntatctic representation has a form of"--name--", wherenameis a string returned bygetName()method.- Specified by:
toSyntaxStringin interfacePsyObject- Returns:
- a syntatctic string representation of a name of this operator.
-
getName
public String getName()
Returns a name of this operator. A name returned is an operator’s simple class name with first character (underscore) discarded. This method must be overriden when using another naming scheme.- Returns:
- a name.
-
getPrefix
public String getPrefix()
-
getSimpleName
public String getSimpleName()
-
-