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

Quick Search    Search Deep

Freenet.node
Interface DataStore  view DataStore download DataStore.java

All Superinterfaces:
Freenet.support.Callback, java.io.Serializable
All Known Implementing Classes:
StandardDataStore

public interface DataStore
extends java.io.Serializable, Freenet.support.Callback


Method Summary
 Freenet.Key findClosestKey(Freenet.Key k)
          Returns the reference associated with the closest key to k.
 Freenet.Key findClosestKey(Freenet.Key k, Freenet.Key maskKey)
          Returns the reference associated with the closest key to k.
 void put(Freenet.Key k, Freenet.Address r, Data d)
          Adds an item to the DataStore
 void remove(Freenet.Key k)
          Removes an item from the DataStore given its key
 Data searchData(Freenet.Key k)
          Searches for a key in the DataStore and if found returns any data associated with that key.
 Freenet.Address searchRef(Freenet.Key k)
          Searches for a key in the DataStore and if found returns any reference associated with that key.
 void tofile(java.lang.String filename)
           
 
Methods inherited from interface Freenet.support.Callback
callback
 

Method Detail

tofile

public void tofile(java.lang.String filename)
            throws java.io.IOException

searchData

public Data searchData(Freenet.Key k)
Searches for a key in the DataStore and if found returns any data associated with that key. If none is found, null is returned.


searchRef

public Freenet.Address searchRef(Freenet.Key k)
Searches for a key in the DataStore and if found returns any reference associated with that key. If none is found, null is returned.


remove

public void remove(Freenet.Key k)
Removes an item from the DataStore given its key


findClosestKey

public Freenet.Key findClosestKey(Freenet.Key k)
Returns the reference associated with the closest key to k.


findClosestKey

public Freenet.Key findClosestKey(Freenet.Key k,
                                  Freenet.Key maskKey)
Returns the reference associated with the closest key to k. The masking key allows the 'next best' key to be found. Imagine the entries in the datastore being sorted in terms of closeness to the key you specify. With no mask key the reference associated with the top-most item will be returned. However, with a mask key any references associated with keys above the mask key (including the mask key itself) will be ignored. This facility allows best-first backtracking.


put

public void put(Freenet.Key k,
                Freenet.Address r,
                Data d)
Adds an item to the DataStore