Class OutputTypeConfiguration

    • Field Detail

      • LOGGER

        protected static final Logger LOGGER
        the logger
      • outputType

        protected OutputType outputType
        The output type being used with the current instance - this must be set in each concrete class which extends OutputTypeConfiguration
      • activeSubOutputTypes

        protected Set<SubOutputTypeEnum> activeSubOutputTypes
        Stores all active sub output types (if any). some output types are broken down further in sub output types which can be accounted for via this set. Can remain empty if not used.
      • outputProperties

        protected SortedSet<OutputProperty> outputProperties
        Output properties to be included in the CSV output files
    • Constructor Detail

      • OutputTypeConfiguration

        public OutputTypeConfiguration​(OutputType outputType)
                                throws PlanItException
        OutputTypeconfiguration constructor
        Parameters:
        outputType - the output type being created
        Throws:
        PlanItException - thrown if there is an exception
    • Method Detail

      • activateSubOutputType

        protected void activateSubOutputType​(SubOutputTypeEnum subOutputTypeEnum)
        Activate a SubOutputTypeEnum for this output type configuration
        Parameters:
        subOutputTypeEnum - SubOutputTypeEnum to be activated
      • deactivateSubOutputType

        protected void deactivateSubOutputType​(SubOutputTypeEnum subOutputTypeEnum)
        Deactivate a SubOutputTypeEnum for this output type configuration
        Parameters:
        subOutputTypeEnum - SubOutputTypeEnum to be deactivated
      • isOutputPropertyValid

        public abstract boolean isOutputPropertyValid​(OutputProperty baseOutputProperty)
        Checks the output property type being added in valid for the current output type configuration
        Parameters:
        baseOutputProperty - the output property type being added
        Returns:
        true if the output property is valid, false otherwise
      • validateAndFilterKeyProperties

        public abstract OutputProperty[] validateAndFilterKeyProperties​(OutputProperty[] outputKeyProperties)
        Validate whether the specified list of keys is valid, and if it is return only the keys which will be used
        Parameters:
        outputKeyProperties - array of output key property types
        Returns:
        array of keys to be used (null if the list is not valid)
      • getOutputType

        public OutputType getOutputType()
        Returns the OutputAdapter being used for this configuration
        Returns:
        the OutputAdapter being used
      • hasActiveSubOutputTypes

        public boolean hasActiveSubOutputTypes()
        Indicates if sub output types are present or not
        Returns:
        true if present, false otherwise
      • addProperty

        public void addProperty​(OutputPropertyType outputProperty)
                         throws PlanItException
        Add an output property to be included in the output files
        Parameters:
        outputProperty - enumeration value specifying which output property to be included in the output files
        Throws:
        PlanItException - thrown if there is an error
      • removeProperty

        public boolean removeProperty​(String propertyClassName)
                               throws PlanItException
        Remove an output property from the list of properties to be included in the output file
        Parameters:
        propertyClassName - class name of the property to be removed
        Returns:
        true if the property is successfully removed, false if it was not in the List of output properties
        Throws:
        PlanItException - thrown if there is an error removing the property
      • removeProperty

        public boolean removeProperty​(OutputPropertyType outputProperty)
                               throws PlanItException
        Remove an output property from the list of properties to be included in the output file
        Parameters:
        outputProperty - enumeration value specifying which output property is to be removed
        Returns:
        true if the property is successfully removed, false if it was not in the List of output properties
        Throws:
        PlanItException - thrown if there is an error removing the property
      • removeAllProperties

        public void removeAllProperties()
        Remove all properties from the current output list
      • getOutputProperty

        public OutputProperty getOutputProperty​(OutputPropertyType outputPropertyType)
        Collect the registered output property by its type
        Parameters:
        outputPropertyType - to collect for
        Returns:
        the output property itself, null if not registered
      • getOutputKeyProperties

        public OutputProperty[] getOutputKeyProperties()
        Returns an array of output properties for keys used in MemoryOutputFormatter The output array can only contain output properties which are of ID_PRIORITY
        Returns:
        array of output key properties used in the LinkOutputAdapter
      • getOutputValueProperties

        public OutputProperty[] getOutputValueProperties()
        Returns an array of output properties for values used in MemoryOutputFormatter The output array can only contain output properties which are not of ID_PRIORITY
        Returns:
        array of output value properties used in the LinkOutputAdapter
      • getOutputProperties

        public SortedSet<OutputProperty> getOutputProperties()
        Returns the current set of output properties for this output configuration
        Returns:
        the current set of output properties for this output configuration
      • getActiveSubOutputTypes

        public Set<SubOutputTypeEnum> getActiveSubOutputTypes()
        Returns a set of activated sub output types (if any)
        Returns:
        Set of activated sub output types (if any)
      • overrideOutputPropertyUnits

        public void overrideOutputPropertyUnits​(OutputPropertyType outputPropertyType,
                                                Unit overrideUnits)
        Indicate a certain output property is to use a different unit for its result than the default (if permitted)
        Parameters:
        outputPropertyType - to alter units for
        overrideUnits - the to be applied units