4A Server -  2.0
 All Classes Namespaces Files Functions Variables Enumerator
cz.vutbr.fit.knot.annotations.document.DocumentUpdate Class Reference

Update of document. More...

Collaboration diagram for cz.vutbr.fit.knot.annotations.document.DocumentUpdate:
Collaboration graph

Classes

class  DocumentUpdateException
 Exception of DocumentUpdate class which is thrown in case of modification failure. More...
 

Public Member Functions

 DocumentUpdate (String documentString)
 
 DocumentUpdate (String documentString, EditorSession edSession)
 
void setDocument (Document doc)
 
Document getDocument ()
 
void setDocumentString (String documentString)
 
String getDocumentString ()
 
void appendModification (TextModification modification)
 
void appendModifications (ArrayList< TextModification > modifications)
 
void removeModification (TextModification modification)
 
void updateDocument () throws DocumentUpdateException
 
void updateDocument (boolean failed, boolean reverseRun) throws DocumentUpdateException
 

Private Member Functions

void updateDocument (boolean failed, boolean reverseRun, ArrayList< TextModification > modifications) throws DocumentUpdateException
 
Integer generateReverseModifications (ArrayList< TextModification > reversedAL, TextModification modification, Node sourceNode)
 

Private Attributes

Document doc
 
String documentString
 
MatcherProvider matcherProvider
 
ArrayList< TextModificationmodificationsAL = new ArrayList<TextModification>()
 
ArrayList< TextModificationreverseModifications = new ArrayList<TextModification>()
 
DocumentUpdateException docUpdateEx = new DocumentUpdateException()
 
EditorSession edSession
 

Detailed Description

Update of document.

Class which update document using TextModifications

Author
Jan Paulovcak (xpaulo00 at stud.fit.vutbr.cz)

Definition at line 43 of file DocumentUpdate.java.

Constructor & Destructor Documentation

cz.vutbr.fit.knot.annotations.document.DocumentUpdate.DocumentUpdate ( String  documentString)

Constructor

Parameters
documentStringTextual content of document

Definition at line 156 of file DocumentUpdate.java.

cz.vutbr.fit.knot.annotations.document.DocumentUpdate.DocumentUpdate ( String  documentString,
EditorSession  edSession 
)

Constructor

Parameters
documentStringTextual content of document
edSessionEditor's (client's) session

Definition at line 167 of file DocumentUpdate.java.

Member Function Documentation

void cz.vutbr.fit.knot.annotations.document.DocumentUpdate.appendModification ( TextModification  modification)

Appends new text modification which will be processed next time on update call.

Parameters
modificationNew modification which should be performed to document.

Definition at line 214 of file DocumentUpdate.java.

void cz.vutbr.fit.knot.annotations.document.DocumentUpdate.appendModifications ( ArrayList< TextModification modifications)

Appends new text modifications which will be processed next time on update call.

Parameters
modificationsNew modifications which should be performed to document.

Definition at line 223 of file DocumentUpdate.java.

Integer cz.vutbr.fit.knot.annotations.document.DocumentUpdate.generateReverseModifications ( ArrayList< TextModification reversedAL,
TextModification  modification,
Node  sourceNode 
)
private

Method creates reversed modifications to document, that may be applied onto it in case of modification failure It inserts created modification into array list passed as parameter

Parameters
reversedALList of reversed modifications
modificationModification on which will be created reverse modification
sourceNodeNode used in modification
Returns
Number of created modifications

Definition at line 793 of file DocumentUpdate.java.

Here is the call graph for this function:

Here is the caller graph for this function:

Document cz.vutbr.fit.knot.annotations.document.DocumentUpdate.getDocument ( )

Gets document

Returns
Document

Definition at line 187 of file DocumentUpdate.java.

String cz.vutbr.fit.knot.annotations.document.DocumentUpdate.getDocumentString ( )

Get document textual content

Returns
Document in textual form

Definition at line 205 of file DocumentUpdate.java.

void cz.vutbr.fit.knot.annotations.document.DocumentUpdate.removeModification ( TextModification  modification)

Removes text modification from the modifications to be performed.

Parameters
modificationText modification to be removed.

Definition at line 232 of file DocumentUpdate.java.

void cz.vutbr.fit.knot.annotations.document.DocumentUpdate.setDocument ( Document  doc)

Sets document to update

Parameters
docDocument

Definition at line 178 of file DocumentUpdate.java.

void cz.vutbr.fit.knot.annotations.document.DocumentUpdate.setDocumentString ( String  documentString)

Sets textual content of document

Parameters
documentStringTextual content of document

Definition at line 196 of file DocumentUpdate.java.

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.document.DocumentUpdate.updateDocument ( ) throws DocumentUpdateException

Updates document.

Exceptions
cz.vutbr.fit.knot.annotations.document.DocumentUpdate.UpdateDocumentException

Definition at line 241 of file DocumentUpdate.java.

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.document.DocumentUpdate.updateDocument ( boolean  failed,
boolean  reverseRun 
) throws DocumentUpdateException

Updates document.

Parameters
failedChecks whether modifying has failed
reverseRunFor reverse run true, false otherwise
Exceptions
cz.vutbr.fit.knot.annotations.document.DocumentUpdate.UpdateDocumentException

Definition at line 252 of file DocumentUpdate.java.

Here is the call graph for this function:

void cz.vutbr.fit.knot.annotations.document.DocumentUpdate.updateDocument ( boolean  failed,
boolean  reverseRun,
ArrayList< TextModification modifications 
) throws DocumentUpdateException
private

Updates document.

Parameters
failedChecks whether modifying has failed
reverseRunFor reverse run true, false otherwise
modificationsList of modifications
Exceptions
cz.vutbr.fit.knot.annotations.document.DocumentUpdate.DocumentUpdateException

Definition at line 264 of file DocumentUpdate.java.

Here is the call graph for this function:

Member Data Documentation

Document cz.vutbr.fit.knot.annotations.document.DocumentUpdate.doc
private

Document to update

Definition at line 137 of file DocumentUpdate.java.

String cz.vutbr.fit.knot.annotations.document.DocumentUpdate.documentString
private

Document to update serialized in string

Definition at line 139 of file DocumentUpdate.java.

DocumentUpdateException cz.vutbr.fit.knot.annotations.document.DocumentUpdate.docUpdateEx = new DocumentUpdateException()
private

Exception to throw

Definition at line 147 of file DocumentUpdate.java.

EditorSession cz.vutbr.fit.knot.annotations.document.DocumentUpdate.edSession
private

Client's session

Definition at line 149 of file DocumentUpdate.java.

MatcherProvider cz.vutbr.fit.knot.annotations.document.DocumentUpdate.matcherProvider
private

MatcherProvider for additional methods

Definition at line 141 of file DocumentUpdate.java.

ArrayList<TextModification> cz.vutbr.fit.knot.annotations.document.DocumentUpdate.modificationsAL = new ArrayList<TextModification>()
private

List of modifications to apply

Definition at line 143 of file DocumentUpdate.java.

ArrayList<TextModification> cz.vutbr.fit.knot.annotations.document.DocumentUpdate.reverseModifications = new ArrayList<TextModification>()
private

List of reverse modifications

Definition at line 145 of file DocumentUpdate.java.


The documentation for this class was generated from the following file: