001    // Copyright 2004, 2005 The Apache Software Foundation
002    //
003    // Licensed under the Apache License, Version 2.0 (the "License");
004    // you may not use this file except in compliance with the License.
005    // You may obtain a copy of the License at
006    //
007    //     http://www.apache.org/licenses/LICENSE-2.0
008    //
009    // Unless required by applicable law or agreed to in writing, software
010    // distributed under the License is distributed on an "AS IS" BASIS,
011    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012    // See the License for the specific language governing permissions and
013    // limitations under the License.
014    
015    package org.apache.tapestry.contrib.tree.model;
016    
017    import java.io.Serializable;
018    import java.util.Collection;
019    
020    /**
021     * @author ceco
022     */
023    
024    public interface ITreeNode extends Serializable
025    {
026        
027        /**
028         * Returns the <code>Collection</code> of children. 
029         */
030        Collection getChildren();
031    
032        /**
033         * Returns the number of children <code>ITreeNode</code>s the receiver
034         * contains.
035         */
036        int getChildCount();
037    
038        /**
039         * Returns the parent <code>ITreeNode</code> of the receiver.
040         */
041        ITreeNode getParent();
042    
043        /**
044         * Returns the true if current node contains received children, otherwise return false.
045         */
046        boolean containsChild(ITreeNode node);
047    
048        /**
049         * Returns true if the receiver allows children.
050         */
051        boolean getAllowsChildren();
052    
053        /**
054         * Returns true if the receiver is a leaf.
055         */
056        boolean isLeaf();
057    
058    }