Your browser does not support JavaScript and this site utilizes JavaScript to build content and provide links to additional information. You should either enable JavaScript in your browser settings or use a browser that supports JavaScript in order to take full advantage of this site.
1 50 package org.apache.avalon.excalibur.collections; 51 52 import java.util.NoSuchElementException ; 53 54 65 public final class SynchronizedPriorityQueue 66 implements PriorityQueue 67 { 68 private final PriorityQueue m_priorityQueue; 69 70 public SynchronizedPriorityQueue( final PriorityQueue priorityQueue ) 71 { 72 m_priorityQueue = priorityQueue; 73 } 74 75 78 public void clear() 79 { 80 synchronized( m_priorityQueue ) 81 { 82 m_priorityQueue.clear(); 83 } 84 } 85 86 91 public boolean isEmpty() 92 { 93 synchronized( m_priorityQueue ) 94 { 95 return m_priorityQueue.isEmpty(); 96 } 97 } 98 99 104 public void insert( final Object element ) 105 { 106 synchronized( m_priorityQueue ) 107 { 108 m_priorityQueue.insert( element ); 109 } 110 } 111 112 118 public Object peek() throws NoSuchElementException  119 { 120 synchronized( m_priorityQueue ) 121 { 122 return m_priorityQueue.peek(); 123 } 124 } 125 126 132 public Object pop() throws NoSuchElementException  133 { 134 synchronized( m_priorityQueue ) 135 { 136 return m_priorityQueue.pop(); 137 } 138 } 139 140 public String toString() 141 { 142 synchronized( m_priorityQueue ) 143 { 144 return m_priorityQueue.toString(); 145 } 146 } 147 } 148 149
| Popular Tags
|