lime
Class Location

java.lang.Object
  extended bylime.Location
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AgentLocation, HostLocation

public abstract class Location
extends java.lang.Object
implements java.io.Serializable

The superclass of all locations, i.e., of both host and agent locations.

In Lime, a tuple is always physically stored in the interface tuple space (ITS) of an agent. However, Lime operations refer to tuples whose location can be expressed in terms of:

Locations are frequently used to specify that a given tuple space operation is concerned with a projection of the shared tuple space defined by a pair of location parameters: the current and destination location of tuples. Then, for instance,

    LimeServerID hostID = ...;
    Agent agent = ...;
    ITuple template = new Tuple().addActual(1).addActual(2);
    LimeTupleSpace ts = new LimeTupleSpace("myApplication");
    Tuple t = ts.in(new HostLocation(hostID), new AgentLocation(agent.getMgr().getID()), template);
    
specifies a blocking in operation that retrieves any tuple matching template whose destination is the ITS named "myApplication" of the agent object, and that are currently located on hostID.

Lcoations can also be specified using "wild cards", for instance to specifically allow the user to leave the value of a given location unspecified, or specify that any location will do. For details of how to use wild cards, refer to AgentLocation and HostLocation.

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

Field Summary
(package private) static short _ANY
          Used to define ANY.
(package private) static short _NORMAL
          Used for non-wild card locations.
(package private) static short _UNKNOWN
          Used when an agent location is created, and the host is currently unknown.
(package private) static short _UNSPECIFIED
          Used to define UNSPECIFIED.
(package private)  int wildCard
           
 
Constructor Summary
(package private) Location(short wildCard)
           
 
Method Summary
 boolean isWildCard()
          Test whether the location is a wild card location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_UNKNOWN

static final short _UNKNOWN
Used when an agent location is created, and the host is currently unknown.

See Also:
Constant Field Values

_NORMAL

static final short _NORMAL
Used for non-wild card locations.

See Also:
Constant Field Values

_UNSPECIFIED

static final short _UNSPECIFIED
Used to define UNSPECIFIED.

See Also:
Constant Field Values

_ANY

static final short _ANY
Used to define ANY.

See Also:
Constant Field Values

wildCard

int wildCard
Constructor Detail

Location

Location(short wildCard)
Method Detail

isWildCard

public boolean isWildCard()
Test whether the location is a wild card location.

Returns:
true if the location is a wild card location.