Class AbstractPaper

All Implemented Interfaces:
Serializable, Comparable<Factory>, Factory, Paper
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:
  • Constructor Details

    • AbstractPaper

      public AbstractPaper(String name, String desc, Enum<? extends Enum<?>> identifier)
      Creates a new paper.
      Parameters:
      name - the name of the paper
      desc - the description of the paper
      identifier - the identifier
    • AbstractPaper

      public AbstractPaper(String name, String desc, String identifier)
      Creates a new paper.
      Parameters:
      name - the name of the paper
      desc - the description of the paper
      identifier - the identifier
  • Method Details

    • getFeature

      public Object getFeature(String key)
      Description copied from interface: Factory
      Gets the value of a feature used by this Factory
      Specified by:
      getFeature in interface Factory
      Parameters:
      key - the key for the feature
      Returns:
      returns the current value of the feature
    • getProperty

      public Object getProperty(String key)
      Description copied from interface: Factory
      Gets the value of a read-only property that applies to all objects returned by this Factory.
      Specified by:
      getProperty in interface Factory
      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(String key, Object value)
      Description copied from interface: Factory
      Sets a feature for new Objects returned by this Factory
      Specified by:
      setFeature in interface Factory
      Parameters:
      key - the key for the feature
      value - the value of the feature
    • asSheetPaper

      public SheetPaper asSheetPaper()
      Description copied from interface: Paper
      Returns this Paper as a SheetPaper
      Specified by:
      asSheetPaper in interface Paper
      Returns:
      returns the SheetPaper
    • asTractorPaper

      public TractorPaper asTractorPaper()
      Description copied from interface: Paper
      Returns this Paper as a TractorPaper
      Specified by:
      asTractorPaper in interface Paper
      Returns:
      returns the TractorPaper
    • asRollPaper

      public RollPaper asRollPaper()
      Description copied from interface: Paper
      Returns this Paper as a RollPaper
      Specified by:
      asRollPaper in interface Paper
      Returns:
      returns the RollPaper