Mercurial Hosting > luan
comparison src/luan/modules/TableLuan.java @ 1334:c88b486a9511
make some Luan methods static
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 12 Feb 2019 22:53:57 -0700 |
parents | 25746915a241 |
children | e0cf0d108a77 |
comparison
equal
deleted
inserted
replaced
1333:25746915a241 | 1334:c88b486a9511 |
---|---|
12 import luan.LuanMethod; | 12 import luan.LuanMethod; |
13 | 13 |
14 | 14 |
15 public final class TableLuan { | 15 public final class TableLuan { |
16 | 16 |
17 public static String concat(Luan luan,LuanTable list,String sep,Integer i,Integer j) throws LuanException { | 17 public static String concat(LuanTable list,String sep,Integer i,Integer j) throws LuanException { |
18 int first = i==null ? 1 : i; | 18 int first = i==null ? 1 : i; |
19 int last = j==null ? list.length() : j; | 19 int last = j==null ? list.length() : j; |
20 StringBuilder buf = new StringBuilder(); | 20 StringBuilder buf = new StringBuilder(); |
21 for( int k=first; k<=last; k++ ) { | 21 for( int k=first; k<=last; k++ ) { |
22 Object val = list.get(k); | 22 Object val = list.get(k); |
23 if( val==null ) | 23 if( val==null ) |
24 break; | 24 break; |
25 if( sep!=null && k > first ) | 25 if( sep!=null && k > first ) |
26 buf.append(sep); | 26 buf.append(sep); |
27 String s = luan.toString(val); | 27 String s = Luan.luanToString(val); |
28 buf.append(s); | 28 buf.append(s); |
29 } | 29 } |
30 return buf.toString(); | 30 return buf.toString(); |
31 } | 31 } |
32 | 32 |