Class HierarchyNavigatorWrap<T,​E>


  • public abstract class HierarchyNavigatorWrap<T,​E>
    extends HierarchyNavigator
    Convenience class for creating versions of HierarchyNavigator with different model object representations.
    Since:
    5.0
    • Constructor Detail

      • HierarchyNavigatorWrap

        public HierarchyNavigatorWrap​(ome.api.IQuery iQuery)
    • Method Detail

      • typeToString

        protected abstract java.lang.String typeToString​(T type)
        Convert the given object type to the type strings expected by HierarchyNavigator.
        Parameters:
        type - an object type
        Returns:
        the corresponding type string
      • stringToType

        protected abstract T stringToType​(java.lang.String typeName)
        Convert the given type string to the object type.
        Parameters:
        typeName - a type string
        Returns:
        the corresponding object type
      • entityToStringLong

        protected abstract java.util.Map.Entry<java.lang.String,​java.lang.Long> entityToStringLong​(E entity)
        Convert a model object to the type string and database ID expected by HierarchyNavigator.
        Parameters:
        entity - a model object
        Returns:
        the corresponding type string and database ID
      • stringLongToEntity

        protected abstract E stringLongToEntity​(java.lang.String typeName,
                                                long id)
        Convert the given type string and database ID to the model object.
        Parameters:
        typeName - a type string
        id - a database ID
        Returns:
        the corresponding model object
      • prepareLookups

        public void prepareLookups​(T toType,
                                   java.util.Collection<E> from)
        Batch bulk database queries to prime the cache for doLookup(Object, Object). It is not necessary to call this method, but it is advised if many lookups are anticipated. Wraps HierarchyNavigator.prepareLookups(String, String, Collection).
        Parameters:
        toType - the type of the objects to which the query objects may be related, not null
        from - the query objects, none null, may be of differing types
      • doLookup

        public com.google.common.collect.ImmutableSet<E> doLookup​(T toType,
                                                                  E from)
        Look up which objects of a given type relate to the given query object. Caches results, and one may bulk-cache results in advance using prepareLookups(Object, Collection). Wraps HierarchyNavigator.doLookup(String, String, Long).
        Parameters:
        toType - the type of the objects to which the query object may be related, not null
        from - the query object, not null
        Returns:
        the related objects, never null