|
Lightweight Bartering Grid | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlbg.protocol.data.GridData
public abstract class GridData
Parent class for all grid data. Offers some basic functionnality for subclasses and forces others.
Field Summary | |
---|---|
protected java.lang.String |
client_hostname
|
static java.lang.String |
HASHING_ALGORITHM
The name of the hashing algorithm that is used by all subclasses. |
java.lang.String |
id
Data ID. |
long |
size
Size (in bytes) of GridData. |
Constructor Summary | |
---|---|
protected |
GridData(java.lang.String id,
long size)
Make a new GridData |
Method Summary | |
---|---|
int |
compareTo(GridData other)
|
abstract byte[] |
getChecksum()
Get checksum from data. |
abstract java.io.InputStream |
getInputStream()
Get an input stream to read the data |
abstract void |
toFile(java.io.File file)
Save data in a file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final java.lang.String id
requestingpeerID.userID.original_filename
public final long size
protected java.lang.String client_hostname
public static final java.lang.String HASHING_ALGORITHM
Constructor Detail |
---|
protected GridData(java.lang.String id, long size) throws GridException
id
- The unique ID for the file. It should be of the form
requestingpeerID.userID.filename
GridException
- if the ID is invalidMethod Detail |
---|
public final int compareTo(GridData other)
compareTo
in interface java.lang.Comparable<GridData>
public abstract void toFile(java.io.File file) throws GridException
file
- The file where to put data
GridException
public abstract byte[] getChecksum() throws GridException
GridException
HASHING_ALGORITHM
public abstract java.io.InputStream getInputStream() throws GridException
GridException
|
Lightweight Bartering Grid | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2005-2008, Cyril Briquet, parts Xavier Dalem.