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:org.sosy_lab.java_smt.solvers.z3.Z3QuantifiedFormulaManager.java

@Override
public Long mkQuantifier(Quantifier q, List<Long> pVariables, Long pBody) {
    if (pVariables.size() == 0) {
        throw new IllegalArgumentException("List of quantified variables can not be empty");
    }//from   ww  w. j  ava  2 s .  c o m
    return Native.mkQuantifierConst(z3context, q == Quantifier.FORALL, 0, pVariables.size(),
            Longs.toArray(pVariables), 0, new long[0], pBody);
}

From source file:net.larry1123.elec.util.config.fieldhanders.longs.LongArrayListFieldHandler.java

/**
 * {@inheritDoc}/*from   w  ww  . j a  va  2 s  .co  m*/
 */
@Override
public void setToFile(ArrayList<Long> value) {
    if (CollectionUtils.isNotEmpty(value)) {
        getPropertiesFile().setLongArray(getPropertyKey(), Longs.toArray(value), getSpacer());
    }
}

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

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

From source file:org.terasology.persistence.typeHandling.coreTypes.LongTypeHandler.java

@Override
public PersistedData serializeCollection(Collection<Long> value, SerializationContext context) {
    return context.create(Longs.toArray(value));
}

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

@Override
protected Long declareUninterpretedFunctionImpl(String pName, Long returnType, List<Long> pArgTypes) {
    long[] types = Longs.toArray(pArgTypes);
    return createFunctionImpl(pName, returnType, types);
}

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

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

    long symbol = mk_string_symbol(z3context, pName);
    long[] sorts = Longs.toArray(pArgTypes);
    long func = mk_func_decl(z3context, symbol, sorts, returnType);
    inc_ref(z3context, func);/* w  w  w . j a v  a  2s .com*/

    smtLogger.logFunctionDeclaration(symbol, sorts, returnType);

    return func;
}

From source file:kungfu.algdesign.util.Utils.java

public static long[] getLongArray(InputStream inputStream) throws IOException {
    InputStreamReader inputStreamReader = new InputStreamReader(inputStream);

    BufferedReader bufferedReader = new BufferedReader(inputStreamReader);

    List<Long> longList = new ArrayList<>();

    String line = null;/*  w w  w. ja va 2 s .c o  m*/

    while ((line = bufferedReader.readLine()) != null) {
        longList.add(Long.valueOf(line));
    }

    return Longs.toArray(longList);
}

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

@Override
protected Long orImpl(Collection<Long> params) {
    return mk_or(z3context, params.size(), Longs.toArray(params));
}

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

@Override
protected Long orImpl(List<Long> params) {
    return mk_or(z3context, params.size(), Longs.toArray(params));
}

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

@Override
protected Long andImpl(Collection<Long> params) {
    return mk_and(z3context, params.size(), Longs.toArray(params));
}