|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.molae.pipe.basic.ObjectProxy<B>
net.sf.molae.pipe.union.ObjectUnion<B,T1,T2>
public class ObjectUnion<B,T1 extends B,T2 extends B>
An instance of a union of type T1 or type T2,
of which neither is a superclass of the other.
The base type of a union is the most specific class
that is a supertype of both, T1 and T2.
The union implements the methods of the supertype.
ObjectUnion implements the union with base type Object
.
Constructor Summary | |
---|---|
protected |
ObjectUnion(T1 base)
Creates an object union of type 1 with the given value. |
protected |
ObjectUnion(T2 base,
boolean dummy)
Creates an object union of type 2 with the given value. |
Method Summary | ||
---|---|---|
T1 |
getBase1()
Allows a type safe get of the base value. |
|
T2 |
getBase2()
Allows a type safe get of the base value. |
|
boolean |
isOfType1()
Gives information about the base type of this union. |
|
static
|
newInstance1(T1 base)
Constructs an ObjectUnion of type T1. |
|
static
|
newInstance2(T2 base)
Constructs an ObjectUnion of type T2. |
Methods inherited from class net.sf.molae.pipe.basic.ObjectProxy |
---|
assertNotNull, equals, getBase, hashCode, toString, toVerboseString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected ObjectUnion(T1 base)
base
- value of this object unionprotected ObjectUnion(T2 base, boolean dummy)
base
- value of this object uniondummy
- is ignoredMethod Detail |
---|
public static <B,T1 extends B,T2 extends B> ObjectUnion<B,T1,T2> newInstance1(T1 base)
base
- value of this instancepublic static <B,T1 extends B,T2 extends B> ObjectUnion<B,T1,T2> newInstance2(T2 base)
base
- value of this instancepublic boolean isOfType1()
true
if the base value is of type T1
public T1 getBase1()
ClassCastException
- base value is not of T1
public T2 getBase2()
ClassCastException
- base value is not of T2
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |