Java BigInteger Value Check isDefined(BigInteger no)

Here you can find the source of isDefined(BigInteger no)

Description

Checking if the BigInteger is set.

License

EUPL

Parameter

Parameter Description
no The number.

Return

true/false

Declaration

public static boolean isDefined(BigInteger no) 

Method Source Code


//package com.java2s;
/* //ww  w .java2  s .c om
 *  Copyright (c) 2010-2014 EUROPEAN UNION
 *  Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
 *  the European Commission - subsequent versions of the EUPL (the "Licence");
 *  You may not use this work except in compliance with the Licence.
 *  You may obtain a copy of the Licence at: 
 *  http://ec.europa.eu/idabc/eupl
 *  
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the Licence is distributed on an "AS IS" basis,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the Licence for the specific language governing permissions and
 *  limitations under the Licence.
 *  
 *  Date: __/__/____
 *  Authors: European Commission, Joint Research Centre
 *  Lucasz Cyra, Emanuela Epure, Daniele Francioli
 *  aq-dev@jrc.ec.europa.eu
 */

import java.math.BigInteger;

import java.util.List;

public class Main {
    /**
     * Checking if an attribute is defined.
     *
     * @param field The attribute.
     * @return true/false
     */
    public static boolean isDefined(String field) {
        return field != null && !field.equals("");
    }

    /**
     * Checking if the list is not empty.
     *
     * @param list The list.
     * @return true/false
     */
    public static boolean isDefined(List<?> list) {
        return list != null && list.size() > 0;
    }

    /**
     * Checking if the BigInteger is set.
     *
     * @param no The number.
     * @return true/false
     */
    public static boolean isDefined(BigInteger no) {
        return no != null;
    }
}

Related

  1. isBigger(final BigInteger big1, final BigInteger big2)
  2. isCovers(BigInteger covers, BigInteger value)
  3. isElementOfZn(BigInteger element, BigInteger n)
  4. isEven(BigInteger x)
  5. isFermatNumber(BigInteger f)
  6. isGoodGaAndGb(BigInteger g_a, BigInteger p)