Skip to content

Commit

Permalink
GROOVY-3252 - implement DGM.toString() for the various primitive arra…
Browse files Browse the repository at this point in the history
…y types.

git-svn-id: http://svn.codehaus.org/groovy/trunk/groovy/groovy-core@14852 a5544e8c-8a19-0410-ba12-f9af4593a198
  • Loading branch information
jimwhite committed Jan 6, 2009
1 parent 9934def commit 3d20737
Showing 1 changed file with 88 additions and 0 deletions.
88 changes: 88 additions & 0 deletions src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
Expand Up @@ -6312,6 +6312,94 @@ else if (size < 0) {
}
return answer.toString();
}

/**
* Returns the string representation of the given array.
*
* @param self an array
* @return the string representation
* @since 1.6
*/
public static String toString(boolean[] self) {
return InvokerHelper.toString(self);
}

/**
* Returns the string representation of the given array.
*
* @param self an array
* @return the string representation
* @since 1.6
*/
public static String toString(byte[] self) {
return InvokerHelper.toString(self);
}

/**
* Returns the string representation of the given array.
*
* @param self an array
* @return the string representation
* @since 1.6
*/
public static String toString(char[] self) {
return InvokerHelper.toString(self);
}

/**
* Returns the string representation of the given array.
*
* @param self an array
* @return the string representation
* @since 1.6
*/
public static String toString(short[] self) {
return InvokerHelper.toString(self);
}

/**
* Returns the string representation of the given array.
*
* @param self an array
* @return the string representation
* @since 1.6
*/
public static String toString(int[] self) {
return InvokerHelper.toString(self);
}

/**
* Returns the string representation of the given array.
*
* @param self an array
* @return the string representation
* @since 1.6
*/
public static String toString(long[] self) {
return InvokerHelper.toString(self);
}

/**
* Returns the string representation of the given array.
*
* @param self an array
* @return the string representation
* @since 1.6
*/
public static String toString(float[] self) {
return InvokerHelper.toString(self);
}

/**
* Returns the string representation of the given array.
*
* @param self an array
* @return the string representation
* @since 1.6
*/
public static String toString(double[] self) {
return InvokerHelper.toString(self);
}

/**
* Returns the string representation of the given map.
Expand Down

0 comments on commit 3d20737

Please sign in to comment.