From ggc
Compiled in 0.057 seconds.
|
01 package intermediate;
02
03 public class DefiniteImplementation implements DefiniteNumericCollection
04 {
05 /**
06 * adds a number to the collection if it has a definite value.
07 * If the number does not have a definite value (e.g. NaN,
08 * POSITIVE_INFINITY, or NEGATIVE_INFINITY), this method should
09 * return without adding the number.
10 * @param number the numeric value to add
11 */
12 public void add(Number number)
13 {
14 }
15
16 /**
17 * removes a number from the collection.
18 * If the number does not exist in the collection,
19 * no exception is thrown and the method call is
20 * just ignored.
21 * @param number the number vaule to be removed
22 */
23 public void remove(Number number)
24 {
25 }
26
27 /**
28 * gets the minimum value in the collection.
29 * This method should return Double.NaN when
30 * there are no items in the collection.
31 * @return the least value in the collection
32 * or Double.NaN if there are no items.
33 */
34 public Number getMin()
35 {
36 return null;
37 }
38
39 /**
40 * gets the maximum value in the collection.
41 * This method should return Double.NaN when
42 * there are no items in the collection.
43 * @return the greatest value in the collection
44 * or Double.NaN if there are no items.
45 */
46 public Number getMax()
47 {
48 return null;
49 }
50
51 /**
52 * gets the median value in the collection.
53 * The median value is the number where there
54 * are an equal count of elements less than and
55 * greater than the given number. If there are
56 * If there is an even count, there will be two
57 * medians. In this case the method returns the
58 * average of the two medians.
59 * This method should return Double.NaN when
60 * there are no items in the collection.
61 * @return the greatest value in the collection
62 * or Double.NaN if there are no items.
63 */
64 public Number getMedian()
65 {
66 return null;
67 }
68
69 /**
70 * gets the average value in the collection.
71 * This method should return Double.NaN when
72 * there are no items in the collection.
73 * @return the greatest value in the collection
74 * or Double.NaN if there are no items.
75 */
76 public Number getAverage()
77 {return null;}
78
79 /**
80 * removes all numbers from the collection.
81 */
82 public void clear()
83 {}
84 }
|
Download/View intermediate/DefiniteImplementation.java