|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.omegahat.Environment.lib.Language.SequenceFunctions
Class used with the addFunctionTable() method to provide "functions" for performing basic sequence
operations.
| Constructor Summary | |
SequenceFunctions()
|
|
| Method Summary | |
static java.lang.Object[] |
c(java.lang.Object[] a,
java.lang.Object[] b)
Specialized version of the more general method in VarSequenceFunctions,
concatenates two arrays into a single array containing the elements of both in the order
they are specified. |
static java.lang.Object |
cycle(java.lang.Object[] vals,
int times)
Replicates the specified array, repeating the sequence of elements times times, resulting in an array of length
vals.length * times
|
static java.lang.Object |
cycle(java.util.Vector vals,
int times)
Take the contents of a vector and repeat them in order for a total length of vals.size() * times
|
static java.lang.Object[] |
rep(java.lang.Object obj,
int length)
repeat the specified object length times
and return an array. |
static java.lang.Object[] |
rep(java.lang.Object obj,
int length,
boolean copy)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SequenceFunctions()
| Method Detail |
public static java.lang.Object[] rep(java.lang.Object obj,
int length)
length times
and return an array.
public static java.lang.Object[] rep(java.lang.Object obj,
int length,
boolean copy)
public static java.lang.Object cycle(java.lang.Object[] vals,
int times)
times times, resulting in an array of length
vals.length * times
Omegahat Example:
[] o = new Object[]{1,"x"}
[] cycle(o, 3)
1
"x"
1
"x"
1
"x"
public static java.lang.Object cycle(java.util.Vector vals,
int times)
vals.size() * times
Omegahat Example:
v = util.Vector()
v[[0]] = 1
v[[1]] = "x"
cycle(v, 3)
[1, "x", 1, "x", 1, "x"] // vector of length 6
public static java.lang.Object[] c(java.lang.Object[] a,
java.lang.Object[] b)
VarSequenceFunctions,
concatenates two arrays into a single array containing the elements of both in the order
they are specified.
a = new Object[]
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||