-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPair.java
More file actions
43 lines (42 loc) · 802 Bytes
/
Pair.java
File metadata and controls
43 lines (42 loc) · 802 Bytes
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
// Will hold the information on a specific token, the type and the value.
public class Pair
{
// Field values for the pair object.
private String value; // Value of token
private String token; // Type of token.
// Empty Constructor
public Pair()
{
}
// Constructor to set both value and token.
public Pair(String v, String t)
{
token = v;
value = t;
}
// Setter for the value.
public void setValue(String v)
{
value = v;
}
// Setter for the token.
public void setToken(String t)
{
token = t;
}
// Getter for the value.
public String getValue()
{
return value;
}
// Getter for the token.
public String getToken()
{
return token;
}
// To string method for the token.
public String toString()
{
return token + " " + value + "\n";
}
}