Class SimplePruner

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, Serializable

    public class SimplePruner
    extends AbstractMapObjectPruner
    Prunes according to a simple upper limit of objects, removing the older ones.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -max-markers <int> (property: maxMarkers)
        The maximum number of markers to keep; -1 for unlimited.
        default: -1
        minimum: -1
     
    -max-rectangles <int> (property: maxRectangles)
        The maximum number of rectangles to keep; -1 for unlimited.
        default: -1
        minimum: -1
     
    -max-polygons <int> (property: maxPolygons)
        The maximum number of polygons to keep; -1 for unlimited.
        default: -1
        minimum: -1
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int m_MaxMarkers
      the maximum for markers.
      protected int m_MaxPolygons
      the maximum for polygons.
      protected int m_MaxRectangles
      the maximum for rectangles.
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Constructor Summary

      Constructors 
      Constructor Description
      SimplePruner()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void defineOptions()
      Adds options to the internal list of options.
      protected void doPrune​(org.openstreetmap.gui.jmapviewer.JMapViewerTree tree)
      Prunes the map objects.
      int getMaxMarkers()
      Returns the maximum number of markers to keep.
      int getMaxPolygons()
      Returns the maximum number of polygons to keep.
      int getMaxRectangles()
      Returns the maximum number of rectangles to keep.
      String globalInfo()
      Returns a string describing the object.
      String maxMarkersTipText()
      Returns the tip text for this property.
      String maxPolygonsTipText()
      Returns the tip text for this property.
      String maxRectanglesTipText()
      Returns the tip text for this property.
      void setMaxMarkers​(int value)
      Sets the maximum number of markers to keep.
      void setMaxPolygons​(int value)
      Sets the maximum number of polygons to keep.
      void setMaxRectangles​(int value)
      Sets the maximum number of rectangles to keep.
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • Field Detail

      • m_MaxMarkers

        protected int m_MaxMarkers
        the maximum for markers.
      • m_MaxRectangles

        protected int m_MaxRectangles
        the maximum for rectangles.
      • m_MaxPolygons

        protected int m_MaxPolygons
        the maximum for polygons.
    • Constructor Detail

      • SimplePruner

        public SimplePruner()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.core.option.AbstractOptionHandler
      • setMaxMarkers

        public void setMaxMarkers​(int value)
        Sets the maximum number of markers to keep.
        Parameters:
        value - the maximum; -1 for unlimited
      • getMaxMarkers

        public int getMaxMarkers()
        Returns the maximum number of markers to keep.
        Returns:
        the maximum; -1 for unlimited
      • maxMarkersTipText

        public String maxMarkersTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setMaxRectangles

        public void setMaxRectangles​(int value)
        Sets the maximum number of rectangles to keep.
        Parameters:
        value - the maximum; -1 for unlimited
      • getMaxRectangles

        public int getMaxRectangles()
        Returns the maximum number of rectangles to keep.
        Returns:
        the maximum; -1 for unlimited
      • maxRectanglesTipText

        public String maxRectanglesTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setMaxPolygons

        public void setMaxPolygons​(int value)
        Sets the maximum number of polygons to keep.
        Parameters:
        value - the maximum; -1 for unlimited
      • getMaxPolygons

        public int getMaxPolygons()
        Returns the maximum number of polygons to keep.
        Returns:
        the maximum; -1 for unlimited
      • maxPolygonsTipText

        public String maxPolygonsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • doPrune

        protected void doPrune​(org.openstreetmap.gui.jmapviewer.JMapViewerTree tree)
        Prunes the map objects.
        Specified by:
        doPrune in class AbstractMapObjectPruner
        Parameters:
        tree - the tree to prune