com.endeca.navigation
Class OptionalInt

java.lang.Object
  extended by com.endeca.navigation.OptionalInt

public class OptionalInt
extends Object

Class representing an int or an unset value. Unlike an int, an OptionalInt may be empty.


Constructor Summary
OptionalInt()
          Default constructor that creates an empty OptionalInt object.
OptionalInt(int val)
          Constructor specifying an int.
 
Method Summary
 int getInt()
          Accessor that returns the int of this OptionalInt.
 boolean isEmpty()
          Returns whether this OptionalInt is empty.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptionalInt

public OptionalInt()
Default constructor that creates an empty OptionalInt object.


OptionalInt

public OptionalInt(int val)
Constructor specifying an int.

Parameters:
val - The value of the int the OptionalInt holds.
Method Detail

getInt

public int getInt()
           throws NoSuchElementException
Accessor that returns the int of this OptionalInt.

Returns:
The int of this OptionalInt.
Throws:
NoSuchElementException

isEmpty

public boolean isEmpty()
Returns whether this OptionalInt is empty.

Returns:
Whether this OptionalInt is empty.


2010 Endeca Technologies, Inc.
Endeca Confidential