Package net.sf.basedb.util
Class AnnotationUtil
java.lang.Object
net.sf.basedb.util.AnnotationUtil
Utility class for working with annotations.
- Version:
- 2.9
- Author:
- Nicklas
- Last modified
- $Date: 2020-02-18 09:50:54 +0100 (tis, 18 feb. 2020) $
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static class
This wrapper class is needed because we need to keep track of extracts linked with raw bioassays and derived bioassays until we have loaded the Extracts of a Physical Bioassay.static class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic AnnotationUtil.Cache
Create a new cache object that can be used withgetAllAnnotatableParentItems(DbControl, Annotatable, Filter, Cache)
static Set<Annotatable>
getAllAnnotatableParentItems
(DbControl dc, Annotatable item, Filter<Annotatable> filter) Get all annotatable parent items for a given item.static Set<Annotatable>
getAllAnnotatableParentItems
(DbControl dc, Annotatable item, Filter<Annotatable> filter, AnnotationUtil.Cache cache) Get all annotatable parent items for a given item.
-
Constructor Details
-
AnnotationUtil
public AnnotationUtil()
-
-
Method Details
-
createCache
Create a new cache object that can be used withgetAllAnnotatableParentItems(DbControl, Annotatable, Filter, Cache)
- Since:
- 3.2
-
getAllAnnotatableParentItems
public static Set<Annotatable> getAllAnnotatableParentItems(DbControl dc, Annotatable item, Filter<Annotatable> filter) Get all annotatable parent items for a given item. AFilter
may be used to filter the returned collection. If a filter is specified only parent items for which theFilter.evaluate(Object)
method returns true are included in the returned collection. Note that all parent items are loaded before the filter is evaluated and that the evaluation order is undefined.- Parameters:
dc
- The DbControl to use for database accessitem
- The item to find the parents forfilter
- An optional filter that can be used to filter which parents to include- Returns:
- A set containing the parent items
- See Also:
-
getAllAnnotatableParentItems
public static Set<Annotatable> getAllAnnotatableParentItems(DbControl dc, Annotatable item, Filter<Annotatable> filter, AnnotationUtil.Cache cache) Get all annotatable parent items for a given item. AFilter
may be used to filter the returned collection. If a filter is specified only parent items for which theFilter.evaluate(Object)
method returns true are included in the returned collection. Note that all parent items are loaded before the filter is evaluated and that the evaluation order is undefined. A cache may be used to improve performance if this method is called multiple times with different items that have overlapping parent trees.- Parameters:
dc
- The DbControl to use for database accessitem
- The item to find the parents forfilter
- An optional filter that can be used to filter which parents to includecache
- An optional cache object- Returns:
- A set containing the parent items
- Since:
- 3.2
- See Also:
-