Exemplo n.º 1
0
  void IRtscProductTemplate$$SINGLETONS() {
    Proto.Obj po;
    Value.Obj vo;

    vo = (Value.Obj) om.findStrict("xdc.tools.IRtscProductTemplate", "xdc.tools");
    po = (Proto.Obj) om.findStrict("xdc.tools.IRtscProductTemplate.Module", "xdc.tools");
    vo.init2(po, "xdc.tools.IRtscProductTemplate", $$DEFAULT, false);
    vo.bind("Module", po);
    vo.bind("$category", "Interface");
    vo.bind("$capsule", $$UNDEF);
    vo.bind("$package", om.findStrict("xdc.tools", "xdc.tools"));
    tdefs.clear();
    proxies.clear();
    inherits.clear();
    vo.bind(
        "TemplateInfo", om.findStrict("xdc.tools.IRtscProductTemplate.TemplateInfo", "xdc.tools"));
    tdefs.add(om.findStrict("xdc.tools.IRtscProductTemplate.TemplateInfo", "xdc.tools"));
    vo.bind("$$tdefs", Global.newArray(tdefs.toArray()));
    vo.bind("$$proxies", Global.newArray(proxies.toArray()));
    vo.bind("$$inherits", Global.newArray(inherits.toArray()));
    ((Value.Arr) pkgV.getv("$interfaces")).add(vo);
    pkgV.bind("IRtscProductTemplate", vo);
    ((Value.Arr) pkgV.getv("$unitNames")).add("IRtscProductTemplate");
    vo.seal(null);
  }
Exemplo n.º 2
0
  public ArrayList<String> getMoveList() {
    moveList.clear();
    if (piece == 0) {
      setListForKing();
    }
    if (piece == 1) {
      setListForQueen();
    }
    if (piece == 2) {
      moveList.clear();
      squareList.clear();
      setListForRook();
    }
    if (piece == 3) {
      setListForKnight();
    }
    if (piece == 4) {
      setListForBishop();
    }
    if (piece == 5) {
      setAttacksForPawn();
    }

    return moveList;
  }
Exemplo n.º 3
0
  void ICmd$$SINGLETONS() {
    Proto.Obj po;
    Value.Obj vo;

    vo = (Value.Obj) om.findStrict("xdc.tools.ICmd", "xdc.tools");
    po = (Proto.Obj) om.findStrict("xdc.tools.ICmd.Module", "xdc.tools");
    vo.init2(po, "xdc.tools.ICmd", $$DEFAULT, false);
    vo.bind("Module", po);
    vo.bind("$category", "Interface");
    vo.bind("$capsule", om.findStrict("xdc.tools.ICmd$$capsule", "xdc.tools"));
    vo.bind("Instance", om.findStrict("xdc.tools.ICmd.Instance", "xdc.tools"));
    vo.bind("Params", om.findStrict("xdc.tools.ICmd.Params", "xdc.tools"));
    vo.bind(
        "PARAMS", ((Proto.Str) om.findStrict("xdc.tools.ICmd.Params", "xdc.tools")).newInstance());
    vo.bind("$package", om.findStrict("xdc.tools", "xdc.tools"));
    tdefs.clear();
    proxies.clear();
    inherits.clear();
    vo.bind("$$tdefs", Global.newArray(tdefs.toArray()));
    vo.bind("$$proxies", Global.newArray(proxies.toArray()));
    vo.bind("$$inherits", Global.newArray(inherits.toArray()));
    ((Value.Arr) pkgV.getv("$interfaces")).add(vo);
    pkgV.bind("ICmd", vo);
    ((Value.Arr) pkgV.getv("$unitNames")).add("ICmd");
    vo.seal(null);
  }
  /** Alarm listener. */
  @Override
  public void handleAlarm(Alarm alarm) {
    if (!_lifecycle.isActive()) return;

    try {
      _alarmConnections.clear();

      synchronized (_connectionPool) {
        _alarmConnections.addAll(_connectionPool);
      }

      for (int i = _alarmConnections.size() - 1; i >= 0; i--) {
        ManagedPoolItem item = _alarmConnections.get(i);

        if (!item.isValid()) item.destroy();
      }

      _alarmConnections.clear();

      fillIdlePool();
    } finally {
      if (!_lifecycle.isActive()) {
      } else if (0 < _idleTimeout && _idleTimeout < 1000) _alarm.queue(1000);
      else if (1000 < _idleTimeout && _idleTimeout < 60000) _alarm.queue(_idleTimeout);
      else _alarm.queue(60000);
    }
  }
Exemplo n.º 5
0
  /*
  	-- This is a helper methid to run the morph files
  */
  private static void runMorphDataSet() throws Exception {

    String morph_directory =
        "../../thesis-datasets/morph/"; // directory where all the morph code is stored
    File d = new File(morph_directory);
    // get all the files from a directory
    File[] fList = d.listFiles();
    List<String> dir_list = new ArrayList<String>();
    for (File file : fList) {
      if (file.isDirectory()) {
        dir_list.add(file.getName());
      }
    }
    for (String dir : dir_list) {
      directory = morph_directory + dir + "/";
      System.out.println("Running TDDD " + directory);
      ReadFile.readFile(directory, fileList); // read the two files
      System.out.println(fileList.get(0) + " " + fileList.get(1));
      preliminaryStep(directory);
      startCDC();
      fileList.clear();
      fileArray.clear();
      hashed_File_List.clear();
    }
  }
