Examples of Cell


Examples of com.youtube.vitess.vtgate.Row.Cell

      val = value;
    }
    if (val == null) {
      throw new RuntimeException("unknown type in RowWritable: " + clazz);
    }
    return new Cell(name, val, clazz);
  }
View Full Code Here

Examples of core.Cell

        caf = new CellAddressFactory(1);
        input = caf.getSpaceForNewRelation(1);//(a)
        standOper = new StandarizationOperator(caf, input);
        resultFormulas = standOper.getFormulas();
        expectedResult = new Formulas();
        expectedResult.put(new Cell('B',1), "IF(ISNA($A1),0,1)");
        expectedResult.put(new Cell('C',1), "MATCH(ROW(),$B:$B,0)");
        expectedResult.put(new Cell('D',1), "INDEX(A:A,$C1)");
        expectedResult.put(new Cell('B',2), "IF(ISNA($A2),B1,B1+1)");
        expectedResult.put(new Cell('C',2), "MATCH(ROW(),$B:$B,0)");
        expectedResult.put(new Cell('D',2), "INDEX(A:A,$C2)");
//        System.out.println("expected:");
//        System.out.println(expectedResult.toString(caf));
//        System.out.println("real");
//        System.out.println(resultFormulas.toString(caf));
        assertEquals(expectedResult, resultFormulas);
        resRelation = standOper.getResultRelation();
        assertEquals(new Column('D'), resRelation.getFirstCol());
        assertEquals(1, resRelation.getCardinality());

        caf = new CellAddressFactory(1);
        input = caf.getSpaceForNewRelation(2);//(a,b)
        standOper = new StandarizationOperator(caf, input);
        resultFormulas = standOper.getFormulas();
        expectedResult = new Formulas();
        expectedResult.put(new Cell('C',1), "IF(ISNA($A1),0,1)");
        expectedResult.put(new Cell('D',1), "MATCH(ROW(),$C:$C,0)");
        expectedResult.put(new Cell('E',1), "INDEX(A:A,$D1)");
        expectedResult.put(new Cell('F',1), "INDEX(B:B,$D1)");
        expectedResult.put(new Cell('C',2), "IF(ISNA($A2),C1,C1+1)");
        expectedResult.put(new Cell('D',2), "MATCH(ROW(),$C:$C,0)");
        expectedResult.put(new Cell('E',2), "INDEX(A:A,$D2)");
        expectedResult.put(new Cell('F',2), "INDEX(B:B,$D2)");
//        System.out.println("expected:");
//        System.out.println(expectedResult.toString(caf));
//        System.out.println("real");
//        System.out.println(resultFormulas.toString(caf));
        assertEquals(expectedResult, resultFormulas);
        resRelation = standOper.getResultRelation();
        assertEquals(new Column('E'), resRelation.getFirstCol());
        assertEquals(2, resRelation.getCardinality());

        caf = new CellAddressFactory(2);//zaczynamy od B
        input = caf.getSpaceForNewRelation(3);//(b,c,d)
        standOper = new StandarizationOperator(caf, input);
        resultFormulas = standOper.getFormulas();
        expectedResult = new Formulas();
        expectedResult.put(new Cell('E',1), "IF(ISNA($B1),0,1)");
        expectedResult.put(new Cell('F',1), "MATCH(ROW(),$E:$E,0)");
        expectedResult.put(new Cell('G',1), "INDEX(B:B,$F1)");
        expectedResult.put(new Cell('H',1), "INDEX(C:C,$F1)");
        expectedResult.put(new Cell('I',1), "INDEX(D:D,$F1)");
        expectedResult.put(new Cell('E',2), "IF(ISNA($B2),E1,E1+1)");
        expectedResult.put(new Cell('F',2), "MATCH(ROW(),$E:$E,0)");
        expectedResult.put(new Cell('G',2), "INDEX(B:B,$F2)");
        expectedResult.put(new Cell('H',2), "INDEX(C:C,$F2)");
        expectedResult.put(new Cell('I',2), "INDEX(D:D,$F2)");
//        System.out.println("expected:");
//        System.out.println(expectedResult.toString(caf));
//        System.out.println("real");
//        System.out.println(resultFormulas.toString(caf));
        assertEquals(expectedResult, resultFormulas);
