Package coneforest.psylla.core
Class PsyOperator
- java.lang.Object
-
- coneforest.psylla.core.PsyOperator
-
- All Implemented Interfaces:
PsyAtomic
,PsyConvertableToName
,PsyConvertableToString
,PsyObject
- Direct Known Subclasses:
PsyOperator.Action
,PsyOperator.Arity01
,PsyOperator.Arity10
,PsyOperator.Arity11
,PsyOperator.Arity20
,PsyOperator.Arity21
,PsyOperator.Arity30
,PsyOperator.Arity31
public abstract class PsyOperator extends Object implements PsyAtomic
A representation of Ψ-operator
object.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PsyOperator.Action
static class
PsyOperator.Arity01
static class
PsyOperator.Arity10<T extends PsyObject>
static class
PsyOperator.Arity11<T extends PsyObject>
static class
PsyOperator.Arity20<T1 extends PsyObject,T2 extends PsyObject>
static class
PsyOperator.Arity21<T1 extends PsyObject,T2 extends PsyObject>
static class
PsyOperator.Arity30<T1 extends PsyObject,T2 extends PsyObject,T3 extends PsyObject>
static class
PsyOperator.Arity31<T1 extends PsyObject,T2 extends PsyObject,T3 extends PsyObject>
-
Constructor Summary
Constructors Constructor Description PsyOperator(String name)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
action(Interpreter interpreter)
void
execute(Interpreter interpreter)
Execute this object in the context of the interpreter.String
getName()
Returns a name of this operator.void
invoke(Interpreter interpreter)
Invoke this object in the context of the interpreter performing an action associated with it.String
toSyntaxString()
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.PsyObject
convert, psyClone, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, typeName
-
-
-
-
Constructor Detail
-
PsyOperator
public PsyOperator(String name)
-
-
Method Detail
-
execute
public void execute(Interpreter interpreter)
Execute this object in the context of the interpreter. Callsinvoke(Interpreter)
method.
-
invoke
public void invoke(Interpreter interpreter)
Invoke this object in the context of the interpreter performing an action associated with it.
-
action
public abstract void action(Interpreter interpreter) throws ClassCastException, PsyException
- Throws:
ClassCastException
PsyException
-
toSyntaxString
public String toSyntaxString()
Returns a syntatctic string representation of this operator. A syntatctic representation has a form of"--name--"
, wherename
is a string returned bygetName()
method.- Specified by:
toSyntaxString
in 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.
-
-