001/**
002 * Copyright 2005-2013 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.krms.tree.node;
017
018import org.apache.commons.lang.StringEscapeUtils;
019
020import java.io.Serializable;
021import java.util.List;
022
023/**
024 * @author Kuali Student Team
025 */
026public class CompareTreeNode implements Serializable {
027
028    private String firstElement;
029    private List<String> firstElementItems;
030    private String secondElement;
031    private List<String> secondElementItems;
032    private String thirdElement;
033    private List<String> thirdElementItems;
034    private String fourthElement;
035    private List<String> fourthElementItems;
036    private String fithElement;
037    private List<String> fithElementItems;
038
039    private int width;
040
041    public CompareTreeNode(int width){
042        this.setWidth(width);
043    }
044
045    public CompareTreeNode(int width, String... elements){
046        this(width);
047        for (int i = 0; i < elements.length; i++) {
048            switch (i) {
049                case 0:
050                    this.firstElement = elements[0];
051                    break;
052                case 1:
053                    this.secondElement = elements[1];
054                    break;
055                case 2:
056                    this.thirdElement = elements[2];
057                    break;
058                case 3:
059                    this.fourthElement= elements[3];
060                    break;
061                case 4:
062                    this.fithElement = elements[4];
063                    break;
064            }
065        }
066    }
067
068    public String getFirstElement() {
069        if((this.firstElement == null) || (this.firstElement.isEmpty())){
070            return StringEscapeUtils.escapeHtml(" ");
071        }
072        return firstElement;
073    }
074
075    public void setFirstElement(String firstElement) {
076        this.firstElement = firstElement;
077    }
078
079    public List<String> getFirstElementItems() {
080        return firstElementItems;
081    }
082
083    public void setFirstElementItems(List<String> firstElementItems) {
084        this.firstElementItems = firstElementItems;
085    }
086
087    public String getSecondElement() {
088        if((this.secondElement == null) || (this.secondElement.isEmpty())){
089            return StringEscapeUtils.escapeHtml(" ");
090        }
091        return secondElement;
092    }
093
094    public void setSecondElement(String secondElement) {
095        this.secondElement = secondElement;
096    }
097
098    public List<String> getSecondElementItems() {
099        return secondElementItems;
100    }
101
102    public void setSecondElementItems(List<String> secondElementItems) {
103        this.secondElementItems = secondElementItems;
104    }
105
106    public String getThirdElement() {
107        if((this.thirdElement == null) || (this.thirdElement.isEmpty())){
108            return StringEscapeUtils.escapeHtml(" ");
109        }
110        return thirdElement;
111    }
112
113    public void setThirdElement(String thirdElement) {
114        this.thirdElement = thirdElement;
115    }
116
117    public List<String> getThirdElementItems() {
118        return thirdElementItems;
119    }
120
121    public void setThirdElementItems(List<String> thirdElementItems) {
122        this.thirdElementItems = thirdElementItems;
123    }
124
125    public String getFourthElement() {
126        if((this.fourthElement == null) || (this.fourthElement.isEmpty())){
127            return StringEscapeUtils.escapeHtml(" ");
128        }
129        return fourthElement;
130    }
131
132    public void setFourthElement(String fourthElement) {
133        this.fourthElement = fourthElement;
134    }
135
136    public List<String> getFourthElementItems() {
137        return fourthElementItems;
138    }
139
140    public void setFourthElementItems(List<String> fourthElementItems) {
141        this.fourthElementItems = fourthElementItems;
142    }
143
144    public String getFithElement() {
145        if((this.fithElement == null) || (this.fithElement.isEmpty())){
146            return StringEscapeUtils.escapeHtml(" ");
147        }
148        return fithElement;
149    }
150
151    public void setFithElement(String fithElement) {
152        this.fithElement = fithElement;
153    }
154
155    public List<String> getFithElementItems() {
156        return fithElementItems;
157    }
158
159    public void setFithElementItems(List<String> fithElementItems) {
160        this.fithElementItems = fithElementItems;
161    }
162
163    public int getWidth() {
164        return width;
165    }
166
167    public void setWidth(int width) {
168        this.width = width;
169    }
170}