/*********************************************************************************************************************************** * Copyright (c) 2000, 2004 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made * available under the terms of the Common Public License v1.0 which accompanies this distribution, and is available at * http://www.eclipse.org/legal/cpl-v10.html * * Contributors: IBM Corporation - initial API and implementation **********************************************************************************************************************************/ package net.sourceforge.phpeclipse.wiki.editor.model; import java.util.ArrayList; public class WikipediaSection { protected static WikipediaSection[] NO_CHILDREN = new WikipediaSection[0]; private WikipediaSection fParent; private String fName; private int fOffset; private int fLength; private int fheaderLevel; protected ArrayList recipeElements; WikipediaSection(WikipediaSection parent, String name, int level, int offset, int length) { fParent = parent; fName = name; fheaderLevel = level; fOffset = offset; fLength = length; recipeElements = new ArrayList(); } public Object[] getChildren() { return recipeElements.toArray(); } public String getName() { return fName; } public int getOffset() { return fOffset; } public int getLength() { return fLength; } /** * @param index * @param element */ public void add(int index, WikipediaSection element) { recipeElements.add(index, element); } /** * @param o * @return */ public boolean add(WikipediaSection o) { return recipeElements.add(o); } /** * @param index * @return */ public WikipediaSection get(int index) { return (WikipediaSection) recipeElements.get(index); } /** * @return */ public int size() { return recipeElements.size(); } /** * @param length The length to set. */ public void setLength(int length) { fLength = length; } /** * @param offset The fOffset to set. */ public void setoffset(int offset) { fOffset = offset; } /** * @return Returns the headerLevel. */ public int getHeaderLevel() { return fheaderLevel; } /** * @param fheaderLevel The headerLevel to set. */ public void setHeaderLevel(int fheaderLevel) { this.fheaderLevel = fheaderLevel; } /** * @return Returns the parent. */ public WikipediaSection getParent() { return fParent; } /** * @param parent The parent to set. */ public void setParent(WikipediaSection parent) { fParent = parent; } }