Examples of FastStack


Examples of com.exigen.ie.tools.FastStack

/**
  * Constructor with given undo stack.
  */
  public GoalStack(UndoStack undoStack)
  {
    init(new FastStack(), undoStack);
  }
View Full Code Here

Examples of com.sun.enterprise.util.collection.FastStack

      
      long now = _clock.getTime();
      long allowed = now - maxIdleTime;
      
       TimeStampedSoftDListNode tsNode = null;
       FastStack stack = new FastStack();
      
       synchronized (super.collection) {

         Object done = null;
         while (done == null) {
           tsNode = (TimeStampedSoftDListNode) list.getFirstDListNode();
          
           if (tsNode == null) {  //Empty list
             done = new Object();
           } else if (tsNode.timeStamp <= allowed) {
            //Need to destroy the contained object
            list.delink(tsNode);
            stack.push(tsNode.object);
            killedCount++;
          } else {
            //This node is not old enough
             done = new Object();
          }
        }  //End of for loop
       
        super.createdCount -= killedCount;
       
        int deficit = list.size() - minSize;
        super.preload(0 - deficit);
       
        if (killedCount == 0) {
        } else if (killedCount == 1) {
          collection.notify();
        } else {
          collection.notifyAll();
        }
       
      } // end of synchronized
     
     
      //Now destroy all collected objects
      while (! stack.isEmpty()) {
        Object object = stack.pop();
      beforeDestroy(object);
         factory.destroy(object);
      }
     
//Bug 4677074      System.out.println("Leaving service after killing " + killedCount + " (idle) objects. Now size: " + list.size());
View Full Code Here

Examples of com.sun.enterprise.util.collection.FastStack

      
      long now = _clock.getTime();
      long allowed = now - maxIdleTime;
      
       TimeStampedDListNode tsNode = null;
       FastStack stack = new FastStack();
      
       synchronized (super.collection) {
         Object done = null;
         while (done == null) {
           tsNode = (TimeStampedDListNode) list.getFirstDListNode();
          
           if (tsNode == null) {  //Empty list
             done = new Object();
           } else if (tsNode.timeStamp <= allowed) {
            //Need to destroy the contained object
            list.delink(tsNode);
            stack.push(tsNode.object);
            killedCount++;
          } else {
            //This node is not old enough
             done = new Object();
          }
        }  //End of for loop
       
        super.createdCount -= killedCount;
       
        if (createdCount < minSize) {
          super.preload(minSize - createdCount);
        }
       
        if (waitCount > 0) {
          if (killedCount == 1) {
            collection.notify();
          } else {
            collection.notifyAll();
          }
        }
       
      } // end of synchronized
     
     
      //Now destroy all collected objects
      while (! stack.isEmpty()) {
        Object object = stack.pop();
      beforeDestroy(object);
         factory.destroy(object);
      }
     
//Bug 4677074      System.out.println("Leaving service after killing " + killedCount + " (idle) objects. Now size: " + list.size());
View Full Code Here

Examples of com.thoughtworks.xstream.core.util.FastStack

     * @since 1.4
     */
    public Dom4JXmlWriter(XMLWriter writer, NameCoder nameCoder) {
        super(nameCoder);
        this.writer = writer;
        this.elementStack = new FastStack(16);
        this.attributes = new AttributesImpl();
        try {
            writer.startDocument();
        } catch (SAXException e) {
            throw new StreamException(e);
View Full Code Here

Examples of com.thoughtworks.xstream.core.util.FastStack

        }
        return minLength;
    }

    public Path apply(Path relativePath) {
        FastStack absoluteStack = new FastStack(16);

        for (int i = 0; i < chunks.length; i++) {
            absoluteStack.push(chunks[i]);
        }

        for (int i = 0; i < relativePath.chunks.length; i++) {
            String relativeChunk = relativePath.chunks[i];
            if (relativeChunk.equals("..")) {
                absoluteStack.pop();
            } else if (!relativeChunk.equals(".")) {
                absoluteStack.push(relativeChunk);
            }
        }

        String[] result = new String[absoluteStack.size()];
        for (int i = 0; i < result.length; i++) {
            result[i] = (String) absoluteStack.get(i);
        }

        return new Path(result);
    }
View Full Code Here

Examples of com.thoughtworks.xstream.core.util.FastStack

     * @param wrapped the wrapped writer
     * @since 1.2
     */
    public StatefulWriter(final HierarchicalStreamWriter wrapped) {
        super(wrapped);
        attributes = new FastStack(16);
    }
View Full Code Here

Examples of com.thoughtworks.xstream.core.util.FastStack

    public int state() {
        return state;
    }

    private Object readResolve() {
        attributes = new FastStack(16);
        return this;
    }
View Full Code Here

Examples of com.thoughtworks.xstream.core.util.FastStack

        }
        return minLength;
    }

    public Path apply(Path relativePath) {
        FastStack absoluteStack = new FastStack(16);

        for (int i = 0; i < chunks.length; i++) {
            absoluteStack.push(chunks[i]);
        }

        for (int i = 0; i < relativePath.chunks.length; i++) {
            String relativeChunk = relativePath.chunks[i];
            if (relativeChunk.equals("..")) {
                absoluteStack.pop();
            } else if (!relativeChunk.equals(".")) {
                absoluteStack.push(relativeChunk);
            }
        }

        String[] result = new String[absoluteStack.size()];
        for (int i = 0; i < result.length; i++) {
            result[i] = (String) absoluteStack.get(i);
        }

        return new Path(result);
    }
View Full Code Here

Examples of com.thoughtworks.xstream.core.util.FastStack

     * @since 1.2
     */
    public Dom4JWriter(XMLWriter writer, XmlFriendlyReplacer replacer) {
        super(replacer);
        this.writer = writer;
        this.elementStack = new FastStack(16);
        this.attributes = new AttributesImpl();
        try {
            writer.startDocument();
        } catch (SAXException e) {
            throw new StreamException(e);
View Full Code Here

Examples of net.buffalo.protocal.util.FastStack

  private QuickWriter writer;
  private FastStack stack;
  private int depth=0;
  public FastStreamWriter(Writer out) {
    this.writer = new QuickWriter(out);
    stack = new FastStack(5);
  }
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.