From ggc
|
01 packagepackage is used to name the directory or folder a class is in intermediate;
02
03 publicpublic is used to indicate unrestricted access (any other class can have access) interfaceinterface is a named collection of declared methods DefiniteNumericCollection
04 {open braces start code blocks and must be matched with a close brace
05 /**
06 * adds a number to the collection ifif executes the next statement only if the condition in parenthesis evaluates to true it has a definite value.
07 * If the number does not have a definite value (e.g. NaN,
08 * POSITIVE_INFINITY, or NEGATIVE_INFINITY), thisthis means the current object (the implicit parameter) method should
09 * returnreturn means to provide the result of the method and/or cease execution of the method immediately without adding the number.
10 * @paramthis is the Javadoc tag for documenting the purpose of parameters number the numeric value to add
11 */
12 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value add(Number number);
13
14 /**
15 * removes a number from the collection.
16 * If the number does not exist in the collection,
17 * no exception is thrown and the method call is
18 * just ignored.
19 * @paramthis is the Javadoc tag for documenting the purpose of parameters number the number vaule to be removed
20 */
21 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value remove(Number number);
22
23 /**
24 * gets the minimum value in the collection.
25 * This method should returnreturn means to provide the result of the method and/or cease execution of the method immediately Double.NaN when
26 * there are no items in the collection.
27 * @returnnull the least value in the collection
28 * or Double.NaN ifif executes the next statement only if the condition in parenthesis evaluates to true there are no items.
29 */
30 publicpublic is used to indicate unrestricted access (any other class can have access) Number getMin();
31
32 /**
33 * gets the maximum value in the collection.
34 * This method should returnreturn means to provide the result of the method and/or cease execution of the method immediately Double.NaN when
35 * there are no items in the collection.
36 * @returnnull the greatest value in the collection
37 * or Double.NaN ifif executes the next statement only if the condition in parenthesis evaluates to true there are no items.
38 */
39 publicpublic is used to indicate unrestricted access (any other class can have access) Number getMax();
40
41 /**
42 * gets the median value in the collection.
43 * The median value is the number where there
44 * are an equal count of elements less than and
45 * greater than the given number. If there are
46 * If there is an even count, there will be two
47 * medians. In thisthis means the current object (the implicit parameter) casecase is used with switch for multiple alternatives (like if/else if...) the method returns the
48 * average of the two medians.
49 * This method should returnreturn means to provide the result of the method and/or cease execution of the method immediately Double.NaN when
50 * there are no items in the collection.
51 * @returnnull the greatest value in the collection
52 * or Double.NaN ifif executes the next statement only if the condition in parenthesis evaluates to true there are no items.
53 */
54 publicpublic is used to indicate unrestricted access (any other class can have access) Number getMedian();
55 /**
56 * gets the average value in the collection.
57 * This method should returnreturn means to provide the result of the method and/or cease execution of the method immediately Double.NaN when
58 * there are no items in the collection.
59 * @returnnull the greatest value in the collection
60 * or Double.NaN ifif executes the next statement only if the condition in parenthesis evaluates to true there are no items.
61 */
62 publicpublic is used to indicate unrestricted access (any other class can have access) Number getAverage();
63 /**
64 * removes all numbers from the collection.
65 */
66 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value clear();
67 }close braces end code blocks and must match an earlier open brace
|
Download/View intermediate/DefiniteNumericCollection.java