From FANG
|
01 packagepackage is used to name the directory or folder a class is in scg.ch13.util;
02
03 /**
04 * Represents a {open braces start code blocks and must be matched with a close brace@link BlockDrop}close braces end code blocks and must match an earlier open brace game position. Each position has a row
05 * and a column. It can be constructed with a pair of integers or
06 * another {open braces start code blocks and must be matched with a close brace@link Position}close braces end code blocks and must match an earlier open brace. Both fields have standard getter/setter
07 * methods.
08 */
09 publicpublic is used to indicate unrestricted access (any other class can have access) classclass is a group of fields and methods used for making objects Position {open braces start code blocks and must be matched with a close brace
10 privateprivate is used to restrict access to the current class only intint is the type for whole numbers and it is short for integer column;
11
12 /** the row and column of thisthis means the current object (the implicit parameter) position */
13 privateprivate is used to restrict access to the current class only intint is the type for whole numbers and it is short for integer row;
14
15 /**
16 * Construct a newnew is used to create objects by calling the constructor {open braces start code blocks and must be matched with a close brace@link Position}close braces end code blocks and must match an earlier open brace from the given values.
17 *
18 * @paramthis is the Javadoc tag for documenting the purpose of parameters row the row value in thisthis means the current object (the implicit parameter) {open braces start code blocks and must be matched with a close brace@link Position}close braces end code blocks and must match an earlier open brace
19 * @paramthis is the Javadoc tag for documenting the purpose of parameters column the column value in thisthis means the current object (the implicit parameter) {open braces start code blocks and must be matched with a close brace@link Position}close braces end code blocks and must match an earlier open brace
20 */
21 publicpublic is used to indicate unrestricted access (any other class can have access) Position(intint is the type for whole numbers and it is short for integer row, intint is the type for whole numbers and it is short for integer column) {open braces start code blocks and must be matched with a close brace
22 thisthis means the current object (the implicit parameter).row =this assignment operator makes the left side equal to the right side row;
23 thisthis means the current object (the implicit parameter).column =this assignment operator makes the left side equal to the right side column;
24 }close braces end code blocks and must match an earlier open brace
25
26 /**
27 * Construct a copy of the original {open braces start code blocks and must be matched with a close brace@link Position}close braces end code blocks and must match an earlier open brace.
28 *
29 * @paramthis is the Javadoc tag for documenting the purpose of parameters original the {open braces start code blocks and must be matched with a close brace@link Position}close braces end code blocks and must match an earlier open brace to copy
30 */
31 publicpublic is used to indicate unrestricted access (any other class can have access) Position(Position original) {open braces start code blocks and must be matched with a close brace
32 thisthis means the current object (the implicit parameter)(original.row, original.column);
33 }close braces end code blocks and must match an earlier open brace
34
35 /**
36 * Get the current column
37 *
38 * @returnnull the column
39 */
40 publicpublic is used to indicate unrestricted access (any other class can have access) intint is the type for whole numbers and it is short for integer getColumn() {open braces start code blocks and must be matched with a close brace
41 returnreturn means to provide the result of the method and/or cease execution of the method immediately column;
42 }close braces end code blocks and must match an earlier open brace
43
44 /**
45 * Get the current row.
46 *
47 * @returnnull the row
48 */
49 publicpublic is used to indicate unrestricted access (any other class can have access) intint is the type for whole numbers and it is short for integer getRow() {open braces start code blocks and must be matched with a close brace
50 returnreturn means to provide the result of the method and/or cease execution of the method immediately row;
51 }close braces end code blocks and must match an earlier open brace
52
53 /**
54 * Set the column in thisthis means the current object (the implicit parameter) {open braces start code blocks and must be matched with a close brace@link Position}close braces end code blocks and must match an earlier open brace.
55 *
56 * @paramthis is the Javadoc tag for documenting the purpose of parameters column the column to set
57 */
58 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value setColumn(intint is the type for whole numbers and it is short for integer column) {open braces start code blocks and must be matched with a close brace
59 thisthis means the current object (the implicit parameter).column =this assignment operator makes the left side equal to the right side column;
60 }close braces end code blocks and must match an earlier open brace
61
62 /**
63 * Set the row in thisthis means the current object (the implicit parameter) {open braces start code blocks and must be matched with a close brace@link Position}close braces end code blocks and must match an earlier open brace.
64 *
65 * @paramthis is the Javadoc tag for documenting the purpose of parameters row the row to set
66 */
67 publicpublic is used to indicate unrestricted access (any other class can have access) voidvoid means the method does not return a value setRow(intint is the type for whole numbers and it is short for integer row) {open braces start code blocks and must be matched with a close brace
68 thisthis means the current object (the implicit parameter).row =this assignment operator makes the left side equal to the right side row;
69 }close braces end code blocks and must match an earlier open brace
70 }close braces end code blocks and must match an earlier open brace
71
72 //Uploaded on Mon Mar 29 21:38:40 EDT 2010
|
Download/View scg/ch13/util/Position.java