View Javadoc

1   /**
2    * Copyright 2005-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krms.tree.node;
17  
18  import groovy.json.StringEscapeUtils;
19  import org.apache.commons.lang.StringUtils;
20  
21  import java.io.Serializable;
22  import java.util.List;
23  
24  /**
25   * @author Kuali Student Team
26   */
27  public class CompareTreeNode implements Serializable {
28  
29      private String firstElement;
30      private List<String> firstElementItems;
31      private String secondElement;
32      private List<String> secondElementItems;
33      private String thirdElement;
34      private List<String> thirdElementItems;
35      private String fourthElement;
36      private List<String> fourthElementItems;
37      private String fithElement;
38      private List<String> fithElementItems;
39  
40      private int width;
41  
42      public CompareTreeNode(int width){
43          this.setWidth(width);
44      }
45  
46      public CompareTreeNode(int width, String... elements){
47          this(width);
48          for (int i = 0; i < elements.length; i++) {
49              switch (i) {
50                  case 0:
51                      this.firstElement = elements[0];
52                      break;
53                  case 1:
54                      this.secondElement = elements[1];
55                      break;
56                  case 2:
57                      this.thirdElement = elements[2];
58                      break;
59                  case 3:
60                      this.fourthElement= elements[3];
61                      break;
62                  case 4:
63                      this.fithElement = elements[4];
64                      break;
65              }
66          }
67      }
68  
69      public String getFirstElement() {
70          if((this.firstElement == null) || (this.firstElement.isEmpty())){
71              return org.apache.commons.lang.StringEscapeUtils.escapeHtml(" ");
72          }
73          return firstElement;
74      }
75  
76      public void setFirstElement(String firstElement) {
77          this.firstElement = firstElement;
78      }
79  
80      public List<String> getFirstElementItems() {
81          return firstElementItems;
82      }
83  
84      public void setFirstElementItems(List<String> firstElementItems) {
85          this.firstElementItems = firstElementItems;
86      }
87  
88      public String getSecondElement() {
89          if((this.secondElement == null) || (this.secondElement.isEmpty())){
90              return org.apache.commons.lang.StringEscapeUtils.escapeHtml(" ");
91          }
92          return secondElement;
93      }
94  
95      public void setSecondElement(String secondElement) {
96          this.secondElement = secondElement;
97      }
98  
99      public List<String> getSecondElementItems() {
100         return secondElementItems;
101     }
102 
103     public void setSecondElementItems(List<String> secondElementItems) {
104         this.secondElementItems = secondElementItems;
105     }
106 
107     public String getThirdElement() {
108         if((this.thirdElement == null) || (this.thirdElement.isEmpty())){
109             return org.apache.commons.lang.StringEscapeUtils.escapeHtml(" ");
110         }
111         return thirdElement;
112     }
113 
114     public void setThirdElement(String thirdElement) {
115         this.thirdElement = thirdElement;
116     }
117 
118     public List<String> getThirdElementItems() {
119         return thirdElementItems;
120     }
121 
122     public void setThirdElementItems(List<String> thirdElementItems) {
123         this.thirdElementItems = thirdElementItems;
124     }
125 
126     public String getFourthElement() {
127         if((this.fourthElement == null) || (this.fourthElement.isEmpty())){
128             return org.apache.commons.lang.StringEscapeUtils.escapeHtml(" ");
129         }
130         return fourthElement;
131     }
132 
133     public void setFourthElement(String fourthElement) {
134         this.fourthElement = fourthElement;
135     }
136 
137     public List<String> getFourthElementItems() {
138         return fourthElementItems;
139     }
140 
141     public void setFourthElementItems(List<String> fourthElementItems) {
142         this.fourthElementItems = fourthElementItems;
143     }
144 
145     public String getFithElement() {
146         if((this.fithElement == null) || (this.fithElement.isEmpty())){
147             return org.apache.commons.lang.StringEscapeUtils.escapeHtml(" ");
148         }
149         return fithElement;
150     }
151 
152     public void setFithElement(String fithElement) {
153         this.fithElement = fithElement;
154     }
155 
156     public List<String> getFithElementItems() {
157         return fithElementItems;
158     }
159 
160     public void setFithElementItems(List<String> fithElementItems) {
161         this.fithElementItems = fithElementItems;
162     }
163 
164     public int getWidth() {
165         return width;
166     }
167 
168     public void setWidth(int width) {
169         this.width = width;
170     }
171 }