added Javadocs in Class Text
This commit is contained in:
parent
ab7f631360
commit
108da09e5f
|
@ -5,40 +5,75 @@ public class Text {
|
|||
private ArrayList<String> text = new ArrayList<>();
|
||||
private String dummyText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
|
||||
|
||||
public boolean add(int n, String text) {
|
||||
if(n < this.text.size()) {
|
||||
this.text.add(n, text);
|
||||
/**
|
||||
* Method to add a paragraph at a specific position.
|
||||
* @param paragraphNumber number of paragraph where the new text should be added
|
||||
* @param text the Text which should be added.
|
||||
* @return returns true if the given paragraph exists and is added successfully
|
||||
*/
|
||||
public boolean add(int paragraphNumber, String text) {
|
||||
if(paragraphNumber < this.text.size()) {
|
||||
this.text.add(paragraphNumber, text);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to add a paragraph at the end of the existing text.
|
||||
* @param text the Text which should be added.
|
||||
* @return returns true if the paragraph is added successfully
|
||||
*/
|
||||
public boolean add(String text) {
|
||||
this.text.add(text);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean dummy(int n) {
|
||||
return add(n, dummyText);
|
||||
/**
|
||||
* Method to add a dummy text paragraph at a specific position.
|
||||
* @param paragraphNumber number of paragraph where the dummy text should be added
|
||||
* @return returns true if the given paragraph exists and is added successfully
|
||||
*/
|
||||
public boolean dummy(int paragraphNumber) {
|
||||
return add(paragraphNumber, dummyText);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to add a dummy text paragraph at the end of the existing text.
|
||||
* @return returns true if the paragraph is added successfully
|
||||
*/
|
||||
public boolean dummy() {
|
||||
return add(dummyText);
|
||||
}
|
||||
|
||||
public boolean replace(int n, String oldString, String replaceString) {
|
||||
if(n < this.text.size()) {
|
||||
/**
|
||||
*
|
||||
* @param paragraphNumber
|
||||
* @param oldString
|
||||
* @param replaceString
|
||||
* @return
|
||||
*/
|
||||
public boolean replace(int paragraphNumber, String oldString, String replaceString) {
|
||||
if(paragraphNumber < this.text.size()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public boolean replace() {
|
||||
public boolean replace(String oldString, String replaceString) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void del(int n) {
|
||||
|
||||
public boolean del(int paragraphNumber) {
|
||||
if(paragraphNumber < this.text.size()) {
|
||||
//paragraph hier löschen.
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public void del() {
|
||||
|
||||
public boolean del() {
|
||||
//letzter paragraph hier löschen.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,5 +2,7 @@ public class TextEditor {
|
|||
|
||||
public static void main(String[] args) {
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue