package poi.support;

import java.util.ArrayList;
import java.util.List;


public class ArraysUtil {

	private ArraysUtil() {
	}

	public static int getHashCode(short[] arrays) {
		List list = new ArrayList();
		for (int i = 0; i < arrays.length; i++) {
			list.add(new Short(arrays[i]));
		}
		return list.hashCode();
	}

	public static int getHashCode(byte[] arrays) {
		List list = new ArrayList();
		for (int i = 0; i < arrays.length; i++) {
			list.add(new Byte(arrays[i]));
		}
		return list.hashCode();
	}

	public static int getHashCode(Object[] arrays) {
		List list = new ArrayList();
		for (int i = 0; i < arrays.length; i++) {
			list.add(arrays[i]);
		}
		return list.hashCode();
	}

	public static String getToString(byte[] arrays) {
		StringBuffer s = new StringBuffer();
		s.append("[");
		for (int i = 0; i < arrays.length; i++) {
			s.append(arrays[i]);
			if (i < arrays.length - 1) {
				s.append(", ");
			}
		}
		s.append("]");
		return new String(s);
	}

	public static String getToString(char[] arrays) {
		StringBuffer s = new StringBuffer();
		s.append("[");
		for (int i = 0; i < arrays.length; i++) {
			s.append(arrays[i]);
			if (i < arrays.length - 1) {
				s.append(", ");
			}
		}
		s.append("]");
		return new String(s);
	}

}
