/*
 * @(#)TreeNodeCollection.java  1.0  2001-10-08
 *
 * Copyright (c) 2001 Werner Randelshofer, Immensee, Switzerland.
 * All rights reserved.
 *
 * You may not use, copy or modify this file, except in compliance with the
 * license agreement you entered into with Werner Randelshofer.
 * For details see accompanying license terms.
 */

package ch.randelshofer.gui.tree;
import java.util.*;
import javax.swing.tree.*;
import ch.randelshofer.util.*;
/**
 * Wraps a default mutable tree node with the List interface.
 *
 * @author  Werni Randelshofer
 * @version 1.0 2001-10-08
 */
public class TreeNodeCollection extends AbstractList {
    DefaultMutableTreeNode model;

    /** Creates new TreeNodeCollection */
    public TreeNodeCollection(DefaultMutableTreeNode n) {
        model = n;
    }

    public Object get(int index) {
        return model.getChildAt(index);
    }
    
    public int size() {
        return model.getChildCount();
    }
}
