edu.iu.cnets.klatsch.lang
Class VList

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

public class VList
extends Value

This value represents a list (i.e., a one-dimensional array).


Field Summary
 Value[] ls
          the values actually being stored
 
Constructor Summary
VList(Value... ls)
           
 
Method Summary
(package private)  java.util.Comparator<Value> getComparator()
          Returns a comparator for sorting numeric values, in support of the sort() method.
(package private)  java.util.Comparator<Value> getComparator(VClosure proc)
          Returns a comparator for sorting numeric value using a user-supplied procedure, in support of the sort(p) method.
 Value method_filter(Value... args)
          filter(p) : Returns the members of the list for which p is true.
 Value method_get(Value... args)
          get(n) : Returns element n from the list.
 Value method_join(Value... args)
          join(ls) : Creates a new list containing the combination of this list and ls.
 Value method_len(Value... args)
          len() : Returns the length of the list.
 Value method_map(Value... args)
          map(p) : Returns the list obtained by calling p on each element.
 Value method_max_index(Value... args)
          max_index : Returns the index of the largest element in the list.
 Value method_max(Value... args)
          max : Returns the largest element in the list.
 Value method_mean(Value... args)
          mean : Returns the mean of the values in the list.
 Value method_min_index(Value... args)
          min_index : Returns the index of the smallest element in the list.
 Value method_min(Value... args)
          min : Returns the smallest element in the list.
 Value method_reduce(Value... args)
          reduce(p, acc) : Reduces the list to a single value by repeating acc = p(x, acc) for each x in the list.
 Value method_set(Value... args)
          set(n, v) : Sets element n to the value v.
 Value method_skew(Value... args)
          skew : Returns the skew of the values in the list.
 Value method_slice(Value... args)
          slice(n1, n2) : Returns the slice of elements from ls[n1] to ls[n2], inclusive.
 Value method_sort(Value... args)
          sort() : Sorts the numeric list in-place and returns it as a value.
 Value method_std(Value... args)
          std : Returns the standard deviation of the values in the list.
 Value method_stream(Value... args)
          stream() : Converts the list to a stream.
 Value method_sum(Value... args)
          sum : Returns the sum of the values of the list.
 java.lang.String toJson()
          Returns a JSON representation of the list.
 java.lang.String toString()
          Returns a printed representation of the list.
 
Methods inherited from class edu.iu.cnets.klatsch.lang.Value
require, requireCount, requireType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ls

public Value[] ls
the values actually being stored

Constructor Detail

VList

public VList(Value... ls)
Method Detail

getComparator

java.util.Comparator<Value> getComparator()
Returns a comparator for sorting numeric values, in support of the sort() method.


getComparator

java.util.Comparator<Value> getComparator(VClosure proc)
Returns a comparator for sorting numeric value using a user-supplied procedure, in support of the sort(p) method.


toString

public java.lang.String toString()
Returns a printed representation of the list.

Specified by:
toString in class Value
Returns:
a printable string

toJson

public java.lang.String toJson()
Returns a JSON representation of the list.

Overrides:
toJson in class Value
Returns:
the JSON representation

method_filter

public Value method_filter(Value... args)
                    throws EvaluationException
filter(p) : Returns the members of the list for which p is true.

Throws:
EvaluationException

method_get

public Value method_get(Value... args)
                 throws EvaluationException
get(n) : Returns element n from the list.

Throws:
EvaluationException

method_join

public Value method_join(Value... args)
                  throws EvaluationException
join(ls) : Creates a new list containing the combination of this list and ls.

Throws:
EvaluationException

method_len

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

Throws:
EvaluationException

method_map

public Value method_map(Value... args)
                 throws EvaluationException
map(p) : Returns the list obtained by calling p on each element.

Throws:
EvaluationException

method_max

public Value method_max(Value... args)
                 throws EvaluationException
max : Returns the largest element in the list.

Throws:
EvaluationException

method_max_index

public Value method_max_index(Value... args)
                       throws EvaluationException
max_index : Returns the index of the largest element in the list.

Throws:
EvaluationException

method_mean

public Value method_mean(Value... args)
                  throws EvaluationException
mean : Returns the mean of the values in the list.

Throws:
EvaluationException

method_min

public Value method_min(Value... args)
                 throws EvaluationException
min : Returns the smallest element in the list.

Throws:
EvaluationException

method_min_index

public Value method_min_index(Value... args)
                       throws EvaluationException
min_index : Returns the index of the smallest element in the list.

Throws:
EvaluationException

method_reduce

public Value method_reduce(Value... args)
                    throws EvaluationException
reduce(p, acc) : Reduces the list to a single value by repeating acc = p(x, acc) for each x in the list.

Throws:
EvaluationException

method_set

public Value method_set(Value... args)
                 throws EvaluationException
set(n, v) : Sets element n to the value v. Returns the value to support chaining.

Throws:
EvaluationException

method_skew

public Value method_skew(Value... args)
                  throws EvaluationException
skew : Returns the skew of the values in the list.

Throws:
EvaluationException

method_slice

public Value method_slice(Value... args)
                   throws EvaluationException
slice(n1, n2) : Returns the slice of elements from ls[n1] to ls[n2], inclusive.

Throws:
EvaluationException

method_sort

public Value method_sort(Value... args)
                  throws EvaluationException
sort() : Sorts the numeric list in-place and returns it as a value. sort(p) : Like sort(), but with a sorting procedure p(a, b).

Throws:
EvaluationException

method_std

public Value method_std(Value... args)
                 throws EvaluationException
std : Returns the standard deviation of the values in the list.

Throws:
EvaluationException

method_stream

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

Throws:
EvaluationException

method_sum

public Value method_sum(Value... args)
                 throws EvaluationException
sum : Returns the sum of the values of the list.

Throws:
EvaluationException