Constructor and Description |
---|
RhnSetImpl()
Default constructor.
|
RhnSetImpl(java.lang.Long id,
java.lang.String lbl,
SetCleanup cleanup0)
Constructs an RhnSet with the given user id and label.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(java.lang.Object e) |
boolean |
addAll(java.util.Collection c) |
void |
addElement(java.lang.Long elem)
Adds an element to the set.
|
void |
addElement(java.lang.Long elem,
java.lang.Long elemTwo)
Adds an element to the set.
|
void |
addElement(java.lang.Long elem,
java.lang.Long elemTwo,
java.lang.Long elemThree)
Add a new element to the Set
|
void |
addElement(RhnSetElement element)
Adds an element to the set.
|
void |
addElement(java.lang.String elem)
Add a new element to the Set.
|
void |
addElements(java.lang.String[] elems)
Adds an array of elements to the set.
|
void |
clear()
Clear the set - remove all elements
|
boolean |
contains(java.lang.Long elem)
Returns whether or not the set contains the given RhnSetElement
given elem (elementTwo is assumed to be null)
|
boolean |
contains(java.lang.Long elem,
java.lang.Long elemTwo)
Returns whether or not the set contains the given RhnSetElement
given elem and elemTwo
|
boolean |
contains(java.lang.Object o) |
boolean |
contains(RhnSetElement e)
Returns whether or not the set contains the given RhnSetElement
|
boolean |
containsAll(java.util.Collection c) |
java.util.Set<RhnSetElement> |
getAdded()
Return a set of all elements that have been added since the last call
to
sync() |
java.util.Set<RhnSetElement> |
getElements()
Returns a java.util.Set of the Elements in the RhnSet.
|
java.util.Set<java.lang.Long> |
getElementValues()
Returns a java.util.Set of the Long values in each RhnSetElement.
|
java.lang.String |
getLabel()
Getter for label
|
java.util.Set<RhnSetElement> |
getRemoved()
Return a set of all elements that have been removed since the last call
to
sync() |
java.lang.Long |
getUserId()
Getter for user id
|
boolean |
isEmpty()
Determine if the set is empty
|
boolean |
isSynced()
Return
true if this set has ever been synced |
java.util.Iterator<RhnSetElement> |
iterator() |
boolean |
remove(java.lang.Long o)
Remove a item from the set.
|
boolean |
remove(java.lang.Object o) |
boolean |
remove(RhnSetElement o)
Remove an rhnSetElement from the set
|
boolean |
removeAll(java.util.Collection c)
removes a collection of RhnSetElemnets from the set
|
void |
removeElement(java.lang.Long elem)
Remove an element from the set
|
void |
removeElement(java.lang.Long elem,
java.lang.Long elemTwo)
Remove an element from the set
|
void |
removeElement(RhnSetElement element)
Remove an element from the set
|
void |
removeElements(java.lang.String[] elems)
Removes an array of elements to the set.
|
boolean |
retainAll(java.util.Collection c)
retains a collection of RhnSetElemnets from the set
|
void |
setLabel(java.lang.String lbl)
Setter for label
|
void |
setUserId(java.lang.Long id)
Setter for user id
|
int |
size()
Returns the size of the element list for the set
|
void |
sync()
Save the current state of the set.
|
java.lang.Object[] |
toArray() |
java.lang.Object[] |
toArray(java.lang.Object[] a) |
public RhnSetImpl()
public RhnSetImpl(java.lang.Long id, java.lang.String lbl, SetCleanup cleanup0)
id
- userid to associate with this RhnSet.lbl
- label to associate with this RhnSet.cleanup0
- the cleanup to use after storing this setpublic void setUserId(java.lang.Long id)
public java.lang.Long getUserId()
public void setLabel(java.lang.String lbl)
public java.lang.String getLabel()
public void addElement(RhnSetElement element)
addElement
in interface RhnSet
element
- Element to be added to the set.public void addElement(java.lang.Long elem, java.lang.Long elemTwo)
addElement
in interface RhnSet
elem
- Element oneelemTwo
- Element twopublic void addElement(java.lang.Long elem, java.lang.Long elemTwo, java.lang.Long elemThree)
addElement
in interface RhnSet
elem
- Element one.elemTwo
- Element two, can be null.elemThree
- Element three, can be null.public void addElement(java.lang.Long elem)
addElement
in interface RhnSet
elem
- Element onepublic void addElement(java.lang.String elem)
addElement
in interface RhnSet
elem
- Element one or Element1|Element2public void addElements(java.lang.String[] elems)
addElements
in interface RhnSet
elems
- String [] - array of elements to addpublic void removeElements(java.lang.String[] elems)
removeElements
in interface RhnSet
elems
- String [] - array of elements to addpublic void removeElement(RhnSetElement element)
removeElement
in interface RhnSet
element
- Element to removepublic void removeElement(java.lang.Long elem, java.lang.Long elemTwo)
removeElement
in interface RhnSet
elem
- value for elementelemTwo
- value for elementTwopublic void removeElement(java.lang.Long elem)
removeElement
in interface RhnSet
elem
- value for elementpublic void clear()
public java.util.Set<RhnSetElement> getElements()
getElements
in interface RhnSet
public java.util.Set<java.lang.Long> getElementValues()
getElementValues
in interface RhnSet
public boolean contains(RhnSetElement e)
public boolean contains(java.lang.Long elem, java.lang.Long elemTwo)
public boolean contains(java.lang.Long elem)
public int size()
public boolean isEmpty()
public void sync()
getAdded()
and
getRemoved()
will report changes with respect to the state
of the set at the last call to this methodpublic boolean isSynced()
true
if this set has ever been syncedtrue
if this set has ever been syncedpublic java.util.Set<RhnSetElement> getAdded()
sync()
sync()
public java.util.Set<RhnSetElement> getRemoved()
sync()
sync()
public boolean add(java.lang.Object e)
add
in interface java.util.Collection
add
in interface java.util.Set
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
addAll
in interface java.util.Set
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection
contains
in interface java.util.Set
public boolean containsAll(java.util.Collection c)
containsAll
in interface java.util.Collection
containsAll
in interface java.util.Set
public java.util.Iterator<RhnSetElement> iterator()
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
iterator
in interface java.util.Set
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection
remove
in interface java.util.Set
public boolean remove(java.lang.Long o)
o
- the first element of the RhnSetElement to removepublic boolean remove(RhnSetElement o)
o
- the elementpublic boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection
removeAll
in interface java.util.Set
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection
retainAll
in interface java.util.Set
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
toArray
in interface java.util.Set
public java.lang.Object[] toArray(java.lang.Object[] a)
toArray
in interface java.util.Collection
toArray
in interface java.util.Set