@Test public void testGetStrings() { final List<Object> misc = new ArrayList<Object>(); misc.add(Long.valueOf(1L)); misc.add(-0.3); final Object[] args = { misc, Boolean.valueOf(false) }; final String[] expectedValues = { "1", "-0.3", "FALSE" }; try { assertArrayEquals("getStrings() failed!", expectedValues, FunctionUtil.getStrings(args)); } catch (final Exception e) { fail("getStrings() failed!"); } }
public static String[] getStrings(final Object[] args) { final List<String> strings = new ArrayList<String>(); for (final Object arg : args) { if (arg instanceof List) { final List list = (List)arg; for (final Object listElement : list) strings.add(getArgAsString(listElement)); } else strings.add(getArgAsString(arg)); } final String[] retVal = new String[strings.size()]; return strings.toArray(retVal); }
FunctionUtil { public static String[] getStrings(final Object[] args) { final List<String> strings = new ArrayList<String>(); for (final Object arg : args) { if (arg instanceof List) { final List list = (List)arg; for (final Object listElement : list) strings.add(getArgAsString(listElement)); } else strings.add(getArgAsString(arg)); } final String[] retVal = new String[strings.size()]; return strings.toArray(retVal); } }
FunctionUtil { public static String[] getStrings(final Object[] args) { final List<String> strings = new ArrayList<String>(); for (final Object arg : args) { if (arg instanceof List) { final List list = (List)arg; for (final Object listElement : list) strings.add(getArgAsString(listElement)); } else strings.add(getArgAsString(arg)); } final String[] retVal = new String[strings.size()]; return strings.toArray(retVal); } private  FunctionUtil(); }
FunctionUtil { public static String[] getStrings(final Object[] args) { final List<String> strings = new ArrayList<String>(); for (final Object arg : args) { if (arg instanceof List) { final List list = (List)arg; for (final Object listElement : list) strings.add(getArgAsString(listElement)); } else strings.add(getArgAsString(arg)); } final String[] retVal = new String[strings.size()]; return strings.toArray(retVal); } private  FunctionUtil(); static double getArgAsDouble(final Object arg); static String getArgAsString(final Object arg); static long getArgAsLong(final Object arg); static boolean getArgAsBoolean(final Object arg); static double numericallySafeSum(final double a[]); static String getOrdinal(final int i); static double calcSampleVariance(final double[] x); static double[] listToArray(final List<Double> a); static boolean isScalarArgType(final Class type); static boolean isTypeOfList(final Class listClassCandidate); static void addScalarArgumentTypes(final List<Class> argTypes); static double[] getDoubles(final Object[] args); static long[] getLongs(final Object[] args); static String[] getStrings(final Object[] args); static boolean[] getBooleans(final Object[] args); static Object translateObjectType(final Object input); }
FunctionUtil { public static String[] getStrings(final Object[] args) { final List<String> strings = new ArrayList<String>(); for (final Object arg : args) { if (arg instanceof List) { final List list = (List)arg; for (final Object listElement : list) strings.add(getArgAsString(listElement)); } else strings.add(getArgAsString(arg)); } final String[] retVal = new String[strings.size()]; return strings.toArray(retVal); } private  FunctionUtil(); static double getArgAsDouble(final Object arg); static String getArgAsString(final Object arg); static long getArgAsLong(final Object arg); static boolean getArgAsBoolean(final Object arg); static double numericallySafeSum(final double a[]); static String getOrdinal(final int i); static double calcSampleVariance(final double[] x); static double[] listToArray(final List<Double> a); static boolean isScalarArgType(final Class type); static boolean isTypeOfList(final Class listClassCandidate); static void addScalarArgumentTypes(final List<Class> argTypes); static double[] getDoubles(final Object[] args); static long[] getLongs(final Object[] args); static String[] getStrings(final Object[] args); static boolean[] getBooleans(final Object[] args); static Object translateObjectType(final Object input);  }