Package net.sf.basedb.util
Class AnnotationUtil.AnnotatableWrapper
- java.lang.Object
-
- net.sf.basedb.util.AnnotationUtil.AnnotatableWrapper
-
- Enclosing class:
- AnnotationUtil
static class AnnotationUtil.AnnotatableWrapper extends Object
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.When we reach a
RawBioAssay
item orDerivedBioAssay
item, we remember the extract on that as we move up towards PhysicalBioAssay. When the PhysicalBioAssay is reached we use the extracts to callPhysicalBioAssay.getAnnotatableParents(int, Collection)
.
-
-
Field Summary
Fields Modifier and Type Field Description private Set<Extract>
allChildExtractsInChain
private AnnotationUtil.Cache
cache
private AnnotationUtil.AnnotatableWrapper
chain
private Extract
extract
private Set<Integer>
extractsInChain
private Annotatable
item
-
Constructor Summary
Constructors Constructor Description AnnotatableWrapper(Annotatable item, AnnotationUtil.AnnotatableWrapper chain)
AnnotatableWrapper(Annotatable item, AnnotationUtil.Cache cache)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
A wrapper is equal to another if they references the same item and chain of extracts.(package private) Annotatable
getAnnotatable()
The annotatable that we are wrapping.(package private) Set<AnnotationUtil.AnnotatableWrapper>
getAnnotatableParentWrappers(DbControl dc)
Get all annotatable parents wrapped inside AnnotatableWrapper:sprivate static Extract
getExtract(Annotatable item)
Get the extract to use.int
hashCode()
private Set<Integer>
loadExtracts()
Load extracts in parent chain.String
toString()
-
-
-
Field Detail
-
item
private final Annotatable item
-
chain
private final AnnotationUtil.AnnotatableWrapper chain
-
cache
private final AnnotationUtil.Cache cache
-
extract
private final Extract extract
-
-
Constructor Detail
-
AnnotatableWrapper
AnnotatableWrapper(Annotatable item, AnnotationUtil.Cache cache)
-
AnnotatableWrapper
AnnotatableWrapper(Annotatable item, AnnotationUtil.AnnotatableWrapper chain)
-
-
Method Detail
-
getExtract
private static Extract getExtract(Annotatable item)
Get the extract to use. This method returns:- If the item is a raw bioassay,
RawBioAssay.getParentExtract()
- If the item is a derived bioassay,
DerivedBioAssay.getExtract()
- null in all other cases.
- If the item is a raw bioassay,
-
getAnnotatable
Annotatable getAnnotatable()
The annotatable that we are wrapping.
-
loadExtracts
private Set<Integer> loadExtracts()
Load extracts in parent chain. We have to consider this for rawbioassay, derived bioassay and physical bioassay since the annotatable parents to a physical bioassay depends on the extracts we have seen while traversing the path from the raw bioassay and up. After reaching the physical bioassay we can forget about the extracts.
-
getAnnotatableParentWrappers
Set<AnnotationUtil.AnnotatableWrapper> getAnnotatableParentWrappers(DbControl dc) throws BaseException
Get all annotatable parents wrapped inside AnnotatableWrapper:s- Throws:
BaseException
-
equals
public boolean equals(Object o)
A wrapper is equal to another if they references the same item and chain of extracts.
-
-