View Full Code Here

Examples of edu.mayo.bmi.guoqian.claml.Cell

    /**
     * Create an instance of {@link Cell }
     *
     */
    public Cell createCell() {
        return new Cell();
    }
View Full Code Here

Examples of environment.Cell

            Logger.getLogger(GUIController.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void ejectAgents(Agent tracer) {
        Cell beforeDeathCell = tracer.getUnit().getLastOccupiedCell();
        short xleft = beforeDeathCell.getX();
        short xright = beforeDeathCell.getX();
        short yleft = beforeDeathCell.getY();
        short yright = beforeDeathCell.getY();
        short direction = tracer.getLastDirection();
        short cols = tracer.getWorld().getParams().getCols();
        short rows = tracer.getWorld().getParams().getRows();
        switch (direction) {
            case 0:
                xleft--;
                xright++;
                if (xleft < 0) {
                    xleft = (short) (cols - 1);
                }
                if (xright >= cols) {
                    xright = 0;
                }
                break;
            case 1:
                xleft--;
                yleft--;
                xright++;
                yright++;
                if (xleft < 0) {
                    xleft = (short) (cols - 1);
                }
                if (xright >= cols) {
                    xright = 0;
                }
                if (yleft < 0) {
                    yleft = (short) (rows - 1);
                }
                if (yright >= rows) {
                    yright = 0;
                }
                break;
            case 2:
                yleft--;
                yright++;
                if (yleft < 0) {
                    yleft = (short) (rows - 1);
                }
                if (yright >= rows) {
                    yright = 0;
                }
                break;
            case 3:
                xleft++;
                yleft--;
                xright--;
                yright++;
                if (xleft >= cols) {
                    xleft = 0;
                }
                if (xright < 0) {
                    xright = (short) (cols - 1);
                }
                if (yleft < 0) {
                    yleft = (short) (rows - 1);
                }
                if (yright >= rows) {
                    yright = 0;
                }
                break;
            case 4:
                xleft++;
                xright--;
                if (xright < 0) {
                    xright = (short) (cols - 1);
                }
                if (xleft >= cols) {
                    xleft = 0;
                }
                break;
            case 5:
                xleft++;
                yleft++;
                xright--;
                yright--;
                if (xright < 0) {
                    xright = (short) (cols - 1);
                }
                if (xleft >= cols) {
                    xleft = 0;
                }
                if (yright < 0) {
                    yright = (short) (rows - 1);
                }
                if (yleft >= rows) {
                    yleft = 0;
                }
                break;
            case 6:
                yleft++;
                yright--;
                if (yright < 0) {
                    yright = (short) (rows - 1);
                }
                if (yleft >= rows) {
                    yleft = 0;
                }
                break;
            case 7:
                xleft--;
                yleft++;
                xright++;
                yright--;
                if (xright >= cols) {
                    xright = 0;
                }
                if (xleft < 0) {
                    xleft = (short) (cols - 1);
                }
                if (yright < 0) {
                    yright = (short) (rows - 1);
                }
                if (yleft >= rows) {
                    yleft = 0;
                }
                break;
            default:
                break;
        }
        Cell rightCell = tracer.getWorld().getCell(xright, yright);
        Cell leftCell = tracer.getWorld().getCell(xleft, yleft);

        int leftOrRight = tracer.getLeftOrRight();
        Cell internalCell = null, externalCell = null;
        if (leftOrRight == -1) {
            internalCell = leftCell;
            externalCell = rightCell;
        } else if (leftOrRight == 1) {
            internalCell = rightCell;
View Full Code Here

Examples of es.mahulo.battleship.model.Cell

   
    List<Ship> ships = new ArrayList<Ship>();
   
    List<Cell> cells = new ArrayList<Cell>();
    Cell cell1 = new Cell();
    cell1.setX(9);
    cell1.setY(1);
    cells.add(cell1);
   
    Cell cell2 = new Cell();
    cell2.setX(9);
    cell2.setY(2);
    cells.add(cell2);

    Cell cell3 = new Cell();
    cell3.setX(9);
    cell3.setY(3);
    cells.add(cell3);

    Cell cell4 = new Cell();
    cell4.setX(9);
    cell4.setY(4);
    cells.add(cell4);

    Cell cell5 = new Cell();
    cell5.setX(9);
    cell5.setY(5);
    cells.add(cell5);
    
    Ship ship1 = new Ship();
    ship1.setShipConfig(shipConfig1);
    ship1.setCells(cells);
   
    ships.add(ship1);
   
   
    cells = new ArrayList<Cell>();
    Cell cell6 = new Cell();
    cell6.setX(7);
    cell6.setY(4);
    cells.add(cell6);
   
   
    Cell cell7 = new Cell();
    cell7.setX(7);
    cell7.setY(5);
    cells.add(cell7);

    Cell cell8 = new Cell();
    cell8.setX(7);
    cell8.setY(6);
    cells.add(cell8);

    Cell cell9 = new Cell();
    cell9.setX(7);
    cell9.setY(7);
    cells.add(cell9);
   
    
    Ship ship2 = new Ship();
    ship2.setShipConfig(shipConfig2);
    ship2.setCells(cells);
   
    ships.add(ship2);


    cells = new ArrayList<Cell>();
   
   
    Cell cell11 = new Cell();
    cell11.setX(2);
    cell11.setY(6);
    cells.add(cell11);

    Cell cell12 = new Cell();
    cell12.setX(3);
    cell12.setY(6);
    cells.add(cell12);

    Cell cell13 = new Cell();
    cell13.setX(4);
    cell13.setY(6);
    cells.add(cell13);

    Ship ship3 = new Ship();
    ship3.setShipConfig(shipConfig3);
    ship3.setCells(cells);
   
    ships.add(ship3);
   

   
    cells = new ArrayList<Cell>();
    Cell cell14 = new Cell();
    cell14.setX(1);
    cell14.setY(1);
    cells.add(cell14);
   
   
    Cell cell15 = new Cell();
    cell15.setX(1);
    cell15.setY(2);
    cells.add(cell15);

    Ship ship4 = new Ship();
    ship4.setShipConfig(shipConfig4);
    ship4.setCells(cells);
   
    ships.add(ship4);

    cells = new ArrayList<Cell>();
    Cell cell16 = new Cell();
    cell16.setX(3);
    cell16.setY(4);
    cells.add(cell16);
   
   
    Cell cell17 = new Cell();
    cell17.setX(4);
    cell17.setY(4);
    cells.add(cell17);

    Ship ship5 = new Ship();
    ship5.setShipConfig(shipConfig4);
    ship5.setCells(cells);
   
    ships.add(ship5);

   

    cells = new ArrayList<Cell>();
    Cell cell18 = new Cell();
    cell18.setX(3);
    cell18.setY(2);
    cells.add(cell18);
   

    Ship ship6 = new Ship();
    ship6.setShipConfig(shipConfig5);
    ship6.setCells(cells);
   
    ships.add(ship6);
   

    cells = new ArrayList<Cell>();
    Cell cell19 = new Cell();
    cell19.setX(1);
    cell19.setY(8);
    cells.add(cell19);
   
   

    Ship ship7 = new Ship();
View Full Code Here

Examples of fr.soleil.bean.samplesbean.model.Cell

    public DefaultMutableTreeTableNode generateTreeTableModel() {
        List<Cell> cellList = rack.getCellList();

        DefaultMutableTreeTableNode aRoot = new DefaultMutableTreeTableNode(new Sample());
        for (Iterator<Cell> iterator = cellList.iterator(); iterator.hasNext();) {
            Cell cell = iterator.next();
            cell.addObserver(this);
            if (!cell.hasChildren()) {
                aRoot.add(new DefaultMutableTreeTableNode(cell));
            }
            else {
                DefaultMutableTreeTableNode currentNode = new DefaultMutableTreeTableNode(cell);
                aRoot.add(currentNode);

                Map<CellPosition, SubCell> positionChildrenMap = cell.getChildrenMap();
                Set<CellPosition> positions = positionChildrenMap.keySet();
                List<CellPosition> orderedPositions = new ArrayList<CellPosition>(positions);
                Collections.sort(orderedPositions);

                for (Iterator<CellPosition> iterator2 = orderedPositions.iterator(); iterator2
View Full Code Here

Examples of freecell.model.pile.Cell

    private List<Tableau> tableaux = new ArrayList<>(8);
    private MoveTracker moveTracker = new MoveTracker();

    public Game() {
        for (int i = 0; i < 4; i++) {
            cells.add(new Cell());
            foundations.add(new Foundation());
        }
        for (int i = 0; i < 8; i++)
            tableaux.add(new Tableau());
        newGame();
View Full Code Here

Examples of gnonograms.utils.Cell

  this.addMouseListener(new GridMouseAdapter());
  this.addMouseMotionListener(new GridMouseMotionAdapter());
  this.addKeyListener(new GridKeyAdapter());
  this.setBorder(BorderFactory.createLineBorder(Color.black));

  currentCell=new Cell(-1,-1,Resource.CELLSTATE_UNDEFINED);
  previousCell=new Cell(-1,-1,Resource.CELLSTATE_UNDEFINED);
  currentRow=-1;
  currentCol=-1;
 
  solvingColors=new Color[8];
  settingColors=new Color[8];
View Full Code Here

Examples of htm.Cell

     
      if(col.numCells()==1) //special case for 1-cell
        rad2sqrt = _colRadius-(_colRadius/3);
     
      for(int i=0; i<col.numCells(); ++i) {
        Cell cell = col.getCell(i);
        Point center = getCellPos(cell);
        if(_mousePos.x > center.x-rad2sqrt && _mousePos.y > center.y-rad2sqrt) {
          if(_mousePos.x < center.x+rad2sqrt && _mousePos.y < center.y+rad2sqrt)
            return cell;
        }
View Full Code Here

Examples of info.jtrac.domain.ExcelFile.Cell

            protected void populateItem(Item item) {
                if(item.getIndex() % 2 == 1) {
                    item.add(CLASS_ALT);
                }          
                item.add(new Label("index", item.getIndex() + 1 + ""));
                Cell cell = (Cell) item.getModelObject();
                Label label = new Label("cell", new PropertyModel(cell, "valueAsString"));
                label.setEscapeModelStrings(false);               
                if(!cell.isValid(column.getColumnHeading())) {
                    label.add(CLASS_ERROR_BACK);
                }
                item.add(label);
                if(mappedDisplayValues != null && distinctCellsContainer.isVisible() && cell.getKey() != null) {
                    String mapped = mappedDisplayValues.get(cell.getKey());
                    item.add(new Label("mapped", mapped));
                } else {
                    item.add(new WebMarkupContainer("mapped"));               
                }
            }
        });
               
        form.add(distinctCellsContainer);
       
        distinctCellsContainer.add(new DistinctCellsView("rows"));
       
        Button updateButton = new Button("update") {
            @Override
            public void onSubmit() {
                if(distinctCellsContainer.isVisible()) {
                    ColumnHeading ch = column.getColumnHeading();
                    for(Cell cell : columnCells) {
                        IModel model = mappedKeys.get(cell.getValueAsString());
                        Object o = model.getObject();                       
                        cell.setKey(o);                       
                    }
                }              
            }
            @Override
            public boolean isVisible() {
                return distinctCellsContainer.isVisible();
            }
        };
       
        form.add(updateButton);
       
       
        Button submitButton = new Button("submit") {
            @Override
            public void onSubmit() {
                ColumnHeading ch = column.getColumnHeading();
                for(Cell cell : columnCells) {
                    if(!cell.isValid(ch)) {
                        error(localize("excel_view.error.invalidValue"));
                        return;
                    }
                }               
                if(ch.isField()) {
                    column.setLabel(ch.getLabel());
                } else {
                    column.setLabel(labelsMap.get(column.getColumnHeading().getName()));
                }
                excelFile.getColumns().set(index, column);
                if(distinctCellsContainer.isVisible()) {
                    for(Cell cell : columnCells) {
                        cell.setValue(mappedDisplayValues.get(cell.getKey()));
                    }
                    excelFile.setColumnCells(index, columnCells);                   
                }
                setResponsePage(previous);
            }
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.