|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<Object>
com.healthmarketscience.common.util.Tuple1<ObjType0>
public class Tuple1<ObjType0>
Simple class for holding a single typed object (useful for returning additional objects from a method call). For convenience, a Tuple can act like an unmodifiable List of Object of a fixed size (the number of elements in the tuple).
Nested Class Summary | |
---|---|
protected static class |
Tuple1.Accessor
Helper class to enable direct indexed access to the tuple values. |
protected static class |
Tuple1.IterableIterator<Type>
An Iterable whose iterator method returns itself. |
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
Tuple1()
Initializes a new Tuple1 with a null object. |
|
Tuple1(ObjType0 obj)
Initializes a new Tuple1 with the provided object. |
Method Summary | ||
---|---|---|
Tuple1<ObjType0> |
clone()
Makes a copy of this Tuple1. |
|
static
|
collection0(Collection<? extends Tuple1<InObjType0>> col)
Returns a Collection adapter for element 0 of the Tuples of the given Collection. |
|
static
|
create(InObjType0 obj0)
Creates a new Tuple1 with the provided object. |
|
boolean |
equals(Object o)
Indicates whether the given Object is equal to this Tuple1. |
|
Object[] |
get()
Gets the object value of this tuple as an Object array. |
|
Object |
get(int index)
Get the value of this tuple identified by index, which must always be 0, since this tuple class stores exactly one object. |
|
ObjType0 |
get0()
Get the object of this tuple. |
|
int |
hashCode()
Returns a hash code for this Tuple1, based on the object it contains. |
|
static
|
iterable0(Iterable<? extends Tuple1<InObjType0>> iable)
Returns an Iterable adapter that returns an Iterator that iterates over element 0 of the tuples within the given Iterable/Iterator. |
|
void |
set(ObjType0 obj0)
Sets the value of this tuple. |
|
void |
set0(ObjType0 obj)
Sets the object of this tuple. |
|
int |
size()
Get the size of this tuple, which is always 1. |
Methods inherited from class java.util.AbstractList |
---|
add, add, addAll, clear, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList |
Methods inherited from class java.util.AbstractCollection |
---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
add, add, addAll, addAll, clear, contains, containsAll, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray, toArray |
Constructor Detail |
---|
public Tuple1()
public Tuple1(ObjType0 obj)
create(InObjType0)
instead, since it infers the type parameter based on
its argument.
obj
- the object to store in this Tuple1.Method Detail |
---|
public static <InObjType0> Tuple1<InObjType0> create(InObjType0 obj0)
obj0
- the object to store in this Tuple1.
public static <InObjType0> Iterable<InObjType0> iterable0(Iterable<? extends Tuple1<InObjType0>> iable)
public static <InObjType0> Collection<InObjType0> collection0(Collection<? extends Tuple1<InObjType0>> col)
public final ObjType0 get0()
public final void set0(ObjType0 obj)
obj
- the object to store in this tuple.public Object[] get()
public Object get(int index)
get
in interface List<Object>
get
in class AbstractList<Object>
index
- the index of the object to retrieve. Must be 0.
public final void set(ObjType0 obj0)
obj0
- the value to store in this tuple.public int size()
size
in interface Collection<Object>
size
in interface List<Object>
size
in class AbstractCollection<Object>
public Tuple1<ObjType0> clone()
clone
in class Object
public boolean equals(Object o)
equals
in interface Collection<Object>
equals
in interface List<Object>
equals
in class AbstractList<Object>
true
if the given Object refers to this Tuple1.true
if the given Object is an instance of Tuple1 for which
the contained object is equal to this Tuple1's object.false
otherwise.public int hashCode()
hashCode
in interface Collection<Object>
hashCode
in interface List<Object>
hashCode
in class AbstractList<Object>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |