public class Tuple<T> extends Object implements Iterable<T>, Serializable, com.google.gwt.user.client.rpc.IsSerializable
Example: 1) Creation // single typed tuple Tuple<Long> nt = new Tuple<Long>(42L); // multi typed tuple Tuple<Object> ot = new Tuple<Object>("Lars Tackmann", "Age", 26); 2) Usage // get single element Integer val = (Integer) ot.get(2); // iterate tuple for (Object o : ot) System.out.printf("'%s' ", o.toString()); // print all elems System.out.printf("Object tuple: %s\n", ot.toString()); 3) Operations // The elements of two tuples a and b can be joined with // union operation that returns a new tuple. Tuple c = a.union (b);
Constructor and Description |
---|
Tuple()
Deprecated.
For serialization purpose use the other constructors
|
Tuple(T... args) |
Modifier and Type | Method and Description |
---|---|
void |
append(T... args)
Appends elements inside a tuple.
|
boolean |
equals(Object obj)
Compares two tuples.
|
T |
get(int index) |
List<T> |
getContent()
Deprecated.
For serialization purpose use the other constructors
|
int |
hashCode() |
Iterator<T> |
iterator() |
void |
setContent(List<T> content)
Deprecated.
For serialization purpose use the other constructors
|
int |
size() |
String |
toString() |
Tuple<? extends T> |
union(Tuple<? extends T> t) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public Tuple()
public Tuple(T... args)
public final List<T> getContent()
public final void setContent(List<T> content)
public final void append(T... args)
public final T get(int index)
public final int size()
public final boolean equals(Object obj)
Copyright © 2017. All Rights Reserved.