001    package ps4;
002    
003    /**
004     * Class overview to be written by student.
005     */
006    public class StreetNumberSet {
007    
008        /**
009         * Creates a StreetNumberSet containing the numbers indicated in the
010         * argument.
011         *
012         * @requires numbers != null && numbers is a space-free comma-delimited list
013         *           of zero or more disjoint parity ranges. Two parity ranges
014         *           are disjoint if they share no elements.
015         *           For example, 10-20 and 19-21 are disjoint:  as
016         *           one only contains even elements and the other contains odd.
017         *           By contrast, 1-5 and 3-7 overlap, as they both contain 3 and 5.
018         *
019         * <p>
020         * A parity range is either a single nonnegative integer "n" or a
021         * hyphen-separated pair of nonnegative integers "m-n", where m and n have
022         * the same parity and m is no greater than n. A range m-n represents the
023         * set of all numbers from m to n, inclusive, which are the same parity as m
024         * and n.
025         *
026         * <p>
027         * For instance, legal arguments to this constructor include
028         * "", "5", "22,253", "3-101", and "1914-1918,1939-1945".
029         */
030        public StreetNumberSet(String numbers) {
031        }
032    
033        /**
034         * @return true if other is a StreetNumberSet that contains the same
035         * numbers as this.  In particular, this expression evaluates to true:
036         * <pre>new StreetNumberSet("1-9").equals(new StreetNumberSet("1-3,5-9"))</pre>
037         */
038        public boolean equals(Object other) {
039            throw new RuntimeException("StreetNumberSet.equals() unimplemented!");
040        }
041    
042        /** @return true iff i is in this */
043        public boolean contains(int i) {
044            throw new RuntimeException("StreetNumberSet.contains() unimplemented!");
045        }
046    
047        /** @return the number of elements less than i in this */
048        public int orderStatistic(int i) {
049            throw new RuntimeException("StreetNumberSet.orderStatistic() unimplemented!");
050        }
051    
052    }