Package org.biojava.bio.annodb
Class LazySearchedAnnotationDB
java.lang.Object
org.biojava.bio.annodb.LazySearchedAnnotationDB
- All Implemented Interfaces:
AnnotationDB
An implementation of AnnotationDB that does a JIT search on another set.
- Since:
- 1.3
- Author:
- Matthew Pocock
-
Field Summary
Fields inherited from interface org.biojava.bio.annodb.AnnotationDB
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionLazySearchedAnnotationDB(String name, AnnotationDB source, AnnotationType schema) Create a new DB from an old one by applying a schema. -
Method Summary
Modifier and TypeMethodDescriptionfilter(AnnotationType at) Find all Annotation instances in this DB that are of a particular type.getName()The name of this AnnotationDB.Get an AnnotationType that accepts all Annotation instances in this DB.iterator()Loop over each Annotation in this db.search(AnnotationType at) Find all Annotation instances in this DB and any Annotations that are child properties of these that match an AnnotationType.intsize()The number of Annotation instances in the DB.
-
Constructor Details
-
LazySearchedAnnotationDB
Create a new DB from an old one by applying a schema.- Parameters:
name- the name of this DBsource- the original DB to searchschema- the schema AnnotationType to apply
-
-
Method Details
-
getName
Description copied from interface:AnnotationDBThe name of this AnnotationDB.
- Specified by:
getNamein interfaceAnnotationDB- Returns:
- the name of this AnnotationDB
-
getSchema
Description copied from interface:AnnotationDBGet an AnnotationType that accepts all Annotation instances in this DB.
The schema should accept all Annotations in the DB. However, it may hit other Annotations. So, AnnotationType.ALL is always a valid schema. Obviously, the more retrictive it is, the more usefull it becomes for introspection.
- Specified by:
getSchemain interfaceAnnotationDB- Returns:
- the schema AnnotationType
-
iterator
Description copied from interface:AnnotationDBLoop over each Annotation in this db.- Specified by:
iteratorin interfaceAnnotationDB- Returns:
- an Iterator over each item in the DB
-
size
Description copied from interface:AnnotationDBThe number of Annotation instances in the DB.- Specified by:
sizein interfaceAnnotationDB- Returns:
- the size of this DB
-
filter
Description copied from interface:AnnotationDBFind all Annotation instances in this DB that are of a particular type.- Specified by:
filterin interfaceAnnotationDB- Parameters:
at- the AnnotationType to match- Returns:
- an AnnotationDB with all matching Annotation instances
-
search
Description copied from interface:AnnotationDBFind all Annotation instances in this DB and any Annotations that are child properties of these that match an AnnotationType.- Specified by:
searchin interfaceAnnotationDB- Parameters:
at- the AnnotationType to search with- Returns:
- an AnnotationDB with all matching Annotation instances, irregardless of how deep in the hieracy they are
-