Exemplo n.º 6
0
 public void mOnClick(View v) {
   switch (v.getId()) {
     case R.id.btn3:
       mItem.clear();
       for (int i = 1001; i <= 1003; i++) {
         mItem.add(Integer.toString(i));
       }
       mAdapter.notifyDataSetChanged();
       break;
     case R.id.btn10:
       mItem.clear();
       for (int i = 1001; i <= 1010; i++) {
         mItem.add(Integer.toString(i));
       }
       mAdapter.notifyDataSetChanged();
       break;
     case R.id.btnalways:
       mList.setOverScrollMode(View.OVER_SCROLL_ALWAYS);
       break;
     case R.id.btnnever:
       mList.setOverScrollMode(View.OVER_SCROLL_NEVER);
       break;
     case R.id.btnifscroll:
       mList.setOverScrollMode(View.OVER_SCROLL_IF_CONTENT_SCROLLS);
       break;
   }
 }
 public static void main(String args[]) {
   BufferedReader br = null;
   try {
     String cLine[];
     br = new BufferedReader(new FileReader("graph.txt"));
     int nodeNum = Integer.parseInt(br.readLine());
     int edgeNum = Integer.parseInt(br.readLine());
     // Initialize the vertices
     for (int i = 0; i < nodeNum; i++) {
       edges.add(new ArrayList<Integer>());
       reversedEdges.add(new ArrayList<Integer>());
     }
     // Verify our amounts are correct
     System.out.println("We have " + nodeNum + " vertices and " + edgeNum + " edges");
     // Read in the edges and put them into the array
     for (int i = 0; i < edgeNum; i++) {
       String line = br.readLine();
       // line = line.substring(1);
       // System.out.println(line);
       cLine = line.split("\\s+");
       int n1 = Integer.parseInt(cLine[0]);
       int n2 = Integer.parseInt(cLine[1]);
       // Add the newly created edge to edges and reversedEdges
       edges.get(n1).add(n2);
       reversedEdges.get(n2).add(n1);
       // System.out.println("Reading in line "+i);
     }
     // Run Depth First Order in numerical order on the reversed digraph
     for (int i = 0; i < nodeNum; i++) {
       depthFirstOrder(i);
     }
     // Reverse the node ordering ArrayList Obtained
     Collections.reverse(nodeOrdering);
     // for(int i:nodeOrdering){System.out.print(i+" ");}
     System.out.println("");
     // Clear visited since it will be used again for DFS
     visitedNodes.clear();
     int count = 1;
     // Now we can DFS based on the Reverse Post Order of the Reversed Di-Graph
     for (int i : nodeOrdering) {
       // Don't want to redo a kernel that we've already visited so we need to make sure that
       // anything already visited won't be visited again
       if (!visitedNodes.contains(i)) {
         // Call DFS from the next unchecked node in the reverse Post Order node list
         depthFirstSearch(i);
         System.out.print("Kernel #" + count + " contains nodes: ");
         for (int j : kernel) {
           System.out.print(j + " ");
         }
         System.out.print("\n");
         count++;
         // Clear the kernel so we can build it again in the next iteration
         kernel.clear();
       }
     }
   } catch (IOException e) {
     System.out.println("IO ERROR: Check Input and Program");
   }
 }
Exemplo n.º 8
0
  /** Enl�ve toutes les formes et redessine */
  public void clear() {

    shapes.clear();
    shapeSelect.clear();
    cpt = 0;
    this.repaint();
    notifyObservers();
  }
Exemplo n.º 9
0
 private void cleanUp() {
   // costs.removeAll(fakeCosts);
   // segments.removeAll(fakeSegments);
   fakeCosts.clear();
   fakeSegments.clear();
   fakeNodes.clear();
   nextSegId = Long.MIN_VALUE;
 }
Exemplo n.º 10
0
  void Platform$$SINGLETONS() {
    Proto.Obj po;
    Value.Obj vo;

    vo = (Value.Obj) om.findStrict("ti.platforms.evm6424.Platform", "ti.platforms.evm6424");
    po = (Proto.Obj) om.findStrict("ti.platforms.evm6424.Platform.Module", "ti.platforms.evm6424");
    vo.init2(po, "ti.platforms.evm6424.Platform", $$DEFAULT, false);
    vo.bind("Module", po);
    vo.bind("$category", "Module");
    vo.bind(
        "$capsule",
        om.findStrict("ti.platforms.evm6424.Platform$$capsule", "ti.platforms.evm6424"));
    vo.bind(
        "Instance",
        om.findStrict("ti.platforms.evm6424.Platform.Instance", "ti.platforms.evm6424"));
    vo.bind(
        "Params", om.findStrict("ti.platforms.evm6424.Platform.Params", "ti.platforms.evm6424"));
    vo.bind(
        "PARAMS",
        ((Proto.Str) om.findStrict("ti.platforms.evm6424.Platform.Params", "ti.platforms.evm6424"))
            .newInstance());
    vo.bind("$package", om.findStrict("ti.platforms.evm6424", "ti.platforms.evm6424"));
    tdefs.clear();
    proxies.clear();
    mcfgs.clear();
    vo.bind("Board", om.findStrict("xdc.platform.IPlatform.Board", "ti.platforms.evm6424"));
    tdefs.add(om.findStrict("xdc.platform.IPlatform.Board", "ti.platforms.evm6424"));
    vo.bind("Memory", om.findStrict("xdc.platform.IPlatform.Memory", "ti.platforms.evm6424"));
    tdefs.add(om.findStrict("xdc.platform.IPlatform.Memory", "ti.platforms.evm6424"));
    vo.bind("MemoryMap", om.findStrict("xdc.platform.IPlatform.MemoryMap", "ti.platforms.evm6424"));
    vo.bind("$$tdefs", Global.newArray(tdefs.toArray()));
    vo.bind("$$proxies", Global.newArray(proxies.toArray()));
    vo.bind("$$mcfgs", Global.newArray(mcfgs.toArray()));
    ((Value.Arr) pkgV.getv("$modules")).add(vo);
    ((Value.Arr) om.findStrict("$modules", "ti.platforms.evm6424")).add(vo);
    vo.bind("$$instflag", 1);
    vo.bind("$$iobjflag", 1);
    vo.bind("$$sizeflag", 1);
    vo.bind("$$dlgflag", 0);
    vo.bind("$$iflag", 1);
    vo.bind("$$romcfgs", "|");
    Proto.Str ps = (Proto.Str) vo.find("Module_State");
    if (ps != null) vo.bind("$object", ps.newInstance());
    vo.bind(
        "$$meta_iobj", om.has("ti.platforms.evm6424.Platform$$instance$static$init", null) ? 1 : 0);
    vo.bind("$$fxntab", Global.newArray());
    vo.bind("$$logEvtCfgs", Global.newArray());
    vo.bind("$$errorDescCfgs", Global.newArray());
    vo.bind("$$assertDescCfgs", Global.newArray());
    Value.Map atmap = (Value.Map) vo.getv("$attr");
    atmap.seal("length");
    vo.bind(
        "Object", om.findStrict("ti.platforms.evm6424.Platform.Object", "ti.platforms.evm6424"));
    pkgV.bind("Platform", vo);
    ((Value.Arr) pkgV.getv("$unitNames")).add("Platform");
  }
