Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc für Elexis version 2.1.7.dev vom 01.09.2013

ch.unibe.iam.scg.archie.utils
Class DatasetHelper

java.lang.Object
  extended by ch.unibe.iam.scg.archie.utils.DatasetHelper

public class DatasetHelper
extends java.lang.Object

Singleton implementation of a dataset helper class. Contains helper functions such as sorting or column operations to perform on a given dataset. $Id$


Nested Class Summary
static class DatasetHelper.DatasetColumnComparator
          Internal comparator used for sorting a dataset according to a given column index and a sort direction.
 
Constructor Summary
DatasetHelper()
           
 
Method Summary
static boolean hasMoneyColumn(DataSet dataset)
          Checks whether a given dataset has at least one money column of data.
static boolean hasNumericColumn(DataSet dataset)
          Checks whether a given dataset has at least one numeric column of data.
static boolean isMoneyColumn(DataSet dataset, int columnIndex)
          Checks whether a given column contains only money values.
static boolean isMoneyColumn(DataSet dataset, java.lang.String column)
          Checks whether a given column contains only money values.
static boolean isNumericColumn(DataSet dataset, int columnIndex)
          Checks whether a given column contains only numeric values.
static boolean isNumericColumn(DataSet dataset, java.lang.String column)
          Checks whether a given column contains only numeric values.
static void sortDataSet(DataSet dataset, java.lang.String column, int direction)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatasetHelper

public DatasetHelper()
Method Detail

sortDataSet

public static final void sortDataSet(DataSet dataset,
                                     java.lang.String column,
                                     int direction)
Parameters:
dataset -
column -
direction -

isMoneyColumn

public static final boolean isMoneyColumn(DataSet dataset,
                                          java.lang.String column)
Checks whether a given column contains only money values. This function only checks the first row for a given column but given the specification and definition of a dataset, we can assume the data / value types in a column are the same. This function uses the column name (heading) to search for the given column in the dataset.

Parameters:
dataset -
column -
Returns:
True if the column contains only numeric characters, false else.

isMoneyColumn

public static final boolean isMoneyColumn(DataSet dataset,
                                          int columnIndex)
Checks whether a given column contains only money values. This function only checks the first row for a given column but given the specification and definition of a dataset, we can assume the data / value types in a column are the same. This function uses the column index to search for the given column in the dataset.

Parameters:
dataset -
columnIndex -
Returns:
True if the column contains only numeric characters, false else.

isNumericColumn

public static final boolean isNumericColumn(DataSet dataset,
                                            java.lang.String column)
Checks whether a given column contains only numeric values. This function only checks the first row for a given column but given the specification and definition of a dataset, we can assume the data / value types in a column are the same. This function uses the column name (heading) to search for the given column in the dataset.

Parameters:
dataset - Dataset to check the column in.
column - String Column name.
Returns:
boolean True if the column contains only numeric characters, false else.

isNumericColumn

public static final boolean isNumericColumn(DataSet dataset,
                                            int columnIndex)
Checks whether a given column contains only numeric values. This function only checks the first row for a given column but given the specification and definition of a dataset, we can assume the data / value types in a column are the same. This function uses the column index to search for the given column in the dataset.

Parameters:
dataset - Dataset to check the column in.
columnIndex -
Returns:
boolean True if the column contains only numeric characters, false else.

hasNumericColumn

public static final boolean hasNumericColumn(DataSet dataset)
Checks whether a given dataset has at least one numeric column of data.

Parameters:
dataset - Dataset to check the columns in.
Returns:
True if the dataset has at least one numeric column, false else.

hasMoneyColumn

public static final boolean hasMoneyColumn(DataSet dataset)
Checks whether a given dataset has at least one money column of data.

Parameters:
dataset - Dataset to check the columns in.
Returns:
True if the dataset has at least one money column, false else.

Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc für Elexis version 2.1.7.dev vom 01.09.2013