Example usage for java.lang Long MAX_VALUE

List of usage examples for java.lang Long MAX_VALUE

Introduction

In this page you can find the example usage for java.lang Long MAX_VALUE.

Prototype

long MAX_VALUE

To view the source code for java.lang Long MAX_VALUE.

Click Source Link

Document

A constant holding the maximum value a long can have, 263-1.

Usage

From source file:com.livhuwani.rambuda.policyquotation_app.service.Impl.PersonCrudServiceImpl.java

@Override
public Person createPerson(Intermediary user) {
    Person newCust = new Person();
    newCust.setId(Long.MAX_VALUE + 1);
    newCust.setName("Rudzani");
    newCust.setSName("Nengovhela");
    newCust.setMemberNumber("200907118");
    newCust.setUser(user);/*w w w . ja  v a  2  s . c o m*/

    Person savedCust = personRepository.saveAndFlush(newCust);
    return savedCust;
}

From source file:com.livhuwani.rambuda.policyquotationapp.services.Impl.IntermediaryCrudServiceImpl.java

@Override
public Intermediary createIntermediary() {
    Intermediary newUser = new Intermediary();
    newUser.setId(Long.MAX_VALUE + 1);
    newUser.setIntermediaryCode("208224262");

    Intermediary savedUser = intermediaryRepository.save(newUser);
    return savedUser;
}

From source file:com.livhuwani.rambuda.policyquotation_app.service.Impl.IntermediaryCrudServiceImpl.java

@Override
public Intermediary createIntermediary() {
    Intermediary newUser = new Intermediary();
    newUser.setId(Long.MAX_VALUE + 1);
    newUser.setIntermediaryCode("208224262");

    Intermediary savedUser = intermediaryRepository.saveAndFlush(newUser);
    return savedUser;
}

From source file:edu.infsci2560.models.Dance.java

public Dance() {
    this.id = Long.MAX_VALUE;
    this.name = null;
    this.danceType = DanceType.Unknown;
    this.difficulty = null;
    //this.description = null;
    this.timeNeed = null;
}

From source file:Main.java

/**
 * Compute e^x to a given scale./*from   w  w  w. ja  v  a 2s .  c  om*/
 * Break x into its whole and fraction parts and
 * compute (e^(1 + fraction/whole))^whole using Taylor's formula.
 * @param x the value of x
 * @param scale the desired scale of the result
 * @return the result value
 */
public static BigDecimal exp(BigDecimal x, int scale) {
    // e^0 = 1
    if (x.signum() == 0) {
        return BigDecimal.valueOf(1);
    }

    // If x is negative, return 1/(e^-x).
    else if (x.signum() == -1) {
        return BigDecimal.valueOf(1).divide(exp(x.negate(), scale), scale, BigDecimal.ROUND_HALF_EVEN);
    }

    // Compute the whole part of x.
    BigDecimal xWhole = x.setScale(0, BigDecimal.ROUND_DOWN);

    // If there isn't a whole part, compute and return e^x.
    if (xWhole.signum() == 0)
        return expTaylor(x, scale);

    // Compute the fraction part of x.
    BigDecimal xFraction = x.subtract(xWhole);

    // z = 1 + fraction/whole
    BigDecimal z = BigDecimal.valueOf(1).add(xFraction.divide(xWhole, scale, BigDecimal.ROUND_HALF_EVEN));

    // t = e^z
    BigDecimal t = expTaylor(z, scale);

    BigDecimal maxLong = BigDecimal.valueOf(Long.MAX_VALUE);
    BigDecimal result = BigDecimal.valueOf(1);

    // Compute and return t^whole using intPower().
    // If whole > Long.MAX_VALUE, then first compute products
    // of e^Long.MAX_VALUE.
    while (xWhole.compareTo(maxLong) >= 0) {
        result = result.multiply(intPower(t, Long.MAX_VALUE, scale)).setScale(scale,
                BigDecimal.ROUND_HALF_EVEN);
        xWhole = xWhole.subtract(maxLong);

        Thread.yield();
    }
    return result.multiply(intPower(t, xWhole.longValue(), scale)).setScale(scale, BigDecimal.ROUND_HALF_EVEN);
}

From source file:jp.primecloud.auto.api.ApiValidate.java

public static void validateFarmNo(String farmNo) {
    ValidateUtil.required(farmNo, "EAPI-000001", new Object[] { PARAM_NAME_FARM_NO });
    ValidateUtil.longInRange(farmNo, new Long(1), Long.MAX_VALUE, "EAPI-000002",
            new Object[] { PARAM_NAME_FARM_NO, new Long(1), Long.MAX_VALUE });
}

From source file:edu.infsci2560.models.Location.java

public Location() {
    this.id = Long.MAX_VALUE;
    this.locationName = null;
    this.locationType = LocationType.Unknown;
    this.address = null;
    this.description = null;
    this.imageName = null;
}

From source file:livhuwani.rambuda.policy_app.services.Impl.PolicyQuoteCrudServiceImpl.java

@Override
public PolicyQuote createPolicyQuotes(Person person, Policy policy) {
    PolicyQuote quote = new PolicyQuote();
    quote.setId(Long.MAX_VALUE + 1);
    quote.setPerson(person);/*from   w w w .ja v  a2 s  . co  m*/
    quote.setPolicy(policy);
    quote.setQuoteAmount(BigDecimal.valueOf(3200));
    quote.setQuoteStatus(Boolean.TRUE);
    quote.setQuoteDate(DateTime.now());

    PolicyQuote savedQuote = policyQuoteRepository.saveAndFlush(quote);
    return savedQuote;
}

From source file:cn.dooland.net.NeverOutDateHttpHeaderParser.java

/**
 * Extracts a {@link Cache.Entry} from a {@link NetworkResponse}.
 * /*from  w  ww.  j av a2  s .  com*/
 * @param response
 *            The network response to parse headers from
 * @return a cache entry for the given response, or null if the response is
 *         not cacheable.
 */
public static Cache.Entry parseCacheHeaders(NetworkResponse response) {

    Map<String, String> headers = response.headers;

    long serverDate = 0;
    long lastModified = 0;

    String serverEtag = null;
    String headerValue;

    headerValue = headers.get("Date");
    if (headerValue != null) {
        serverDate = parseDateAsEpoch(headerValue);
    }

    headerValue = headers.get("Last-Modified");
    if (headerValue != null) {
        lastModified = parseDateAsEpoch(headerValue);
    }

    serverEtag = headers.get("ETag");

    Cache.Entry entry = new Cache.Entry();
    entry.data = response.data;
    entry.etag = serverEtag;
    entry.softTtl = Long.MAX_VALUE;
    entry.ttl = Long.MAX_VALUE;
    entry.serverDate = serverDate;
    entry.lastModified = lastModified;
    entry.responseHeaders = headers;

    return entry;
}

From source file:edu.infsci2560.models.KMCatalogEntry.java

public KMCatalogEntry() {
    this.id = Long.MAX_VALUE;
    this.documentTitle = null;
    this.knowledgeOwner = null;
    this.audience = null;
    this.documentCategory = null;
    this.community = null;
    this.product = null;
    this.documentFilename = null;
}