From: <pat...@us...> - 2009-10-16 19:39:08
|
Revision: 966 http://cishell.svn.sourceforge.net/cishell/?rev=966&view=rev Author: pataphil Date: 2009-10-16 19:38:51 +0000 (Fri, 16 Oct 2009) Log Message: ----------- * Improved documentation of StringUtilities.interpretObjectAsString. * Added TODOs to reflect considerations by Joseph and Russell. (No time to do them now.) * Reviewed by Joseph. Modified Paths: -------------- trunk/core/org.cishell.utilities/src/org/cishell/utilities/StringUtilities.java Modified: trunk/core/org.cishell.utilities/src/org/cishell/utilities/StringUtilities.java =================================================================== --- trunk/core/org.cishell.utilities/src/org/cishell/utilities/StringUtilities.java 2009-10-16 19:02:20 UTC (rev 965) +++ trunk/core/org.cishell.utilities/src/org/cishell/utilities/StringUtilities.java 2009-10-16 19:38:51 UTC (rev 966) @@ -67,12 +67,20 @@ * Prefuse table columns are typed. If a column contains a null cell, * Prefuse types that column as an array type, and it then represents * null values with arrays of length 0. + * To handle this, this method returns: + * null if the object is actually null or array of length 0; + * just the first element of the array; or + * the result of the object's toString method. */ + // TODO: Rename to interpretAsString. + // TODO: Move these things to TableUtilities. + // TODO: Handle all cases, including all primitive array types and + // perhaps primitive box types (i.e. Integer). public static String interpretObjectAsString(Object object) { if (object == null) { return null; } else if (object instanceof String[]) { - String[] objectAsStringArray = (String[])object; + String[] objectAsStringArray = (String[]) object; if (objectAsStringArray.length == 0) { return null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |