lime
Class HostLocation

java.lang.Object
  |
  +--lime.Location
        |
        +--lime.HostLocation
All Implemented Interfaces:
java.io.Serializable

public class HostLocation
extends Location

Defines the location of a tuple within the host-level tuple space associated with a host. This tuple space is defined to be the union of all the interface tuple spaces (ITS) of the agents residing on that host. Objects of this class are used for specifying at most the current location when invoking location-dependent operations (see the Location class). It is not possible to specify a destination for a host. To do this semantically, one would create a stationary agent "representing" the host, but this would be accessed as an AgentLocation.

One "wild card location" constant is provided by this class: UNSPECIFIED: it is used to leave unspecified the current lcoation field in a location-dependent operation. Thus, for instance, using the example provided in class Location:

LimeTupleSpace ts = new LimeTupleSpace("myApplication");
ITuple t = ts.in(HostLocation.UNSPECIFIED,
new AgentLocation(agent.getMgr().getID()),
template);
specifies a blocking in that searches the whole shared tuple space for a tuple whose final location is the agent's ITS named myApplication.

Version:
1.0 alpha
Author:
Amy L. Murphy, Gian Pietro Picco
See Also:
LimeTupleSpace, AgentID, AgentLocation, LocalizedReaction, Serialized Form

Field Summary
static HostLocation UNSPECIFIED
          Define a wild card location that denotes an unspecified host location.
 
Constructor Summary
HostLocation(LimeServerID host)
          Create a location corresponding to the host-level tuple space of a given host.
 
Method Summary
 boolean equals(java.lang.Object l)
          Tests two host locations for equality.
 java.lang.String toString()
          Returns a concise textual description for this object.
 
Methods inherited from class lime.Location
isWildCard
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNSPECIFIED

public static final HostLocation UNSPECIFIED
Define a wild card location that denotes an unspecified host location.
Constructor Detail

HostLocation

public HostLocation(LimeServerID host)
Create a location corresponding to the host-level tuple space of a given host.
Parameters:
host - the host address:port combination.
Method Detail

equals

public boolean equals(java.lang.Object l)
Tests two host locations for equality.
Overrides:
equals in class java.lang.Object
Parameters:
l - a host location (it can be a wild card location).
Returns:
if the locations being compared are not wild cards, true is returned if both locations correspond to the same host. If the locations are wild cards, then true is returned if they correspond to the same constant (e.g, the method returns true when comparing two UNSPECIFIED locations). In all the remaining cases false is returned.

toString

public java.lang.String toString()
Returns a concise textual description for this object.
Overrides:
toString in class java.lang.Object