1 /***********************************************************************************************************************************
2 * Copyright (c) 2000, 2004 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made
3 * available under the terms of the Common Public License v1.0 which accompanies this distribution, and is available at
4 * http://www.eclipse.org/legal/cpl-v10.html
6 * Contributors: IBM Corporation - initial API and implementation
7 **********************************************************************************************************************************/
8 package net.sourceforge.phpeclipse.wiki.editor.model;
10 import java.util.ArrayList;
12 public class WikipediaSection {
13 protected static WikipediaSection[] NO_CHILDREN = new WikipediaSection[0];
15 private WikipediaSection fParent;
21 private int fheaderLevel;
22 protected ArrayList recipeElements;
24 WikipediaSection(WikipediaSection parent, String name, int level, int offset, int length) {
30 recipeElements = new ArrayList();
34 public Object[] getChildren() {
35 return recipeElements.toArray();
38 public String getName() {
42 public int getOffset() {
46 public int getLength() {
54 public void add(int index, WikipediaSection element) {
55 recipeElements.add(index, element);
62 public boolean add(WikipediaSection o) {
63 return recipeElements.add(o);
70 public WikipediaSection get(int index) {
71 return (WikipediaSection) recipeElements.get(index);
78 return recipeElements.size();
82 * @param length The length to set.
84 public void setLength(int length) {
89 * @param offset The fOffset to set.
91 public void setoffset(int offset) {
95 * @return Returns the headerLevel.
97 public int getHeaderLevel() {
101 * @param fheaderLevel The headerLevel to set.
103 public void setHeaderLevel(int fheaderLevel) {
104 this.fheaderLevel = fheaderLevel;
107 * @return Returns the parent.
109 public WikipediaSection getParent() {
113 * @param parent The parent to set.
115 public void setParent(WikipediaSection parent) {