1
2
3
4
5
6
7
8
9 package jline.console.history;
10
11 import java.util.Iterator;
12 import java.util.ListIterator;
13
14
15
16
17
18
19
20
21 public interface History
22 extends Iterable<History.Entry>
23 {
24 int size();
25
26 boolean isEmpty();
27
28 int index();
29
30 void clear();
31
32 CharSequence get(int index);
33
34 void add(CharSequence line);
35
36
37
38
39
40
41
42
43 void set(int index, CharSequence item);
44
45
46
47
48
49
50
51
52 CharSequence remove(int i);
53
54
55
56
57
58
59
60 CharSequence removeFirst();
61
62
63
64
65
66
67
68 CharSequence removeLast();
69
70 void replace(CharSequence item);
71
72
73
74
75
76 interface Entry
77 {
78 int index();
79
80 CharSequence value();
81 }
82
83 ListIterator<Entry> entries(int index);
84
85 ListIterator<Entry> entries();
86
87 Iterator<Entry> iterator();
88
89
90
91
92
93 CharSequence current();
94
95 boolean previous();
96
97 boolean next();
98
99 boolean moveToFirst();
100
101 boolean moveToLast();
102
103 boolean moveTo(int index);
104
105 void moveToEnd();
106 }