01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package org.terracotta.dso.views;
06:
07: public class RootWrapper {
08: private RootsWrapper m_parent;
09: private int m_index;
10:
11: RootWrapper(RootsWrapper parent, int index) {
12: m_parent = parent;
13: m_index = index;
14: }
15:
16: RootsWrapper getParent() {
17: return m_parent;
18: }
19:
20: boolean isSetFieldName() {
21: return m_parent.getRootArray(m_index).isSetFieldName();
22: }
23:
24: String getFieldName() {
25: return m_parent.getRootArray(m_index).getFieldName();
26: }
27:
28: boolean isSetFieldExpression() {
29: return m_parent.getRootArray(m_index).isSetFieldExpression();
30: }
31:
32: String getFieldExpression() {
33: return m_parent.getRootArray(m_index).getFieldExpression();
34: }
35:
36: void remove() {
37: m_parent.removeRoot(m_index);
38: }
39:
40: public String toString() {
41: return isSetFieldName() ? getFieldName() : getFieldExpression();
42: }
43: }
|