Class CharactersToBeReplaced

java.lang.Object
  |
  +--CharactersToBeReplaced

class CharactersToBeReplaced
extends java.lang.Object
implements UserOptions

this class builts the user mask


Field Summary
(package private)  java.lang.String[][] data
           
(package private)  int n_members
           
 
Fields inherited from interface UserOptions
DEFAULTSFILENAME, FREQUENCY_SAVE_TURNS, MAXIMUM_WORDS_STRING, NO_TURNS, REPLACEMASKSIZE, TRANSLATION_SEGMENTS
 
Constructor Summary
CharactersToBeReplaced(DefaultCharactersToBeReplaced def)
          takes the default mask as the user's mask and orders it
 
Method Summary
 java.lang.String[][] getData()
           
 int getMembersNumber()
           
 void setData(int pos)
          rearanges the data when a row is deleted
 void setData(java.lang.String os, java.lang.String ns, int pos)
          inserts a new line in the matrix
 void sort()
          implements the bubble sort algorithm the sorting is done according to the length of the characters to be replaced.
 void writeData()
          writes the user's mask to the disk
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

data

java.lang.String[][] data

n_members

int n_members
Constructor Detail

CharactersToBeReplaced

public CharactersToBeReplaced(DefaultCharactersToBeReplaced def)
takes the default mask as the user's mask and orders it
See Also:
sort()
Method Detail

getData

public java.lang.String[][] getData()
Returns:
the user's mask

sort

public void sort()
implements the bubble sort algorithm the sorting is done according to the length of the characters to be replaced. the sorting is done in decreasing order

setData

public void setData(java.lang.String os,
                    java.lang.String ns,
                    int pos)
inserts a new line in the matrix
Parameters:
os - the string to be replaced
ns - the string to replace with

setData

public void setData(int pos)
rearanges the data when a row is deleted
Parameters:
pos - the number of row which is deleted

writeData

public void writeData()
writes the user's mask to the disk

getMembersNumber

public int getMembersNumber()
Returns:
the number of rows containing data in the user's mask