public abstract class FeaturedBase extends Object implements C.Featured
Provide common logic to handle C.Featured interface
C.Featured.Factory| Constructor and Description |
|---|
FeaturedBase() |
| Modifier and Type | Method and Description |
|---|---|
protected EnumSet<C.Feature> |
features_() |
EnumSet<C.Feature> |
features()
Get all characteristics in
EnumSet |
protected abstract EnumSet<C.Feature> |
initFeatures()
Sub class should override this method to provide initial feature set for the feature based instance
|
boolean |
is(C.Feature feature)
Check if this object has a certain
C.Feature |
protected FeaturedBase |
setFeature(C.Feature feature) |
protected FeaturedBase |
unsetFeature(C.Feature feature) |
protected abstract EnumSet<C.Feature> initFeatures()
Sub class should override this method to provide initial feature set for the feature based instance
public final EnumSet<C.Feature> features()
C.FeaturedGet all characteristics in EnumSet
features in interface C.FeaturedEnumSet of all characteristics hold by this objectpublic final boolean is(C.Feature feature)
C.FeaturedCheck if this object has a certain C.Feature
is in interface C.Featuredfeature - the characteristic to be testedtrue if this object has the characteristic, or false otherwiseprotected FeaturedBase setFeature(C.Feature feature)
protected FeaturedBase unsetFeature(C.Feature feature)
Copyright © 2014–2021 OSGL (Open Source General Library). All rights reserved.