edu.iu.cnets.klatsch.lang
Class VStack

java.lang.Object
  extended by edu.iu.cnets.klatsch.lang.Value
      extended by edu.iu.cnets.klatsch.lang.VStack

public class VStack
extends Value

This value represents a push-down stack (i.e., LIFO).


Field Summary
(package private)  java.util.Stack<Value> s
          the values actually being stored
 
Constructor Summary
VStack(java.util.Stack<Value> s)
           
 
Method Summary
 Value method_empty(Value... args)
          empty() : Returns true if the stack is empty.
 Value method_len(Value... args)
          len() : Returns the length of the stack.
 Value method_list(Value... args)
          list() : Converts the stack to a list.
 Value method_peek(Value... args)
          peek() : Returns the top element without popping it.
 Value method_pop(Value... args)
          pop() : Remove and return the top element in the stack.
 Value method_push(Value... args)
          push(v) : Pushes the value v onto the top of the stack.
 Value method_stream(Value... args)
          stream() : Converts the stack to a stream.
 java.lang.String toString()
           
 
Methods inherited from class edu.iu.cnets.klatsch.lang.Value
require, requireCount, requireType, toJson
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

s

java.util.Stack<Value> s
the values actually being stored

Constructor Detail

VStack

public VStack(java.util.Stack<Value> s)
Method Detail

toString

public java.lang.String toString()
Specified by:
toString in class Value

method_empty

public Value method_empty(Value... args)
                   throws EvaluationException
empty() : Returns true if the stack is empty.

Throws:
EvaluationException

method_len

public Value method_len(Value... args)
                 throws EvaluationException
len() : Returns the length of the stack.

Throws:
EvaluationException

method_list

public Value method_list(Value... args)
                  throws EvaluationException
list() : Converts the stack to a list.

Throws:
EvaluationException

method_peek

public Value method_peek(Value... args)
                  throws EvaluationException
peek() : Returns the top element without popping it.

Throws:
EvaluationException

method_pop

public Value method_pop(Value... args)
                 throws EvaluationException
pop() : Remove and return the top element in the stack.

Throws:
EvaluationException

method_push

public Value method_push(Value... args)
                  throws EvaluationException
push(v) : Pushes the value v onto the top of the stack. Returns the stack to support method chaining.

Throws:
EvaluationException

method_stream

public Value method_stream(Value... args)
                    throws EvaluationException
stream() : Converts the stack to a stream.

Throws:
EvaluationException