Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.fetish.directory.tool
Class NeighborRegistry  view NeighborRegistry download NeighborRegistry.java

java.lang.Object
  extended bycom.fetish.directory.tool.NeighborRegistry

public class NeighborRegistry
extends java.lang.Object

Data structure to store neighbors


Nested Class Summary
private  class NeighborRegistry.SidCmp
          Comparator for ServiceIDs
 
Field Summary
private  java.util.TreeMap neighbors
          Tree to look for neighbors through their url
private  java.util.TreeMap serviceIDs
          Tree to look for neighbors through their ServiceID
 
Constructor Summary
NeighborRegistry()
          Creates an empty registry of neighbors
 
Method Summary
 void clear()
          Destroys and reinitializes the structure
 boolean contains(java.lang.String neighborUrl)
          Checks the existence of a neighbor url
 ServiceID get(ServiceID sid)
          Obtains a neighbor url through its ServiceID
 ServiceID[] getServiceIDs()
          Obtain the whole list of neighbor ServiceIDs
 java.lang.String[] getUrls()
          Obtain the whole list of neighbor urls
 void put(java.lang.String neighborUrl, ServiceID sid)
          Adds a new pair to the structure
 void remove(ServiceID sid)
          Delete a neighbor identified by its ServiceID
 int size()
          Return the element count on the registry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

neighbors

private java.util.TreeMap neighbors
Tree to look for neighbors through their url


serviceIDs

private java.util.TreeMap serviceIDs
Tree to look for neighbors through their ServiceID

Constructor Detail

NeighborRegistry

public NeighborRegistry()
Creates an empty registry of neighbors

Method Detail

put

public void put(java.lang.String neighborUrl,
                ServiceID sid)
Adds a new pair to the structure


contains

public boolean contains(java.lang.String neighborUrl)
Checks the existence of a neighbor url


get

public ServiceID get(ServiceID sid)
Obtains a neighbor url through its ServiceID


remove

public void remove(ServiceID sid)
Delete a neighbor identified by its ServiceID


getServiceIDs

public ServiceID[] getServiceIDs()
Obtain the whole list of neighbor ServiceIDs


getUrls

public java.lang.String[] getUrls()
Obtain the whole list of neighbor urls


clear

public void clear()
Destroys and reinitializes the structure


size

public int size()
Return the element count on the registry