RandomSec/main/java/com/metaweb/gridworks/expr/CellTuple.java
Stefano Mazzocchi 365868564f create 'main' and 'server'
git-svn-id: http://google-refine.googlecode.com/svn/branches/split-refactor@905 7d457c2a-affb-35e4-300a-418c747d4874
2010-05-30 16:52:50 +00:00

35 lines
961 B
Java

package com.metaweb.gridworks.expr;
import java.util.Properties;
import com.metaweb.gridworks.model.Cell;
import com.metaweb.gridworks.model.Column;
import com.metaweb.gridworks.model.Project;
import com.metaweb.gridworks.model.Row;
public class CellTuple implements HasFields {
final public Project project;
final public Row row;
public CellTuple(Project project, Row row) {
this.project = project;
this.row = row;
}
public Object getField(String name, Properties bindings) {
Column column = project.columnModel.getColumnByName(name);
if (column != null) {
int cellIndex = column.getCellIndex();
Cell cell = row.getCell(cellIndex);
if (cell != null) {
return new WrappedCell(project, name, cell);
}
}
return null;
}
public boolean fieldAlsoHasFields(String name) {
return true;
}
}