Example usage for java.util.concurrent.atomic AtomicLong toString

List of usage examples for java.util.concurrent.atomic AtomicLong toString

Introduction

In this page you can find the example usage for java.util.concurrent.atomic AtomicLong toString.

Prototype

public String toString() 

Source Link

Document

Returns the String representation of the current value.

Usage

From source file:Main.java

public static void main(String[] argv) {
    AtomicLong nextId = new AtomicLong();

    System.out.println(nextId.getAndIncrement());
    System.out.println(nextId.toString());
}

From source file:okuyama.imdst.util.KeyManagerValueMap.java

public String[] getAllDataUseSize() {

    if (dataSizeMap == null || dataSizeMap.size() == 0)
        return null;

    String[] sizeList = new String[dataSizeMap.size()];
    Set entrySet = dataSizeMap.entrySet();
    Iterator entryIte = entrySet.iterator();
    int idx = 0;//  w  w w . ja v a2 s .co  m
    while (entryIte.hasNext()) {

        Map.Entry obj = (Map.Entry) entryIte.next();
        if (obj == null)
            continue;

        String key = (String) obj.getKey();
        AtomicLong size = (AtomicLong) obj.getValue();

        sizeList[idx] = key + "=" + size.toString();
        idx++;
    }

    return sizeList;
}

From source file:org.structr.javaparser.JavaParserModule.java

/**
 * Add compilation units of all jar files found in the given folder to the index.
 *
 * @param folderPath// w  w w  . j ava  2 s .  com
 */
public void addJarsToIndex(final String folderPath) {

    logger.info("Starting adding jar files in " + folderPath);

    final CombinedTypeSolver typeSolver = new CombinedTypeSolver();
    typeSolver.add(new ReflectionTypeSolver());

    final AtomicLong count = new AtomicLong(0);

    try {
        Files.newDirectoryStream(Paths.get(folderPath), path -> path.toString().endsWith(".jar"))
                .forEach((file) -> {
                    try {
                        typeSolver.add(new JarTypeSolver(new FileInputStream(file.toFile())));
                        count.addAndGet(1L);

                    } catch (IOException ex) {
                    }
                });

    } catch (IOException ex) {
    }

    logger.info("Added " + count.toString() + " jar files to the type solver");

    typeSolver.add(structrTypeSolver);

    facade = JavaParserFacade.get(typeSolver);

    logger.info("Done with adding jar files in " + folderPath);
}

From source file:ca.oson.json.Oson.java

private String atomicLong2JsonDefault(FieldData objectDTO) {
    AtomicLong valueToReturn = json2AtomicLongDefault(objectDTO);

    if (valueToReturn == null) {
        return null;
    }//from  www  .  j  a v  a  2s  . com

    return valueToReturn.toString();
}