sg.edu.nus.protocol.body
Class SPSearchRangeBody

java.lang.Object
  extended by sg.edu.nus.protocol.body.Body
      extended by sg.edu.nus.protocol.body.SPSearchRangeBody
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class SPSearchRangeBody
extends Body
implements java.io.Serializable

Implement the message body used for performing the range search.

Version:
1.0 2006-2-22
Author:
Vu Quang Hieu
See Also:
Serialized Form

Constructor Summary
SPSearchRangeBody(PhysicalInfo physicalSender, LogicalInfo logicalSender, PhysicalInfo physicalRequester, LogicalInfo logicalRequester, IndexValue minValue, IndexValue maxValue, boolean canLeft, boolean canRight, LogicalInfo logicalDestination)
          Construct the message body with speicified parameters.
SPSearchRangeBody(java.lang.String serializeData)
          Construct the message body with a string value.
 
Method Summary
 boolean getCanLeft()
          Get the previledge of sending request to the left
 boolean getCanRight()
          Get the previledge of sending request to the right
 LogicalInfo getLogicalDestination()
          Get logical address of the receiver
 LogicalInfo getLogicalRequester()
          Get logical address of the requester
 LogicalInfo getLogicalSender()
          Get logical address of the sender
 IndexValue getMaxValue()
          Get max value of the searched range
 IndexValue getMinValue()
          Get min value of the searched range
 PhysicalInfo getPhysicalRequester()
          Get physical address of the requester
 PhysicalInfo getPhysicalSender()
          Get physical address of the sender
 java.lang.String getString()
          Return a readable string for testing or writing in the log file
 void setCanLeft(boolean canLeft)
          Update the previledge of sending request to the left
 void setCanRight(boolean canRight)
          Update the previledge of sending request to the right
 void setLogicalDestination(LogicalInfo logicalDestination)
          Update logical address of the receiver
 void setLogicalRequester(LogicalInfo logicalRequester)
          Update logical address of the requester
 void setLogicalSender(LogicalInfo logicalSender)
          Update logical address of the sender
 void setPhysicalRequester(PhysicalInfo physicalRequester)
          Update physical address of the requester
 void setPhysicalSender(PhysicalInfo physicalSender)
          Update physical address of the sender
 java.lang.String toString()
           
 
Methods inherited from class sg.edu.nus.protocol.body.Body
clone
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SPSearchRangeBody

public SPSearchRangeBody(PhysicalInfo physicalSender,
                         LogicalInfo logicalSender,
                         PhysicalInfo physicalRequester,
                         LogicalInfo logicalRequester,
                         IndexValue minValue,
                         IndexValue maxValue,
                         boolean canLeft,
                         boolean canRight,
                         LogicalInfo logicalDestination)
Construct the message body with speicified parameters.

Parameters:
physicalSender - physical address of the sender
logicalSender - logical address of the sender
physicalRequester - physical address of the requester
logicalRequester - logical address of the requester
minValue - min value of the searched range
maxValue - max value of the searched range
canLeft - can forward the query to the left
canRight - can forward the query to the right
logicalDestination - logical address of the receiver

SPSearchRangeBody

public SPSearchRangeBody(java.lang.String serializeData)
Construct the message body with a string value.

Parameters:
serializeData - the string value that contains the serialized message body
Method Detail

setPhysicalSender

public void setPhysicalSender(PhysicalInfo physicalSender)
Update physical address of the sender

Parameters:
physicalSender - physical address of the sender

getPhysicalSender

public PhysicalInfo getPhysicalSender()
Get physical address of the sender

Returns:
physical address of the sender

setLogicalSender

public void setLogicalSender(LogicalInfo logicalSender)
Update logical address of the sender

Parameters:
logicalSender - logical address of the sender

getLogicalSender

public LogicalInfo getLogicalSender()
Get logical address of the sender

Returns:
logical address of the sender

setPhysicalRequester

public void setPhysicalRequester(PhysicalInfo physicalRequester)
Update physical address of the requester

Parameters:
physicalRequester - physical address of the requester

getPhysicalRequester

public PhysicalInfo getPhysicalRequester()
Get physical address of the requester

Returns:
physical address of the requester

setLogicalRequester

public void setLogicalRequester(LogicalInfo logicalRequester)
Update logical address of the requester

Parameters:
logicalRequester - logical address of the requester

getLogicalRequester

public LogicalInfo getLogicalRequester()
Get logical address of the requester

Returns:
logical address of the requester

getMinValue

public IndexValue getMinValue()
Get min value of the searched range

Returns:
min value of the searched range

getMaxValue

public IndexValue getMaxValue()
Get max value of the searched range

Returns:
max value of the searched range

setCanLeft

public void setCanLeft(boolean canLeft)
Update the previledge of sending request to the left

Parameters:
canLeft - true can forward the request to the left, false can not

getCanLeft

public boolean getCanLeft()
Get the previledge of sending request to the left

Returns:
true can forward the request to the left, false can not

setCanRight

public void setCanRight(boolean canRight)
Update the previledge of sending request to the right

Parameters:
canRight - true can forward the request to the right, false can not

getCanRight

public boolean getCanRight()
Get the previledge of sending request to the right

Returns:
true can forward the request to the right, false can not

setLogicalDestination

public void setLogicalDestination(LogicalInfo logicalDestination)
Update logical address of the receiver

Parameters:
logicalDestination - logical address of the receiver

getLogicalDestination

public LogicalInfo getLogicalDestination()
Get logical address of the receiver

Returns:
logical address of the receiver

getString

public java.lang.String getString()
Return a readable string for testing or writing in the log file

Returns:
a readable string

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object