danbikel.wordnet
Class RemoteEnumerator
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--danbikel.wordnet.RemoteEnumerator
- All Implemented Interfaces:
- Remote, RemoteEnumeration, Serializable
- public class RemoteEnumerator
- extends UnicastRemoteObject
- implements RemoteEnumeration
This class provides a wrapper for Enumeration objects to be accessed
remotely via RMI. Its primary use is to provide access to the methods
WordNet.getCachedDataEntries(java.lang.String) and
WordNet.getCachedIndexEntries(java.lang.String) for RMI clients, as defined by
the same-named methods in WordNetRemote (which are implemented
by WordNetServer).
RemoteEnumerator objects are fail-fast, just as normal
Enumeration objects are.
- See Also:
- Serialized Form
|
Constructor Summary |
RemoteEnumerator(Enumeration e)
Constructs a RemoteEnumerator object, wrapping a locally-accessed
Enumeration object. |
|
Method Summary |
boolean |
hasMoreElements()
Tests if the underlying enumeration object contains more elements. |
Object |
nextElement()
Returns the next element of the underlying enumeration if the underlying
enumeration object has at least one more element to provide. |
RemoteEnumerator
public RemoteEnumerator(Enumeration e)
throws RemoteException
- Constructs a RemoteEnumerator object, wrapping a locally-accessed
Enumeration object.
hasMoreElements
public boolean hasMoreElements()
throws RemoteException
- Tests if the underlying enumeration object contains more elements.
- Specified by:
hasMoreElements in interface RemoteEnumeration
- Returns:
true if and only if this enumeration object contains
at least one more element to provide; false otherwise.
RemoteException
nextElement
public Object nextElement()
throws RemoteException
- Returns the next element of the underlying enumeration if the underlying
enumeration object has at least one more element to provide.
- Specified by:
nextElement in interface RemoteEnumeration
RemoteException
Author: Dan Bikel