src/org/gel/air/util/GroupHelpers.java

Go to the documentation of this file.
00001 package org.gel.air.util;
00002 
00003 import java.util.Collection;
00004 import java.util.Comparator;
00005 import java.util.Iterator;
00006 
00007 public class GroupHelpers {
00008 
00009         public static void arrayToCollection (Collection group, Object [] data) {
00010                 for (int i = 0; i < data.length; i++)
00011                         group.add (data[i]);
00012         }
00013         
00014         public static boolean collectionsEqual (Collection a, Collection b, 
00015                         Comparator comp) {
00016                 if (a.size() == b.size()) {
00017                         Iterator one = a.iterator();
00018                         Iterator two = b.iterator();
00019                         while (one.hasNext()) {
00020                                 if (comp.compare(one.next(), two.next ()) != 0)
00021                                         return false;
00022                         }
00023                         return true;
00024                 }
00025                 else
00026                         return false;
00027         }
00028 
00029 }

Generated on Mon Aug 19 06:03:40 2013 for Mauve by doxygen 1.3.6