abstract class Function[R] extends Postfix[R] with Precedence[R]
Represents a function.
A function can have zero or more arguments. Immediately following the function, there should be a pair of brackets, within which there should be the arguments to the function. The arguments to the function should be separated by the ArgSeparator token.
For example, in sin(4)
, sin
is a function that accepts one argument. Similarly, in max(3, 4)
, max
is
a function that accepts two arguments, and ',
' is an argument separator.
- R
The type that the evaluator should return after evaluating the tokens
- Source
- Token.scala
- Alphabetic
- By Inheritance
- Function
- Precedence
- Postfix
- Token
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
Function(args: Int)
- args
The number of arguments this function accepts
Abstract Value Members
-
abstract
def
apply(args: Seq[R]): R
Applies the function on the given arguments and returns the result.
Applies the function on the given arguments and returns the result.
- args
The arguments to apply the function on. The length of this parameter will always be the number of arguments this function accepts.
- returns
The result of applying the function on the input arguments
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val args: Int
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
precedence: Int
The precedence of the function, that is, the priority with which it should be evaluated.
The precedence of the function, that is, the priority with which it should be evaluated.
By default this is
Int.MaxValue
to indicate highest priority.- returns
The precedence of the function
- Definition Classes
- Function → Precedence
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
This is the documentation for the Evaluator project (see GitHub).
The main package net.totietje.evaluator. The net.totietje.complex package contains an example usage of this package, which may also be useful.