/** * Constructor: for C JNI calls * * @param value Integer value */ public CellData(Integer value) { setValue(value); }
private void setValue(String stringValue, Object value, CellDataType type) { setStringValue(stringValue); setObjectValue(value); setType(type); }
/** * Constructor: fast initialization */ public CellData() { setNull(); }
/** * Add a row * * @param row Row to add */ public void addRow(Map<String, CellData> row) { getRows().add(row); setRecords(getRows().size()); }
/** * Adds a variable to the map * * @param name Variable name * @param value Variable value * @return this */ public ServiceData addVariable(String name, String value) { this.getVariableMap().put(name, new CellData(value)); return this; }
@Override public CellData copy() throws AWException { return new CellData(this); }
/** * Sort datalist * * @param list DataList to sort * @param columnId Sort by field list * @param direction Sort direction */ public static void sort(DataList list, String columnId, String direction) { List<SortColumn> sortColumnList = new ArrayList<>(); SortColumn sortColumn = new SortColumn(columnId, direction); sortColumnList.add(sortColumn); Collections.sort(list.getRows(), new CompareRow(sortColumnList)); }
/** * Sort datalist * * @param list DataList to sort * @param sortList Sort by field list */ public static void sort(DataList list, List<SortColumn> sortList) { Collections.sort(list.getRows(), new CompareRow(sortList)); }
/** * Returns the object value * * @return Total pages */ public Object toObject() { return getObjectValue(); }
@Override public MaintainResultDetails copy() throws AWException { return new MaintainResultDetails(this); }
@Override public QueryParameter copy() throws AWException { return new QueryParameter(this); }
/** * Check if a row is inside another list * * @param list Row list * @param rowToCheck row to check * @param comparator row comparator */ private static boolean in(List<Map<String, CellData>> list, Map<String, CellData> rowToCheck, CompareRow comparator) { for (Map<String, CellData> row : list) { if (comparator.compare(row, rowToCheck) == 0) { return true; } } return false; } }
/** * Adds a client action to the list * * @param clientAction Client action to be added * @return this */ public ServiceData addClientAction(ClientAction clientAction) { this.getClientActionList().add(clientAction); return this; }
/** * Get variable from the map * * @param name Variable name * @return this */ public CellData getVariable(String name) { return getVariableMap().get(name); }
/** * Add a column with one row value * * @param list DataList * @param columnName Column name (alias) * @param cellValue Cell value */ public static void addColumnWithOneRow(DataList list, String columnName, String cellValue) { // Add cell to row addCellToRow(list, columnName, 0, new CellData(cellValue)); }
/** * Constructor: for C JNI calls * * @param value Float value */ public CellData(Float value) { setValue(value); }
/** * Copy constructor * * @param other */ public CellData(CellData other) { if (other != null) { this.printable = other.printable; this.sendStringValue = other.sendStringValue; this.stringValue = other.stringValue; this.objectValue = other.objectValue; this.type = other.type; } else { setNull(); } }
/** * Add a column with one row value * * @param list DataList * @param columnName Column name (alias) * @param cellValue Cell value */ public static void addColumnWithOneRow(DataList list, String columnName, Object cellValue) { // Add cell to row addCellToRow(list, columnName, 0, new CellData(cellValue)); }
/** * Constructor: for C JNI calls * * @param value Date value */ public CellData(Date value) { setValue(value); }
/** * Constructor: for C JNI calls * * @param value String value */ public CellData(String value) { setValue(value); }