Package java.util

Examples of java.util.LinkedList.removeFirst()


    public Object pop() {
        LinkedList linkedList = ((LinkedList) threadLocal.get());
        if (linkedList.isEmpty()) {
            return null;
        }
        return linkedList.removeFirst();
    }

    public Object peek() {
        LinkedList linkedList = ((LinkedList) threadLocal.get());
        if (linkedList.isEmpty()) {
View Full Code Here


            // Check the job queue.
            synchronized(jobQueue) {
                if(jobQueue.size() > 0) {
                    // Remove the first job.
                    dequeuedObject = jobQueue.removeFirst();
                } else {
                    try {
                        // Wait for a notify() on the queue.
                        jobQueue.wait();
                        continue;
View Full Code Here

            // Check the job queue.
            synchronized(jobQueue) {
                if(jobQueue.size() > 0) {
                    // Remove the first job.
                    dequeuedObject = jobQueue.removeFirst();
                } else {
                    try {
                        // Wait for a notify() on the queue.
                        jobQueue.wait();
                        continue;
View Full Code Here

                  !m_suspended && i >= 0; --i )
            {
                final LinkedList queue = m_priorityQueues[i];
                synchronized ( queue ) {
                    if ( !queue.isEmpty() ) {
                        runnable = (Runnable)queue.removeFirst();
                        break;
                    }
                }
            }
View Full Code Here

    public void popPrefixMapping(String prefix) {
        LinkedList stack = (LinkedList) xmlPrefixMapper.get(prefix);
        if (stack == null || stack.size() == 0) {
            // XXX throw new Exception("XXX");
        }
        stack.removeFirst();
    }

    /*
     * Returns the URI to which the given prefix maps.
     *
 
View Full Code Here

      LinkedList msgs = state.getASFMessages();
     
      while (msgs.size() > 0)
      {
         AsfMessageHolder holder = (AsfMessageHolder)msgs.removeFirst();

         if (trace) { log.trace("sending " + holder.msg + " to the message listener" ); }

         ClientConsumer.callOnMessageStatic(del, state.getDistinguishedListener(), holder.consumerID,
                                              holder.queueName, false,
View Full Code Here

                }

            // deletes can result in UPDATE or DELETE events
            } else if(changeType == ListEvent.DELETE) {
                // figure out if we deleted a UNIQUE or DUPLICATE or UNIQUE_WITH_DUPLICATE
                final Object deleted = removedValues.removeFirst();

                // get the index of the element removed from the source list
                final int sourceDeletedIndex = deleted == DUPLICATE ? changeIndex - 1 : changeIndex;

                // determine the index of the GroupList the removal impacts
View Full Code Here

        if (queue != null)
        {
            while (!queue.isEmpty())
            {
                searchClass = (Class) queue.removeFirst();

                result = registrations.get(searchClass);
                if (result != null)
                    return result;
View Full Code Here

    public Object pop() {
        LinkedList linkedList = ((LinkedList) threadLocal.get());
        if (linkedList.isEmpty()) {
            return null;
        }
        return linkedList.removeFirst();
    }

    public Object peek() {
        LinkedList linkedList = ((LinkedList) threadLocal.get());
        if (linkedList.isEmpty()) {
View Full Code Here

        classPath.clear();

        LinkedList locationStack = new LinkedList(urls);
        try {
            while (!locationStack.isEmpty()) {
                URL url = (URL) locationStack.removeFirst();

                // Skip any duplicate urls in the claspath
                if (classPath.containsKey(url)) {
                    continue;
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.