|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectproper.core.ProperObject
proper.database.ConnectorObject
proper.relaggs.RelaggsStructure
public class RelaggsStructure
Title: RelaggsStructure
Description: Stores the information about the attributes
of an aggregated table.
ChangeLog:
Field Summary | |
---|---|
static java.lang.String |
KEY_DATE_Y
Hashtable key for the year-month-day objects. |
static java.lang.String |
KEY_DATE_YM
Hashtable key for the year-month-day objects. |
static java.lang.String |
KEY_DATE_YMD
Hashtable key for the year-month-day objects. |
static java.lang.String |
KEY_INT_AVG
Hashtable key for the average (for Double). |
static java.lang.String |
KEY_INT_CNTALL
Hashtable key for the number of all records (for Integer). |
static java.lang.String |
KEY_INT_CNTVAL
Hashtable key for the number of distinct values (for Integer). |
static java.lang.String |
KEY_INT_MAX
Hashtable key for the maximum (for Integer). |
static java.lang.String |
KEY_INT_MED
Hashtable key for the median (for Integer). |
static java.lang.String |
KEY_INT_MIN
Hashtable key for the minimum (for Integer). |
static java.lang.String |
KEY_INT_Q1
Hashtable key for the 1-quartil (for Integer). |
static java.lang.String |
KEY_INT_Q3
Hashtable key for the 3-quartil (for Integer). |
static java.lang.String |
KEY_INT_RNG
Hashtable key for the range (for Integer). |
static java.lang.String |
KEY_INT_STDDEV
Hashtable key for the standard deviation (for Double). |
static java.lang.String |
KEY_INT_SUM
Hashtable key for the sum (for Integer). |
static java.lang.String |
KEY_INT_VALUES
Hashtable key for the values (for Vector). |
Fields inherited from interface proper.core.ProperInterface |
---|
VERSION |
Constructor Summary | |
---|---|
RelaggsStructure(Connector conn)
Creates a new RelaggsStructure. |
Method Summary | |
---|---|
void |
addAttribute(RelaggsAttribute attr)
Adds an attribute that should be aggregated to the structure. |
void |
addAttributeValue(RelaggsAttribute attr,
java.sql.Date value,
int key)
Adds a date attribute value to the structure. |
void |
addAttributeValue(RelaggsAttribute attr,
int value,
int key)
Adds an integer attribute value to the structure. |
void |
addAttributeValue(RelaggsAttribute attr,
java.lang.String value,
int key)
Adds a string attribute value to the structure. |
void |
addAttributeValueGroupBy(RelaggsAttribute attr,
RelaggsAttribute gb_attr,
java.lang.Object gb_value,
java.sql.Date value,
int key)
Adds a date attribute value for a condition attribute value to the structure. |
void |
addAttributeValueGroupBy(RelaggsAttribute attr,
RelaggsAttribute gb_attr,
java.lang.Object gb_value,
java.lang.Object value,
java.lang.String value_type,
int key)
Adds an integer attribute value or an aggregated integer value for a condition attribute value to the structure. |
void |
addAttributeValueGroupBy(RelaggsAttribute attr,
RelaggsAttribute gb_attr,
java.lang.Object gb_value,
java.lang.String value,
int key)
Adds a string attribute value for a condition attribute value to the structure. |
void |
addRecord()
Increments the record counter. |
java.lang.String |
getAlterTableColumns(RelaggsTable source_table)
Returns the columns part for an ALTER TABLE statement containing the new columns for the aggregated values. FracPete: changed sql from type String to
StringBuffer for performance reasons
introduced a HashSet to identify duplicate columns
changed data types to ANSI types: INT, DOUBLE PRECISION
|
java.util.HashSet |
getColumns()
returns the columns used as basis for creating a new unique one |
java.util.Hashtable |
getGroupByAttributes()
Returns a hashtable containing the condition attributes as key. |
java.util.Enumeration |
getKeyValues()
Returns an Enumeration containing the key attribute values. |
java.sql.PreparedStatement |
getUpdateQuery(java.lang.Object key,
RelaggsTable source,
RelaggsTable dest,
Join join)
Returns an PreparedStatement containing the UPDATE query with the aggregated values for a key value. |
boolean |
isAggregationValid(RelaggsAttribute attr)
Returns whether the attribute should be aggregated according to the max_aggr_values parameter. |
boolean |
isAggregationValid(RelaggsAttribute attr,
java.lang.String attr_param)
Returns whether the attribute should be aggregated according to the max_aggr_values parameter. |
void |
printReport()
Prints information about the collected data. |
void |
processAttributes()
Calculates the aggregation values median, 1-quart, 3-quart and range for integer attributes. |
Methods inherited from class proper.database.ConnectorObject |
---|
getConnector |
Methods inherited from class proper.core.ProperObject |
---|
addListener, addOutput, classInVerbose, debugprint, debugprint, debugprint, debugprint, debugprintln, debugprintln, debugprintln, debugprintln, debugprintln, getListeners, getRuntime, getVerbose, getVerboseLevel, getVerboseLevelForClass, getVerboseString, getVerboseStringForClass, notifyListener, notifyListeners, print, print, print, print, println, println, println, println, println, printMemory, removeListener, setOutput, setVerbose, setVerboseLevel, setVerboseString, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String KEY_DATE_YMD
public static final java.lang.String KEY_DATE_YM
public static final java.lang.String KEY_DATE_Y
public static final java.lang.String KEY_INT_CNTALL
public static final java.lang.String KEY_INT_CNTVAL
public static final java.lang.String KEY_INT_SUM
public static final java.lang.String KEY_INT_AVG
public static final java.lang.String KEY_INT_MIN
public static final java.lang.String KEY_INT_MAX
public static final java.lang.String KEY_INT_STDDEV
public static final java.lang.String KEY_INT_Q1
public static final java.lang.String KEY_INT_Q3
public static final java.lang.String KEY_INT_MED
public static final java.lang.String KEY_INT_RNG
public static final java.lang.String KEY_INT_VALUES
Constructor Detail |
---|
public RelaggsStructure(Connector conn)
conn
- the Connector instanceMethod Detail |
---|
public java.util.HashSet getColumns()
public void addRecord()
public void addAttribute(RelaggsAttribute attr)
attr
- the attribute that should be addedpublic void addAttributeValue(RelaggsAttribute attr, int value, int key)
attr
- the integer attributevalue
- the integer valuekey
- the integer aggregation keypublic void addAttributeValue(RelaggsAttribute attr, java.sql.Date value, int key)
attr
- the date attributevalue
- the date valuekey
- the integer aggregation keypublic void addAttributeValueGroupBy(RelaggsAttribute attr, RelaggsAttribute gb_attr, java.lang.Object gb_value, java.sql.Date value, int key)
attr
- the date attributegb_attr
- the condition attributegb_value
- the condition attribute valuevalue
- the date attribute valuekey
- the integer aggregation keypublic void addAttributeValueGroupBy(RelaggsAttribute attr, RelaggsAttribute gb_attr, java.lang.Object gb_value, java.lang.Object value, java.lang.String value_type, int key)
attr
- the integer attributegb_attr
- the condition attributegb_value
- the condition attribute valuevalue
- the integer value or the aggregated value (type
Integer or Double)value_type
- the type of the inserted value:
- KEY_INT_VALUES for a single integer value
- KEY_INT_[Aggr.-function] for an aggregated valuekey
- the integer aggregation keypublic void addAttributeValue(RelaggsAttribute attr, java.lang.String value, int key)
attr
- the string attributevalue
- the string attribute valuekey
- the integer aggregation keypublic void addAttributeValueGroupBy(RelaggsAttribute attr, RelaggsAttribute gb_attr, java.lang.Object gb_value, java.lang.String value, int key)
attr
- the string attributegb_attr
- the condition attributegb_value
- the condition attribute valuevalue
- the string attribute valuekey
- the integer aggregation keypublic void processAttributes()
public void printReport()
public java.util.Hashtable getGroupByAttributes()
public java.lang.String getAlterTableColumns(RelaggsTable source_table)
String
to
StringBuffer
for performance reasons
HashSet
to identify duplicate columns
source_table
- the attribute table that contained the original data
for the aggregationpublic boolean isAggregationValid(RelaggsAttribute attr, java.lang.String attr_param)
max_aggr_values
parameter.
attr
- the attribute to checkattr_param
- only for date attributes: the type of the date
attribute (KEY_DATE_*)public boolean isAggregationValid(RelaggsAttribute attr)
max_aggr_values
parameter. For date attributes returns true
if one of the format types is valid for aggregation.
attr
- the attribute to checkpublic java.util.Enumeration getKeyValues()
public java.sql.PreparedStatement getUpdateQuery(java.lang.Object key, RelaggsTable source, RelaggsTable dest, Join join) throws java.sql.SQLException
key
- the key attribute valuesource
- the attribute table that contained the original data
for the aggregationdest
- the result table that will contain the aggregated
datajoin
- the foreign key relation
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |