01 /*
02 * DetailsGroup.java
03 *
04 * Niraj Aswani, 09/March/07
05 *
06 * $Id: DetailsGroup.html,v 1.0 2007/03/09 16:13:01 niraj Exp $
07 */
08 package gate.gui.ontology;
09
10 import gate.creole.ontology.OResource;
11 import java.util.*;
12
13 /**
14 * Represents each group (e.g. direct sub classes, all subclasses,
15 * property values etc.) shown in the right hand side of panel when a
16 * resource in the ontology tree is selected.
17 *
18 * @author niraj
19 *
20 */
21 public class DetailsGroup {
22 public DetailsGroup(String groupName, boolean flag,
23 Collection<OResource> collection) {
24 name = groupName;
25 expanded = flag;
26 values = collection != null ? new ArrayList(collection) : new ArrayList();
27 }
28
29 public String getName() {
30 return name;
31 }
32
33 public boolean isExpanded() {
34 return expanded;
35 }
36
37 public void setExpanded(boolean flag) {
38 expanded = flag;
39 }
40
41 public void setName(String s) {
42 name = s;
43 }
44
45 public int getSize() {
46 return values.size();
47 }
48
49 public Object getValueAt(int index) {
50 return values.get(index);
51 }
52
53 public List getValues() {
54 return values;
55 }
56
57 public void setValues(List list) {
58 values = list;
59 }
60
61 /** Set one of the value in the list.
62 * Same behaviour as {@link List#set(int, Object)}. */
63 public Object setValueAt(int index, Object value) {
64 return values.set(index, value);
65 }
66
67 boolean expanded;
68
69 String name;
70
71 List values;
72 }
|