DRCL J-Sim API

drcl.inet.mac
Class NeighborQueryContract

java.lang.Object
  extended bydrcl.comp.Contract
      extended bydrcl.inet.mac.NeighborQueryContract

public class NeighborQueryContract
extends Contract

The NeightbourQueryContract contract. This contract defines the commands and the message format between Channel component and NodePositionTracker component.

Author:
Ye Ge
See Also:
Channel, NodePositionTracker

Nested Class Summary
static class NeighborQueryContract.Message
           
 
Field Summary
static NeighborQueryContract INSTANCE
           
 
Fields inherited from class drcl.comp.Contract
Role_INITIATOR, Role_PEER, Role_REACTOR
 
Constructor Summary
NeighborQueryContract()
           
NeighborQueryContract(int role_)
           
 
Method Summary
 java.lang.Object getContractContent()
          Returns the content of this contract (format?).
 java.lang.String getName()
           
static java.lang.Object query(long nid_, double X_, double Y_, double Z_, Port out_)
          Queries the neighbours of the sender whose current position is (X_, Y_, Z_).
static void reply(long[] nodeList_, Port out_)
          Sends back a reply through the out_ port
 
Methods inherited from class drcl.comp.Contract
getRole, match, setRole
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final NeighborQueryContract INSTANCE
Constructor Detail

NeighborQueryContract

public NeighborQueryContract()

NeighborQueryContract

public NeighborQueryContract(int role_)
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in class Contract

getContractContent

public java.lang.Object getContractContent()
Description copied from class: Contract
Returns the content of this contract (format?).

Specified by:
getContractContent in class Contract

query

public static java.lang.Object query(long nid_,
                                     double X_,
                                     double Y_,
                                     double Z_,
                                     Port out_)
Queries the neighbours of the sender whose current position is (X_, Y_, Z_).


reply

public static void reply(long[] nodeList_,
                         Port out_)
Sends back a reply through the out_ port

Parameters:
nodeList_ - an array of the nid's of neighboring nodes.

DRCL J-Sim API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~