demo.helloworld.step2.api
Class HelloWorldQueryState

java.lang.Object
  |
  +--demo.helloworld.step2.api.HelloWorldQueryState
All Implemented Interfaces:
DDQueryState, QuickSerializable

public class HelloWorldQueryState
extends Object
implements DDQueryState

HelloWorldQueryState is a DDQueryState used in a HelloWorldLocateMsg used to keep track of number of servers that has be found by HelloWorldQuery

Version:
$Id: HelloWorldQueryState.java,v 1.1 2004/06/14 06:30:17 kelvinso Exp $
Author:
Chiu Wah Kelvin So

Constructor Summary
HelloWorldQueryState(InputBuffer buffer)
          Constructs a HelloWorldQueryState from its serialized form.
HelloWorldQueryState(int numberOfReqServers)
          Creates a new HelloWorldQueryState.
 
Method Summary
 boolean add(SecureHash src)
          Adds the specified server to the serversGuidSet if it is not already present.
 boolean contains(SecureHash src)
          Tests whether the serversGuidSet contains the specified server
 int numberOfRequestedServers()
          numberOfRequestedServers returns the requested number of servers.
 void serialize(OutputBuffer buffer)
          Specified by ostore.util.QuickSerializable
 int size()
          size returns the size of the serversGuidSet
 String toString()
          Specified by java.lang.Object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HelloWorldQueryState

public HelloWorldQueryState(int numberOfReqServers)
Creates a new HelloWorldQueryState.


HelloWorldQueryState

public HelloWorldQueryState(InputBuffer buffer)
                     throws QSException
Constructs a HelloWorldQueryState from its serialized form.

Parameters:
buffer - serialized form of object.
Method Detail

serialize

public void serialize(OutputBuffer buffer)
Specified by ostore.util.QuickSerializable

Specified by:
serialize in interface QuickSerializable

add

public boolean add(SecureHash src)
Adds the specified server to the serversGuidSet if it is not already present.

Parameters:
src - SecureHash
Returns:
true if the set serversGuidSet did not already contain the specified server.

contains

public boolean contains(SecureHash src)
Tests whether the serversGuidSet contains the specified server

Parameters:
src - SecureHash
Returns:
true if the serversGuidSet already contains the specified server.

numberOfRequestedServers

public int numberOfRequestedServers()
numberOfRequestedServers returns the requested number of servers.

Returns:
the requested number of servers.

size

public int size()
size returns the size of the serversGuidSet

Returns:
size returns the size of the serversGuidSet

toString

public String toString()
Specified by java.lang.Object

Overrides:
toString in class Object