-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLine.java
68 lines (57 loc) · 1.72 KB
/
Line.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
* Name: Rynel Luo, Vidula Kopli
* PennKey: rynelluo, vkopli
* Recitation: 215, 216
*
* Description: Line interface used by blackLine and blankLine classes
*/
public interface Line {
/**
* sees if there is another readable column in the image's row (line)
* @return if the image has another readable column
*/
public boolean hasNext();
/**
* moves on to the next column in the image (line)
*/
public void next();
/**
* make quarter note at current position (currCol, y)
*/
public Note makeQuarterNote();
/**
* make quarter note at current position (currCol, y)
*/
public Note makeHalfNote();
/**
* Checks for a black "blob" (quarter note) on the line at currCol
* assumes currCol is set to valid index
* @return whether there is a note on the line
*/
public boolean checkQuarterNote();
/**
* Checks for a half note on the line at currCol
* assumes currCol is set to valid index
* @return whether there is a note on the line
*/
public boolean checkHalfNote();
/**
* set the note that the line can play
* @param int which staff it is
*/
public void setStaffIdx(int staffIdx);
/**
* set currCol/startCol and endCol
* @param the number of columns
*/
public void setXlim(int numCols);
/**
* optional function to further restrict columns that are searched
* @param start and end columns
*/
public void setXlim(int startCol, int endCol);
/**
* Visualize the black lines for user
*/
public void draw();
}