-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIPAddress.java
More file actions
64 lines (51 loc) · 1.08 KB
/
Copy pathIPAddress.java
File metadata and controls
64 lines (51 loc) · 1.08 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
53
54
55
56
57
58
59
60
61
62
63
64
import java.util.Random;
/**
* Created by ayg447 on 6/9/2015.
*/
public class IPAddress extends Converter
{
private Random addressGenerator = new Random();
private int firstOctet;
private int secondOctet;
private int thirdOctet;
private int fourthOctet;
public IPAddress(int first, int second, int third, int fourth)
{
setFirstOctet(first);
setSecondOctet(second);
setThirdOctet(third);
setFourthOctet(fourth);
}
public void setFirstOctet(int first)
{
firstOctet = first;
}
public void setSecondOctet(int second)
{
secondOctet = second;
}
public void setThirdOctet(int third)
{
thirdOctet = third;
}
public void setFourthOctet(int fourth)
{
fourthOctet = fourth;
}
public int getFirstOctet()
{
return firstOctet;
}
public int getSecondOctet()
{
return secondOctet;
}
public int getThirdOctet()
{
return thirdOctet;
}
public int getFourthOctet()
{
return fourthOctet;
}
}