|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectedu.vub.at.objects.natives.NATNil
edu.vub.at.objects.natives.NATByCopy
edu.vub.at.objects.natives.grammar.NATAbstractGrammar
edu.vub.at.objects.natives.grammar.AGExpression
edu.vub.at.objects.natives.NATTable
The native implementation of an AmbientTalk table. A table is implemented by a java array. An important distinction between AT tables and Java arrays is that ATTable objects are indexed from [1..size] rather than [0..size[
| Field Summary | |
ATObject[] |
elements_
|
static NATTable |
EMPTY
|
| Fields inherited from class edu.vub.at.objects.natives.NATNil |
_INSTANCE_ |
| Constructor Summary | |
private |
NATTable(ATObject[] elements)
|
| Method Summary | |
NATTable |
asNativeTable()
|
static NATTable |
atValue(ATObject[] array)
Table factory method. |
ATTable |
base__oppls_(ATTable other)
[1,2,3] + [4,5] => [1,2,3,4,5] |
ATTable |
base_asTable()
|
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 sep)
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 first,
ATNumber last)
tab.select(start, stop) == els = [ ] ; start.to: stop do: { |i| els << tab[i] } ; els |
ATObject |
base_with_collect_(ATObject init,
ATClosure clo)
Collect all elements of the table by combining them using the given closure. |
static ATObject[] |
collate(ATObject[] ary1,
ATObject[] ary2)
Auxiliary method to collate two Java arrays |
protected int |
extractIndex(ATNumber atIndex)
|
ATObject |
meta_eval(ATContext ctx)
To evaluate a table, evaluate all of its constituent expressions, taking special care to take into account spliced expressions. |
ATTable |
meta_getStripes()
Returns the stripes of this object. |
NATText |
meta_print()
Prints out the object in a human-readable way. |
ATObject |
meta_quote(ATContext ctx)
To quote a table, quote all elements of the table. |
ATObject |
meta_resolve()
When an object is deserialized after it has been passed to another actor, it is given a chance to tell the interpreter which object it represents. |
static NATTable |
of(ATObject one)
|
static NATTable |
of(ATObject one,
ATObject two)
|
static NATTable |
of(ATObject one,
ATObject two,
ATObject three)
|
| Methods inherited from class edu.vub.at.objects.natives.grammar.AGExpression |
base_asExpression |
| Methods inherited from class edu.vub.at.objects.natives.NATByCopy |
meta_pass |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 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_extend, meta_getDynamicParent, meta_getLexicalParent, meta_grabField, meta_grabMethod, meta_invoke, meta_isCloneOf, meta_isRelatedTo, meta_isStripedWith, meta_listFields, meta_listMethods, meta_lookup, meta_newInstance, meta_pass, meta_receive, meta_respondsTo, meta_select, meta_send, meta_share |
| Field Detail |
public static final NATTable EMPTY
public final ATObject[] elements_
| Constructor Detail |
private NATTable(ATObject[] elements)
| Method Detail |
public static final NATTable atValue(ATObject[] array)
public static final NATTable of(ATObject one)
public static final NATTable of(ATObject one,
ATObject two)
public static final NATTable of(ATObject one,
ATObject two,
ATObject three)
public ATTable base_asTable()
base_asTable in interface ATConversionsbase_asTable in class NATNilpublic NATTable asNativeTable()
asNativeTable in interface ATConversionsasNativeTable in class NATNil
public ATObject meta_eval(ATContext ctx)
throws InterpreterException
meta_eval in interface ATObjectmeta_eval in class NATNilInterpreterException
public ATObject meta_quote(ATContext ctx)
throws InterpreterException
meta_quote in interface ATObjectmeta_quote in class NATNilInterpreterException
public NATText meta_print()
throws InterpreterException
ATObject
meta_print in interface ATObjectmeta_print in class NATNilInterpreterException
public ATTable meta_getStripes()
throws InterpreterException
ATObject
meta_getStripes in interface ATObjectmeta_getStripes in class AGExpressionInterpreterExceptionpublic ATNumber base_getLength()
base_getLength in interface ATTable
public ATObject base_at(ATNumber index)
throws InterpreterException
base_at in interface ATTableInterpreterException
public ATObject base_atPut(ATNumber index,
ATObject value)
throws InterpreterException
base_atPut in interface ATTableInterpreterExceptionpublic ATBoolean base_isEmpty()
base_isEmpty in interface ATTable
public ATNil base_each_(ATClosure clo)
throws InterpreterException
ATTable
base_each_ in interface ATTableInterpreterException
public ATTable base_map_(ATClosure clo)
throws InterpreterException
ATTable
base_map_ in interface ATTableInterpreterException
public ATObject base_with_collect_(ATObject init,
ATClosure clo)
throws InterpreterException
ATTable
base_with_collect_ in interface ATTableInterpreterException
public ATTable base_filter_(ATClosure clo)
throws InterpreterException
ATTable
base_filter_ in interface ATTableInterpreterException
public ATObject base_find_(ATClosure clo)
throws InterpreterException
ATTable
base_find_ in interface ATTableInterpreterException
public ATText base_implode()
throws InterpreterException
ATTable
base_implode in interface ATTableInterpreterException
public ATText base_join(ATText sep)
throws InterpreterException
ATTable
base_join in interface ATTableInterpreterException
public ATTable base_select(ATNumber first,
ATNumber last)
throws InterpreterException
base_select in interface ATTableInterpreterException
public ATTable base__oppls_(ATTable other)
throws InterpreterException
ATTable
base__oppls_ in interface ATTableInterpreterException
protected int extractIndex(ATNumber atIndex)
throws InterpreterException
InterpreterException
public static final ATObject[] collate(ATObject[] ary1,
ATObject[] ary2)
public ATObject meta_resolve()
throws InterpreterException
ATObject
meta_resolve in interface ATObjectmeta_resolve in class NATByCopyInterpreterException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||