gps.protocol
Class Peer

java.lang.Object
  extended by gps.protocol.Agent
      extended by gps.protocol.Peer
All Implemented Interfaces:
SimEventHandler
Direct Known Subclasses:
BTPeer

public class Peer
extends Agent

Peer base class, all specific protocol peers inherit from it.

Version:
1.2, 6/20/2005
Author:
Weishuai Yang

Field Summary
 java.util.HashMap mDocDBbyKey
           
 
Constructor Summary
Peer()
          dummy constructor
Peer(int i)
          constructs a Peer with peer id
 
Method Summary
 Document getDocument(java.lang.String key)
          retrieve a document by key
 void ownDocument(Document doc)
          add a document to this peer, to be overriden
 void reset()
          resets status of the peer
 java.lang.String toString()
          gets string description
 
Methods inherited from class gps.protocol.Agent
agentDraw, attachTo, getID, getNode, handle, isActive
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mDocDBbyKey

public java.util.HashMap mDocDBbyKey
Constructor Detail

Peer

public Peer()
dummy constructor


Peer

public Peer(int i)
constructs a Peer with peer id

Method Detail

reset

public void reset()
resets status of the peer

Overrides:
reset in class Agent

ownDocument

public void ownDocument(Document doc)
add a document to this peer, to be overriden

Parameters:
doc - the Document

getDocument

public Document getDocument(java.lang.String key)
retrieve a document by key

Parameters:
key -
Returns:
Document

toString

public java.lang.String toString()
gets string description

Overrides:
toString in class Agent
Returns:
string description