E
- public class SetCover<E extends Identifiable> extends Object
Constructor and Description |
---|
SetCover() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E element)
Adds element to the set.
|
boolean |
addAll(Collection<E> elements)
Adds all elements from the collection to the set.
|
void |
clear()
Removes all the elements from the set.
|
boolean |
contains(E element)
Checks whether set contains the element.
|
boolean |
contains(String elementIdentifier)
Checks whether set contains an element specified by the identifier.
|
boolean |
equals(Object obj) |
E |
get(String elementIdentifier)
Retrieves element rom the set.
|
Set<E> |
getSet()
Returns unmodifiable set of elements.
|
Set<E> |
getSet(boolean modifiable)
Returns set of elements.
|
int |
hashCode() |
boolean |
remove(E element)
Removes element from the set
|
int |
size()
Returns number of elements in the set.
|
String |
toString()
Resturns string representation of the set
|
public boolean contains(E element)
element
- looked up in the setpublic boolean contains(String elementIdentifier)
elementIdentifier
- identifier of the element looked up in the setpublic boolean add(E element)
element
- element to be added. Cannot be null.public boolean addAll(Collection<E> elements)
elements
- collection of elements to be added. Cannot contain any
null elements.public E get(String elementIdentifier)
elementIdentifier
- identifier of the element to be retrievedpublic boolean remove(E element)
element
- element to be remoed from the set. Cannot be null.public void clear()
public Set<E> getSet()
public Set<E> getSet(boolean modifiable)
modifiable
- specifies if the set will be modifiable or notpublic int size()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
equals
in class Object
obj
- object to compare set withObject.equals(java.lang.Object)
public String toString()
toString
in class Object
Object.toString()
Copyright © 2016. All Rights Reserved.