/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

/*
 * VaryNode.java
 * Copyright (C) 2002 University of Waikato, Hamilton, New Zealand
 * 
 */
package dataset.adtree;

public class VaryNode implements java.io.Serializable {
	
	private static final long serialVersionUID = 1620302617107007728L;

	/** index of the node varied **/
	public int m_iNode;

	/** most common value **/
	public int m_nMCV;

	/** list of ADNode children **/
	public ADNode[] m_ADNodes;

	/** Creates new VaryNode */
	public VaryNode(int iNode) {
		m_iNode = iNode;
	}

	/**
	 * print is used for debugging only, called from ADNode
	 *
	 * @param sTab
	 *            amount of space.
	 */
	public void print(String sTab) {
		for (int iValue = 0; iValue < m_ADNodes.length; iValue++) {
			System.out.print(sTab + iValue + ": ");
			if (m_ADNodes[iValue] == null) {
				if (iValue == m_nMCV) {
					System.out.println("MCV");
				} else {
					System.out.println("null");
				}
			} else {
				System.out.println();
				m_ADNodes[iValue].print();
			}
		}
	}
}