示例#1
0
 /*
  * Recursive descent into subclusters.
  */
 private static void flatten(ArrayList<Cluster> flattened, Collection<Cluster> clusters) {
   for (Cluster c : clusters) {
     flattened.add(c);
     final List<Cluster> subclusters = c.getSubclusters();
     if (!subclusters.isEmpty()) {
       flatten(flattened, subclusters);
     }
   }
 }
示例#2
0
 /** For JSON serialization only. */
 @JsonProperty("clusters")
 @SuppressWarnings("unused")
 private List<Cluster> getSubclustersForSerialization() {
   return subclustersView.isEmpty() ? null : subclustersView;
 }