3.2.4: 2013-12-06

net.sf.basedb.util
Class AnnotationUtil.AnnotatableWrapper

java.lang.Object
  extended by 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 or DerivedBioAssay item, we remember the extract on that as we move up towards PhysicalBioAssay. When the PhysicalBioAssay is reached we use the extracts to call PhysicalBioAssay.getAnnotatableParents(int, Collection).


Field Summary
private  AnnotationUtil.Cache cache
           
private  AnnotationUtil.AnnotatableWrapper chain
           
private  Extract extract
           
private  Set<Extract> extractsInChain
           
private  Annotatable item
           
 
Constructor Summary
AnnotationUtil.AnnotatableWrapper(Annotatable item, AnnotationUtil.AnnotatableWrapper chain)
           
AnnotationUtil.AnnotatableWrapper(Annotatable item, AnnotationUtil.Cache cache)
           
 
Method Summary
 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()
          Get all annotatable parents wrapped inside AnnotatableWrapper:s
private static Extract getExtract(Annotatable item)
          Get the extract to use.
 int hashCode()
           
private  Set<Extract> loadExtracts()
          Load extracts in parent chain.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

item

private final Annotatable item

extractsInChain

private final Set<Extract> extractsInChain

chain

private final AnnotationUtil.AnnotatableWrapper chain

cache

private final AnnotationUtil.Cache cache

extract

private final Extract extract
Constructor Detail

AnnotationUtil.AnnotatableWrapper

AnnotationUtil.AnnotatableWrapper(Annotatable item,
                                  AnnotationUtil.Cache cache)

AnnotationUtil.AnnotatableWrapper

AnnotationUtil.AnnotatableWrapper(Annotatable item,
                                  AnnotationUtil.AnnotatableWrapper chain)
Method Detail

getExtract

private static Extract getExtract(Annotatable item)
Get the extract to use. This method returns:


getAnnotatable

Annotatable getAnnotatable()
The annotatable that we are wrapping.


loadExtracts

private Set<Extract> 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()
                                                              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.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

3.2.4: 2013-12-06