Class PropertiesManagerCore<T extends GeoPackageCore>

  • Type Parameters:
    T - templated GeoPackage object

    public abstract class PropertiesManagerCore<T extends GeoPackageCore>
    extends Object
    Properties Manager Core using the Properties Extension on a group of cached GeoPackages
    Since:
    3.0.2
    Author:
    osbornb
    • Constructor Detail

      • PropertiesManagerCore

        protected PropertiesManagerCore()
        Constructor
      • PropertiesManagerCore

        protected PropertiesManagerCore​(T geoPackage)
        Constructor
        Parameters:
        geoPackage - GeoPackage
      • PropertiesManagerCore

        protected PropertiesManagerCore​(Collection<T> geoPackages)
        Constructor
        Parameters:
        geoPackages - collection of GeoPackages
      • PropertiesManagerCore

        protected PropertiesManagerCore​(GeoPackageCoreCache<T> cache)
        Constructor
        Parameters:
        cache - GeoPackage cache
    • Method Detail

      • getPropertiesExtension

        protected abstract PropertiesCoreExtension<T,​?,​?,​?> getPropertiesExtension​(T geoPackage)
        Create a properties extension from the GeoPackage
        Parameters:
        geoPackage - GeoPackage
        Returns:
        properties extension
      • getGeoPackageNames

        public Set<String> getGeoPackageNames()
        Get the GeoPackage names
        Returns:
        names
      • numGeoPackages

        public int numGeoPackages()
        Get the number of GeoPackages
        Returns:
        GeoPackage count
      • getGeoPackages

        public List<T> getGeoPackages()
        Get the GeoPackages
        Returns:
        collection of GeoPackages
      • hasGeoPackage

        public boolean hasGeoPackage​(String name)
        Checks if the GeoPackage name exists
        Parameters:
        name - GeoPackage name
        Returns:
        true if exists
      • getGeoPackage

        public T getGeoPackage​(String name)
        Get the GeoPackage for the GeoPackage name
        Parameters:
        name - GeoPackage name
        Returns:
        GeoPackage
      • addGeoPackages

        public void addGeoPackages​(Collection<T> geoPackages)
        Add a collection of GeoPackages
        Parameters:
        geoPackages - GeoPackages
      • addGeoPackage

        public void addGeoPackage​(T geoPackage)
        Add GeoPackage
        Parameters:
        geoPackage - GeoPackage
      • closeGeoPackages

        public void closeGeoPackages()
        Close all GeoPackages in the manager
      • removeGeoPackage

        public T removeGeoPackage​(String name)
        Remove the GeoPackage with the name but does not close it
        Parameters:
        name - GeoPackage name
        Returns:
        removed GeoPackage
      • clearGeoPackages

        public void clearGeoPackages()
        Clears all cached GeoPackages but does not close them
      • removeAndCloseGeoPackage

        public boolean removeAndCloseGeoPackage​(String name)
        Remove and close the GeoPackage with name, same as closeGeoPackage(String)
        Parameters:
        name - GeoPackage name
        Returns:
        true if found, removed, and closed
      • closeGeoPackage

        public boolean closeGeoPackage​(String name)
        Close the GeoPackage with name
        Parameters:
        name - GeoPackage name
        Returns:
        true if found and closed
      • closeRetainGeoPackages

        public void closeRetainGeoPackages​(Collection<String> retain)
        Close GeoPackages not specified in the retain GeoPackage names
        Parameters:
        retain - GeoPackages to retain
      • closeGeoPackages

        public void closeGeoPackages​(Collection<String> names)
        Close GeoPackages with names
        Parameters:
        names - GeoPackage names
      • numProperties

        public int numProperties()
        Get the number of unique properties
        Returns:
        property count
      • getProperties

        public Set<String> getProperties()
        Get the unique properties
        Returns:
        set of properties
      • hasProperty

        public List<T> hasProperty​(String property)
        Get the GeoPackages with the property name
        Parameters:
        property - property name
        Returns:
        GeoPackages
      • missingProperty

        public List<T> missingProperty​(String property)
        Get the GeoPackages missing the property name
        Parameters:
        property - property name
        Returns:
        GeoPackages
      • numValues

        public int numValues​(String property)
        Get the number of unique values for the property
        Parameters:
        property - property name
        Returns:
        number of values
      • hasValues

        public boolean hasValues​(String property)
        Check if the property has any values
        Parameters:
        property - property name
        Returns:
        true if has any values
      • getValues

        public Set<String> getValues​(String property)
        Get the unique values for the property
        Parameters:
        property - property name
        Returns:
        set of values
      • hasValue

        public List<T> hasValue​(String property,
                                String value)
        Get the GeoPackages with the property name and value
        Parameters:
        property - property name
        value - property value
        Returns:
        GeoPackages
      • missingValue

        public List<T> missingValue​(String property,
                                    String value)
        Get the GeoPackages missing the property name and value
        Parameters:
        property - property name
        value - property value
        Returns:
        GeoPackages
      • addValue

        public int addValue​(String property,
                            String value)
        Add a property value to all GeoPackages
        Parameters:
        property - property name
        value - value
        Returns:
        number of GeoPackages added to
      • addValue

        public boolean addValue​(String geoPackage,
                                String property,
                                String value)
        Add a property value to a specified GeoPackage
        Parameters:
        geoPackage - GeoPackage name
        property - property name
        value - value
        Returns:
        true if added
      • deleteProperty

        public int deleteProperty​(String property)
        Delete the property and values from all GeoPackages
        Parameters:
        property - property name
        Returns:
        number of GeoPackages deleted from
      • deleteProperty

        public boolean deleteProperty​(String geoPackage,
                                      String property)
        Delete the property and values from a specified GeoPackage
        Parameters:
        geoPackage - GeoPackage name
        property - property name
        Returns:
        true if deleted
      • deleteValue

        public int deleteValue​(String property,
                               String value)
        Delete the property value from all GeoPackages
        Parameters:
        property - property name
        value - property value
        Returns:
        number of GeoPackages deleted from
      • deleteValue

        public boolean deleteValue​(String geoPackage,
                                   String property,
                                   String value)
        Delete the property value from a specified GeoPackage
        Parameters:
        geoPackage - GeoPackage name
        property - property name
        value - property value
        Returns:
        true if deleted
      • deleteAll

        public int deleteAll()
        Delete all properties and values from all GeoPackages
        Returns:
        number of GeoPackages deleted from
      • deleteAll

        public boolean deleteAll​(String geoPackage)
        Delete all properties and values from a specified GeoPackage
        Parameters:
        geoPackage - GeoPackage name
        Returns:
        true if any deleted
      • removeExtension

        public void removeExtension()
        Remove the extension from all GeoPackages
      • removeExtension

        public void removeExtension​(String geoPackage)
        Remove the extension from a specified GeoPackage
        Parameters:
        geoPackage - GeoPackage name