Exemplo n.º 11
0
  public void playScum() // main method to play one round of scum
      {
    setupRound(); // init round

    while (!isDone()) // while the game is going
    {
      ArrayList<ScumCard> move = new ArrayList<ScumCard>(); // the players choice for a move
      if (discardPile.size() == 0) // if the discard pile is empty
      {
        while (players.get(currentPlayer).isDone()) // finds the first avalible player
        currentPlayer = (currentPlayer + 1) % players.size();
        do {
          move = players.get(currentPlayer).getMove(0);
          // System.err.println(move);
        } while (!isValid(move)
            || move == null); // keep asking for moves until a valid move is played (no skipping)
        numCardsPlay = move.size(); // sets up how many cards each person should play in this round
      } else // if the discard pile is not empty
      {
        do move = players.get(currentPlayer).getMove(numCardsPlay); // gets a move from the player
        while (!isValid(move)); // checks if it is valid
      }

      if (move == null) // if the player is skipping
      {
        skippedPlayers++; // increment the skipping counter
        if (skippedPlayers >= players.size() - 1) // if all the players have skipped
        {
          lastMove.clear(); // clear the last move
          clearDiscard(); // clear the discard pile
        }
      } else // if not skipping
      {
        skippedPlayers = 0; // reset the skip counter
        lastMove.clear(); // reset the last move variable
        for (ScumCard c : move) // for each card:
        {
          lastMove.add(c); // add to the last move
          discardPile.add(c); // add the card to the discard pile
          players.get(currentPlayer).removeCard(c); // remove the card from the player's hand
        }

        if (players.get(currentPlayer).isDone()) // if the player is done
        setRank(players.get(currentPlayer)); // set their rank

        if (move.get(0).getRank() == 12) {
          lastMove.clear();
          clearDiscard();
          currentPlayer--;
        }
      }
      currentPlayer = (currentPlayer + 1) % players.size(); // increment the players
    }
  }
Exemplo n.º 12
0
  @SuppressWarnings("unchecked")
  public void resetElements(
      T[] elements,
      final @Nullable Comparator<T> sortComparator,
      final boolean restoreSelectedElements) {
    final List<T> selectedElements =
        restoreSelectedElements && mySelectedElements != null
            ? new ArrayList<T>(mySelectedElements)
            : null;
    myElements = elements;
    if (sortComparator != null) {
      myComparator = new ElementNodeComparatorWrapper(sortComparator);
    }
    mySelectedNodes.clear();
    myNodeToParentMap.clear();
    myElementToNodeMap.clear();
    myContainerNodes.clear();

    ApplicationManager.getApplication()
        .runReadAction(
            new Runnable() {
              @Override
              public void run() {
                myTreeModel = buildModel();
              }
            });

    myTree.setModel(myTreeModel);
    myTree.setRootVisible(false);

    restoreTree();

    if (myOptionControls == null) {
      myCopyJavadocCheckbox = new NonFocusableCheckBox(IdeBundle.message("checkbox.copy.javadoc"));
      if (myIsInsertOverrideVisible) {
        myInsertOverrideAnnotationCheckbox =
            new NonFocusableCheckBox(IdeBundle.message("checkbox.insert.at.override"));
        myOptionControls =
            new JCheckBox[] {myCopyJavadocCheckbox, myInsertOverrideAnnotationCheckbox};
      } else {
        myOptionControls = new JCheckBox[] {myCopyJavadocCheckbox};
      }
    }

    myTree.doLayout();
    setOKActionEnabled(myElements != null && myElements.length > 0);

    if (selectedElements != null) {
      selectElements(selectedElements.toArray(new ClassMember[selectedElements.size()]));
    }
    if (mySelectedElements == null || mySelectedElements.isEmpty()) {
      expandFirst();
    }
  }
Exemplo n.º 13
0
 private void clearPanel() {
   tabbedPane.removeAll();
   tabbedToolPanel.removeAll();
   panes.clear();
   keys.clear();
   vpInfo.clear();
   toolList.clear();
   objList.clear();
   removeAllPushpinComp();
   for (int i = 0; i < nviews; i++) tp_paneInfo[i].clear();
 }
