Class ObjectStoreSummary


  • public class ObjectStoreSummary
    extends java.lang.Object
    A summary of the data in an ObjectStore
    Author:
    Richard Smith, Kim Rutherford, Mark Woodbridge
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_MAX_VALUES
      The default number of values to make available for UI dropdowns - attributes with more values will not become dropdowns.
      protected java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> emptyAttributesMap  
      protected java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> emptyFieldsMap  
      protected int maxValues  
    • Constructor Summary

      Constructors 
      Constructor Description
      ObjectStoreSummary​(java.util.Properties properties)
      Construct a summary from a properties object.
      ObjectStoreSummary​(ObjectStore os, java.util.Properties configuration)
      Construct a summary from by running queries in the ObjectStore.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> getAllNullAttributes()
      Get a list of the attributes that are always null or empty.
      java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> getAllNullReferencesAndCollections()
      Get a list of reference and collection names that are always null or empty.
      int getClassCount​(java.lang.String className)
      Get the number of instances of a particular class in the ObjectStore.
      java.util.List<java.lang.Object> getFieldValues​(java.lang.String className, java.lang.String fieldName)
      Get a list of the possible values (as Strings) for a given field in a given class.
      int getMaxValues()
      Return the configured maximum number of values to show in a dropdown.
      java.util.Set<java.lang.String> getNullAttributes​(java.lang.String className)
      Get a list of the attributes that, for a given class, are always null or empty.
      java.util.Set<java.lang.String> getNullReferencesAndCollections​(java.lang.String className)
      Get a list of the reference and collection names that, for a given class, are always null or empty.
      java.util.Properties toProperties()
      Convert this summary to a properties object
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • emptyFieldsMap

        protected final java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> emptyFieldsMap
      • emptyAttributesMap

        protected final java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> emptyAttributesMap
      • maxValues

        protected int maxValues
      • DEFAULT_MAX_VALUES

        public static final int DEFAULT_MAX_VALUES
        The default number of values to make available for UI dropdowns - attributes with more values will not become dropdowns.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ObjectStoreSummary

        public ObjectStoreSummary​(ObjectStore os,
                                  java.util.Properties configuration)
                           throws java.lang.ClassNotFoundException,
                                  ObjectStoreException
        Construct a summary from by running queries in the ObjectStore.
        Parameters:
        os - the objectstore
        configuration - the configuration for summarization
        Throws:
        java.lang.ClassNotFoundException - if a class cannot be found
        ObjectStoreException - if an error occurs accessing the data
      • ObjectStoreSummary

        public ObjectStoreSummary​(java.util.Properties properties)
        Construct a summary from a properties object.
        Parameters:
        properties - the properties
    • Method Detail

      • getMaxValues

        public int getMaxValues()
        Return the configured maximum number of values to show in a dropdown.
        Returns:
        the maximum number of values to show in a dropdown
      • getClassCount

        public int getClassCount​(java.lang.String className)
        Get the number of instances of a particular class in the ObjectStore.
        Parameters:
        className - the class name to look up
        Returns:
        the count of the instances of the class
      • getFieldValues

        public java.util.List<java.lang.Object> getFieldValues​(java.lang.String className,
                                                               java.lang.String fieldName)
        Get a list of the possible values (as Strings) for a given field in a given class.
        Parameters:
        className - the class to search for
        fieldName - the field name to search for
        Returns:
        a list of the possible values for the class and field, or null if the summary isn't available (because, for example, there are too many possible values)
      • getNullReferencesAndCollections

        public java.util.Set<java.lang.String> getNullReferencesAndCollections​(java.lang.String className)
        Get a list of the reference and collection names that, for a given class, are always null or empty.
        Parameters:
        className - the class name to look up
        Returns:
        Set of null reference and empty collection names
      • getAllNullReferencesAndCollections

        public java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> getAllNullReferencesAndCollections()
        Get a list of reference and collection names that are always null or empty.
        Returns:
        Set of null references and empty collection names mapped to class names
      • getNullAttributes

        public java.util.Set<java.lang.String> getNullAttributes​(java.lang.String className)
        Get a list of the attributes that, for a given class, are always null or empty.
        Parameters:
        className - the class name to look up
        Returns:
        Set of null attribute names
      • getAllNullAttributes

        public java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> getAllNullAttributes()
        Get a list of the attributes that are always null or empty.
        Returns:
        Set of null attribute names mapped to class names
      • toProperties

        public java.util.Properties toProperties()
        Convert this summary to a properties object
        Returns:
        the properties