Example usage for jdk.nashorn.internal.runtime JSType isNumber

List of usage examples for jdk.nashorn.internal.runtime JSType isNumber

Introduction

In this page you can find the example usage for jdk.nashorn.internal.runtime JSType isNumber.

Prototype

public static boolean isNumber(final Object obj) 

Source Link

Document

Returns true if object represents a primitive JavaScript number value.

Usage

From source file:cPenjat.java

public boolean checkChar(String value) {
    boolean check = false;
    try {/*  w ww.  j  av a 2  s.co  m*/
        if (!JSType.isNumber(value)) {
            if (value.length() == 1) {
                check = true;
            }
        }
    } catch (Exception e) {
        System.out.println(e.toString());
    }
    return check;
}

From source file:aulaorientacaoobjeto.aplicacaoCpf.java

public String cpfParseString() {

    String numCpf = null;/*from  w  w  w. j a v  a  2s . c o m*/
    Boolean confere = false;
    while (!confere == true) {
        boolean digitouAlgumCPF = false;
        while (!digitouAlgumCPF) {
            numCpf = JOptionPane.showInputDialog(null, "Qual Numero do Cpf?\nInsira apenas os digitos: ");
            if (numCpf == null) {
                digitouAlgumCPF = false;
                JOptionPane.showMessageDialog(null, "Digite um cpf para continuar!");
            } else {
                digitouAlgumCPF = true;
                numCpf = numCpf.trim();
                if (JSType.isNumber(numCpf) && numCpf.length() == 11) {
                    confere = true;
                } else {
                    JOptionPane.showMessageDialog(null, "Numero de Cpf esta com formato incorreto!");

                }
            }
        }
    }
    return numCpf;
}

From source file:ConversaoDigitos.NumerosExtenso.java

int Digitos(String Numero) {
    if (JSType.isNumber(Numero)) {

        if (Numero.length() > 9) {
            Numero = Numero.substring(0, 9);
        }//from   w w w  .  j a va2 s .  c o  m
        return Numero.length();
    }
    JOptionPane.showMessageDialog(null, " Voce no digitou um numero!", "Erro", JOptionPane.WARNING_MESSAGE);
    System.exit(0);
    return -1;
}