Class Document

java.lang.Object
  |
  +--Document

public class Document
extends java.lang.Object
implements Tags, UserOptions

This class builts the model of the application

See Also:
Tags, UserOptions

Field Summary
(package private)  boolean autosave
          holds the autosave property
 javax.swing.event.EventListenerList changeListeners
          used for the adaptors connected with this model
 int current_turn_number
          number of the current turn being used
 Judgements CurrentTurn
          current turn of the dialogue
(package private)  long elem_file
          contains the number of bytes in the file
(package private)  java.io.File file
          the file associated with the document
 Judgements FirstTurn
          first turn of the dialogue
(package private)  int frequency_to_save
          gives the step according to which the turns are saved
(package private)  boolean issaved
          indicates if the document is saved or not
 Judgements j
          here the data of the turn are contained
(package private)  int output
          the number corresponding to the module which performed the translations
(package private)  int read_quant
          number of bytes that have been read
(package private)  boolean selsave
          indicates if every turn is saved or only some selected ones
 int turn_number
          number of turns in the dialogue
 
Fields inherited from interface Tags
tag
 
Fields inherited from interface UserOptions
DEFAULTSFILENAME, FREQUENCY_SAVE_TURNS, MAXIMUM_WORDS_STRING, NO_TURNS, REPLACEMASKSIZE, TRANSLATION_SEGMENTS
 
Constructor Summary
Document(java.io.File file)
           
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener x)
          this method adds a change listener to the model
 void findTurn(int turn)
          finds a turn according to the parameter
protected  void fireChange()
          when a change occurs stateChanged is alled on the registered classes
 int getCurrentTurnNumber()
           
 Judgements getData()
          retrieves the data of the current turn
 Document getDoc()
           
 Judgements getFirst()
          retrieves the data of the first turn of the dialogue
 Judgements getFirstTurn()
           
 int getFrequencytoSave()
           
 int getTurnNumber()
           
 boolean isTag(java.lang.String value)
          This method is the implementation of the tags interface add verifies wheter a string is in the tag[] array range or not.
 void removeChangeListener(javax.swing.event.ChangeListener x)
          this method removes a change listener to the model
 void ResetValues()
          sets the values when no document is used
 void setFrequencytoSave(int n)
          set the step woith which the turns are saved
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

file

java.io.File file
the file associated with the document

output

int output
the number corresponding to the module which performed the translations

FirstTurn

public Judgements FirstTurn
first turn of the dialogue

CurrentTurn

public Judgements CurrentTurn
current turn of the dialogue

changeListeners

public javax.swing.event.EventListenerList changeListeners
used for the adaptors connected with this model

turn_number

public int turn_number
number of turns in the dialogue

current_turn_number

public int current_turn_number
number of the current turn being used

autosave

boolean autosave
holds the autosave property

issaved

boolean issaved
indicates if the document is saved or not

selsave

boolean selsave
indicates if every turn is saved or only some selected ones

frequency_to_save

int frequency_to_save
gives the step according to which the turns are saved

j

public Judgements j
here the data of the turn are contained

elem_file

long elem_file
contains the number of bytes in the file

read_quant

int read_quant
number of bytes that have been read
Constructor Detail

Document

public Document(java.io.File file)
Parameters:
file - the file associated with the current document
Method Detail

getDoc

public Document getDoc()
Returns:
a referrence to the current object

getTurnNumber

public int getTurnNumber()
Returns:
the number of turns in the dialogue

getCurrentTurnNumber

public int getCurrentTurnNumber()
Returns:
the number of the current turn

setFrequencytoSave

public void setFrequencytoSave(int n)
set the step woith which the turns are saved
Parameters:
n - the step

getFrequencytoSave

public int getFrequencytoSave()
Returns:
the frequency to save the turns

getFirstTurn

public Judgements getFirstTurn()
Returns:
first turn of the dialogue
See Also:
Judgements

findTurn

public void findTurn(int turn)
finds a turn according to the parameter
Parameters:
turn - the number of the turn to be found
See Also:
Judgements, fireChange()

getData

public Judgements getData()
retrieves the data of the current turn
See Also:
Judgements

getFirst

public Judgements getFirst()
retrieves the data of the first turn of the dialogue
See Also:
Judgements

ResetValues

public void ResetValues()
sets the values when no document is used
See Also:
Judgements

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener x)
this method adds a change listener to the model

removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener x)
this method removes a change listener to the model

fireChange

protected void fireChange()
when a change occurs stateChanged is alled on the registered classes

isTag

public boolean isTag(java.lang.String value)
This method is the implementation of the tags interface add verifies wheter a string is in the tag[] array range or not.
Specified by:
isTag in interface Tags
Parameters:
value - indicates the string to look for in the tag[] array