CSC407 OOP Example

plan.dom
Class Software

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

public class Software
extends DefaultFeatureListImplementation
implements FeatureList


Field Summary
private  java.lang.String name
           
 
Constructor Summary
(package private) Software(java.lang.String name)
           
 
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 getLabel()
          The FeatureList label is the name of the Software product.
 java.lang.String getName()
           
 int numFeatures(Priority p)
          Returns the number of features broken out by priority.
 Release planRelease(double capacity)
          Suggests a release of this software product.
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.]
 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

name

private java.lang.String name
Constructor Detail

Software

Software(java.lang.String name)
Method Detail

getName

public java.lang.String getName()

planRelease

public Release planRelease(double capacity)
Suggests a release of this software product.

Parameters:
capacity - the number of person-days of coding effort available to work on the release
Returns:
a Release containing a suggested list of features

getLabel

public java.lang.String getLabel()
The FeatureList label is the name of the Software product.

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