/** {@inheritDoc} */
 @Override
 public T get(Long id) throws NotFoundException {
   if (!dao.isExist(id)) {
     throw new NotFoundException("Entity with id: " + id + " not found");
   }
   return dao.get(id);
 }
 /**
  * Returns the sum of squared deviations of Y from its mean.
  *
  * <p>If the model has no intercept term, <code>0</code> is used for the mean of Y - i.e., what is
  * returned is the sum of the squared Y values.
  *
  * <p>The value returned by this method is the SSTO value used in the {@link #calculateRSquared()
  * R-squared} computation.
  *
  * @return SSTO - the total sum of squares
  * @see #isNoIntercept()
  * @since 2.2
  */
 public double calculateTotalSumOfSquares() {
   if (isNoIntercept()) {
     return StatUtils.sumSq(Y.getData());
   } else {
     return new SecondMoment().evaluate(Y.getData());
   }
 }
Esempio n. 3
0
 /**
  * Checks if the pair contains <tt>o</tt>. The pair contains <tt>o</tt> if either the first or the
  * second member of the pair matches o.
  *
  * @param o The object to be checked against the members of the pair
  * @return True if o matches one of the members of the pair, else false.
  */
 public boolean contains(Object o) {
   if (o == null) {
     return false;
   } else if (o.getClass() == x.getClass() || o.getClass() == y.getClass()) {
     return x.equals(o) || y.equals(o);
   } else {
     return false;
   }
 }
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((x == null) ? 0 : x.hashCode());
   result = prime * result + ((y == null) ? 0 : y.hashCode());
   return result;
 }
 @Test
 public void convertToIndex() {
   assertThat(A.ordinal(), is(0));
   assertThat(B.ordinal(), is(1));
   assertThat(C.ordinal(), is(2));
   assertThat(X.ordinal(), is(23));
   assertThat(Y.ordinal(), is(24));
   assertThat(Z.ordinal(), is(25));
 }
Esempio n. 6
0
    @Override
    public boolean equals(Object o) {
      if (this == o) return true;
      if (o == null || getClass() != o.getClass()) return false;

      Pair<?, ?> pair = (Pair<?, ?>) o;

      if (x != null ? !x.equals(pair.x) : pair.x != null) return false;
      return !(y != null ? !y.equals(pair.y) : pair.y != null);
    }
  protected void notificate() {
    if ((getServiceEventEntity() == null)
        || (getServiceEventEntity() != null && getServiceEventEntity().getNotifyMessage())) {

      Integer title = event.getTitle();
      Integer desc = event.getSuccessMessage();

      if (getServiceEventEntity() == null) {
        desc = event.getErrorMessage();
      }

      CsTigoApplication.vibrate(CsTigoApplication.getGlobalParameterHelper().getPlatformVibrate());

      CsTigoApplication.showNotification(
          CSTigoNotificationID.SERVICE_UPDATE,
          CsTigoApplication.getContext().getString(title),
          CsTigoApplication.getContext().getString(desc),
          (getServiceEventEntity() != null && getServiceEventEntity().getActivityToOpen() != null
              ? getServiceEventEntity().getActivityToOpen()
              : MessageHistoryActivity.class));
    }
  }
Esempio n. 8
0
  /**
   * Set the target the resource will be loaded into.
   *
   * @param target The target to load the resource into.
   * @return The given target.
   * @see RequestManager#clear(Target)
   */
  public <Y extends Target<TranscodeType>> Y into(Y target) {
    Util.assertMainThread();
    if (target == null) {
      throw new IllegalArgumentException("You must pass in a non null Target");
    }
    if (!isModelSet) {
      throw new IllegalArgumentException("You must call #load() before calling #into()");
    }

    Request previous = target.getRequest();

    if (previous != null) {
      requestManager.clear(target);
    }

    requestOptions.lock();
    Request request = buildRequest(target);
    target.setRequest(request);
    requestManager.track(target, request);

    return target;
  }