Exemplo n.º 14
0
 /** cleans up a connection by removing all user from all maintained lists */
 public void close() {
   error("Connection to server was lost");
   admin = false;
   users.clear();
   afks.clear();
   ignores.clear();
   admins.clear();
   channels.clear();
   cboChannels.removeAllItems();
   updateList();
 }
Exemplo n.º 15
0
 @Override
 public void clear() {
   if (null != dictionary && dictionary.isEditable()) {
     List<Word> copy = new ArrayList<Word>(this);
     super.clear();
     for (Word word : copy) {
       removeFromIndexWords(word);
     }
   } else {
     super.clear();
   }
 }
    public void createRenderables() {
      this.gridElements = new ArrayList<GridElement>();
      double gridStep = this.size / 10;
      Position p1, p2;
      ArrayList<Position> positions = new ArrayList<Position>();

      // South-North lines
      for (int i = 1; i <= 9; i++) {
        double easting = this.SWEasting + gridStep * i;
        positions.clear();
        p1 = computePosition(this.UTMZone, this.hemisphere, easting, SWNorthing);
        p2 = computePosition(this.UTMZone, this.hemisphere, easting, SWNorthing + this.size);
        if (this.isTruncated) {
          computeTruncatedSegment(p1, p2, this.UTMZoneSector, positions);
        } else {
          positions.add(p1);
          positions.add(p2);
        }
        if (positions.size() > 0) {
          p1 = positions.get(0);
          p2 = positions.get(1);
          Object polyline = createLineRenderable(positions, Polyline.GREAT_CIRCLE);
          Sector lineSector = Sector.boundingSector(p1, p2);
          GridElement ge = new GridElement(lineSector, polyline, GridElement.TYPE_LINE_EASTING);
          ge.setValue(easting);
          this.gridElements.add(ge);
        }
      }
      // West-East lines
      for (int i = 1; i <= 9; i++) {
        double northing = this.SWNorthing + gridStep * i;
        positions.clear();
        p1 = computePosition(this.UTMZone, this.hemisphere, SWEasting, northing);
        p2 = computePosition(this.UTMZone, this.hemisphere, SWEasting + this.size, northing);
        if (this.isTruncated) {
          computeTruncatedSegment(p1, p2, this.UTMZoneSector, positions);
        } else {
          positions.add(p1);
          positions.add(p2);
        }
        if (positions.size() > 0) {
          p1 = positions.get(0);
          p2 = positions.get(1);
          Object polyline = createLineRenderable(positions, Polyline.GREAT_CIRCLE);
          Sector lineSector = Sector.boundingSector(p1, p2);
          GridElement ge = new GridElement(lineSector, polyline, GridElement.TYPE_LINE_NORTHING);
          ge.setValue(northing);
          this.gridElements.add(ge);
        }
      }
    }
