Here you can find the source of parseIntervals(Node intervals)
private static Integer[] parseIntervals(Node intervals)
//package com.java2s; /*//from w w w . ja v a 2s. c o m * $Id$ * * Copyright 1998,1999,2000,2001 by Rockhopper Technologies, Inc., * 75 Trueman Ave., Haddonfield, New Jersey, 08033-2529, U.S.A. * All rights reserved. * * This software is the confidential and proprietary information * of Rockhopper Technologies, Inc. ("Confidential Information"). You * shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement * you entered into with RTI. */ import java.util.ArrayList; import java.util.List; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { private static Integer[] parseIntervals(Node intervals) { NodeList sc = intervals.getChildNodes(); int len = sc.getLength(); int[] a = new int[len]; List<Integer> list = new ArrayList<Integer>(); for (int i = 0; i < len; i++) { Node nn = sc.item(i); if (nn.getNodeName().equalsIgnoreCase("interval")) { // System.out.println(nn.getTextContent()); a[i] = Integer.parseInt(nn.getTextContent()); list.add(Integer.parseInt(nn.getTextContent())); } } Integer[] array = new Integer[list.size()]; return list.toArray(array); } }