content.java

来自「java案例开发一书的源代码」· Java 代码 · 共 82 行

JAVA
82
字号
/* * Content.java * * Created on 2003年11月5日, 下午8:48 */package romulus;/** * This class is used to group the ContentItems. * @author  Romulus * @version 1.0 */public class Content implements RomulusNode{        /** All the content items are in this Vector.*/    private java.util.Vector contentitems = new java.util.Vector();        /** content lable.*/    private String label = null;        /** ident.*/    private String ident = null;        /** Creates a new instance of Content */    Content(String ident, String lable) throws RomulusException{        if(ident == null){            throw new RomulusException(RomulusException.IdentError);        }        this.ident = ident;        this.label = lable;    }        /** get label*/    public String getLable(){        return label;    }        public String getIdent(){        return ident;    }        /**     * Add a content item to the content.     * @param item the content item added.     */    void Add(ContentItem item){        contentitems.add(item);    }        /**     * Remove a content item from the content.     * @param item the item will be removed.     * @return true if content contents such content item.     */    boolean Remove(ContentItem item){        return contentitems.remove(item);    }        /**     * Get the iterator to browse the content.     * @return the iterator.     */    public java.util.Iterator contentItemIterator(){        return contentitems.iterator();    }        /**     * @return the size of the content.     */    public int size(){        return contentitems.size();    }        /** The method used to accept the Visitor to do something. */    public void Accept(Visitor v) throws java.sql.SQLException, RomulusException {        v.VisitContent(this);    }    }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?