edu.udo.cs.miningmart.m4.core
Class EstimatedStatistics

java.lang.Object
  extended by edu.udo.cs.miningmart.m4.core.EstimatedStatistics
All Implemented Interfaces:
EstimatedStatistics

public class EstimatedStatistics
extends java.lang.Object
implements EstimatedStatistics

Author:
Timm Euler
See Also:
EstimatedStatistics

Field Summary
 
Fields inherited from interface edu.udo.cs.miningmart.m4.EstimatedStatistics
VALUE_DISCRETE_UNKNOWN, VALUE_DOUBLE_UNKNOWN, VALUE_INT_UNKNOWN
 
Constructor Summary
EstimatedStatistics(Concept theConcept)
          This constructor creates an EstimatedStatistics object for the given Concept.
 
Method Summary
 void addAttribute(java.lang.String nameOfAttribute)
           
 void addValueInformation(java.lang.String nameOfAttribute, java.lang.String value, int noOfOccurrences)
           
 EstimatedStatistics copy(Concept toConcept)
           
 void copyValueList(java.lang.String nameOfDestinationAttribute, EstimatedStatistics from, java.lang.String nameOfSourceAttribute)
          Copy the list of values (with their number of occurrences) of the attribute with name nameOfSourceAttributefrom the given EstimatedStatistics object to this object, to the attribute with name nameOfDestinationAttribute.
 double getBiggestValue(java.lang.String nameOfAttribute)
           
 Concept getConcept()
          Returns the concept this EstimatedStatistics object applies to.
 double getLowestValue(java.lang.String nameOfAttribute)
           
 int getNumberOfMissingValues(java.lang.String nameOfAttribute)
           
 int getNumberOfOccurrences(java.lang.String nameOfAttribute, java.lang.String value)
           
 long getNumberOfRows()
           
 java.util.Vector getValueList(java.lang.String nameOfAttribute)
          Returns a Vector with the values this attribute takes.
 boolean readAvailableStatisticsFromDb()
          If the concept that these ES belong to is of type MINING, it may happen that some statistics have been computed for the columnset that may be attached to it.
 void removeValue(java.lang.String value, java.lang.String nameOfAttribute)
          Removes the given value from the list of values of the given attribute.
 void setBiggestValue(java.lang.String nameOfAttribute, double value)
           
 void setLowestValue(java.lang.String nameOfAttribute, double value)
           
 void setNumberOfMissingValues(java.lang.String nameOfAttribute, int number)
           
 void setNumberOfOccurrences(java.lang.String nameOfAttribute, java.lang.String value, int number)
           
 void setNumberOfRows(long numberOfRows)
           
 void setValueList(java.lang.String nameOfAttribute, java.util.Vector theValues)
          Sets the list of occurring values of the given attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EstimatedStatistics

public EstimatedStatistics(Concept theConcept)
                    throws M4Exception
This constructor creates an EstimatedStatistics object for the given Concept. If the concept is of type DB then its actual statistics are computed and copied to the estimated values. Otherwise all estimated values are set to be unknown. This means that any inference or estimation has to be done elsewhere.

Throws:
M4Exception
Method Detail

getConcept

public Concept getConcept()
Returns the concept this EstimatedStatistics object applies to.

Specified by:
getConcept in interface EstimatedStatistics

getValueList

public java.util.Vector getValueList(java.lang.String nameOfAttribute)
Description copied from interface: EstimatedStatistics
Returns a Vector with the values this attribute takes.

Specified by:
getValueList in interface EstimatedStatistics
Returns:
See Also:
EstimatedStatistics.getValueList(String)

setValueList

public void setValueList(java.lang.String nameOfAttribute,
                         java.util.Vector theValues)
Description copied from interface: EstimatedStatistics
Sets the list of occurring values of the given attribute. The given vector must contain Strings with the values.

Specified by:
setValueList in interface EstimatedStatistics
theValues - a Vector with Strings

copyValueList

public void copyValueList(java.lang.String nameOfDestinationAttribute,
                          EstimatedStatistics from,
                          java.lang.String nameOfSourceAttribute)
