|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.semanticweb.owlapi.reasoner.impl.SynonymSetImpl<E>
public class SynonymSetImpl<E>
Author: Matthew Horridge
The University of Manchester
Information Management Group
Date: 01-Aug-2009
Constructor Summary | |
---|---|
SynonymSetImpl()
Constructs a new, empty set; the backing HashMap instance has default initial capacity (16) and load factor (0.75). |
|
SynonymSetImpl(java.util.Collection<? extends E> c)
Constructs a new set containing the elements in the specified collection. |
|
SynonymSetImpl(E e)
Creates a singleton synonym set |
Method Summary | ||
---|---|---|
boolean |
add(E o)
Adds the specified element to this set if it is not already present. |
|
boolean |
addAll(java.util.Collection<? extends E> c)
Adds all of the elements in the specified collection to this collection (optional operation). |
|
void |
clear()
Removes all of the elements from this set. |
|
boolean |
contains(java.lang.Object o)
Returns true if this set contains the specified element. |
|
boolean |
containsAll(java.util.Collection<?> c)
Returns true if this set contains all of the elements of the specified collection. |
|
E |
getSingletonElement()
Gets the one and only element if this set of synonyms is a singleton set |
|
boolean |
isEmpty()
Returns true if this set contains no elements. |
|
boolean |
isSingleton()
Determines if this set of synonyms is a singleton set. |
|
java.util.Iterator<E> |
iterator()
Returns an iterator over the elements in this set. |
|
boolean |
remove(java.lang.Object o)
Removes the specified element from this set if it is present. |
|
boolean |
removeAll(java.util.Collection<?> c)
Removes from this set all of its elements that are contained in the specified collection (optional operation). |
|
boolean |
retainAll(java.util.Collection<?> c)
Retains only the elements in this collection that are contained in the specified collection (optional operation). |
|
int |
size()
Returns the number of elements in this set (its cardinality). |
|
java.lang.Object[] |
toArray()
Returns an array containing all of the elements in this set. |
|
|
toArray(T[] a)
Returns an array containing all of the elements in this set; the runtime type of the returned array is that of the specified array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SynonymSetImpl()
public SynonymSetImpl(E e)
e
- The one and only elementpublic SynonymSetImpl(java.util.Collection<? extends E> c)
c
- the collection whose elements are to be placed into this set.
java.lang.NullPointerException
- if the specified collection is null.Method Detail |
---|
public boolean isSingleton()
true
if this synonym set is a singleton set, otherwise false
public E getSingletonElement()
isSingleton()
public java.util.Iterator<E> iterator()
ConcurrentModificationException
public boolean add(E o)
o
- element to be added to this set.
public boolean remove(java.lang.Object o)
o
- object to be removed from this set, if present.
public void clear()
public boolean removeAll(java.util.Collection<?> c)
This implementation determines which is the smaller of this set and the specified collection, by invoking the size method on each. If this set has fewer elements, then the implementation iterates over this set, checking each element returned by the iterator in turn to see if it is contained in the specified collection. If it is so contained, it is removed from this set with the iterator's remove method. If the specified collection has fewer elements, then the implementation iterates over the specified collection, removing from this set each element returned by the iterator, using this set's remove method.
Note that this implementation will throw an UnsupportedOperationException if the iterator returned by the iterator method does not implement the remove method.
c
- elements to be removed from this set.
java.lang.UnsupportedOperationException
- removeAll is not supported
by this set.
java.lang.NullPointerException
- if the specified collection is null.remove(Object)
,
contains(Object)
public boolean addAll(java.util.Collection<? extends E> c)
This implementation iterates over the specified collection, and adds each object returned by the iterator to this collection, in turn.
Note that this implementation will throw an UnsupportedOperationException unless add is overridden (assuming the specified collection is non-empty).
c
- collection whose elements are to be added to this collection.
java.lang.UnsupportedOperationException
- if this collection does not
support the addAll method.
java.lang.NullPointerException
- if the specified collection is null.add(Object)
public boolean retainAll(java.util.Collection<?> c)
This implementation iterates over this collection, checking each element returned by the iterator in turn to see if it's contained in the specified collection. If it's not so contained, it's removed from this collection with the iterator's remove method.
Note that this implementation will throw an UnsupportedOperationException if the iterator returned by the iterator method does not implement the remove method and this collection contains one or more elements not present in the specified collection.
c
- elements to be retained in this collection.
java.lang.UnsupportedOperationException
- if the retainAll method
is not supported by this Collection.
java.lang.NullPointerException
- if the specified collection is null.remove(Object)
,
contains(Object)
public int size()
public boolean isEmpty()
public boolean contains(java.lang.Object o)
e
such that (o==null ? e==null :
o.equals(e))
.
o
- element whose presence in this set is to be tested.
java.lang.ClassCastException
- if the type of the specified element
is incompatible with this set (optional).
java.lang.NullPointerException
- if the specified element is null and this
set does not support null elements (optional).public java.lang.Object[] toArray()
public <T> T[] toArray(T[] a)
a
- the array into which the elements of this set are to
be stored, if it is big enough; otherwise, a new array of the
same runtime type is allocated for this purpose.
java.lang.ArrayStoreException
- the runtime type of a is not a supertype
of the runtime type of every element in this set.
java.lang.NullPointerException
- if the specified array is null.public boolean containsAll(java.util.Collection<?> c)
c
- collection to be checked for containment in this set.
java.lang.ClassCastException
- if the types of one or more elements
in the specified collection are incompatible with this
set (optional).
java.lang.NullPointerException
- if the specified collection contains one
or more null elements and this set does not support null
elements (optional).
java.lang.NullPointerException
- if the specified collection is
null.contains(Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |