Interface OrdinalPolicy
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
DefaultOrdinalPolicy
,NonTopLevelOrdinalPolicy
public interface OrdinalPolicy extends Serializable
Filtering category ordinals inCategoryParentsStream
, where a given category ordinal is added to the stream, and than its parents are being added one after the other usingTaxonomyWriter.getParent(int)
.
That loop should have a stop point - the default approach (excluding the ROOT) is implemented inDefaultOrdinalPolicy
.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
init(TaxonomyWriter taxonomyWriter)
Initialize the policy with a TaxonomyWriter.boolean
shouldAdd(int ordinal)
Check whether a given category ordinal should be added to the stream.
-
-
-
Method Detail
-
shouldAdd
boolean shouldAdd(int ordinal)
Check whether a given category ordinal should be added to the stream.- Parameters:
ordinal
- A given category ordinal which is to be tested for stream addition.- Returns:
true
if the category should be added.false
otherwise.
-
init
void init(TaxonomyWriter taxonomyWriter)
Initialize the policy with a TaxonomyWriter. This method can be implemented as noop if the ordinal policy is not taxonomy dependent- Parameters:
taxonomyWriter
- A relevant taxonomyWriter object, with which ordinals sent toshouldAdd(int)
are examined.
-
-