public class DefaultResultSetPrinter extends AbstractImplementation implements ResultSetPrinterIF
ResultSetPrinterIF
Modifier and Type | Class and Description |
---|---|
class |
DefaultResultSetPrinter.ResultColumn
The result column.
|
Modifier and Type | Field and Description |
---|---|
protected int[] |
charWidth
The char width of the columns
|
protected int |
columnCount
The total number of columns.
|
protected DefaultFormatToString |
defaultFormatToString
The default formatter.
|
protected static int |
MAXLEN |
protected static java.lang.String |
SPACES |
protected java.lang.Object[] |
stringVal
The column string presentation.
|
arguments, ctx, descriptor, NEW_LINE
Constructor and Description |
---|
DefaultResultSetPrinter()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
findColumn(ApplicationStructure asObj,
ResultSetExt[] resultSet,
java.lang.String name)
Find a specific column.
|
T_LONGLONG[] |
getAIds(ApplicationStructure asObj,
ResultSetExt[] resultSet)
Get all the application element ids of the columns.
|
protected NameValueSeqUnitId |
getAttributeRestValues(ResultSetExt[] resultSet,
int column) |
protected NameValueSeqUnitId |
getAttributeValues(ResultSetExt[] resultSet,
int column)
Get the attribute values.
|
java.lang.String |
getCellStringValue(ApplicationStructure asObj,
ResultSetExt[] resultSet,
int column,
int row,
FormatToStringIF format)
Get the cell string value.
|
int |
getColumnCount(ResultSetExt[] resultSet)
Get the column count.
|
int |
getColumnDisplaySize(ApplicationStructure asObj,
ResultSetExt[] resultSet,
int column,
FormatToStringIF format)
Indicates the designated column's normal maximum width in characters.
|
java.lang.String[] |
getColumnStringValue(ApplicationStructure asObj,
ResultSetExt[] resultSet,
int column,
FormatToStringIF format)
Get the column string value.
|
DefaultResultSetPrinter.ResultColumn[] |
getResultColumns(ApplicationStructure asObj,
ResultSetExt[] resultSet,
java.util.List<java.lang.String> alias,
java.util.List<FormatToStringIF> formats)
Get the result columns.
|
int |
getRowCount(ApplicationStructure asObj,
ResultSetExt[] resultSet,
java.util.List<FormatToStringIF> formats)
Get the row count.
|
java.lang.String[] |
getRowStringValue(ApplicationStructure asObj,
ResultSetExt[] resultSet,
int row,
FormatToStringIF format)
Get the row string value.
|
java.lang.String |
getUnitString(ApplicationStructure asObj,
T_LONGLONG unitID)
Get the unit string of the instan ce element with the given Id.
|
void |
init()
Initialize the program.
|
protected boolean |
isNumeric(NameValueSeqUnitId values)
Return a boolean whether the value is numeric.
|
protected boolean |
isNumeric(ResultSetExt[] resultSet,
int column)
Return a boolean whether the value is numeric.
|
java.lang.String[] |
listColumns(ApplicationStructure asObj,
ResultSetExt[] resultSet,
java.util.List<java.lang.String> alias)
List attribute names belong to the result set.
|
static void |
print(java.io.PrintStream out,
ApplicationStructure asObj,
ResultSetExt[] resultSet)
Use this static method to print your result set.
|
void |
print(java.io.PrintStream out,
ApplicationStructure asObj,
ResultSetExt[] resultSet,
java.util.List<java.lang.String> alias,
java.util.List<FormatToStringIF> formats,
java.lang.String prefix,
java.lang.String postfix)
Print out.
|
void |
print(java.io.PrintStream out,
ApplicationStructure asObj,
ResultSetExt[] resultSet,
java.util.List<java.lang.String> alias,
java.lang.String prefix,
java.lang.String postfix)
Print out.
|
java.lang.String[] |
ts_UnionSeqToString(ApplicationStructure asObj,
T_LONGLONG aid,
NameValueSeqUnitId nvuSeq,
java.lang.String format)
Get the column string value.
|
addAttributesToNameValueUnitArray, addAttributeToNameValueUnitArray, addStringValueToNameValueUnitArray, checkDirectoy, checkDirectoy, checkDirectoy, checkFile, checkFile, checkFile, checkIntValue, checkStringValue, compressNvuArray, createMessageFromPropertyFile, createMessageFromPropertyFile, createMessageFromPropertyFile, createTsUnionFromObject, deleteRowWithAttributes, getArguments, getContext, getDescriptor, getListFromProperty, getMandatoryProperty, getMandatoryProperty, getMandatoryPropertyAsInt, getMandatoryPropertyAsList, getMandatoryPropertyWithRuleException, getNvuArrayFromMap, getNvuArrayFromMap, getNvuObjectWithName, getNvuObjectWithName, getNvuObjectWithName, getOdsCacheFromProperty, getOptioanlPropertyAsInt, getOptionalProperty, getOptionalProperty, getOptionalProperty, getOptionalProperty, getOptionalPropertyAsBoolean, getOptionalPropertyAsBoolean, getOptionalPropertyAsBoolean, getOptionalPropertyAsList, makeUpperCaseKeyword, removeAttributeFromNameValueUnitArray, removeAttributeFromNameValueUnitArray, setArguments, setContext, setDescriptor
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContext, getDescriptor, setArguments, setContext, setDescriptor
protected static final java.lang.String SPACES
protected static final int MAXLEN
protected int[] charWidth
protected java.lang.Object[] stringVal
protected int columnCount
protected DefaultFormatToString defaultFormatToString
public DefaultResultSetPrinter()
public void init() throws InitializationFailedException
init
in interface ImplementationIF
init
in class AbstractImplementation
InitializationFailedException
- if the initialization fails.public DefaultResultSetPrinter.ResultColumn[] getResultColumns(ApplicationStructure asObj, ResultSetExt[] resultSet, java.util.List<java.lang.String> alias, java.util.List<FormatToStringIF> formats) throws AoException
asObj
- the application structureresultSet
- the result set.alias
- the list that holds the aliases of the column names.AoException
public java.lang.String[] listColumns(ApplicationStructure asObj, ResultSetExt[] resultSet, java.util.List<java.lang.String> alias) throws AoException
asObj
- the application structureresultSet
- the result set.AoException
public T_LONGLONG[] getAIds(ApplicationStructure asObj, ResultSetExt[] resultSet) throws AoException
asObj
- the application structureresultSet
- the result set.AoException
public int findColumn(ApplicationStructure asObj, ResultSetExt[] resultSet, java.lang.String name) throws java.lang.Exception
asObj
- the application structureresultSet
- the result set.name
- the name of the column.java.lang.Exception
public int getColumnDisplaySize(ApplicationStructure asObj, ResultSetExt[] resultSet, int column, FormatToStringIF format) throws AoException
resultSet
- the result set.column
- The column index.AoException
public java.lang.String[] getRowStringValue(ApplicationStructure asObj, ResultSetExt[] resultSet, int row, FormatToStringIF format) throws AoException
resultSet
- the result set.row
- The row index.AoException
public java.lang.String getCellStringValue(ApplicationStructure asObj, ResultSetExt[] resultSet, int column, int row, FormatToStringIF format) throws AoException
resultSet
- the result set.column
- The column index.row
- The row index.AoException
public java.lang.String[] getColumnStringValue(ApplicationStructure asObj, ResultSetExt[] resultSet, int column, FormatToStringIF format) throws AoException
resultSet
- the result set.column
- The column index.AoException
public java.lang.String getUnitString(ApplicationStructure asObj, T_LONGLONG unitID)
asObj
- the applciation structureunitID
- the unit Id.public java.lang.String[] ts_UnionSeqToString(ApplicationStructure asObj, T_LONGLONG aid, NameValueSeqUnitId nvuSeq, java.lang.String format) throws AoException
unionSeq
- the sequence of union of the column data.AoException
protected boolean isNumeric(NameValueSeqUnitId values) throws AoException
AoException
protected boolean isNumeric(ResultSetExt[] resultSet, int column) throws AoException
AoException
protected NameValueSeqUnitId getAttributeValues(ResultSetExt[] resultSet, int column) throws AoException
resultSet
- the result set.column
- The column index.AoException
protected NameValueSeqUnitId getAttributeRestValues(ResultSetExt[] resultSet, int column) throws AoException
AoException
public int getColumnCount(ResultSetExt[] resultSet) throws AoException
resultSet
- the result set.AoException
public int getRowCount(ApplicationStructure asObj, ResultSetExt[] resultSet, java.util.List<FormatToStringIF> formats) throws AoException
AoException
public void print(java.io.PrintStream out, ApplicationStructure asObj, ResultSetExt[] resultSet, java.util.List<java.lang.String> alias, java.lang.String prefix, java.lang.String postfix) throws AoException
print
in interface ResultSetPrinterIF
out
- the print streamasObj
- the ASAM ODS Application Structure.resultSet
- the result set.alias
- the list that holds the aliases of the column names.prefix
- this prefix string should be printed before other output.postfix
- this postfix string should be printed at the end of the output.AoException
public void print(java.io.PrintStream out, ApplicationStructure asObj, ResultSetExt[] resultSet, java.util.List<java.lang.String> alias, java.util.List<FormatToStringIF> formats, java.lang.String prefix, java.lang.String postfix) throws AoException
print
in interface ResultSetPrinterIF
out
- the print streamasObj
- the ASAM ODS Application Structure.resultSet
- the result set.alias
- the list that holds the aliases of the column names.formats
- the list of format strings.prefix
- this prefix string should be printed before other output.postfix
- this postfix string should be printed at the end of the output.AoException
public static void print(java.io.PrintStream out, ApplicationStructure asObj, ResultSetExt[] resultSet) throws AoException
out
- the print streamasObj
- the application structure.resultSet
- the result set.AoException