Class AggregationUtility<T extends AggregatedRecord<T,​?>>


  • public class AggregationUtility<T extends AggregatedRecord<T,​?>>
    extends Object
    Author:
    Luca Frosini (ISTI - CNR)
    • Constructor Detail

      • AggregationUtility

        public AggregationUtility​(T t)
    • Method Detail

      • setDefaultAggregationFields

        protected void setDefaultAggregationFields()
      • setDefaultNeededFields

        protected void setDefaultNeededFields()
      • setAggregationFields

        public void setAggregationFields​(Set<String> aggregationFields)
        This function is used to set the Set of Aggregation Fields. By default this Set if composed by Required Fields for lossless aggregation. If you want perform lossy aggregation set this Set consistently with NeededFields using setNeededFields(java.util.Set<java.lang.String>)
        Parameters:
        aggregationFields -
      • setNeededFields

        public void setNeededFields​(Set<String> neededFields)
        This function is used to set the Set of Needed Fields to keep after aggregation. All other fields are removed. By default this Set if composed by Required Fields and AggregationField for lossless aggregation. If you want perform lossy aggregation set this Set consistently with AggregationFields using setAggregationFields(java.util.Set<java.lang.String>)
        Parameters:
        neededFields -
      • isAggregable

        public boolean isAggregable​(T record)
        Check if the record provided as argument is aggregable with the one provided to the Constructor. This is done comparing the value of each AggregationFields
        Parameters:
        record - to check
        Returns:
        true if the record provided as argument is aggregable with the one provided to the Constructor. False otherwise.
      • cleanExtraFields

        protected void cleanExtraFields()
        Remove all fields which are not in AggregationFields nor in AggregatedFields Sets