Exemplo n.º 17
0
  void Agent$$SINGLETONS() {
    Proto.Obj po;
    Value.Obj vo;

    vo = (Value.Obj) om.findStrict("ti.sysbios.rta.Agent", "ti.sysbios.rta");
    po = (Proto.Obj) om.findStrict("ti.sysbios.rta.Agent.Module", "ti.sysbios.rta");
    vo.init2(po, "ti.sysbios.rta.Agent", $$DEFAULT, false);
    vo.bind("Module", po);
    vo.bind("$category", "Module");
    vo.bind("$capsule", om.findStrict("ti.sysbios.rta.Agent$$capsule", "ti.sysbios.rta"));
    vo.bind("$package", om.findStrict("ti.sysbios.rta", "ti.sysbios.rta"));
    tdefs.clear();
    proxies.clear();
    mcfgs.clear();
    icfgs.clear();
    inherits.clear();
    vo.bind("Transport", om.findStrict("ti.sysbios.rta.Agent.Transport", "ti.sysbios.rta"));
    vo.bind(
        "Transport_RTDX", om.findStrict("ti.sysbios.rta.Agent.Transport_RTDX", "ti.sysbios.rta"));
    vo.bind(
        "Transport_STOP_MODE_ONLY",
        om.findStrict("ti.sysbios.rta.Agent.Transport_STOP_MODE_ONLY", "ti.sysbios.rta"));
    vo.bind(
        "Transport_USER", om.findStrict("ti.sysbios.rta.Agent.Transport_USER", "ti.sysbios.rta"));
    vo.bind("$$tdefs", Global.newArray(tdefs.toArray()));
    vo.bind("$$proxies", Global.newArray(proxies.toArray()));
    vo.bind("$$mcfgs", Global.newArray(mcfgs.toArray()));
    vo.bind("$$icfgs", Global.newArray(icfgs.toArray()));
    vo.bind("$$inherits", Global.newArray(inherits.toArray()));
    ((Value.Arr) pkgV.getv("$modules")).add(vo);
    ((Value.Arr) om.findStrict("$modules", "ti.sysbios.rta")).add(vo);
    vo.bind("$$instflag", 0);
    vo.bind("$$iobjflag", 1);
    vo.bind("$$sizeflag", 1);
    vo.bind("$$dlgflag", 0);
    vo.bind("$$iflag", 0);
    vo.bind("$$romcfgs", "|");
    vo.bind("$$nortsflag", 0);
    Proto.Str ps = (Proto.Str) vo.find("Module_State");
    if (ps != null) vo.bind("$object", ps.newInstance());
    vo.bind("$$meta_iobj", om.has("ti.sysbios.rta.Agent$$instance$static$init", null) ? 1 : 0);
    vo.bind("$$fxntab", Global.newArray());
    vo.bind("$$logEvtCfgs", Global.newArray());
    vo.bind("$$errorDescCfgs", Global.newArray());
    vo.bind("$$assertDescCfgs", Global.newArray());
    Value.Map atmap = (Value.Map) vo.getv("$attr");
    atmap.seal("length");
    pkgV.bind("Agent", vo);
    ((Value.Arr) pkgV.getv("$unitNames")).add("Agent");
  }
  void G711DEC$$SINGLETONS() {
    Proto.Obj po;
    Value.Obj vo;

    vo =
        (Value.Obj)
            om.findStrict(
                "ti.sdo.ce.examples.codecs.g711.G711DEC", "ti.sdo.ce.examples.codecs.g711");
    po =
        (Proto.Obj)
            om.findStrict(
                "ti.sdo.ce.examples.codecs.g711.G711DEC.Module", "ti.sdo.ce.examples.codecs.g711");
    vo.init2(po, "ti.sdo.ce.examples.codecs.g711.G711DEC", $$DEFAULT, false);
    vo.bind("Module", po);
    vo.bind("$category", "Module");
    vo.bind(
        "$capsule",
        om.findStrict(
            "ti.sdo.ce.examples.codecs.g711.G711DEC$$capsule", "ti.sdo.ce.examples.codecs.g711"));
    vo.bind(
        "$package",
        om.findStrict("ti.sdo.ce.examples.codecs.g711", "ti.sdo.ce.examples.codecs.g711"));
    tdefs.clear();
    proxies.clear();
    mcfgs.clear();
    vo.bind("$$tdefs", Global.newArray(tdefs.toArray()));
    vo.bind("$$proxies", Global.newArray(proxies.toArray()));
    vo.bind("$$mcfgs", Global.newArray(mcfgs.toArray()));
    ((Value.Arr) pkgV.getv("$modules")).add(vo);
    ((Value.Arr) om.findStrict("$modules", "ti.sdo.ce.examples.codecs.g711")).add(vo);
    vo.bind("$$instflag", 0);
    vo.bind("$$iobjflag", 1);
    vo.bind("$$sizeflag", 1);
    vo.bind("$$dlgflag", 0);
    vo.bind("$$iflag", 1);
    vo.bind("$$romcfgs", "|");
    Proto.Str ps = (Proto.Str) vo.find("Module_State");
    if (ps != null) vo.bind("$object", ps.newInstance());
    vo.bind(
        "$$meta_iobj",
        om.has("ti.sdo.ce.examples.codecs.g711.G711DEC$$instance$static$init", null) ? 1 : 0);
    vo.bind("$$fxntab", Global.newArray());
    vo.bind("$$logEvtCfgs", Global.newArray());
    vo.bind("$$errorDescCfgs", Global.newArray());
    vo.bind("$$assertDescCfgs", Global.newArray());
    Value.Map atmap = (Value.Map) vo.getv("$attr");
    atmap.seal("length");
    pkgV.bind("G711DEC", vo);
    ((Value.Arr) pkgV.getv("$unitNames")).add("G711DEC");
  }
Exemplo n.º 19
0
  void Cmdr$$SINGLETONS() {
    Proto.Obj po;
    Value.Obj vo;

    vo = (Value.Obj) om.findStrict("xdc.tools.Cmdr", "xdc.tools");
    po = (Proto.Obj) om.findStrict("xdc.tools.Cmdr.Module", "xdc.tools");
    vo.init2(po, "xdc.tools.Cmdr", $$DEFAULT, false);
    vo.bind("Module", po);
    vo.bind("$category", "Module");
    vo.bind("$capsule", om.findStrict("xdc.tools.Cmdr$$capsule", "xdc.tools"));
    vo.bind("Instance", om.findStrict("xdc.tools.Cmdr.Instance", "xdc.tools"));
    vo.bind("Params", om.findStrict("xdc.tools.Cmdr.Params", "xdc.tools"));
    vo.bind(
        "PARAMS", ((Proto.Str) om.findStrict("xdc.tools.Cmdr.Params", "xdc.tools")).newInstance());
    vo.bind("$package", om.findStrict("xdc.tools", "xdc.tools"));
    tdefs.clear();
    proxies.clear();
    mcfgs.clear();
    icfgs.clear();
    inherits.clear();
    vo.bind("Context", om.findStrict("xdc.tools.Cmdr.Context", "xdc.tools"));
    vo.bind("SHELL", om.findStrict("xdc.tools.Cmdr.SHELL", "xdc.tools"));
    vo.bind("SCRIPT", om.findStrict("xdc.tools.Cmdr.SCRIPT", "xdc.tools"));
    vo.bind("$$tdefs", Global.newArray(tdefs.toArray()));
    vo.bind("$$proxies", Global.newArray(proxies.toArray()));
    vo.bind("$$mcfgs", Global.newArray(mcfgs.toArray()));
    vo.bind("$$icfgs", Global.newArray(icfgs.toArray()));
    vo.bind("$$inherits", Global.newArray(inherits.toArray()));
    ((Value.Arr) pkgV.getv("$modules")).add(vo);
    ((Value.Arr) om.findStrict("$modules", "xdc.tools")).add(vo);
    vo.bind("$$instflag", 1);
    vo.bind("$$iobjflag", 1);
    vo.bind("$$sizeflag", 1);
    vo.bind("$$dlgflag", 0);
    vo.bind("$$iflag", 0);
    vo.bind("$$romcfgs", "|");
    vo.bind("$$nortsflag", 0);
    Proto.Str ps = (Proto.Str) vo.find("Module_State");
    if (ps != null) vo.bind("$object", ps.newInstance());
    vo.bind("$$meta_iobj", om.has("xdc.tools.Cmdr$$instance$static$init", null) ? 1 : 0);
    vo.bind("$$fxntab", Global.newArray());
    vo.bind("$$logEvtCfgs", Global.newArray());
    vo.bind("$$errorDescCfgs", Global.newArray());
    vo.bind("$$assertDescCfgs", Global.newArray());
    Value.Map atmap = (Value.Map) vo.getv("$attr");
    atmap.seal("length");
    vo.bind("Object", om.findStrict("xdc.tools.Cmdr.Object", "xdc.tools"));
    pkgV.bind("Cmdr", vo);
    ((Value.Arr) pkgV.getv("$unitNames")).add("Cmdr");
  }
