edu.vub.at.objects
Interface ATTable

All Superinterfaces:
ATAbstractGrammar, ATConversions, ATExpression, ATObject, ATStatement
All Known Subinterfaces:
ATMailbox
All Known Implementing Classes:
NATTable

public interface ATTable
extends ATExpression

The public interface to a native AmtientTalk table (an array). Extends the ATExpression interface as a Table may also be output by the parser as a literal.

Author:
tvc

Method Summary
 ATTable base__oppls_(ATTable other)
          [1,2,3] + [4,5] => [1,2,3,4,5]
 ATObject base_at(ATNumber index)
           
 ATObject base_atPut(ATNumber index, ATObject value)
           
 ATNil base_each_(ATClosure clo)
          Apply a closure to each element of the table
 ATTable base_filter_(ATClosure clo)
          Keep only those elements of the table for which the closure evaluates to true.
 ATObject base_find_(ATClosure clo)
          Return the index of the first element for which the given predicate returns true.
 ATNumber base_getLength()
           
 ATText base_implode()
          Implode the receiver table of characters into a text string
 ATBoolean base_isEmpty()
           
 ATText base_join(ATText txt)
          Join all the text elements of the receiver table into a text string where the argument is used as a separator
 ATTable base_map_(ATClosure clo)
          Map a closure over each element of the table, resulting in a new table.
 ATTable base_select(ATNumber start, ATNumber stop)
          Select a subrange of the table: idx: 1 2 3 4 5 [a, b, c, d, e].select(2,4) => [b, c, d]
 ATObject base_with_collect_(ATObject init, ATClosure clo)
          Collect all elements of the table by combining them using the given closure.
 
Methods inherited from interface edu.vub.at.objects.ATObject
base__opeql__opeql_, base_init, base_new, meta_addField, meta_addMethod, meta_assignField, meta_assignVariable, meta_clone, meta_defineField, meta_doesNotUnderstand, meta_eval, meta_extend, meta_getDynamicParent, meta_getLexicalParent, meta_getStripes, meta_grabField, meta_grabMethod, meta_invoke, meta_isCloneOf, meta_isRelatedTo, meta_isStripedWith, meta_listFields, meta_listMethods, meta_lookup, meta_newInstance, meta_pass, meta_print, meta_quote, meta_receive, meta_resolve, meta_respondsTo, meta_select, meta_send, meta_share
 
Methods inherited from interface edu.vub.at.objects.coercion.ATConversions
asAmbientTalkObject, asJavaClassUnderSymbiosis, asJavaObjectUnderSymbiosis, asNativeBoolean, asNativeException, asNativeFarReference, asNativeFraction, asNativeNumber, asNativeNumeric, asNativeTable, asNativeText, base_asActorMirror, base_asAsyncMessage, base_asBegin, base_asBoolean, base_asClosure, base_asDefinition, base_asExpression, base_asFarReference, base_asField, base_asHandler, base_asMessage, base_asMessageCreation, base_asMethod, base_asMirror, base_asNumber, base_asSplice, base_asStatement, base_asStripe, base_asSymbol, base_asTable, base_asUnquoteSplice, base_asVariableAssignment, base_isBoolean, base_isCallFrame, base_isClosure, base_isFarReference, base_isMessageCreation, base_isMethod, base_isMirror, base_isSplice, base_isStripe, base_isSymbol, base_isTable, base_isUnquoteSplice, base_isVariableAssignment, isAmbientTalkObject, isJavaObjectUnderSymbiosis, isNativeBoolean, isNativeField, isNativeText
 

Method Detail

base_getLength

public ATNumber base_getLength()
                        throws InterpreterException
Throws:
InterpreterException

base_at

public ATObject base_at(ATNumber index)
                 throws InterpreterException
Throws:
InterpreterException

base_atPut

public ATObject base_atPut(ATNumber index,
                           ATObject value)
                    throws InterpreterException
Throws:
InterpreterException

base_isEmpty

public ATBoolean base_isEmpty()
                       throws InterpreterException
Throws:
InterpreterException

base_each_

public ATNil base_each_(ATClosure clo)
                 throws InterpreterException
Apply a closure to each element of the table. [ tab ].each: { |v| ... }

Returns:
nil, always
Throws:
InterpreterException

base_map_

public ATTable base_map_(ATClosure clo)
                  throws InterpreterException
Map a closure over each element of the table, resulting in a new table. result := [ tab ].map: { |v| ... }

Throws:
InterpreterException

base_with_collect_

public ATObject base_with_collect_(ATObject init,
                                   ATClosure clo)
                            throws InterpreterException
Collect all elements of the table by combining them using the given closure. The first time closure is called, the initialization element is passed as first argument. result := [ tab ].with: 0 collect: { |total, next| total + next }

Throws:
InterpreterException

base_filter_

public ATTable base_filter_(ATClosure clo)
                     throws InterpreterException
Keep only those elements of the table for which the closure evaluates to true. result := [ tabl ].filter: { |elt| booleanCondition(elt) }

Throws:
InterpreterException

base_find_

public ATObject base_find_(ATClosure clo)
                    throws InterpreterException
Return the index of the first element for which the given predicate returns true. Returns nil if no element satisfying the closure can be found. result := [ tabl ].find: { |elt| booleanCondition(elt) }

Throws:
InterpreterException

base_implode

public ATText base_implode()
                    throws InterpreterException
Implode the receiver table of characters into a text string

Throws:
InterpreterException

base_join

public ATText base_join(ATText txt)
                 throws InterpreterException
Join all the text elements of the receiver table into a text string where the argument is used as a separator

Throws:
InterpreterException

base_select

public ATTable base_select(ATNumber start,
                           ATNumber stop)
                    throws InterpreterException
Select a subrange of the table: idx: 1 2 3 4 5 [a, b, c, d, e].select(2,4) => [b, c, d]

Throws:
InterpreterException

base__oppls_

public ATTable base__oppls_(ATTable other)
                     throws InterpreterException
[1,2,3] + [4,5] => [1,2,3,4,5]

Throws:
InterpreterException