uk.ac.ebi.microarray.zooma.utils
Class OntologyUtils

java.lang.Object
  extended by uk.ac.ebi.microarray.zooma.utils.OntologyUtils

public class OntologyUtils
extends java.lang.Object

Convenience class containing static methods that are useful in comparing ontology terms etc.

Author:
Tony Burdett

Constructor Summary
OntologyUtils()
           
 
Method Summary
static boolean containsEquivalentTerm(java.util.Collection<uk.ac.ebi.ontocat.OntologyTerm> terms, uk.ac.ebi.ontocat.OntologyTerm termToMatch)
           
static boolean contentsEqual(java.util.Collection a, java.util.Collection b)
           
static boolean contentsEquivalent(java.util.Collection<uk.ac.ebi.ontocat.OntologyTerm> a, java.util.Collection<uk.ac.ebi.ontocat.OntologyTerm> b)
           
static boolean termsAreEquivalent(uk.ac.ebi.ontocat.OntologyTerm a, uk.ac.ebi.ontocat.OntologyTerm b)
           
static boolean termsAreSubset(java.util.Collection<uk.ac.ebi.ontocat.OntologyTerm> collectionA, java.util.Collection<uk.ac.ebi.ontocat.OntologyTerm> collectionB)
          Returns true if collectionB contains all the terms in collectionA, plus more
static boolean termsAreSuperset(java.util.Collection<uk.ac.ebi.ontocat.OntologyTerm> collectionA, java.util.Collection<uk.ac.ebi.ontocat.OntologyTerm> collectionB)
          Returns true if collectionB contains some of the terms in collectionA, and no others more
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OntologyUtils

public OntologyUtils()
Method Detail

contentsEqual

public static boolean contentsEqual(java.util.Collection a,
                                    java.util.Collection b)

contentsEquivalent

public static boolean contentsEquivalent(java.util.Collection<uk.ac.ebi.ontocat.OntologyTerm> a,
                                         java.util.Collection<uk.ac.ebi.ontocat.OntologyTerm> b)

containsEquivalentTerm

public static boolean containsEquivalentTerm(java.util.Collection<uk.ac.ebi.ontocat.OntologyTerm> terms,
                                             uk.ac.ebi.ontocat.OntologyTerm termToMatch)

termsAreEquivalent

public static boolean termsAreEquivalent(uk.ac.ebi.ontocat.OntologyTerm a,
                                         uk.ac.ebi.ontocat.OntologyTerm b)

termsAreSuperset

public static boolean termsAreSuperset(java.util.Collection<uk.ac.ebi.ontocat.OntologyTerm> collectionA,
                                       java.util.Collection<uk.ac.ebi.ontocat.OntologyTerm> collectionB)
Returns true if collectionB contains some of the terms in collectionA, and no others more

Parameters:
collectionA - the first collection, to test if its a superset of B
collectionB - the collection to compare to
Returns:
true is collectionB is the superset of the collectionA

termsAreSubset

public static boolean termsAreSubset(java.util.Collection<uk.ac.ebi.ontocat.OntologyTerm> collectionA,
                                     java.util.Collection<uk.ac.ebi.ontocat.OntologyTerm> collectionB)
Returns true if collectionB contains all the terms in collectionA, plus more

Parameters:
collectionA - the first collection, to test if its a subset of B
collectionB - the collection to compare to
Returns:
true is collectionB is the subset of the collectionA


Copyright © 2010. All Rights Reserved.