/*
 * Copyright (c) 2016, Dave Borncamp <dbornc1@students.towson.edu>
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * * Redistributions of source code must retain the above copyright notice, this
 *   list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above copyright notice,
 *   this list of conditions and the following disclaimer in the documentation
 *   and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

package assignment1;

/**
 *
 * @author Dave Borncamp <dbornc1@students.towson.edu>
 * @date {date?date?string("dd/mm/yyyy")}
 */
public class UnitFraction extends Fraction{

    /**
     * Normal Constructor
     * 
     * @param numerator - Numerator for the Fraction.
     * @param denominator-  Denominator for the Fraction.
     */
    public UnitFraction(int numerator, int denominator) {
        super(numerator, denominator);
    }

    /**
     * Copy Constructor
     * @param f - Fraction or UnitFraction to copy
     */
    public UnitFraction(Fraction f) {
        super(f);
    }
    
    
    @Override
    public String toString(){
        return "UnitFraction "+Integer.toString(+this.getNumerator()) + "/" + Integer.toString(this.getDenominator());
    }

}

@@ -1489,40 +1489,451 @@
 ate 
-%7Bdate?date?string(%22dd/mm/yyyy%22)%7D
+02/07/16%0A * %0A * A unit fraction is defined as a fraction where the numerator is one and the denominator is a positive integer.%0A * Make sure to check that the arguments are good%0A * %0A *  In order to make this class immutable this class would need to remove all setters and make the class final so %0A * that methods cannot be overridden. Then all of the variables should also be made private and final so that they%0A * cannot be accessed directly. 
 %0A */
@@ -2132,32 +2132,184 @@
 action.%0A     */%0A
+    %0A    private void check(int num, int den)%7B%0A        if (num != 1 %7C%7C den %3C 0)%7B%0A            throw new IllegalArgumentException();%0A        %7D%0A    %7D%0A    %0A
     public UnitF
@@ -2389,16 +2389,55 @@
 nator);%0A
+        check(numerator, denominator);%0A
     %7D%0A%0A 
@@ -2560,24 +2560,24 @@
 action f) %7B%0A
-
         supe
@@ -2582,16 +2582,69 @@
 per(f);%0A
+        check(f.getNumerator(), f.getDenominator());%0A
     %7D%0A  

Make the UnitFraction an actual unit fraction by adding a check function that is called in the constructor and add comments about how this could be made immutable.