Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.concurrent.watchdog.DocumentChecksum Class Reference

List of all members.

Public Member Functions

 DocumentChecksum (SPath path)
SPath getPath ()
int getLength ()
void setLength (int length)
int getHash ()
void setHash (int hash)
void setDirty (boolean b)
void dispose ()
void bind (IDocument doc)
void update ()
boolean existsFile ()
String toString ()

Static Public Attributes

static final int NON_EXISTING_DOC = -1

Protected Attributes

IDocumentListener dirtyListener
final SPath path
int length
int hash
IDocument document
boolean dirty

Detailed Description

This Class represents a checksum of a document. It contains the path, the length and the hash code of the document.

Author:
chjacob

Constructor & Destructor Documentation

de.fu_berlin.inf.dpp.concurrent.watchdog.DocumentChecksum.DocumentChecksum ( SPath  path)

Creates a new Checksum for the document represented in the given path.

The checksum is initially created without being bound to a document.


Member Function Documentation

void de.fu_berlin.inf.dpp.concurrent.watchdog.DocumentChecksum.bind ( IDocument  doc)
void de.fu_berlin.inf.dpp.concurrent.watchdog.DocumentChecksum.dispose ( )
boolean de.fu_berlin.inf.dpp.concurrent.watchdog.DocumentChecksum.existsFile ( )

Returns whether this checksum represents a file which exists at the host.

If false is returned, then this checksum indicates that the host has no file under the given path.

int de.fu_berlin.inf.dpp.concurrent.watchdog.DocumentChecksum.getHash ( )
int de.fu_berlin.inf.dpp.concurrent.watchdog.DocumentChecksum.getLength ( )
SPath de.fu_berlin.inf.dpp.concurrent.watchdog.DocumentChecksum.getPath ( )
void de.fu_berlin.inf.dpp.concurrent.watchdog.DocumentChecksum.setDirty ( boolean  b)
void de.fu_berlin.inf.dpp.concurrent.watchdog.DocumentChecksum.setHash ( int  hash)
void de.fu_berlin.inf.dpp.concurrent.watchdog.DocumentChecksum.setLength ( int  length)
String de.fu_berlin.inf.dpp.concurrent.watchdog.DocumentChecksum.toString ( )
void de.fu_berlin.inf.dpp.concurrent.watchdog.DocumentChecksum.update ( )

Member Data Documentation

Initial value:
 new IDocumentListener() {

        @Override
        public void documentAboutToBeChanged(DocumentEvent event) {
            
        }

        @Override
        public void documentChanged(DocumentEvent event) {
            dirty = true;
        }
    }

Constant used for representing a missing file

 All Classes Namespaces Files Functions Variables Enumerations