16 #ifndef QGSSTRINGSTATISTICALSUMMARY_H 17 #define QGSSTRINGSTATISTICALSUMMARY_H 20 #include <QVariantList> 22 #include "qgis_core.h" 58 All = Count | CountDistinct | CountMissing | Min | Max | MinimumLength | MaximumLength | MeanLength,
73 Statistics statistics()
const {
return mStatistics; }
81 void setStatistics( QgsStringStatisticalSummary::Statistics stats ) { mStatistics = stats; }
94 void calculate(
const QStringList &values );
103 void calculateFromVariants(
const QVariantList &values );
119 void addString(
const QString &
string );
134 void addValue(
const QVariant &value );
153 int count()
const {
return mCount; }
175 QString
min()
const {
return mMin; }
180 QString
max()
const {
return mMax; }
206 Statistics mStatistics;
209 QSet< QString > mValues;
218 void testString(
const QString &
string );
221 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsStringStatisticalSummary::Statistics )
223 #endif // QGSSTRINGSTATISTICALSUMMARY_H int countDistinct() const
Returns the number of distinct string values.
Statistic
Enumeration of flags that specify statistics to be calculated.
void setStatistics(QgsStringStatisticalSummary::Statistics stats)
Sets flags which specify which statistics will be calculated.
QString max() const
Returns the maximum (non-null) string value.
int count() const
Returns the calculated count of values.
double meanLength() const
Returns the mean length of strings.
QString min() const
Returns the minimum (non-null) string value.
int countMissing() const
Returns the number of missing (null) string values.
QSet< QString > distinctValues() const
Returns the set of distinct string values.
Calculator for summary statistics and aggregates for a list of strings.
int maxLength() const
Returns the maximum length of strings.
int minLength() const
Returns the minimum length of strings.