mirror of https://github.com/apache/activemq.git
Added a handy little rotateTo method to be able to quickly rotate to a specific node.
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@740329 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c01e182cfd
commit
ba706d134d
|
@ -105,6 +105,17 @@ public class LinkedNodeList<T extends LinkedNode<T>> {
|
||||||
return head = head.getNextCircular();
|
return head = head.getNextCircular();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Move the head to the tail and returns the new head node.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public void rotateTo(T head) {
|
||||||
|
assert head!=null: "Cannot rotate to a null head";
|
||||||
|
assert head.list == this : "Cannot rotate to a node not linked to this list";
|
||||||
|
this.head = head;
|
||||||
|
}
|
||||||
|
|
||||||
public int size() {
|
public int size() {
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue