public class InMemoryTaxonomyDatabase extends Object implements TaxonomyDatabase
List based in-memory "database". NOT THREAD-SAFE!| Constructor and Description |
|---|
InMemoryTaxonomyDatabase() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsGenus(String genus)
Case insensitive search for genus.
|
boolean |
containsSpecies(String genus,
String species)
Does the database contain at least one record that exactly matches specified genus and species?.
|
List<String> |
findSimilarGenus(String genus,
int maxSize)
Return a list of genera close to the specified genus.
|
List<String> |
findSimilarSpecies(String genus,
String species,
int maxSize)
Return a list of species close to the specified genus and species.
|
protected List<SpeciesRow> |
getAllGenusSpecies(String genus)
Gets the all genus species.
|
String |
getSpeciesAuthority(String genus,
String species)
Return the species authority for the specified species within genus.
|
static void |
print(Object suggestion)
Prints the.
|
static <T> void |
print(Suggestion<T> suggestion)
Prints the.
|
void |
registerGenus(Long genusId,
String genus)
Add a genus to the database.
|
void |
registerSpecies(SpeciesRow speciesRow)
Add species to the database.
|
String |
toString() |
public void registerGenus(Long genusId, String genus)
genusId - the genus idgenus - the genuspublic void registerSpecies(SpeciesRow speciesRow) throws TaxonomyException
speciesRow - the species rowTaxonomyException - the taxonomy exceptionpublic boolean containsGenus(String genus)
containsGenus in interface TaxonomyDatabasegenus - the genuspublic List<String> findSimilarGenus(String genus, int maxSize)
TaxonomyDatabasefindSimilarGenus in interface TaxonomyDatabasegenus - genusmaxSize - TODOpublic static <T> void print(Suggestion<T> suggestion)
T - the generic typesuggestion - the suggestionpublic static void print(Object suggestion)
suggestion - the suggestionprotected List<SpeciesRow> getAllGenusSpecies(String genus)
genus - the genuspublic boolean containsSpecies(String genus, String species)
TaxonomyDatabasecontainsSpecies in interface TaxonomyDatabasegenus - the genusspecies - the speciestrue if there is at least one recordpublic List<String> findSimilarSpecies(String genus, String species, int maxSize)
TaxonomyDatabasefindSimilarSpecies in interface TaxonomyDatabasegenus - valid genusspecies - speciesmaxSize - TODOpublic String getSpeciesAuthority(String genus, String species)
TaxonomyDatabasegetSpeciesAuthority in interface TaxonomyDatabasegenus - the genusspecies - the speciesnullCopyright © 2016 Global Crop Diversity Trust. All rights reserved.