/**
 * 
 */
package mathsquared.resultswizard2;

/**
 * Represents a method by which tied contestants are assigned a particular place. All contestants are assigned the place mandated by the TiePlaceAssignment for the event.
 * 
 * @author MathSquared
 * 
 */
public enum TiePlaceAssignment {
    /**
     * Assigns the place at the top of a range.
     */
    TOP {
        public int assignPlace (int placeOne, int placeTwo) {
            return (placeOne < placeTwo) ? placeOne : placeTwo; // return the LOWER number
        }
    },
    /**
     * Assigns the place at the bottom of a range.
     */
    BOTTOM {
        public int assignPlace (int placeOne, int placeTwo) {
            return (placeOne < placeTwo) ? placeTwo : placeOne; // return the HIGHER number
        }
    },
    /**
     * Assigns the place at the middle of a range, rounding towards the better (lesser) place.
     */
    MID_ROUND_BETTER {
        public int assignPlace (int placeOne, int placeTwo) {
            int high = (placeOne < placeTwo) ? placeOne : placeTwo;
            int low = (placeOne < placeTwo) ? placeTwo : placeOne;
            int diff = low - high; // the number of places under consideration minus one (fencepost effect)
            return high + diff / 2; // halfway through the range--since division truncates, this will round towards high
        }
    },
    /**
     * Assigns the place at the middle of a range, rounding towards the worse (greater) place.
     */
    MID_ROUND_WORSE {
        public int assignPlace (int placeOne, int placeTwo) {
            int high = (placeOne < placeTwo) ? placeOne : placeTwo;
            int low = (placeOne < placeTwo) ? placeTwo : placeOne;
            int diff = low - high; // the number of places under consideration minus one (fencepost effect)
            return low - diff / 2; // halfway through the range--since division truncates, this will round towards low
        }
    };
}

@@ -1930,11 +1930,460 @@
 %7D%0A    %7D;
+%0A%0A    // Default implementation%0A    /**%0A     * Given a range of places, assigns a place to all competitors tied within that range.%0A     * %0A     * @param placeOne one inclusive end of the range%0A     * @param placeTwo another inclusive end of the range (need not be greater than placeOne)%0A     * @return the place to assign to the competitors in the given range%0A     */%0A    public int assignPlace (int placeOne, int placeTwo) %7B%0A        return 0;%0A    %7D
 %0A%7D%0A

Add default implementation of assignPlace to TiePlaceAssignment