org.deri.wsmo4j.logicalexpression.util
Class SetUtil

java.lang.Object
  extended by org.deri.wsmo4j.logicalexpression.util.SetUtil

public class SetUtil
extends Object

Utility to check typing of sets

 Created on Jul 24, 2005
 Committed by $Author: marin_dimitrov $
 $Source$,
 

Version:
$Revision: 896 $ $Date: 2005-09-09 18:51:42 +0300 (Fri, 09 Sep 2005) $
Author:
Holger Lausen

Constructor Summary
SetUtil()
           
 
Method Summary
static boolean allOfType(Collection collection, Class type)
          Checks if all object in a collection are of specfic type.
static Set createSet(Object o)
          Create an HashSet, add an Object to it and return the Set
static Set createSet(Object o1, Object o2)
          Create an HashSet, add two Objects to it and return the Set
static Set createSet(Object o1, Object o2, Object o3)
          Create an HashSet, add three Objects to it and return the Set
static Set createSet(Object o1, Object o2, Object o3, Object o4)
          Create an HashSet, add four Objects to it and return the Set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetUtil

public SetUtil()
Method Detail

allOfType

public static boolean allOfType(Collection collection,
                                Class type)
Checks if all object in a collection are of specfic type.

Parameters:
collection - collection to be checked
type - the Type that the objects have to be an instance of
Returns:
true if all objects in Collection are of specified type

createSet

public static Set createSet(Object o)
Create an HashSet, add an Object to it and return the Set

Parameters:
o - Object to be added to the HashSet
Returns:
HashSet containing the Object o

createSet

public static Set createSet(Object o1,
                            Object o2)
Create an HashSet, add two Objects to it and return the Set

Parameters:
o1 - Object 1 to be added to the HashSet
o2 - Object 2 to be added to the HashSet
Returns:
HashSet containing the Objects o1 and o2

createSet

public static Set createSet(Object o1,
                            Object o2,
                            Object o3)
Create an HashSet, add three Objects to it and return the Set

Parameters:
o1 - Object 1 to be added to the HashSet
o2 - Object 2 to be added to the HashSet
o3 - Object 3 to be added to the HashSet
Returns:
HashSet containing the Objects o1, o2 and o3

createSet

public static Set createSet(Object o1,
                            Object o2,
                            Object o3,
                            Object o4)
Create an HashSet, add four Objects to it and return the Set

Parameters:
o1 - Object 1 to be added to the HashSet
o2 - Object 2 to be added to the HashSet
o3 - Object 3 to be added to the HashSet
o4 - Object 4 to be added to the HashSet
Returns:
HashSet containing the Objects o1, o2, o3 and o4


Copyright © 2004-2008 Ontotext Lab.. All Rights Reserved.