-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTag.java
More file actions
46 lines (40 loc) · 1.09 KB
/
Copy pathTag.java
File metadata and controls
46 lines (40 loc) · 1.09 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
package photo_renamer;
import java.io.Serializable;
/** A tag applied to ImageFile objects located in the system. */
class Tag implements Serializable {
/** The serialVersionUID for this class. */
private static final long serialVersionUID = 3707256125680272656L;
/** The name of this tag. */
String name;
/**
* An image tag.
*
* @param name the name of this tag
*/
Tag(String name) {
this.name = name;
}
/**
* Return a string representation of this Tag.
*
* @return the name of this tag
*/
@Override
public String toString() {
return this.name;
}
/**
* Return whether this Tag is equal to Tag comp.
*
* @param comp the Tag object being compared to
* @return a boolean of whether this Tag is equal to Tag comp
*/
@Override
public boolean equals(Object comp) {
boolean isEqual = false;
if (comp != null && comp instanceof Tag) {
isEqual = this.name.toLowerCase().equals(((Tag) comp).name.toLowerCase());
}
return isEqual;
}
}