net.sourceforge.obby4j
Class DocumentContents

java.lang.Object
  extended by net.sourceforge.obby4j.DocumentContents

public class DocumentContents
extends java.lang.Object

Represents the contents of a document and provides state management for sync and edit processes.


Nested Class Summary
static class DocumentContents.State
          The states a document's content can be in.
 
Constructor Summary
DocumentContents(Document document)
          Creates an initially empty document content instance.
 
Method Summary
 DocumentContents.State getState()
           
 java.lang.String getString()
           
 void recordDelete(int pos, int length)
          TODO javadoc
 void recordInsert(java.lang.String chunk, int pos)
          TODO javadoc
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DocumentContents

public DocumentContents(Document document)
Creates an initially empty document content instance.

Parameters:
document - the document that contains the content
Method Detail

getState

public DocumentContents.State getState()
Returns:
The state of the content.
See Also:
DocumentContents.State

getString

public java.lang.String getString()
Returns:
a String representation of the contents

recordDelete

public void recordDelete(int pos,
                         int length)
TODO javadoc

Parameters:
pos -
length -

recordInsert

public void recordInsert(java.lang.String chunk,
                         int pos)
TODO javadoc

Parameters:
chunk -
pos -

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()