-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDev.java
More file actions
68 lines (54 loc) · 1.55 KB
/
Dev.java
File metadata and controls
68 lines (54 loc) · 1.55 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
65
66
67
68
// Press Shift twice to open the Search Everywhere dialog and type `show whitespaces`,
// then press Enter. You can now see whitespace characters in your code.
import java.util.Collections;
import java.util.Comparator;
import java.util.Scanner;
import model.VLSM;
public class Dev {
public static void main(String[] args) {
Scanner scn = new Scanner (System.in);
VLSM vlsm = new VLSM();
int k = 1;
System.out.println("##### WELCOME TO JDNETTING #####");
if (!args[0].equals(null)) {
vlsm.listRedIP.add(args[0]);
System.out.println("Red IP added");
}
System.out.println("#### Write the quantity host by subnet ####");
/*
* Quantity host
*/
while (k <= Integer.parseInt(args[1])) {
System.out.print("Subnet "+k+"=> ");
int qh = Integer.parseInt(scn.next());
vlsm.listQuantityHost.add(qh);
k++;
}
/*
* Sort List
*/
Comparator<Integer> descendingComparator = (a, b) -> b.compareTo(a);
Collections.sort(vlsm.listQuantityHost, descendingComparator);
/*
* Prefix and Host Required
*/
vlsm.PrefixAndHostRequired();
/*
* JUMPER
*/
vlsm.Jumper();
/*
* Subred Mask
*/
vlsm.FindSubredMask();
/*
* RED IP
*/
vlsm.FindRedIP();
/*
* Overview O.O
*/
vlsm.Overview();
scn.close();
}
}