-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVideo.java
More file actions
52 lines (46 loc) · 1.11 KB
/
Copy pathVideo.java
File metadata and controls
52 lines (46 loc) · 1.11 KB
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
public class Video implements Comparable<Video>
{
String name;
String barcode;
Customer renter;
public Video left;
public Video right;
public Video next;
public Video(String name, String barcode)
{
this.name = name;
this.barcode = barcode;
this.renter = null;
left = null;
right = null;
}
public Video(String name, String barcode, Customer renter)
{
this.name = name;
this.barcode = barcode;
this.renter = renter;
left = null;
right = null;
}
public int compareTo(Video other)
{
if(this.barcode.compareTo(other.barcode) < 0) return -1;
else return 1;
}
public boolean equals(Video other)
{
boolean equal = false;
if(name.equals(other.name))
{
if(barcode.equals(other.barcode))
{
equal = true;
}
}
return equal;
}
public String toString()
{
return name + " |Barcode: " + barcode + "|";
}
}