com.clarkparsia.pellint.util.CollectionUtil Maven / Gradle / Ivy
The newest version!
// Copyright (c) 2006 - 2008, Clark & Parsia, LLC.
// This source code is available under the terms of the Affero General Public License v3.
//
// Please see LICENSE.txt for full license terms, including the availability of proprietary exceptions.
// Questions, comments, or requests for clarification: [email protected]
package com.clarkparsia.pellint.util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
*
* Title: Collection Utilities
*
*
* Description:
*
*
* Copyright: Copyright (c) 2008
*
*
* Company: Clark & Parsia, LLC.
*
*
* @author Harris Lin
*/
public class CollectionUtil {
public static List makeList() {
return new ArrayList();
}
public static Set makeSet() {
return new HashSet();
}
public static Map makeMap() {
return new HashMap();
}
public static List copy(List extends T> a) {
return new ArrayList(a);
}
public static Set copy(Set extends T> a) {
return new HashSet(a);
}
public static Set asSet(T... a) {
return new HashSet(Arrays.asList(a));
}
}