11part of query;
22
3+ /// Property query base
34abstract class PropertyQuery <T > {
45 final Pointer <OBX_query_prop > _cProp;
56 final int _type;
67 bool _distinct = false ;
78
8- PropertyQuery (Pointer <OBX_query > cQuery, int propertyId, this ._type)
9+ PropertyQuery ._ (Pointer <OBX_query > cQuery, int propertyId, this ._type)
910 : _cProp =
1011 checkObxPtr (C .query_prop (cQuery, propertyId), 'property query' );
1112
@@ -15,10 +16,12 @@ abstract class PropertyQuery<T> {
1516 /// Set [replaceNullWith] to return null values as that value.
1617 List <T > find ({T /*?*/ replaceNullWith});
1718
19+ /// Close the property query, freeing its resources
1820 void close () {
1921 checkObx (C .query_prop_close (_cProp));
2022 }
2123
24+ /// Get the status of "distinct-values" configuration.
2225 bool get distinct => _distinct;
2326
2427 /// Set to only return distinct values.
@@ -62,6 +65,7 @@ abstract class PropertyQuery<T> {
6265
6366/// shared implementation, hence mixin
6467mixin _CommonNumeric <T > on PropertyQuery <T > {
68+ /// Average value of the property over all objects matching the query.
6569 double average () {
6670 final ptr = allocate <Double >();
6771 try {
@@ -73,9 +77,10 @@ mixin _CommonNumeric<T> on PropertyQuery<T> {
7377 }
7478}
7579
80+ /// "Property query" for an integer field. Created by [Query.property()] .
7681class IntegerPropertyQuery extends PropertyQuery <int > with _CommonNumeric {
77- IntegerPropertyQuery (Pointer <OBX_query > query, int propertyId, int obxType)
78- : super (query, propertyId, obxType);
82+ IntegerPropertyQuery ._ (Pointer <OBX_query > query, int propertyId, int obxType)
83+ : super ._ (query, propertyId, obxType);
7984
8085 int _op (
8186 int Function (Pointer <OBX_query_prop >, Pointer <Int64 >, Pointer <Int64 >)
@@ -89,10 +94,13 @@ class IntegerPropertyQuery extends PropertyQuery<int> with _CommonNumeric {
8994 }
9095 }
9196
97+ /// Minimum value of the property over all objects matching the query.
9298 int min () => _op (C .query_prop_min_int);
9399
100+ /// Maximum value of the property over all objects matching the query.
94101 int max () => _op (C .query_prop_max_int);
95102
103+ /// Sum of all property values over objects matching the query.
96104 int sum () => _op (C .query_prop_sum_int);
97105
98106 @override
@@ -143,9 +151,10 @@ class IntegerPropertyQuery extends PropertyQuery<int> with _CommonNumeric {
143151 }
144152}
145153
154+ /// "Property query" for a double field. Created by [Query.property()] .
146155class DoublePropertyQuery extends PropertyQuery <double > with _CommonNumeric {
147- DoublePropertyQuery (Pointer <OBX_query > query, int propertyId, int obxType)
148- : super (query, propertyId, obxType);
156+ DoublePropertyQuery ._ (Pointer <OBX_query > query, int propertyId, int obxType)
157+ : super ._ (query, propertyId, obxType);
149158
150159 double _op (
151160 int Function (Pointer <OBX_query_prop >, Pointer <Double >, Pointer <Int64 >)
@@ -159,10 +168,13 @@ class DoublePropertyQuery extends PropertyQuery<double> with _CommonNumeric {
159168 }
160169 }
161170
171+ /// Minimum value of the property over all objects matching the query.
162172 double min () => _op (C .query_prop_min);
163173
174+ /// Maximum value of the property over all objects matching the query.
164175 double max () => _op (C .query_prop_max);
165176
177+ /// Sum of all property values over objects matching the query.
166178 double sum () => _op (C .query_prop_sum);
167179
168180 @override
@@ -193,11 +205,12 @@ class DoublePropertyQuery extends PropertyQuery<double> with _CommonNumeric {
193205 }
194206}
195207
208+ /// "Property query" for a string field. Created by [Query.property()] .
196209class StringPropertyQuery extends PropertyQuery <String > {
197210 bool _caseSensitive = false ;
198211
199- StringPropertyQuery (Pointer <OBX_query > query, int propertyId, int obxType)
200- : super (query, propertyId, obxType);
212+ StringPropertyQuery ._ (Pointer <OBX_query > query, int propertyId, int obxType)
213+ : super ._ (query, propertyId, obxType);
201214
202215 /// Set to return case sensitive distinct values.
203216 ///
@@ -207,6 +220,7 @@ class StringPropertyQuery extends PropertyQuery<String> {
207220 checkObx (C .query_prop_distinct_case (_cProp, _distinct, _caseSensitive));
208221 }
209222
223+ /// Get status of the case-sensitive configuration.
210224 bool get caseSensitive => _caseSensitive;
211225
212226 @override
0 commit comments