Esempio n. 9
0
  @Override
  protected final Expr unLambda(final Name n) {
    final Map<Name, Expr> map = defs.unLambda().getMap();
    final LinkedList<Set<Name>> sorted = topoSort(map);

    Expr ex = getBody();
    for (final Set<Name> names : sorted) {
      if (names.size() == 1) {
        final Name nm = names.iterator().next();
        final Expr def = map.get(nm);
        final int uses = ex.numOfUses(nm);
        if (uses == 0) {
          // name unused, ignore it
          log.info("removing unused definition " + nm + ": " + def);
        } else if (uses == 1 || def instanceof Value) {
          // can be inlined
          log.info("inlining " + nm + ": " + def);
          ex = ex.inline(nm, def);
        } else {
          ex = App.create(new Lambda(nm.toString(), ex), map.get(nm));
        }
      } else {
        final Name[] na = names.toArray(new Name[names.size()]);

        Expr funs = NIL, res = K.app(ex);
        for (final Name element : na) {
          funs = CONS.app(map.get(element), funs);
        }

        funs = K.app(funs);

        for (final Name element : na) {
          funs = U.app(new Lambda(element.toString(), funs));
          if (res.hasFree(element)) {
            res = U.app(new Lambda(element.toString(), res));
          } else {
            // name unused, ignore it
            log.info("rewriting unused name: U { " + element + " -> f } ==> (f . tl)");
            final Name nm = Name.createName();
            res = new Lambda(nm.toString(), App.create(res, TL.app(nm)));
          }
        }

        ex = App.create(res, Y.app(funs));
      }
    }

    return ex.unLambda(n);
  }
 protected <X, Y> Page<X> findByPager(
     Pageable pager, String selectStatement, Y condition, Map<String, Object> otherParams) {
   PageInterceptor.PAGE_PARAM.set(pager);
   Map<String, Object> params = new HashMap<>();
   params.put("condition", condition);
   params.putAll(parseFields(condition, condition.getClass()));
   if (!CollectionUtils.isEmpty(otherParams)) {
     params.putAll(otherParams);
   }
   List<X> result = selectList(selectStatement, params);
   PageInterceptor.PAGE_PARAM.remove();
   Long total = PageInterceptor.PAGINATION_TOTAL.get();
   PageInterceptor.PAGINATION_TOTAL.remove();
   return new PageImpl<X>(result, pager, total);
 }
Esempio n. 11
0
  public void run() {
    // 1.Read in a triangle mesh from an input file with
    //  format ASCII UCD generated by Gridgen
    MeshReader reader = new MeshReader("triangle.grd");
    Mesh mesh = reader.read2DMesh();
    // Compute geometry relationship of nodes and elements
    mesh.computeNodeBelongsToElements();

    // 2.Mark border types
    HashMap<NodeType, Function> mapNTF = new HashMap<NodeType, Function>();
    mapNTF.put(NodeType.Dirichlet, null);
    mesh.markBorderNode(mapNTF);

    // 3.Use element library to assign degrees of
    //  freedom (DOF) to element
    ElementList eList = mesh.getElementList();
    FELinearTriangle feLT = new FELinearTriangle();
    for (int i = 1; i <= eList.size(); i++) feLT.assignTo(eList.at(i));

    // 4.Weak form
    WeakFormLaplace2D weakForm = new WeakFormLaplace2D();
    // Right hand side(RHS): f = -2*(x^2+y^2)+36
    weakForm.setF(X.M(X).A(Y.M(Y)).M(-2.0).A(36.0));

    // 5.Assembly process
    AssemblerScalar assembler = new AssemblerScalar(mesh, weakForm);
    assembler.assemble();
    Matrix stiff = assembler.getStiffnessMatrix();
    Vector load = assembler.getLoadVector();
    // Boundary condition
    assembler.imposeDirichletCondition(C0);

    // 6.Solve linear system
    SolverJBLAS solver = new SolverJBLAS();
    Vector u = solver.solveDGESV(stiff, load);
    System.out.println("u=");
    for (int i = 1; i <= u.getDim(); i++) System.out.println(String.format("%.3f", u.get(i)));

    // 7.Output results to an Techplot format file
    MeshWriter writer = new MeshWriter(mesh);
    writer.writeTechplot("./tutorial/Laplace2D.dat", u);

    this.mesh = mesh;
    this.u = u;
  }
Esempio n. 12
0
  @Override
  public boolean equals(Object obj) {

    if (obj instanceof Tuple) {
      Tuple tuple = (Tuple) obj;

      // (x != null && tuple.x != null) ==> (x==tuple.x || x.equals(tuple.x))
      // x == null <==> tuple.x == null

      boolean equalsX =
          (x == null && tuple.x == null)
              || ((x != null && tuple.x != null) && (x == tuple.x || x.equals(tuple.x)));
      boolean equalsY =
          (y == null && tuple.y == null)
              || ((y != null && tuple.y != null) && (y == tuple.y || y.equals(tuple.y)));

      return equalsX && equalsY;
    }

    return false;
  }
