com.bstek.urule.model.table.DecisionTable Maven / Gradle / Ivy
/*******************************************************************************
* Copyright 2017 Bstek
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
******************************************************************************/
package com.bstek.urule.model.table;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.bstek.urule.model.rule.Library;
/**
* @author Jacky.gao
* @since 2015年1月19日
*/
public class DecisionTable {
private Integer salience;
private Date effectiveDate;
private Date expiresDate;
private Boolean enabled;
private String remark;
private List rows;
private List columns;
private Map cellMap;
private List libraries;
public Integer getSalience() {
return salience;
}
public void setSalience(Integer salience) {
this.salience = salience;
}
public Date getEffectiveDate() {
return effectiveDate;
}
public void setEffectiveDate(Date effectiveDate) {
this.effectiveDate = effectiveDate;
}
public Date getExpiresDate() {
return expiresDate;
}
public void setExpiresDate(Date expiresDate) {
this.expiresDate = expiresDate;
}
public Boolean getEnabled() {
return enabled;
}
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public List getRows() {
return rows;
}
public void addLibrary(Library library){
if(libraries==null){
libraries=new ArrayList();
}
libraries.add(library);
}
public void addRow(Row row){
if(rows==null){
rows=new ArrayList();
}
rows.add(row);
}
public void addColumn(Column col){
if(columns==null){
columns=new ArrayList();
}
columns.add(col);
}
public void addCell(Cell cell){
if(cellMap==null){
cellMap=new HashMap();
}
cellMap.put(buildCellKey(cell.getRow(),cell.getCol()), cell);
}
public void setRows(List rows) {
this.rows = rows;
}
public List getColumns() {
return columns;
}
public void setColumns(List columns) {
this.columns = columns;
}
public Map getCellMap() {
return cellMap;
}
public List getLibraries() {
return libraries;
}
public void setLibraries(List libraries) {
this.libraries = libraries;
}
public String buildCellKey(int row,int col){
return row+","+col;
}
}