Package org.daisy.paper
Class AbstractPaper
- java.lang.Object
-
- org.daisy.factory.AbstractFactory
-
- org.daisy.paper.AbstractPaper
-
- Direct Known Subclasses:
RollPaper,SheetPaper,TractorPaper
public abstract class AbstractPaper extends AbstractFactory implements Paper
Provides a default implementation for Paper.- Author:
- Joel HÃ¥kansson
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.daisy.paper.Paper
Paper.Type
-
-
Constructor Summary
Constructors Constructor Description AbstractPaper(java.lang.String name, java.lang.String desc, java.lang.Enum<? extends java.lang.Enum<?>> identifier)Creates a new paper.AbstractPaper(java.lang.String name, java.lang.String desc, java.lang.String identifier)Creates a new paper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RollPaperasRollPaper()Returns this Paper as a RollPaperSheetPaperasSheetPaper()Returns this Paper as a SheetPaperTractorPaperasTractorPaper()Returns this Paper as a TractorPaperjava.lang.ObjectgetFeature(java.lang.String key)Gets the value of a feature used by this Factoryjava.lang.ObjectgetProperty(java.lang.String key)Gets the value of a read-only property that applies to all objects returned by this Factory.voidsetFeature(java.lang.String key, java.lang.Object value)Sets a feature for new Objects returned by this Factory-
Methods inherited from class org.daisy.factory.AbstractFactory
compareTo, getDescription, getDisplayName, getIdentifier, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.daisy.factory.Factory
getDescription, getDisplayName, getIdentifier
-
-
-
-
Constructor Detail
-
AbstractPaper
public AbstractPaper(java.lang.String name, java.lang.String desc, java.lang.Enum<? extends java.lang.Enum<?>> identifier)Creates a new paper.- Parameters:
name- the name of the paperdesc- the description of the paperidentifier- the identifier
-
AbstractPaper
public AbstractPaper(java.lang.String name, java.lang.String desc, java.lang.String identifier)Creates a new paper.- Parameters:
name- the name of the paperdesc- the description of the paperidentifier- the identifier
-
-
Method Detail
-
getFeature
public java.lang.Object getFeature(java.lang.String key)
Description copied from interface:FactoryGets the value of a feature used by this Factory- Specified by:
getFeaturein interfaceFactory- Parameters:
key- the key for the feature- Returns:
- returns the current value of the feature
-
getProperty
public java.lang.Object getProperty(java.lang.String key)
Description copied from interface:FactoryGets the value of a read-only property that applies to all objects returned by this Factory.- Specified by:
getPropertyin interfaceFactory- Parameters:
key- the name of the property to get- Returns:
- returns the value associated with this property or null if none is found
-
setFeature
public void setFeature(java.lang.String key, java.lang.Object value)Description copied from interface:FactorySets a feature for new Objects returned by this Factory- Specified by:
setFeaturein interfaceFactory- Parameters:
key- the key for the featurevalue- the value of the feature
-
asSheetPaper
public SheetPaper asSheetPaper()
Description copied from interface:PaperReturns this Paper as a SheetPaper- Specified by:
asSheetPaperin interfacePaper- Returns:
- returns the SheetPaper
-
asTractorPaper
public TractorPaper asTractorPaper()
Description copied from interface:PaperReturns this Paper as a TractorPaper- Specified by:
asTractorPaperin interfacePaper- Returns:
- returns the TractorPaper
-
asRollPaper
public RollPaper asRollPaper()
Description copied from interface:PaperReturns this Paper as a RollPaper- Specified by:
asRollPaperin interfacePaper- Returns:
- returns the RollPaper
-
-