Esempio n. 13
0
  private static void loadDoses() throws IOException {
    RcopiaDb db = DatabaseFactory.instance().get(DOSE_CHECK, Display.getMasterLogger());

    ArrayList doses = db.getAll();

    Iterator iter = doses.iterator();
    while (iter.hasNext()) {
      RcopiaInfo info = (RcopiaInfo) iter.next();
      if (info.isDeleted()) continue;

      long drugID = info.getInt(DRUG_ID);
      if (drugID == 0) continue;

      if (!Y.equalsIgnoreCase(info.getString(IS_MAINTENANCE_DOSE))) continue;

      ArrayList list = (ArrayList) doseMap.get(drugID);
      if (list == null) {
        list = new ArrayList();
        doseMap.put(drugID, list);
      }

      list.add(info);
    }
  }
Esempio n. 14
0
  public static <T extends Object, Y extends Object> void copyFields(T from, Y too) {

    Class<? extends Object> fromClass = from.getClass();
    Field[] fromFields = fromClass.getDeclaredFields();

    Class<? extends Object> tooClass = too.getClass();
    Field[] tooFields = tooClass.getDeclaredFields();
    Map<String, Field> fromFieldMap = new HashMap<String, Field>();

    for (Field field : fromFields) {
      fromFieldMap.put(field.getName().toLowerCase(), field);
    }

    if (fromFields != null && tooFields != null) {
      for (Field tooF : tooFields) {
        try {
          Field fromF =
              fromFieldMap.get(
                  tooF.getName().toLowerCase()); // fromClass.getDeclaredField(tooF.getName());
          if (fromF != null && fromF.getType().equals(tooF.getType())) {
            tooF.setAccessible(true);
            fromF.setAccessible(true);
            tooF.set(too, fromF.get(from));
          }
        } catch (SecurityException e) {
          e.printStackTrace();
        } catch (IllegalArgumentException e) {
          e.printStackTrace();
        } catch (IllegalAccessException e) {
          e.printStackTrace();
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
    }
  }
Esempio n. 15
0
 public String toString() {
   return "(" + x.toString() + "," + y.toString() + ")";
 }
Esempio n. 16
0
 void m() {
   Y x = Y.valueOf("X");
   Y[] y = Y.values();
 }
Esempio n. 17
0
 /** To string method. Gives some fancy output. */
 @Override
 public String toString() {
   return "<" + x.toString() + ", " + y.toString() + ">";
 }
Esempio n. 18
0
 public static void main(String[] args) {
   Y y = new Y();
   System.out.println("Y生成後");
   y.showY();
 }
Esempio n. 19
0
  public void cambiarModoMayus() {
    minusculas = !minusculas;

    if (minusculas) {
      Q.setText("q");
      W.setText("w");
      E.setText("e");
      R.setText("r");
      T.setText("t");
      Y.setText("y");
      U.setText("u");
      I.setText("i");
      O.setText("o");
      P.setText("p");
      A.setText("a");
      S.setText("s");
      D.setText("d");
      F.setText("f");
      G.setText("g");
      H.setText("h");
      J.setText("j");
      K.setText("k");
      L.setText("l");
      N2.setText("ñ");
      Z.setText("z");
      X.setText("x");
      C.setText("c");
      V.setText("v");
      B.setText("b");
      N.setText("n");
      M.setText("m");
    } else {
      Q.setText("Q");
      W.setText("W");
      E.setText("E");
      R.setText("R");
      T.setText("T");
      Y.setText("Y");
      U.setText("U");
      I.setText("I");
      O.setText("O");
      P.setText("P");
      A.setText("A");
      S.setText("S");
      D.setText("D");
      F.setText("F");
      G.setText("G");
      H.setText("H");
      J.setText("J");
      K.setText("K");
      L.setText("L");
      N2.setText("Ñ");
      Z.setText("Z");
      X.setText("X");
      C.setText("C");
      V.setText("V");
      B.setText("B");
      N.setText("N");
      M.setText("M");
    }
  }
Esempio n. 20
0
 private void YActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_YActionPerformed
   // TODO add your handling code here:
   actualizaCampo(Y.getText());
 } // GEN-LAST:event_YActionPerformed
Esempio n. 21
0
  /**
   * This method is called from within the constructor to initialize the form. WARNING: Do NOT
   * modify this code. The content of this method is always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    teclado_base = new javax.swing.JPanel();
    H = new javax.swing.JButton();
    F = new javax.swing.JButton();
    G = new javax.swing.JButton();
    S = new javax.swing.JButton();
    D = new javax.swing.JButton();
    P = new javax.swing.JButton();
    A = new javax.swing.JButton();
    I = new javax.swing.JButton();
    O = new javax.swing.JButton();
    K = new javax.swing.JButton();
    J = new javax.swing.JButton();
    L = new javax.swing.JButton();
    N2 = new javax.swing.JButton();
    Z = new javax.swing.JButton();
    X = new javax.swing.JButton();
    C = new javax.swing.JButton();
    V = new javax.swing.JButton();
    B = new javax.swing.JButton();
    N = new javax.swing.JButton();
    Q = new javax.swing.JButton();
    U = new javax.swing.JButton();
    M = new javax.swing.JButton();
    T = new javax.swing.JButton();
    R = new javax.swing.JButton();
    E = new javax.swing.JButton();
    Espacio = new javax.swing.JButton();
    W = new javax.swing.JButton();
    Y = new javax.swing.JButton();

    H.setText("H");
    H.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            HActionPerformed(evt);
          }
        });

    F.setText("F");
    F.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            FActionPerformed(evt);
          }
        });

    G.setText("G");
    G.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            GActionPerformed(evt);
          }
        });

    S.setText("S");
    S.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            SActionPerformed(evt);
          }
        });

    D.setText("D");
    D.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            DActionPerformed(evt);
          }
        });

    P.setText("P");
    P.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            PActionPerformed(evt);
          }
        });

    A.setText("A");
    A.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            AActionPerformed(evt);
          }
        });

    I.setText("I");
    I.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            IActionPerformed(evt);
          }
        });

    O.setText("O");
    O.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            OActionPerformed(evt);
          }
        });

    K.setText("K");
    K.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            KActionPerformed(evt);
          }
        });

    J.setText("J");
    J.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            JActionPerformed(evt);
          }
        });

    L.setText("L");
    L.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            LActionPerformed(evt);
          }
        });

    N2.setText("Ñ");
    N2.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            N2ActionPerformed(evt);
          }
        });

    Z.setText("Z");
    Z.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            ZActionPerformed(evt);
          }
        });

    X.setText("X");
    X.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            XActionPerformed(evt);
          }
        });

    C.setText("C");
    C.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            CActionPerformed(evt);
          }
        });

    V.setText("V");
    V.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            VActionPerformed(evt);
          }
        });

    B.setText("B");
    B.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            BActionPerformed(evt);
          }
        });

    N.setText("N");
    N.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            NActionPerformed(evt);
          }
        });

    Q.setText("Q");
    Q.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            QActionPerformed(evt);
          }
        });

    U.setText("U");
    U.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            UActionPerformed(evt);
          }
        });

    M.setText("M");
    M.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            MActionPerformed(evt);
          }
        });

    T.setText("T");
    T.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            TActionPerformed(evt);
          }
        });

    R.setText("R");
    R.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            RActionPerformed(evt);
          }
        });

    E.setText("E");
    E.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            EActionPerformed(evt);
          }
        });

    Espacio.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            EspacioActionPerformed(evt);
          }
        });

    W.setText("W");
    W.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            WActionPerformed(evt);
          }
        });

    Y.setText("Y");
    Y.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            YActionPerformed(evt);
          }
        });

    javax.swing.GroupLayout teclado_baseLayout = new javax.swing.GroupLayout(teclado_base);
    teclado_base.setLayout(teclado_baseLayout);
    teclado_baseLayout.setHorizontalGroup(
        teclado_baseLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                teclado_baseLayout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        teclado_baseLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                teclado_baseLayout
                                    .createSequentialGroup()
                                    .addGroup(
                                        teclado_baseLayout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.TRAILING, false)
                                            .addGroup(
                                                teclado_baseLayout
                                                    .createSequentialGroup()
                                                    .addComponent(
                                                        Q,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        58,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .RELATED)
                                                    .addComponent(
                                                        W,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        58,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .RELATED)
                                                    .addComponent(
                                                        E,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        58,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .UNRELATED)
                                                    .addComponent(
                                                        R,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        58,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addGroup(
                                                teclado_baseLayout
                                                    .createSequentialGroup()
                                                    .addComponent(
                                                        A,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        58,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .RELATED)
                                                    .addComponent(
                                                        S,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        58,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .RELATED)
                                                    .addComponent(
                                                        D,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        58,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .RELATED,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        Short.MAX_VALUE)
                                                    .addComponent(
                                                        F,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        58,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        teclado_baseLayout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(
                                                G,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                58,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(
                                                T,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                58,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        teclado_baseLayout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(
                                                H,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                58,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(
                                                Y,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                58,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        teclado_baseLayout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(
                                                J,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                58,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(
                                                U,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                58,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        teclado_baseLayout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(
                                                K,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                58,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(
                                                I,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                58,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        teclado_baseLayout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(
                                                L,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                58,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(
                                                O,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                58,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        teclado_baseLayout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(
                                                N2,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                58,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(
                                                P,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                58,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(
                                teclado_baseLayout
                                    .createSequentialGroup()
                                    .addComponent(
                                        Z,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        58,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        teclado_baseLayout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(
                                                Espacio,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                500,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGroup(
                                                teclado_baseLayout
                                                    .createSequentialGroup()
                                                    .addComponent(
                                                        X,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        58,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .RELATED)
                                                    .addComponent(
                                                        C,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        58,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .RELATED)
                                                    .addComponent(
                                                        V,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        58,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .RELATED)
                                                    .addComponent(
                                                        B,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        58,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .RELATED)
                                                    .addComponent(
                                                        N,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        58,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .RELATED)
                                                    .addComponent(
                                                        M,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        58,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)))))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    teclado_baseLayout.setVerticalGroup(
        teclado_baseLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                teclado_baseLayout
                    .createSequentialGroup()
                    .addGap(41, 41, 41)
                    .addGroup(
                        teclado_baseLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                teclado_baseLayout
                                    .createSequentialGroup()
                                    .addComponent(
                                        Q,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        44,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(10, 10, 10))
                            .addGroup(
                                teclado_baseLayout
                                    .createSequentialGroup()
                                    .addComponent(
                                        W,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        44,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(11, 11, 11))
                            .addGroup(
                                teclado_baseLayout
                                    .createSequentialGroup()
                                    .addGroup(
                                        teclado_baseLayout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(
                                                E,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                44,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(
                                                R,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                44,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(
                                                T,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                44,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(
                                                Y,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                44,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(
                                                U,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                44,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(
                                                I,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                44,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(
                                                O,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                44,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(
                                                P,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                44,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(18, 18, 18)))
                    .addGroup(
                        teclado_baseLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(
                                A,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                44,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                S,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                44,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                D,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                44,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(
                                teclado_baseLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(
                                        G,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        44,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(
                                        F,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        44,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(
                                H,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                44,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                J,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                44,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                K,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                44,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                L,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                44,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                N2,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                44,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(
                        teclado_baseLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                Z,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                44,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                X,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                44,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                C,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                44,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                V,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                44,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                B,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                44,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                N,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                44,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                M,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                44,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED, 39, Short.MAX_VALUE)
                    .addComponent(
                        Espacio,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        44,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(19, 19, 19)));

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(
                teclado_base,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(
                teclado_base,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE));
  } // </editor-fold>//GEN-END:initComponents
Esempio n. 22
0
 @Override
 public int hashCode() {
   return a.hashCode() + 31 * b.hashCode();
 }
Esempio n. 23
0
 @Override
 public boolean equals(Object o) {
   @SuppressWarnings("unchecked")
   Pair<X, Y> p = (Pair<X, Y>) o;
   return a.equals(p.a) && b.equals(p.b);
 }
 /**
  * Returns the sum of squared deviations of Y from its mean.
  *
  * @return total sum of squares
  */
 public double calculateTotalSumOfSquares() {
   return new SecondMoment().evaluate(Y.getData());
 }
Esempio n. 25
0
 @Override
 public int hashCode() {
   int result = x != null ? x.hashCode() : 0;
   result = 31 * result + (y != null ? y.hashCode() : 0);
   return result;
 }
 public <Y, X> void f(Object obj, Y y, X x) {
   System.out.println(obj.getClass().getName());
   System.out.println(y.getClass().getName());
   System.out.println(x.getClass().getName());
 }