public class Tuple extends Compound
Tuple triple =
new Tuple(
jpl.Util.toTermArray(
new Atom( "a" ),
new Atom( "b" ),
new Atom( "c" ) ) );
This constructor (using the jpl.Util class for convenience)
creates a triple corresponding to the Prolog tuple (a,b,c).The Tuple.Pair class can be used to create 2-element tuples. Use the let() method to obtain a reference to the ith (starting from 0) element in the Tuple.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library Public License for more details.
Compound| Modifier and Type | Class and Description |
|---|---|
static class |
Tuple.Pair
A Pair is a two-element Tuple
|
| Constructor and Description |
|---|
Tuple(Term[] elts)
Create a Tuple whose arity is determined by the size of the
input array.
|
Tuple(Term t0,
Term t1)
This constructor is shorthand for
|
Tuple(Term t0,
Term t1,
Term t2)
This constructor is shorthand for
|
Tuple(Term t0,
Term t1,
Term t2,
Term t3)
This constructor is shorthand for
|
Tuple(Term t0,
Term t1,
Term t2,
Term t3,
Term t4)
This constructor is shorthand for
|
Tuple(Term t0,
Term t1,
Term t2,
Term t3,
Term t4,
Term t5)
This constructor is shorthand for
|
Tuple(Term t0,
Term t1,
Term t2,
Term t3,
Term t4,
Term t5,
Term t6)
This constructor is shorthand for
|
Tuple(Term t0,
Term t1,
Term t2,
Term t3,
Term t4,
Term t5,
Term t6,
Term t7)
This constructor is shorthand for
|
Tuple(Term t0,
Term t1,
Term t2,
Term t3,
Term t4,
Term t5,
Term t6,
Term t7,
Term t8)
This constructor is shorthand for
|
Tuple(Term t0,
Term t1,
Term t2,
Term t3,
Term t4,
Term t5,
Term t6,
Term t7,
Term t8,
Term t9)
This constructor is shorthand for
|
| Modifier and Type | Method and Description |
|---|---|
String |
debugString() |
Term |
elt(int i) |
String |
toString()
Converts a Compound to its String form, atom( arg_1, ..., arg_n )
|
args, atom, computeSubstitution, equals, from_term_t, ith, putcomputeSubstitutions, debugString, from_term_t, terms_equals, terms_to_term_ts, toStringpublic Tuple(Term[] elts)
elts - the Terms in the Tuplepublic Tuple(Term t0, Term t1)
new Tuple(
Util.toTermArray( t0, t1 ) )
t0 - a jpl.Termt1 - a jpl.Termpublic Tuple(Term t0, Term t1, Term t2)
new Tuple(
Util.toTermArray( t0, t1, t2 ) )
t0 - a jpl.Termt1 - a jpl.Termt2 - a jpl.Termpublic Tuple(Term t0, Term t1, Term t2, Term t3)
new Tuple(
Util.toTermArray( t0, t1, t2, t3 ) )
t0 - a jpl.Termt1 - a jpl.Termt2 - a jpl.Termt3 - a jpl.Termpublic Tuple(Term t0, Term t1, Term t2, Term t3, Term t4)
new Tuple(
Util.toTermArray( t0, t1, t2, t3, t4 ) )
t0 - a jpl.Termt1 - a jpl.Termt2 - a jpl.Termt3 - a jpl.Termt4 - a jpl.Termpublic Tuple(Term t0, Term t1, Term t2, Term t3, Term t4, Term t5)
new Tuple(
Util.toTermArray( t0, t1, t2, t3, t4,
t5 ) )
t0 - a jpl.Termt1 - a jpl.Termt2 - a jpl.Termt3 - a jpl.Termt4 - a jpl.Termt5 - a jpl.Termpublic Tuple(Term t0, Term t1, Term t2, Term t3, Term t4, Term t5, Term t6)
new Tuple(
Util.toTermArray( t0, t1, t2, t3, t4,
t5, t6 ) )
t0 - a jpl.Termt1 - a jpl.Termt2 - a jpl.Termt3 - a jpl.Termt4 - a jpl.Termt5 - a jpl.Termt6 - a jpl.Termpublic Tuple(Term t0, Term t1, Term t2, Term t3, Term t4, Term t5, Term t6, Term t7)
new Tuple(
Util.toTermArray( t0, t1, t2, t3, t4,
t5, t6, t7 ) )
t0 - a jpl.Termt1 - a jpl.Termt2 - a jpl.Termt3 - a jpl.Termt4 - a jpl.Termt5 - a jpl.Termt6 - a jpl.Termt7 - a jpl.Termpublic Tuple(Term t0, Term t1, Term t2, Term t3, Term t4, Term t5, Term t6, Term t7, Term t8)
new Tuple(
Util.toTermArray( t0, t1, t2, t3, t4,
t5, t6, t7, t8 ) )
t0 - a jpl.Termt1 - a jpl.Termt2 - a jpl.Termt3 - a jpl.Termt4 - a jpl.Termt5 - a jpl.Termt6 - a jpl.Termt7 - a jpl.Termt8 - a jpl.Termpublic Tuple(Term t0, Term t1, Term t2, Term t3, Term t4, Term t5, Term t6, Term t7, Term t8, Term t9)
new Tuple(
Util.toTermArray( t0, t1, t2, t3, t4,
t5, t6, t7, t8, t9 ) )
t0 - a jpl.Termt1 - a jpl.Termt2 - a jpl.Termt3 - a jpl.Termt4 - a jpl.Termt5 - a jpl.Termt6 - a jpl.Termt7 - a jpl.Termt8 - a jpl.Termt9 - a jpl.Termpublic final Term elt(int i)
public String toString()
Compoundpublic String debugString()
debugString in class CompoundCopyright © 2015. All rights reserved.