public class RoundRobinLoadBalancedList<E> extends Object implements LoadBalancedList<E>
LoadBalancedList.Node<E>| Constructor and Description |
|---|
RoundRobinLoadBalancedList() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears all entries from the list.
|
boolean |
contains(E item)
Checks if the item is already contained in this list.
|
E |
getNext()
Gets the next item to use from the list.
|
int |
getRemainingSize() |
int |
getSize()
Gets the total number of items (size) of the list.
|
List<LoadBalancedList.Node<E>> |
getValues()
Gets a list of all nodes.
|
protected void |
rebuildRemainingItems() |
void |
remove(E item)
Removes an item from the list.
|
protected void |
resetCountsAndRebuildRemainingItems() |
void |
set(E item,
int weight)
Adds the item to the list if it doesn't yet exist.
|
String |
toString() |
public List<LoadBalancedList.Node<E>> getValues()
LoadBalancedListgetValues in interface LoadBalancedList<E>public void clear()
LoadBalancedListclear in interface LoadBalancedList<E>public boolean contains(E item)
LoadBalancedListcontains in interface LoadBalancedList<E>item - The item to check for in listpublic void set(E item, int weight)
LoadBalancedListset in interface LoadBalancedList<E>item - The item to add or setweight - The new weight of the itempublic void remove(E item)
LoadBalancedListremove in interface LoadBalancedList<E>item - The item to remove.protected void rebuildRemainingItems()
protected void resetCountsAndRebuildRemainingItems()
public int getSize()
LoadBalancedListgetSize in interface LoadBalancedList<E>public int getRemainingSize()
public E getNext()
LoadBalancedListgetNext in interface LoadBalancedList<E>Copyright © 2012-2015 Cloudhopper by Twitter. All Rights Reserved.