Description copied from interface: EstimatedStatistics
Copy the list of values (with their number of occurrences) of the attribute with name nameOfSourceAttributefrom the given EstimatedStatistics object to this object, to the attribute with name nameOfDestinationAttribute.

Specified by:
copyValueList in interface EstimatedStatistics
Parameters:
nameOfDestinationAttribute - name of attribute to which to set the copied list
from - the given EstimatedStatistics object
nameOfSourceAttribute - name of attribute from which to copy

removeValue

public void removeValue(java.lang.String value,
                        java.lang.String nameOfAttribute)
Description copied from interface: EstimatedStatistics
Removes the given value from the list of values of the given attribute.

Specified by:
removeValue in interface EstimatedStatistics
See Also:
EstimatedStatistics.removeValue(String, String)

getNumberOfMissingValues

public int getNumberOfMissingValues(java.lang.String nameOfAttribute)
Specified by:
getNumberOfMissingValues in interface EstimatedStatistics
See Also:
EstimatedStatistics.getNumberOfMissingValues(String)

setNumberOfMissingValues

public void setNumberOfMissingValues(java.lang.String nameOfAttribute,
                                     int number)
Specified by:
setNumberOfMissingValues in interface EstimatedStatistics
See Also:
EstimatedStatistics.setNumberOfMissingValues(String, int)

getBiggestValue

public double getBiggestValue(java.lang.String nameOfAttribute)
Specified by:
getBiggestValue in interface EstimatedStatistics
See Also:
EstimatedStatistics.getBiggestValue(String)

setBiggestValue

public void setBiggestValue(java.lang.String nameOfAttribute,
                            double value)
Specified by:
setBiggestValue in interface EstimatedStatistics
See Also:
EstimatedStatistics.setBiggestValue(String, double)

setLowestValue

public void setLowestValue(java.lang.String nameOfAttribute,
                           double value)
Specified by:
setLowestValue in interface EstimatedStatistics
See Also:
EstimatedStatistics.setLowestValue(String, double)

getLowestValue

public double getLowestValue(java.lang.String nameOfAttribute)
Specified by:
getLowestValue in interface EstimatedStatistics
See Also:
EstimatedStatistics.getLowestValue(String)

readAvailableStatisticsFromDb

public boolean readAvailableStatisticsFromDb()
                                      throws M4Exception
Description copied from interface: EstimatedStatistics
If the concept that these ES belong to is of type MINING, it may happen that some statistics have been computed for the columnset that may be attached to it. If such statistics are stored in the M4 schema they can be used as the estimations with this method.

Specified by:
readAvailableStatisticsFromDb in interface EstimatedStatistics
Returns:
TRUE iff any estimations were updated with information from M4.
Throws:
M4Exception
See Also:
EstimatedStatistics.readAvailableStatisticsFromDb()

getNumberOfRows

public long getNumberOfRows()
Specified by:
getNumberOfRows in interface EstimatedStatistics
See Also:
EstimatedStatistics.getNumberOfRows()

setNumberOfRows

public void setNumberOfRows(long numberOfRows)
Specified by:
setNumberOfRows in interface EstimatedStatistics
See Also:
edu.udo.cs.miningmart.m4.EstimatedStatistics#setNumberOfRows(int)

setNumberOfOccurrences

public void setNumberOfOccurrences(java.lang.String nameOfAttribute,
                                   java.lang.String value,
                                   int number)
Specified by:
setNumberOfOccurrences in interface EstimatedStatistics

getNumberOfOccurrences

public int getNumberOfOccurrences(java.lang.String nameOfAttribute,
                                  java.lang.String value)
Specified by:
getNumberOfOccurrences in interface EstimatedStatistics

copy

public EstimatedStatistics copy(Concept toConcept)
                         throws M4Exception
Specified by:
copy in interface EstimatedStatistics
Throws:
M4Exception

addValueInformation

public void addValueInformation(java.lang.String nameOfAttribute,
                                java.lang.String value,
                                int noOfOccurrences)
Specified by:
addValueInformation in interface EstimatedStatistics

addAttribute

public void addAttribute(java.lang.String nameOfAttribute)
Specified by:
addAttribute in interface EstimatedStatistics


Copyright © 2001-2005