|
org.openide.util 7.9.0 1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openide.util.Union2<First,Second>
public abstract class Union2<First,Second>
A union type which can contain one of two kinds of objects.
Object.equals(java.lang.Object)
and Object.hashCode()
treat this as a container,
not identical to the contained object, but the identity is based on the contained
object. The union is serialiable if its contained object is.
Object.toString()
delegates to the contained object.
Method Summary | ||
---|---|---|
abstract Union2<First,Second> |
clone()
|
|
static
|
createFirst(First first)
Construct a union based on the first type. |
|
static
|
createSecond(Second second)
Construct a union based on the second type. |
|
abstract First |
first()
Retrieve the union member of the first type. |
|
abstract boolean |
hasFirst()
Check if the union contains the first type. |
|
abstract boolean |
hasSecond()
Check if the union contains the second type. |
|
abstract Second |
second()
Retrieve the union member of the second type. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public abstract First first() throws IllegalArgumentException
IllegalArgumentException
- if the union really contains the second typepublic abstract Second second() throws IllegalArgumentException
IllegalArgumentException
- if the union really contains the first typepublic abstract boolean hasFirst()
public abstract boolean hasSecond()
public abstract Union2<First,Second> clone()
public static <First,Second> Union2<First,Second> createFirst(First first)
first
- an object of the first type
public static <First,Second> Union2<First,Second> createSecond(Second second)
second
- an object of the second type
|
org.openide.util 7.9.0 1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |