Example #1
0
 protected List<Long> findSortedSrcEdges(Collection<Rule> rules) {
   final Set<Long> srcIPs = new HashSet<Long>(rules.size() * 2 + 1, 1);
   int srcIPIndex = Util.getDimensionInfoIndex(Util.SRC_IP_INFO);
   for (Rule rule : rules) {
     RangeDimensionRange property = rule.getProperty(srcIPIndex);
     srcIPs.add(property.getStart());
     srcIPs.add(property.getEnd());
   }
   List<Long> ipsSorted = new ArrayList<Long>(srcIPs);
   for (Long srcIP : srcIPs) {
     ipsSorted.add(srcIP);
   }
   Collections.sort(ipsSorted);
   return ipsSorted;
 }