|
|||||||||
| Home >> All >> Freenet >> [ node overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
Freenet.node
Class StandardDataStore

java.lang.ObjectFreenet.node.StandardDataStore
- All Implemented Interfaces:
- Freenet.support.Callback, DataStore, java.io.Serializable
- public class StandardDataStore
- extends java.lang.Object
- implements DataStore
- extends java.lang.Object
| Field Summary | |
protected Freenet.support.CyclicArray |
ar
|
static java.lang.String |
filename
|
protected java.util.Hashtable |
h
|
long |
maxData
|
private static long |
write_interval
|
| Constructor Summary | |
StandardDataStore(long maxData,
int maxItems)
|
|
| Method Summary | |
void |
callback()
|
protected void |
cleanUpData()
Removes excess data (ie. |
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. |
protected int |
findNextClosestPos(Freenet.Key k,
Freenet.Key nextk)
Will return the position in ar of the closest key to k that is not as close as nextk |
java.util.Enumeration |
keys()
|
static DataStore |
makeDataStore(Node node,
long maxData,
int maxItems)
|
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 fname)
|
java.lang.String |
toString()
Convert this Object to a human-readable String. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
write_interval
private static long write_interval
filename
public static java.lang.String filename
maxData
public long maxData
ar
protected Freenet.support.CyclicArray ar
h
protected java.util.Hashtable h
| Constructor Detail |
StandardDataStore
public StandardDataStore(long maxData,
int maxItems)
| Method Detail |
makeDataStore
public static DataStore makeDataStore(Node node, long maxData, int maxItems)
tofile
public void tofile(java.lang.String fname) throws java.io.IOException
callback
public void callback()
- Specified by:
callbackin interfaceFreenet.support.Callback
keys
public java.util.Enumeration keys()
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.
- Specified by:
searchDatain interfaceDataStore
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)
findClosestKey
public Freenet.Key findClosestKey(Freenet.Key k)
- Returns the reference associated with the closest key
to k.
- Specified by:
findClosestKeyin interfaceDataStore
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.
- Specified by:
findClosestKeyin interfaceDataStore
put
public void put(Freenet.Key k, Freenet.Address r, Data d)
findNextClosestPos
protected int findNextClosestPos(Freenet.Key k, Freenet.Key nextk)
- Will return the position in ar of the closest key to k that is not
as close as nextk
cleanUpData
protected void cleanUpData()
- Removes excess data (ie. if there is more data than is
permitted by the maxData field).
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object - Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string concatenation with this object. If the result is
null, string concatenation will instead use"null".The default implementation returns
getClass().getName() + "@" + Integer.toHexString(hashCode()).
|
|||||||||
| Home >> All >> Freenet >> [ node overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
Freenet.node.StandardDataStore