+ /**
+ * Returns the vlan id number for all vlans specified
+ *
+ * @return the vlan id number for all vlans specified
+ */
+ public Set<Short> getVlanList() {
+ /*
+ * example: Vlan = "1,3,5-12"
+ * elemArray = ["1" "3" "5-12"]
+ * elem[2] = "5-12" --> limits = ["5" "12"]
+ * vlanList = [1 3 5 6 7 8 9 10 11 12]
+ */
+ Set<Short> vlanList = new HashSet<Short>();
+ try {
+ String[] elemArray = dlVlan.split(",");
+ for (String elem : elemArray) {
+ if (elem.contains("-")) {
+ String[] limits = elem.split("-");
+ for (short j = Short.valueOf(limits[0]); j <= Short.valueOf(limits[1]); j++) {
+ vlanList.add(Short.valueOf(j));
+ }
+ } else {
+ vlanList.add(Short.valueOf(elem));
+ }
+ }
+ } catch (NumberFormatException e) {
+
+ }
+ return vlanList;
+ }
+