📄 ihierarchy.java
字号:
/* * SchoolEJB - CyberDemia's library of EJBs for educational related services. * Copyright (C) 2003 CyberDemia Research and Services * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * See the COPYING file located in the top-level-directory of * the archive of this library for complete text of license. */package com.cyberdemia.school;/** * IHierarchy is an interface that is implemented by all * hierarchy node classes that may be part of the hierarchy tree * configured in <i>school.xml</i>. * IHierarchy defines the common methods for a node in the hierarchy tree. * * @author Alexander Yap */public interface IHierarchy{ /** * Gets the unique ID. * @return Unique ID. */ Integer getId(); /** * Gets a String that encodes the hierarchy from the * root node to this hierarchy node. * Each hierarchy node has its own unique "hierarchy identifier" String. * @return The hierarchy identifier. */ String getHierarchyId(); /** * Gets the name intended for display in user interface. * @return Name of this hierarchy node. */ String getName(); /** * Gets the type of this node, based on the depth within the hierarchy. * All the nodes at a certain level are of the same type. * A set of templates are defined in <i>school.xml</i> to map * the node levels to types. * @return Node type. */ String getType(); /** * Gets the level of this node within the hierarchy. * The root node has level 0. * @return Node level. */ int getLevel(); /** * Gets the children of this node. * @return Array of all children nodes. */ IHierarchy[] getChildren(); /** * Checks if this node has any children. * @return true if this node has one or more children, otherwise false. */ boolean hasChildren(); /** * Gets a child of this node. * @param id Child node ID. * @return Child node, or null if no child with the ID. */ IHierarchy getChild(Integer id); /** * Adds a child to this node. * @param child Child node to add. */ void addChild(IHierarchy child); /** * Gets the parent of this node. * @return Parent node. */ IHierarchy getParent(); /** * Checks if this hierarchy node is the deepest node. * @return true if this node is the deepest, otherwise false. */ boolean isDeepest(); /** * Separator between the different components of the hierarchy Id. */ String HIERARCHY_ID_SEPARATOR = ",";}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -