/** return content as string array */ public String[] toStringArray() { if (iContent.size() == 1 && iContent.get(0).toString().length() == 0) return new String[] {}; String[] ret = new String[iContent.size()]; for (int i = 0; i < ret.length; i++) { Term t = elementAt(i); ret[i] = (t.getText().length() > 0 ? t.toString() : t.elementAt(0).toString()); } return ret; }
/** return content as int array */ public int[] toIntArray() { // System.err.println("ToIntArray: "+this); if (iContent.size() == 1 && iContent.get(0).toString().length() == 0) return new int[] {}; int[] ret = new int[iContent.size()]; for (int i = 0; i < ret.length; i++) { Term t = elementAt(i); ret[i] = (t.getText().length() > 0 ? Integer.parseInt(t.getText()) : t.elementAt(0).toInt()); // System.err.println(" "+i+" .. "+ret[i]); } return ret; }