Package java.util

Examples of java.util.Stack


    public TransactionRecoverImpl(TransactionManager txnManager) {
        this.txnManager = txnManager;
        //this.txnManager.setRecover(this);
        redoTable = new HashMap();
        redoStack = new Stack();
        stacks = 0;
    }
View Full Code Here


            logger.fatal("Failed in saveStack of recovery process: lsn = " + lsn.toString() + ".  System will in inconsistant state");
            logger.fatal("recover failed because disk is full ");
            System.exit(-1);

        }
        redoStack = new Stack();
    }
View Full Code Here

    Integer status=(Integer)statusStack.peek();
    return status.intValue();
  }
 
  public Object parse(Reader in) throws Exception{
    Stack statusStack=new Stack();
    Stack valueStack=new Stack();
    Yylex lexer=new Yylex(in);
    Yytoken token=null;
    int status=S_INIT;
   
    try{
      do{
        token=lexer.yylex();
        if(token==null)
          token=new Yytoken(Yytoken.TYPE_EOF,null);
        switch(status){
        case S_INIT:
          switch(token.type){
          case Yytoken.TYPE_VALUE:
            status=S_IN_FINISHED_VALUE;
            statusStack.push(new Integer(status));
            valueStack.push(token.value);
            break;
          case Yytoken.TYPE_LEFT_BRACE:
            status=S_IN_OBJECT;
            statusStack.push(new Integer(status));
            valueStack.push(new JSONObject());
            break;
          case Yytoken.TYPE_LEFT_SQUARE:
            status=S_IN_ARRAY;
            statusStack.push(new Integer(status));
            valueStack.push(new JSONArray());
            break;
          default:
            status=S_IN_ERROR;
          }//inner switch
          break;
         
        case S_IN_FINISHED_VALUE:
          if(token.type==Yytoken.TYPE_EOF)
            return valueStack.pop();
          else
            return null;
         
        case S_IN_OBJECT:
          switch(token.type){
          case Yytoken.TYPE_COMMA:
            break;
          case Yytoken.TYPE_VALUE:
            if(token.value instanceof String){
              String key=(String)token.value;
              valueStack.push(key);
              status=S_PASSED_PAIR_KEY;
              statusStack.push(new Integer(status));
            }
            else{
              status=S_IN_ERROR;
            }
            break;
          case Yytoken.TYPE_RIGHT_BRACE:
            if(valueStack.size()>1){
              statusStack.pop();
              JSONObject map = (JSONObject)valueStack.pop();
              map.compactify(-0.9f);
              status=peekStatus(statusStack);
            }
            else{
              status=S_IN_FINISHED_VALUE;
            }
            break;
          default:
            status=S_IN_ERROR;
            break;
          }//inner switch
          break;
         
        case S_PASSED_PAIR_KEY:
          switch(token.type){
          case Yytoken.TYPE_COLON:
            break;
          case Yytoken.TYPE_VALUE:
            statusStack.pop();
            String key=(String)valueStack.pop();
            JSONObject parent=(JSONObject)valueStack.peek();
            parent.put(key,token.value);
            status=peekStatus(statusStack);
            break;
          case Yytoken.TYPE_LEFT_SQUARE:
            statusStack.pop();
            key=(String)valueStack.pop();
            parent=(JSONObject)valueStack.peek();
            JSONArray newArray=new JSONArray();
            parent.put(key,newArray);
            status=S_IN_ARRAY;
            statusStack.push(new Integer(status));
            valueStack.push(newArray);
            break;
          case Yytoken.TYPE_LEFT_BRACE:
            statusStack.pop();
            key=(String)valueStack.pop();
            parent=(JSONObject)valueStack.peek();
            JSONObject newObject=new JSONObject();
            parent.put(key,newObject);
            status=S_IN_OBJECT;
            statusStack.push(new Integer(status));
            valueStack.push(newObject);
            break;
          default:
            status=S_IN_ERROR;
          }
          break;
         
        case S_IN_ARRAY:
          switch(token.type){
          case Yytoken.TYPE_COMMA:
            break;
          case Yytoken.TYPE_VALUE:
            JSONArray val=(JSONArray)valueStack.peek();
            val.add(token.value);
            break;
          case Yytoken.TYPE_RIGHT_SQUARE:
            if(valueStack.size()>1){
              statusStack.pop();
              valueStack.pop();
              status=peekStatus(statusStack);
            }
            else{
              status=S_IN_FINISHED_VALUE;
            }
            break;
          case Yytoken.TYPE_LEFT_BRACE:
            val=(JSONArray)valueStack.peek();
            JSONObject newObject=new JSONObject();
            val.add(newObject);
            status=S_IN_OBJECT;
            statusStack.push(new Integer(status));
            valueStack.push(newObject);
            break;
          case Yytoken.TYPE_LEFT_SQUARE:
            val=(JSONArray)valueStack.peek();
            JSONArray newArray=new JSONArray();
            val.add(newArray);
            status=S_IN_ARRAY;
            statusStack.push(new Integer(status));
            valueStack.push(newArray);
            break;
          default:
            status=S_IN_ERROR;
          }//inner switch
          break;
View Full Code Here

        handlerPipeline.addHandler(handler1);
        handlerPipeline.addHandler(handler2);
        context.setInPipeline(handlerPipeline);
       
        handlerPipeline.invoke(context);
        Stack invoked = (Stack) context.getProperty(handlerPipeline.toString());
       
        assertTrue(handler1.isInvoked());
        assertTrue(invoked.contains(handler1));
        assertFalse(handler2.isInvoked());
        assertFalse(invoked.contains(handler2));
       
        context.getCurrentPipeline().resume(context);
       
        assertTrue(handler1.isInvoked());
        assertTrue(invoked.contains(handler1));
        assertTrue(handler2.isInvoked());
        assertTrue(invoked.contains(handler2));
    }
View Full Code Here

  public HTMLSheetInformationViewer(Frame parent, HTMLSheetInformation sid) {
    super(parent, sid.getTitle(), false);
   
    this.sid = sid;
   
    backward = new Stack();
    forward = new Stack();


    // Create html viewer
    viewer = new AntiAliasedTextPane();
    JScrollPane scrollPane = new JScrollPane(viewer);
View Full Code Here


    public HelpViewer(Frame parent, String title) {
        super(parent, title, false);

        backward = new Stack();
        forward = new Stack();


        // Create help page viewer
        viewer = new AntiAliasedTextPane();
        JScrollPane scrollPane = new JScrollPane(viewer);
View Full Code Here

   */
  protected Object wizardObject;
 
  public WizardManager(){
    currentPage=null;
    pageHistory = new Stack();
    settings = new HashMap();
    wizardObject = null;
  }
View Full Code Here

     *            true if inner frames created will be closable
     */
    public DesktopCardPanel(boolean scrollable, boolean closable) {
        super(new BorderLayout());

        backwardStack = new Stack();
        forwardStack = new Stack();
       
        _scrollable = scrollable;
        _closable = closable;

        createCardPopupMenu();
View Full Code Here

    void initializeStreams ()
    {
        mStdIn = new BufferedReader(new InputStreamReader(System.in));
        mIn = mStdIn;
        mInStack = new Stack();
    }
View Full Code Here

    }

    try { oBugs.store(oConn, oBug.getClass(), true); }
    catch (java.lang.InstantiationException ignore) { /* never thrown*/ }

    Stack oPending = new Stack();

    int iChilds = oChilds.load(oConn, aChild);

    if (DebugFile.trace) DebugFile.writeln(String.valueOf(iChilds) + " childs loaded for " + getString(DB.gu_project));

    for (int c=0; c<iChilds;c++) oPending.push(oChilds.get(0,c));

    while (!oPending.empty()) {
      aChild[0] = oPending.pop();

      iChilds = oChilds.load(oConn, aChild);

      if (DebugFile.trace) DebugFile.writeln(String.valueOf(iChilds) + " childs loaded for " + aChild[0]);

      oProj = new Project(oConn, (String) aChild[0]);
      oProj.replace(DB.gu_project, Gadgets.generateUUID());
      if (oSubProjMap.containsKey(oProj.get(DB.id_parent)))
        oProj.replace(DB.id_parent, oSubProjMap.get(oProj.get(DB.id_parent)));
      oProj.store(oConn);

      iDuties = oDuties.load (oConn, new Object[]{oProj.get(DB.gu_project)});

      if (DebugFile.trace) DebugFile.writeln(String.valueOf(iDuties) + " duties loaded for " + oProj.getString(DB.gu_project));

      for (int d=0; d<iDuties; d++) {
        oDuties.setElementAt(Gadgets.generateUUID(), 0, d);
        oDuties.setElementAt(oProj.get(DB.gu_project), 2, d);
      }

      try {
        oDuties.store(oConn, oDuty.getClass(), true);
      }
      catch (java.lang.InstantiationException ignore) { /* never thrown*/ }

      iBugs = oBugs.load (oConn, new Object[]{oProj.get(DB.gu_project)});

      if (DebugFile.trace) DebugFile.writeln(String.valueOf(iBugs) + " bugs loaded for " + oProj.getString(DB.gu_project));

      for (int b=0; b<iBugs; b++) {
        oBugs.setElementAt(Gadgets.generateUUID(), 0, b);
        oBugs.setElementAt(oProj.get(DB.gu_project), 3, b);
      }

      try {
        oBugs.store(oConn, oBug.getClass(), true);
      }
      catch (java.lang.InstantiationException ignore) { /* never thrown*/ }

      oSubProjMap.put (aChild[0], oProj.getString(DB.gu_project));

      for (int c=0; c<iChilds;c++)
        oPending.push(oChilds.get(0,c));
    } // wend

    // Re-expandir todos los hijos del padre absoluto del clon
    oProj = new Project((String) oSubProjMap.get(get(DB.gu_project)));
    String sTopParent = oProj.topParent(oConn);
View Full Code Here

TOP

Related Classes of java.util.Stack

Copyright © 2018 www.massapicom. 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.