Example usage for java.lang Long Long

List of usage examples for java.lang Long Long

Introduction

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

Prototype

@Deprecated(since = "9")
public Long(String s) throws NumberFormatException 

Source Link

Document

Constructs a newly allocated Long object that represents the long value indicated by the String parameter.

Usage

From source file:br.ufac.sion.converter.CargoConverter.java

@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) {
    if (StringUtils.isBlank(value)) {
        return null;
    }/*from   w ww . ja  v a2s .  com*/
    System.out.println("cargo " + value);
    return this.cargoFacade.findById(new Long(value));
}

From source file:br.ufac.sion.inscricao.converter.CandidatoConverter.java

@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) {
    if (StringUtils.isBlank(value)) {
        return null;
    }/*from w ww  .  jav a 2  s  .  c o m*/
    return this.candidatoFacade.findById(new Long(value));
}

From source file:br.ufac.sion.converter.ContaConverter.java

@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) {
    if (StringUtils.isBlank(value)) {
        return null;
    }// w  ww. j  ava2 s.  com
    return this.contaBancariaFacade.findById(new Long(value));
}

From source file:hu.jozsef.vesza.so.servlets.LocationImageService.java

@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    Long eventId = new Long(request.getParameter("identifier"));
    Event fetchedEvent = objectify.load().type(Event.class).id(eventId).now();
    String imageUrl = "/WEB-INF/" + fetchedEvent.getLocation().getShortName() + ".png";
    String imageRealPath = this.getServletContext().getRealPath(imageUrl);
    InputStream imgStream = new FileInputStream(new File(imageRealPath));

    Blob image = new Blob(IOUtils.toByteArray(imgStream));
    if (image != null) {
        response.setContentType("image/jpeg");
        response.getOutputStream().write(image.getBytes());
    } else {/*from   w ww . j  av a  2s.c  o m*/
        response.getWriter().write("no image");
    }

}

From source file:com.fileanalyzer.util.LineStatisticCalculator.java

public FileStatistic getFileStatistic() {
    FileStatistic fileStatis = new FileStatistic();

    fileStatis.setLengthLine(new Long(line.length()));
    String strArr[] = line.split(regexp);
    TreeSet<Integer> maxWord = new TreeSet();
    TreeSet<Integer> minWord = new TreeSet();
    long sumWords = 0;
    for (int i = 0; i < strArr.length; ++i) {
        int strSize = strArr[i].length();
        sumWords += strSize;/*from  w  w  w. j  av a2  s. c  o  m*/
        if (i > 0 && i < strArr.length - 1)
            maxWord.add(strSize);
        minWord.add(strSize);
    }
    fileStatis.setLine(HtmlUtils.htmlEscape(line));
    if (sumWords > 0) {
        fileStatis.setAvgWord(new Double(sumWords / strArr.length));
        fileStatis.setMinWord(new Long(minWord.first()));
    }
    if (maxWord.size() > 0)
        fileStatis.setMaxWord(new Long(maxWord.last()));
    if (getIdFk() != null)
        fileStatis.setFileId(getIdFk());
    return fileStatis;
}

From source file:br.ufac.sion.converter.FuncionarioConverter.java

@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) {
    if (StringUtils.isBlank(value)) {
        return null;
    }//from w  w  w  . j  a  va2s. com
    return this.funcionarioFacade.findById(new Long(value));
}

From source file:br.ufac.sion.inscricao.converter.LocalidadeConverter.java

@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) {
    if (StringUtils.isBlank(value)) {
        return null;
    }//from   www.  j av  a  2 s  . c o m
    return this.localidadeFacade.findById(new Long(value));
}

From source file:MainClass.java

public Object[][] getFileStats(File dir) {
    String files[] = dir.list();/*from w  ww. ja v a2 s.co m*/
    Object[][] results = new Object[files.length][titles.length];

    for (int i = 0; i < files.length; i++) {
        File tmp = new File(files[i]);
        results[i][0] = new Boolean(tmp.isDirectory());
        results[i][1] = tmp.getName();
        results[i][2] = new Boolean(tmp.canRead());
        results[i][3] = new Boolean(tmp.canWrite());
        results[i][4] = new Long(tmp.length());
        results[i][5] = new Date(tmp.lastModified());
    }
    return results;
}

From source file:com.redhat.lightblue.crud.validator.MinMaxCheckerTest.java

/**
 * Col1: For debugging purposes to know which test case had issues
 * Col2: A instantiation to test with. Should always represent 2.
 */// ww  w .j a va 2s  .  c o  m
@Parameters(name = "{index}: {0}")
public static Collection<Object[]> data() {
    return Arrays.asList(new Object[][] { { Integer.class, new Integer(2) },
            { Byte.class, new Byte(new Integer(2).byteValue()) },
            { Short.class, new Short(new Integer(2).shortValue()) }, { Long.class, new Long(2L) },
            { Float.class, new Float(2F) }, { Double.class, new Double(2D) },
            { BigInteger.class, new BigInteger("2") }, { BigDecimal.class, new BigDecimal(2) } });
}

From source file:com.repaskys.domain.ShortUrl.java

public static Long shortCodeToId(String shortCode) {
    int i = CODEC.decode(shortCode);
    return new Long(i);
}