01: package net.firstpartners.nounit.utility;
02:
03: /**
04: * Title: NoUnit - Identify Classes that are not being unit Tested
05: *
06: * Copyright (C) 2001 Paul Browne , FirstPartners.net
07: *
08: *
09: * This program is free software; you can redistribute it and/or
10: * modify it under the terms of the GNU General Public License
11: * as published by the Free Software Foundation; either version 2
12: * of the License, or (at your option) any later version.
13: *
14: * This program is distributed in the hope that it will be useful,
15: * but WITHOUT ANY WARRANTY; without even the implied warranty of
16: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17: * GNU General Public License for more details.
18: *
19: * You should have received a copy of the GNU General Public License
20: * along with this program; if not, write to the Free Software
21: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22: *
23: * @author Paul Browne
24: * @version 0.7
25: */
26:
27: import java.util.Collection;
28: import java.util.HashSet;
29:
30: /**
31: * Performs common , but tricky tasks on Collections
32: * e.g. Stripping of spaces from Files
33: */
34: public class CollectionUtil {
35:
36: /**
37: * Convert an Array to a HashSet
38: * @param arrayToConvert
39: * @return convertedHashSet with Array Information in it
40: */
41: public static Collection convertArrayToCollection(
42: Object[] arrayToConvert) {
43:
44: //Local Variables
45: HashSet convertedHashSet = new HashSet();
46:
47: //Loop and Convert
48: for (int a = 0; a < arrayToConvert.length; a++) {
49: convertedHashSet.add(arrayToConvert[a]);
50: }
51:
52: return convertedHashSet;
53:
54: }
55:
56: }
|