-
Notifications
You must be signed in to change notification settings - Fork 3
/
LyricLine.java
52 lines (42 loc) · 1.45 KB
/
LyricLine.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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package arrays;
/**
* Models a single line of a lyric in a song
* and contains timing data
* @author Eric Darsow <edarsow@ccac.edu>
*/
public class LyricLine {
// Member variables
public String lineText;
public long timeToDisplayMilli;
/**
* Default, no-argument constructor lives here
* Constructor names are ALWAYS identical to
* the class name, with optional input arguments
*/
public LyricLine(){
System.out.println("Inside no-arg constructor");
// Initializing member varibles to sensible
//defaults
lineText = "[no lyric]";
// Inject a sensible default display time
timeToDisplayMilli = 1000;
} // close no-arg constructor
/**
* Creates an instance of LyricLine
* @param lt actual line's text
* @param ms number of milliseconds to display line
*/
public LyricLine(String lt, long ms){
System.out.println("Inside two-arg constructor:");
System.out.println("Received lt: " + lt);
System.out.println("Received ms: " + ms);
// transfer the input parameters to our member variables
lineText = lt;
timeToDisplayMilli = ms;
} // Close two-arg constructor
} // close class