/** Returns the plural case variable value. */ private long getPlural(String pluralVarName) { IntegerData pluralValue = (IntegerData) placeholders.get(pluralVarName); if (pluralValue == null) { throw new IllegalArgumentException("No value provided for plural: '" + pluralVarName + "'"); } return pluralValue.longValue(); } }
/** Returns the plural case variable value. */ private static long getPlural(Map<String, Object> placeholders, String pluralVarName) { IntegerData pluralValue = (IntegerData) placeholders.get(pluralVarName); if (pluralValue == null) { throw new IllegalArgumentException("No value provided for plural: '" + pluralVarName + "'"); } return pluralValue.longValue(); }
/** * Returns the smallest (closest to negative infinity) integer value that is greater than or equal * to the argument. */ public static long ceil(SoyValue arg) { if (arg instanceof IntegerData) { return ((IntegerData) arg).longValue(); } else { return (long) Math.ceil(arg.floatValue()); } }
/** * Returns the largest (closest to positive infinity) integer value that is less than or equal to * the argument. */ public static long floor(SoyValue arg) { if (arg instanceof IntegerData) { return ((IntegerData) arg).longValue(); } else { return (long) Math.floor(arg.floatValue()); } }
/** * Returns the smallest (closest to negative infinity) integer value that is greater than or equal * to the argument. */ public static long ceil(SoyValue arg) { if (arg instanceof IntegerData) { return ((IntegerData) arg).longValue(); } else { return (long) Math.ceil(arg.floatValue()); } }
/** * Returns the largest (closest to positive infinity) integer value that is less than or equal to * the argument. */ public static long floor(SoyValue arg) { if (arg instanceof IntegerData) { return ((IntegerData) arg).longValue(); } else { return (long) Math.floor(arg.floatValue()); } }