Exemplo n.º 20
0
 public static boolean callCheat(ArrayList<Card> caller) {
   // If the last person cheated
   if (lastPlayerCheated) {
     // gives the person who cheated the card
     lastPlayerHand.addAll(pile);
     pile.clear();
     return true;
   } else {
     // If the last person did not cheat
     // Gives the cards to the caller
     caller.addAll(pile);
     pile.clear();
     return false;
   }
 }
  void UNIVERSALConfig$$SINGLETONS() {
    Proto.Obj po;
    Value.Obj vo;

    vo = (Value.Obj) om.findStrict("ti.sdo.ce.universal.UNIVERSALConfig", "ti.sdo.ce.universal");
    po =
        (Proto.Obj)
            om.findStrict("ti.sdo.ce.universal.UNIVERSALConfig.Module", "ti.sdo.ce.universal");
    vo.init2(po, "ti.sdo.ce.universal.UNIVERSALConfig", $$DEFAULT, false);
    vo.bind("Module", po);
    vo.bind("$category", "Module");
    vo.bind("$capsule", $$UNDEF);
    vo.bind("$package", om.findStrict("ti.sdo.ce.universal", "ti.sdo.ce.universal"));
    tdefs.clear();
    proxies.clear();
    mcfgs.clear();
    icfgs.clear();
    inherits.clear();
    vo.bind("$$tdefs", Global.newArray(tdefs.toArray()));
    vo.bind("$$proxies", Global.newArray(proxies.toArray()));
    vo.bind("$$mcfgs", Global.newArray(mcfgs.toArray()));
    vo.bind("$$icfgs", Global.newArray(icfgs.toArray()));
    vo.bind("$$inherits", Global.newArray(inherits.toArray()));
    ((Value.Arr) pkgV.getv("$modules")).add(vo);
    ((Value.Arr) om.findStrict("$modules", "ti.sdo.ce.universal")).add(vo);
    vo.bind("$$instflag", 0);
    vo.bind("$$iobjflag", 1);
    vo.bind("$$sizeflag", 1);
    vo.bind("$$dlgflag", 0);
    vo.bind("$$iflag", 0);
    vo.bind("$$romcfgs", "|");
    vo.bind("$$nortsflag", 0);
    Proto.Str ps = (Proto.Str) vo.find("Module_State");
    if (ps != null) vo.bind("$object", ps.newInstance());
    vo.bind(
        "$$meta_iobj",
        om.has("ti.sdo.ce.universal.UNIVERSALConfig$$instance$static$init", null) ? 1 : 0);
    vo.bind("$$fxntab", Global.newArray());
    vo.bind("$$logEvtCfgs", Global.newArray());
    vo.bind("$$errorDescCfgs", Global.newArray());
    vo.bind("$$assertDescCfgs", Global.newArray());
    Value.Map atmap = (Value.Map) vo.getv("$attr");
    atmap.setElem("", "./UNIVERSALConfig.xdt");
    atmap.seal("length");
    vo.bind("TEMPLATE$", "./UNIVERSALConfig.xdt");
    pkgV.bind("UNIVERSALConfig", vo);
    ((Value.Arr) pkgV.getv("$unitNames")).add("UNIVERSALConfig");
  }
Exemplo n.º 22
0
  protected final void loadChildren(DynamicNode node) throws DbException {
    if (node.hasLoaded() || node.isLeaf()) return;
    node.setHasLoaded();
    Object userObject = node.getUserObject();
    if (userObject == ROOT) return;
    SrVector children = new SrVector(10);
    boolean isSorted = true;
    DbObject dbParent = null;
    if (userObject == DB_RAM) {
      Db[] dbs = Db.getDbs();
      for (int i = 0; i < dbs.length; i++) {
        if (dbs[i] instanceof DbRAM) insertProjects(children, dbs[i]);
      }
    } else if (userObject instanceof Db) {
      insertProjects(children, (Db) userObject);
    } else {
      dbParent = (DbObject) userObject;
      dbParent.getDb().beginTrans(Db.READ_TRANS);
      insertComponents(children, dbParent);
      isSorted = childrenAreSorted(dbParent);
      dbParent.getDb().commitTrans();
    }

    if (isSorted) {
      children.sort(getComparator(dbParent));
    }

    ArrayList groupNodeList = new ArrayList();
    DynamicNode groupNode = null;
    Enumeration enumeration = children.elements();
    while (enumeration.hasMoreElements()) {
      DynamicNode childNode = (DynamicNode) enumeration.nextElement();
      GroupParams group = childNode.getGroupParams();
      if (group.name == null) {
        node.add(childNode);
      } else {
        if (groupNode == null) {
          groupNode = createGroupNode(group);
          node.add(groupNode);
          groupNodeList.add(groupNode);
        } else if (!groupNode.toString().equals(group.name)) {
          boolean groupFound = false;
          for (int i = 0; i < groupNodeList.size(); i++) {
            groupNode = (DynamicNode) groupNodeList.get(i);
            if (groupNode.toString().equals(group.name)) {
              groupFound = true;
              break;
            }
          }
          if (!groupFound) {
            groupNode = createGroupNode(group);
            node.add(groupNode);
            groupNodeList.add(groupNode);
          }
        }
        groupNode.add(childNode);
      }
    }
    groupNodeList.clear();
  }
    @Override
    public Object findElement(String s) {
      List<ObjectWithWeight> elements = new ArrayList<ObjectWithWeight>();
      s = s.trim();
      final ListIterator<Object> it = getElementIterator(0);
      while (it.hasNext()) {
        final ObjectWithWeight o = new ObjectWithWeight(it.next(), s, getComparator());
        if (!o.weights.isEmpty()) {
          elements.add(o);
        }
      }
      ObjectWithWeight cur = null;
      ArrayList<ObjectWithWeight> current = new ArrayList<ObjectWithWeight>();
      for (ObjectWithWeight element : elements) {
        if (cur == null) {
          cur = element;
          current.add(cur);
          continue;
        }

        final int i = element.compareWith(cur);
        if (i == 0) {
          current.add(element);
        } else if (i < 0) {
          cur = element;
          current.clear();
          current.add(cur);
        }
      }

      return current.isEmpty() ? null : findClosestTo(myInitialPsiElement, current);
    }
