Filter
public class SpeciesReferenceFilter extends NameFilter
NameFilter
that allows users to search for a
SimpleSpeciesReference
that refers to a Species
with the
given identifier attribute. The boolean switch filterForSpecies
that
can be changed using the setFilterForSpecies(boolean)
method decides
whether this SpeciesReferenceFilter
should use the given identifier
to filter for the actual SimpleSpeciesReference
or for the referenced
Species
.Constructor | Description |
---|---|
SpeciesReferenceFilter() |
Creates a new
SpeciesReferenceFilter with undefined properties. |
SpeciesReferenceFilter(java.lang.String id) |
|
SpeciesReferenceFilter(java.lang.String id,
java.lang.String name) |
|
SpeciesReferenceFilter(Species species) |
Creates a new
SpeciesReferenceFilter that only accepts instances of
SpeciesReference pointing to the id of the given Species . |
Modifier and Type | Method | Description |
---|---|---|
boolean |
accepts(java.lang.Object o) |
This method checks whether the given object is of the correct type and
has the desired properties set to be acceptable.
|
boolean |
isFilterForSpecies() |
|
void |
setFilterForSpecies(boolean filterForSpecies) |
getId, getName, setId, setName
public SpeciesReferenceFilter()
SpeciesReferenceFilter
with undefined properties.public SpeciesReferenceFilter(Species species)
SpeciesReferenceFilter
that only accepts instances of
SpeciesReference
pointing to the id of the given Species
.species
- the Species
of interest.public SpeciesReferenceFilter(java.lang.String id)
id
- the identifier of a Species
or SpeciesReference
we
are interested in. Whether we accept the id of a Species
or
a SpeciesReference
depends on the flag that can be defined
with setFilterForSpecies(boolean)
.setFilterForSpecies(boolean)
public SpeciesReferenceFilter(java.lang.String id, java.lang.String name)
id
- the identifier of a Species
or SpeciesReference
we
are interested in. Whether we accept the id of a Species
or
a SpeciesReference
depends on the flag that can be defined
with setFilterForSpecies(boolean)
.name
- the name of the element we are interested in.setFilterForSpecies(boolean)
public boolean accepts(java.lang.Object o)
Filter
accepts
in interface Filter
accepts
in class NameFilter
o
- some object whose properties are to be checked.public boolean isFilterForSpecies()
public void setFilterForSpecies(boolean filterForSpecies)
filterForSpecies
- the filterForSpecies to set