420
|
1 package test.mergertest;
|
|
2
|
|
3 import java.util.ArrayList;
|
|
4 import java.util.List;
|
|
5
|
|
6 import test.editortest.REPText;
|
|
7 import test.editortest.REPTextListener;
|
|
8
|
|
9 public class REPTextWithLinkedList implements REPText {
|
|
10
|
|
11 ArrayList<String> textList = new ArrayList<String>();
|
|
12
|
|
13 public void addTextListener(REPTextListener listener) {
|
|
14 // TODO Auto-generated method stub
|
|
15
|
|
16 }
|
|
17
|
|
18 public String delete(int lineno) {
|
|
19 return null;
|
|
20 }
|
|
21
|
|
22 public String get(int i) {
|
|
23 // TODO Auto-generated method stub
|
|
24 return null;
|
|
25 }
|
|
26
|
|
27 public void insert(int lineno, String text) {
|
|
28 int d = lineno - textList.size() + 1;
|
|
29
|
|
30 for(int i = 0; i < d; i++){
|
|
31 textList.add("");
|
|
32 }
|
|
33
|
|
34 textList.add(lineno, text);
|
|
35 }
|
|
36
|
|
37 public List<String> list() {
|
|
38 // TODO Auto-generated method stub
|
|
39 return textList;
|
|
40 }
|
|
41
|
|
42 public int size() {
|
|
43 // TODO Auto-generated method stub
|
|
44 return 0;
|
|
45 }
|
|
46
|
|
47 }
|