Exemplo n.º 24
0
 void $$SINGLETONS() {
   pkgP.init(
       "host.platforms.SUN.Package",
       (Proto.Obj) om.findStrict("xdc.IPackage.Module", "host.platforms.SUN"));
   Scriptable cap =
       (Scriptable) Global.callFxn("loadCapsule", xdcO, "host/platforms/SUN/package.xs");
   om.bind("xdc.IPackage$$capsule", cap);
   Object fxn;
   fxn = Global.get(cap, "init");
   if (fxn != null)
     pkgP.addFxn(
         "init", (Proto.Fxn) om.findStrict("xdc.IPackage$$init", "host.platforms.SUN"), fxn);
   fxn = Global.get(cap, "close");
   if (fxn != null)
     pkgP.addFxn(
         "close", (Proto.Fxn) om.findStrict("xdc.IPackage$$close", "host.platforms.SUN"), fxn);
   fxn = Global.get(cap, "validate");
   if (fxn != null)
     pkgP.addFxn(
         "validate",
         (Proto.Fxn) om.findStrict("xdc.IPackage$$validate", "host.platforms.SUN"),
         fxn);
   fxn = Global.get(cap, "exit");
   if (fxn != null)
     pkgP.addFxn(
         "exit", (Proto.Fxn) om.findStrict("xdc.IPackage$$exit", "host.platforms.SUN"), fxn);
   fxn = Global.get(cap, "getLibs");
   if (fxn != null)
     pkgP.addFxn(
         "getLibs", (Proto.Fxn) om.findStrict("xdc.IPackage$$getLibs", "host.platforms.SUN"), fxn);
   fxn = Global.get(cap, "getSects");
   if (fxn != null)
     pkgP.addFxn(
         "getSects",
         (Proto.Fxn) om.findStrict("xdc.IPackage$$getSects", "host.platforms.SUN"),
         fxn);
   pkgP.bind("$capsule", cap);
   pkgV.init2(pkgP, "host.platforms.SUN", Value.DEFAULT, false);
   pkgV.bind("$name", "host.platforms.SUN");
   pkgV.bind("$category", "Package");
   pkgV.bind("$$qn", "host.platforms.SUN.");
   pkgV.bind("$vers", Global.newArray("1, 0, 0, 1"));
   Value.Map atmap = (Value.Map) pkgV.getv("$attr");
   atmap.seal("length");
   imports.clear();
   imports.add(Global.newArray("xdc.platform", Global.newArray()));
   pkgV.bind("$imports", imports);
   StringBuilder sb = new StringBuilder();
   sb.append("var pkg = xdc.om['host.platforms.SUN'];\n");
   sb.append("if (pkg.$vers.length >= 3) {\n");
   sb.append("pkg.$vers.push(Packages.xdc.services.global.Vers.getDate(xdc.csd() + '/..'));\n");
   sb.append("}\n");
   sb.append("pkg.build.libraries = [\n");
   sb.append("];\n");
   sb.append("pkg.build.libDesc = [\n");
   sb.append("];\n");
   sb.append("if('suffix' in xdc.om['xdc.IPackage$$LibDesc']) {\n");
   sb.append("}\n");
   Global.eval(sb.toString());
 }
Exemplo n.º 25
0
 void $$SINGLETONS() {
   pkgP.init(
       "ti.platforms.evm6424.Package",
       (Proto.Obj) om.findStrict("xdc.IPackage.Module", "ti.platforms.evm6424"));
   pkgP.bind("$capsule", $$UNDEF);
   pkgV.init2(pkgP, "ti.platforms.evm6424", Value.DEFAULT, false);
   pkgV.bind("$name", "ti.platforms.evm6424");
   pkgV.bind("$category", "Package");
   pkgV.bind("$$qn", "ti.platforms.evm6424.");
   pkgV.bind("$vers", Global.newArray("1, 0, 0, 0"));
   Value.Map atmap = (Value.Map) pkgV.getv("$attr");
   atmap.seal("length");
   imports.clear();
   imports.add(Global.newArray("ti.catalog.c6000", Global.newArray()));
   imports.add(Global.newArray("xdc.platform", Global.newArray(1, 0, 1)));
   pkgV.bind("$imports", imports);
   StringBuilder sb = new StringBuilder();
   sb.append("var pkg = xdc.om['ti.platforms.evm6424'];\n");
   sb.append("if (pkg.$vers.length >= 3) {\n");
   sb.append("pkg.$vers.push(Packages.xdc.services.global.Vers.getDate(xdc.csd() + '/..'));\n");
   sb.append("}\n");
   sb.append("pkg.build.libraries = [\n");
   sb.append("];\n");
   sb.append("pkg.build.libDesc = [\n");
   sb.append("];\n");
   sb.append("if('suffix' in xdc.om['xdc.IPackage$$LibDesc']) {\n");
   sb.append("}\n");
   Global.eval(sb.toString());
 }
