annotate core/src/luan/modules/TableLuan.java @ 427:dae264ad6a7b

fix LuanTable.put() to use metatables
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 01 May 2015 19:29:07 -0600
parents 23a93c118042
children 3ffe8ba5b297
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
167
4c0131c2b650 merge luan/lib into modules
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 142
diff changeset
1 package luan.modules;
44
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
2
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
3 import java.util.Comparator;
118
735708619119 add Debug.debug()
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 112
diff changeset
4 import java.util.List;
44
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
5 import java.util.ArrayList;
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
6 import java.util.Arrays;
48
64ecb7a3aad7 rename Lua to Luan
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 46
diff changeset
7 import luan.Luan;
64ecb7a3aad7 rename Lua to Luan
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 46
diff changeset
8 import luan.LuanState;
64ecb7a3aad7 rename Lua to Luan
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 46
diff changeset
9 import luan.LuanTable;
64ecb7a3aad7 rename Lua to Luan
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 46
diff changeset
10 import luan.LuanFunction;
64ecb7a3aad7 rename Lua to Luan
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 46
diff changeset
11 import luan.LuanException;
76
97b03fc807ad add HttpLib and WebServlet
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 74
diff changeset
12 import luan.LuanRuntimeException;
297
899253043270 remove PackageLuan.load_lib()
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 274
diff changeset
13 import luan.LuanMethod;
407
7fd9f1b7b878 replace LuanPropertyTable with LuanPropertyMeta
Franklin Schmidt <fschmidt@gmail.com>
parents: 297
diff changeset
14 import luan.LuanPropertyMeta;
44
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
15
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
16
168
ebe9db183eb7 rename *Lib.java to *Luan.java
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 167
diff changeset
17 public final class TableLuan {
44
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
18
49
8ede219cd111 add WebShell
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 48
diff changeset
19 public static String concat(LuanState luan,LuanTable list,String sep,Integer i,Integer j) throws LuanException {
44
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
20 int first = i==null ? 1 : i;
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
21 int last = j==null ? list.length() : j;
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
22 StringBuilder buf = new StringBuilder();
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
23 for( int k=first; k<=last; k++ ) {
426
23a93c118042 fix LuanTable.get() to use metatables
Franklin Schmidt <fschmidt@gmail.com>
parents: 425
diff changeset
24 Object val = list.rawGet(k);
44
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
25 if( val==null )
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
26 break;
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
27 if( sep!=null && k > first )
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
28 buf.append(sep);
48
64ecb7a3aad7 rename Lua to Luan
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 46
diff changeset
29 String s = Luan.asString(val);
44
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
30 if( s==null )
130
0594c132888b cleanup
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 124
diff changeset
31 throw luan.exception( "invalid value ("+Luan.type(val)+") at index "+k+" in table for 'concat'" );
44
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
32 buf.append(val);
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
33 }
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
34 return buf.toString();
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
35 }
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
36
222
b76fcb72d97d add AbstractLuanTable and improve HttpLuan
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 221
diff changeset
37 public static void insert(LuanTable list,int pos,Object value){
b76fcb72d97d add AbstractLuanTable and improve HttpLuan
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 221
diff changeset
38 list.insert(pos,value);
44
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
39 }
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
40
222
b76fcb72d97d add AbstractLuanTable and improve HttpLuan
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 221
diff changeset
41 public static Object remove(LuanTable list,int pos) {
b76fcb72d97d add AbstractLuanTable and improve HttpLuan
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 221
diff changeset
42 return list.remove(pos);
44
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
43 }
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
44
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
45 private static interface LessThan {
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
46 public boolean isLessThan(Object o1,Object o2);
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
47 }
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
48
49
8ede219cd111 add WebShell
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 48
diff changeset
49 public static void sort(final LuanState luan,LuanTable list,final LuanFunction comp) throws LuanException {
44
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
50 final LessThan lt;
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
51 if( comp==null ) {
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
52 lt = new LessThan() {
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
53 public boolean isLessThan(Object o1,Object o2) {
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
54 try {
130
0594c132888b cleanup
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 124
diff changeset
55 return luan.isLessThan(o1,o2);
48
64ecb7a3aad7 rename Lua to Luan
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 46
diff changeset
56 } catch(LuanException e) {
64ecb7a3aad7 rename Lua to Luan
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 46
diff changeset
57 throw new LuanRuntimeException(e);
44
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
58 }
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
59 }
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
60 };
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
61 } else {
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
62 lt = new LessThan() {
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
63 public boolean isLessThan(Object o1,Object o2) {
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
64 try {
130
0594c132888b cleanup
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 124
diff changeset
65 return Luan.toBoolean(Luan.first(luan.call(comp,"comp-arg",new Object[]{o1,o2})));
48
64ecb7a3aad7 rename Lua to Luan
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 46
diff changeset
66 } catch(LuanException e) {
64ecb7a3aad7 rename Lua to Luan
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 46
diff changeset
67 throw new LuanRuntimeException(e);
44
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
68 }
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
69 }
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
70 };
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
71 }
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
72 try {
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
73 list.sort( new Comparator<Object>() {
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
74 public int compare(Object o1,Object o2) {
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
75 return lt.isLessThan(o1,o2) ? -1 : lt.isLessThan(o2,o1) ? 1 : 0;
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
76 }
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
77 } );
48
64ecb7a3aad7 rename Lua to Luan
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 46
diff changeset
78 } catch(LuanRuntimeException e) {
64ecb7a3aad7 rename Lua to Luan
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 46
diff changeset
79 throw (LuanException)e.getCause();
44
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
80 }
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
81 }
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
82
118
735708619119 add Debug.debug()
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 112
diff changeset
83 public static LuanTable pack(Object... args) {
411
23b99a5039b5 remove Luan.newTable()
Franklin Schmidt <fschmidt@gmail.com>
parents: 407
diff changeset
84 LuanTable tbl = new LuanTable();
221
ec016471c6eb make LuanTable an interface
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 171
diff changeset
85 boolean hasNull = false;
ec016471c6eb make LuanTable an interface
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 171
diff changeset
86 for( int i=0; i<args.length; i++ ) {
ec016471c6eb make LuanTable an interface
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 171
diff changeset
87 Object v = args[i];
ec016471c6eb make LuanTable an interface
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 171
diff changeset
88 if( v==null ) {
ec016471c6eb make LuanTable an interface
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 171
diff changeset
89 hasNull = true;
ec016471c6eb make LuanTable an interface
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 171
diff changeset
90 } else if( !hasNull ) {
ec016471c6eb make LuanTable an interface
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 171
diff changeset
91 tbl.add(v);
ec016471c6eb make LuanTable an interface
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 171
diff changeset
92 } else {
427
dae264ad6a7b fix LuanTable.put() to use metatables
Franklin Schmidt <fschmidt@gmail.com>
parents: 426
diff changeset
93 tbl.rawPut(i+1,v);
221
ec016471c6eb make LuanTable an interface
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 171
diff changeset
94 }
ec016471c6eb make LuanTable an interface
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 171
diff changeset
95 }
427
dae264ad6a7b fix LuanTable.put() to use metatables
Franklin Schmidt <fschmidt@gmail.com>
parents: 426
diff changeset
96 tbl.rawPut( "n", args.length );
221
ec016471c6eb make LuanTable an interface
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 171
diff changeset
97 return tbl;
44
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
98 }
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
99
297
899253043270 remove PackageLuan.load_lib()
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 274
diff changeset
100 @LuanMethod public static Object[] unpack(LuanTable tbl,Integer iFrom,Integer iTo) {
118
735708619119 add Debug.debug()
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 112
diff changeset
101 int from = iFrom!=null ? iFrom : 1;
735708619119 add Debug.debug()
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 112
diff changeset
102 int to = iTo!=null ? iTo : tbl.length();
735708619119 add Debug.debug()
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 112
diff changeset
103 List<Object> list = new ArrayList<Object>();
735708619119 add Debug.debug()
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 112
diff changeset
104 for( int i=from; i<=to; i++ ) {
426
23a93c118042 fix LuanTable.get() to use metatables
Franklin Schmidt <fschmidt@gmail.com>
parents: 425
diff changeset
105 list.add( tbl.rawGet(i) );
118
735708619119 add Debug.debug()
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 112
diff changeset
106 }
735708619119 add Debug.debug()
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 112
diff changeset
107 return list.toArray();
44
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
108 }
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
109
48
64ecb7a3aad7 rename Lua to Luan
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 46
diff changeset
110 public static LuanTable sub_list(LuanTable list,int from,int to) {
44
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
111 return list.subList(from,to);
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
112 }
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
113
274
8afe9f2fdfec AB testing, not fully tested
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 222
diff changeset
114 public static LuanTable clone(LuanTable tbl) {
425
0a2fb80907f9 minor LuanTable cleanup
Franklin Schmidt <fschmidt@gmail.com>
parents: 415
diff changeset
115 return new LuanTable(tbl);
274
8afe9f2fdfec AB testing, not fully tested
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 222
diff changeset
116 }
8afe9f2fdfec AB testing, not fully tested
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 222
diff changeset
117
407
7fd9f1b7b878 replace LuanPropertyTable with LuanPropertyMeta
Franklin Schmidt <fschmidt@gmail.com>
parents: 297
diff changeset
118 public static LuanTable new_property_table() {
415
ce8e19567911 make LuanPropertyMeta a singleton
Franklin Schmidt <fschmidt@gmail.com>
parents: 411
diff changeset
119 return LuanPropertyMeta.INSTANCE.newTable();
407
7fd9f1b7b878 replace LuanPropertyTable with LuanPropertyMeta
Franklin Schmidt <fschmidt@gmail.com>
parents: 297
diff changeset
120 }
44
57054fa43189 implement table lib
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
121 }