Example usage for com.google.common.primitives Longs toArray

List of usage examples for com.google.common.primitives Longs toArray

Introduction

In this page you can find the example usage for com.google.common.primitives Longs toArray.

Prototype

public static long[] toArray(Collection<? extends Number> collection) 

Source Link

Document

Returns an array containing each value of collection , converted to a long value in the manner of Number#longValue .

Usage

From source file:co.cask.tephra.distributed.TransactionConverterUtils.java

public static Transaction unwrap(TTransaction thriftTx) {
    return new Transaction(thriftTx.getReadPointer(), thriftTx.getTransactionId(), thriftTx.getWritePointer(),
            thriftTx.getInvalids() == null ? EMPTY_LONG_ARRAY : Longs.toArray(thriftTx.getInvalids()),
            thriftTx.getInProgress() == null ? EMPTY_LONG_ARRAY : Longs.toArray(thriftTx.getInProgress()),
            thriftTx.getFirstShort(), getTransactionType(thriftTx.getType()),
            thriftTx.getCheckpointWritePointers() == null ? EMPTY_LONG_ARRAY
                    : Longs.toArray(thriftTx.getCheckpointWritePointers()),
            getVisibilityLevel(thriftTx.getVisibilityLevel()));
}

From source file:com.facebook.presto.orc.metadata.statistics.HiveBloomFilter.java

public HiveBloomFilter(List<Long> bits, int numBits, int numHashFunctions) {
    this.bitSet = new BitSet(Longs.toArray(bits));
    this.numBits = numBits;
    this.numHashFunctions = numHashFunctions;
}

From source file:io.hops.transaction.lock.CachedBlockLock.java

public CachedBlockLock(List<Long> blockIds, DatanodeID datanodeId) {
    this.blockIds = Longs.toArray(blockIds);
    this.datanodeId = datanodeId;
}

From source file:org.sosy_lab.java_smt.solvers.z3.Z3UFManager.java

@Override
protected Long createUninterpretedFunctionCallImpl(Long funcDecl, List<Long> pArgs) {
    return Native.mkApp(z3context, funcDecl, pArgs.size(), Longs.toArray(pArgs));
}

From source file:org.apache.tajo.storage.thirdparty.orc.BloomFilterIO.java

/**
 * Initializes the BloomFilter from the given Orc BloomFilter
 *///from   w ww .j a  va 2  s  .c  om
public BloomFilterIO(OrcProto.BloomFilter bloomFilter) {
    this.bitSet = new BitSet(Longs.toArray(bloomFilter.getBitsetList()));
    this.numHashFunctions = bloomFilter.getNumHashFunctions();
    this.numBits = (int) this.bitSet.bitSize();
}

From source file:org.sosy_lab.cpachecker.util.predicates.z3.Z3QuantifiedFormulaManager.java

@Override
protected Long exists(List<Long> pVariables, Long pBody) {
    return Z3NativeApi.mk_exists_const(z3context, 0, pVariables.size(), Longs.toArray(pVariables), 0,
            Longs.toArray(Collections.<Long>emptyList()), pBody);
}

From source file:org.sosy_lab.java_smt.solvers.mathsat5.Mathsat5FormulaManager.java

static long[] getMsatTerm(Collection<? extends Formula> pFormulas) {
    return Longs.toArray(Collections2.transform(pFormulas, Mathsat5FormulaManager::getMsatTerm));
}

From source file:org.sosy_lab.java_smt.solvers.z3.Z3UFManager.java

@Override
protected Long declareUninterpretedFunctionImpl(String pName, Long returnType, List<Long> pArgTypes) {

    long symbol = Native.mkStringSymbol(z3context, pName);
    long[] sorts = Longs.toArray(pArgTypes);
    long func = Native.mkFuncDecl(z3context, symbol, sorts.length, sorts, returnType);
    Native.incRef(z3context, func);
    return func;//from   w ww  . j av  a 2  s .co  m
}

From source file:org.sosy_lab.solver.mathsat5.Mathsat5FunctionFormulaManager.java

@Override
protected Long createUninterpretedFunctionCallImpl(Long funcDecl, List<Long> pArgs) {
    long[] args = Longs.toArray(pArgs);
    return createUIFCallImpl(funcDecl, args);
}

From source file:org.sosy_lab.solver.z3.Z3FunctionFormulaManager.java

@Override
protected Long createUninterpretedFunctionCallImpl(Long funcDecl, List<Long> pArgs) {
    long[] args = Longs.toArray(pArgs);
    return unsafeManager.createUIFCallImpl(funcDecl, args);
}