-
Notifications
You must be signed in to change notification settings - Fork 0
/
Location.java
29 lines (25 loc) · 869 Bytes
/
Location.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
public class Location {
// index of Block in DynamicArray.arrayofBlocks
protected final int blockIndex;
// index of element in the arrayOfElements in the Block
protected final int elementIndex;
// Workhorse constructor. Initialize variables.
public Location(int blockIndex, int elementIndex) {
this.blockIndex = blockIndex;
this.elementIndex = elementIndex;
}
// Returns blockIndex
public int getBlockIndex() {
return blockIndex;
}
// returns elementIndex
public int getElementIndex() {
return elementIndex;
}
// Create a pretty representation of the Location for debugging.
// Example:
// blockIndex:2 elementIndex:1
protected String toStringForDebugging() {
return ("blockIndex:" + blockIndex + " elementIndex:" + elementIndex);
}
}