CSC407 OOP Example

plan.dom
Class Release

java.lang.Object
  |
  +--plan.dom.DefaultFeatureListImplementation
        |
        +--plan.dom.Release
All Implemented Interfaces:
FeatureList

public class Release
extends DefaultFeatureListImplementation
implements FeatureList

Represents a possible release of a software product.


Field Summary
private  java.lang.String designator
           
 
Constructor Summary
Release()
           
 
Method Summary
 void addFeature(Feature f)
          Add the indicated feature to the list.
 java.util.Iterator featureIterator()
          Get an Iterator over the features.
 java.lang.String getDesignator()
           
 java.lang.String getLabel()
          The FeatureList label is the same as the release designator.
 int numFeatures(Priority p)
          Returns the number of features broken out by priority.
 void setDesignator(java.lang.String designator)
           
protected  void sortFeatures(java.util.Comparator compare)
          Sort features according to the order given by the Feature Comparator.
protected  void subtract(DefaultFeatureListImplementation other)
          Remove all features in the other list from this one.]
 void subtract(Release other)
          Removes features from this release that appear in the other release.
 double totalSizingOfFeatures(Priority p)
          Returns the total sizing of features broken out by priority.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface plan.dom.FeatureList
featureIterator, numFeatures, totalSizingOfFeatures
 

Field Detail

designator

private java.lang.String designator
Constructor Detail

Release

public Release()
Method Detail

subtract

public void subtract(Release other)
Removes features from this release that appear in the other release.

Parameters:
other - the release containing features to be removed

getDesignator

public java.lang.String getDesignator()

setDesignator

public void setDesignator(java.lang.String designator)

getLabel

public java.lang.String getLabel()
The FeatureList label is the same as the release designator.

Specified by:
getLabel in interface FeatureList
Returns:
the descriptive (short) label

featureIterator

public java.util.Iterator featureIterator()
Get an Iterator over the features.

Specified by:
featureIterator in interface FeatureList
Returns:
the requested Iterator

addFeature

public void addFeature(Feature f)
Add the indicated feature to the list.

Parameters:
f - the feature to add

sortFeatures

protected void sortFeatures(java.util.Comparator compare)
Sort features according to the order given by the Feature Comparator.


subtract

protected void subtract(DefaultFeatureListImplementation other)
Remove all features in the other list from this one.]

Parameters:
other - the feature list to substract from this one

numFeatures

public int numFeatures(Priority p)
Returns the number of features broken out by priority.

Specified by:
numFeatures in interface FeatureList
Parameters:
p - if null, all features, else only features of the given priority
Returns:
the count of the specified features

totalSizingOfFeatures

public double totalSizingOfFeatures(Priority p)
Returns the total sizing of features broken out by priority.

Specified by:
totalSizingOfFeatures in interface FeatureList
Parameters:
p - if null, all features, else only features of the given priority
Returns:
the total of the sizings of the specified features

CSC407 OOP Example