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
|
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 |
data
java.lang.String[][] data
n_members
int n_members
CharactersToBeReplaced
public CharactersToBeReplaced(DefaultCharactersToBeReplaced def)
- takes the default mask as the user's mask and orders it
- See Also:
sort()
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 replacedns
- 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