Exemplo n.º 26
0
 private void safeBeginParagraph() {
   if (!myParagraphStarted) {
     myParagraphStarted = true;
     myBufferIsEmpty = true;
     beginParagraph(ZLTextParagraph.Kind.TEXT_PARAGRAPH);
     if (!myParagraphStored) {
       // final ArrayList models = Model.getBookTextModels();
       // myParagraphVector.add(new Pair(((ZLTextPlainModel)
       // models.get(models.size()-1)/*BookTextModel*/).getParagraphsNumber() - 1, models.size() -
       // 1));
       myParagraphStored = true;
     }
     for (Iterator it = myDelayedControls.iterator(); it.hasNext(); ) {
       Pair pit = (Pair) it.next();
       addControl((Byte) pit.myFirst, (Boolean) pit.mySecond);
     }
     // if (myForcedEntry != null) {
     //	addControl(myForcedEntry);
     // } else {
     addControl(FBTextKind.REGULAR, true);
     // }
     for (Iterator it = myDelayedHyperlinks.iterator(); it.hasNext(); ) {
       addHyperlinkControl(FBTextKind.INTERNAL_HYPERLINK, (String) it.next());
     }
     myDelayedHyperlinks.clear();
   }
 }
Exemplo n.º 27
0
  public void updateNodeName(String oldName, String newName) {
    // Update in the whole Tree
    if (!oldName.isEmpty() && !newName.isEmpty()) {

      Enumeration en = root.depthFirstEnumeration();

      while (en.hasMoreElements()) {
        DecisionTreeNode node = (DecisionTreeNode) en.nextElement();
        if (node.nodeName.compareTo(oldName) == 0) {
          node.nodeName = newName;
        }
      }
    }

    // Update in the added Node List
    ArrayList<String> nodesToBeAdded = new ArrayList<String>(addedNodes);
    addedNodes.clear();

    for (String node : nodesToBeAdded) {
      String[] arr = node.split(":");
      if (arr[1].compareTo(oldName) == 0) {
        addedNodes.add(arr[0] + ":" + newName + ":" + arr[2]);
      } else {
        addedNodes.add(node);
      }
    }

    // Update in the correctNode list
    correctNodes.put(newName, correctNodes.get(oldName));
    correctNodes.remove(oldName);
  }
 public boolean comparePrefix(String prefixCode, String prefixCodeWithProc) {
   try {
     boolean flag = false;
     String prefixBreak[] = prefixCode.split("#");
     String prefixProcBreak[] = prefixCodeWithProc.split("#");
     for (String str : prefixBreak) {
       flag = false;
       for (int i = 0; i < prefixProcBreak.length; i++) {
         if (prefixProcBreak[i].equals(str)) {
           flag = true;
           prefixProcBreak[i] = "-1";
           break;
         }
       }
       if (!flag) return false;
     }
     if (prefixCode.length() == prefixCodeWithProc.length()) {
       procList.clear();
       procList.add(prefixCodeWithProc);
       return true;
     } else procList.add(prefixCodeWithProc);
   } catch (Exception ed) {
   }
   return false;
 }
Exemplo n.º 29
0
  public boolean moveValid(Square candidateSquare) {
    if (piece == 0) {
      setListForKing();
    }
    if (piece == 1) {
      setListForQueen();
    }
    if (piece == 2) {
      moveList.clear();
      setListForRook();
    }
    if (piece == 3) {
      setListForKnight();
    }
    if (piece == 4) {
      setListForBishop();
    }

    if (piece == 5) {
      setListForPawn();
    }

    if (moveList.contains(candidateSquare.getPosition())) {
      return true;
    }
    return false;
  }
 void $$SINGLETONS() {
   pkgP.init(
       "ti.sdo.ce.utils.rtcfg.osal.Package",
       (Proto.Obj) om.findStrict("xdc.IPackage.Module", "ti.sdo.ce.utils.rtcfg.osal"));
   pkgP.bind("$capsule", $$UNDEF);
   pkgV.init2(pkgP, "ti.sdo.ce.utils.rtcfg.osal", Value.DEFAULT, false);
   pkgV.bind("$name", "ti.sdo.ce.utils.rtcfg.osal");
   pkgV.bind("$category", "Package");
   pkgV.bind("$$qn", "ti.sdo.ce.utils.rtcfg.osal.");
   pkgV.bind("$vers", Global.newArray("1, 0, 0"));
   Value.Map atmap = (Value.Map) pkgV.getv("$attr");
   atmap.seal("length");
   imports.clear();
   pkgV.bind("$imports", imports);
   StringBuilder sb = new StringBuilder();
   sb.append("var pkg = xdc.om['ti.sdo.ce.utils.rtcfg.osal'];\n");
   sb.append("if (pkg.$vers.length >= 3) {\n");
   sb.append("pkg.$vers.push(Packages.xdc.services.global.Vers.getDate(xdc.csd() + '/..'));\n");
   sb.append("}\n");
   sb.append("pkg.build.libraries = [\n");
   sb.append("];\n");
   sb.append("pkg.build.libDesc = [\n");
   sb.append("];\n");
   Global.eval(sb.toString());
 }