1 | package eu.clarin.sru.fcs.aggregator.sopt; |
---|
2 | |
---|
3 | import java.util.Map; |
---|
4 | import java.util.Set; |
---|
5 | import org.zkoss.zul.DefaultTreeNode; |
---|
6 | import org.zkoss.zul.Treeitem; |
---|
7 | |
---|
8 | /** |
---|
9 | * Represents corpora model that has access to Corpus objects and their |
---|
10 | * information about corpora. |
---|
11 | * |
---|
12 | * @author Yana Panchenko |
---|
13 | */ |
---|
14 | public interface CorpusModelI { |
---|
15 | |
---|
16 | |
---|
17 | public boolean isCorpusSelected(DefaultTreeNode<Corpus> node); |
---|
18 | |
---|
19 | /** |
---|
20 | * Remove the nodes which parent is |
---|
21 | * <code>parent</code> with indexes |
---|
22 | * <code>indexes</code> |
---|
23 | * |
---|
24 | * @param parent The parent of nodes are removed |
---|
25 | * @param indexFrom the lower index of the change range |
---|
26 | * @param indexTo the upper index of the change range |
---|
27 | * @throws IndexOutOfBoundsException - indexFrom < 0 or indexTo > number of |
---|
28 | * parent's children |
---|
29 | */ |
---|
30 | public void remove(DefaultTreeNode<Corpus> parent, int indexFrom, int indexTo); |
---|
31 | |
---|
32 | /** |
---|
33 | * Remove the nodes which parent is |
---|
34 | * <code>parent</code> with indexes |
---|
35 | * <code>indexes</code> |
---|
36 | * |
---|
37 | * @param parent The parent of nodes are removed |
---|
38 | * @param indexFrom the lower index of the change range |
---|
39 | * @param indexTo the upper index of the change range |
---|
40 | * @throws IndexOutOfBoundsException - indexFrom < 0 or indexTo > number of |
---|
41 | * parent's children |
---|
42 | */ |
---|
43 | public void remove(DefaultTreeNode<Corpus> parent, int index); |
---|
44 | |
---|
45 | /** |
---|
46 | * Insert new nodes which parent is |
---|
47 | * <code>parent</code> with indexes |
---|
48 | * <code>indexes</code> by new nodes |
---|
49 | * <code>newNodes</code> |
---|
50 | * |
---|
51 | * @param parent The parent of nodes are inserted |
---|
52 | * @param indexFrom the lower index of the change range |
---|
53 | * @param indexTo the upper index of the change range |
---|
54 | * @param newNodes New nodes which are inserted |
---|
55 | * @throws IndexOutOfBoundsException - indexFrom < 0 or indexTo > number of |
---|
56 | * parent's children |
---|
57 | */ |
---|
58 | public void insert(DefaultTreeNode<Corpus> parent, int indexFrom, int indexTo, DefaultTreeNode<Corpus>[] newNodes); |
---|
59 | |
---|
60 | /** |
---|
61 | * Append new nodes which parent is |
---|
62 | * <code>parent</code> by new nodes |
---|
63 | * <code>newNodes</code> |
---|
64 | * |
---|
65 | * @param parent The parent of nodes are appended |
---|
66 | * @param newNodes New nodes which are appended |
---|
67 | */ |
---|
68 | public void add(DefaultTreeNode<Corpus> parent, DefaultTreeNode<Corpus>[] newNodes); |
---|
69 | |
---|
70 | /** |
---|
71 | * Append new node which parent is |
---|
72 | * <code>parent</code> by new node |
---|
73 | * <code>newNode</code> |
---|
74 | * |
---|
75 | * @param parent The parent of appended node |
---|
76 | * @param newNode New node which is appended |
---|
77 | */ |
---|
78 | public void add(DefaultTreeNode<Corpus> parent, DefaultTreeNode<Corpus> newNode); |
---|
79 | |
---|
80 | public boolean hasChildren(Treeitem item); |
---|
81 | |
---|
82 | |
---|
83 | |
---|
84 | /** |
---|
85 | * Append new node which parent is |
---|
86 | * <code>parent</code> by a new node that contains |
---|
87 | * <code>corpus</code> |
---|
88 | * |
---|
89 | * @param parent The parent of appended node |
---|
90 | * @param corpus The corpus that the new appended node should contain |
---|
91 | */ |
---|
92 | public void add(DefaultTreeNode<Corpus> parent, Corpus corpus); |
---|
93 | |
---|
94 | public void addToSelected(Corpus data); |
---|
95 | |
---|
96 | public void removeFromSelected(Corpus data); |
---|
97 | |
---|
98 | public Map<String, Set<Corpus>> getSelectedCorpora(); |
---|
99 | |
---|
100 | } |
---|