/** * Create a typed symbol value. * * @param sym The symbol. * @param val The value. * @param <T> The type of the symbol. * @return A pair of the symbol and value. */ @SuppressWarnings("unchecked") public static <T> SymbolValue<T> of(TypedSymbol<T> sym, T val) { if (sym.getType().equals(Double.class)) { return (SymbolValue<T>) new DoubleSymbolValue((TypedSymbol<Double>) sym, (Double) val); } else { return new TypedSymbolValue<T>(sym, val); } }
/** * Create an unboxed symbol value. * * @param sym The symbol. * @param val The value. * @return A pair of the symbol and value. */ public static DoubleSymbolValue of(Symbol sym, double val) { return of(TypedSymbol.of(Double.class, sym), val); }