intial source from ttp://www.sf.net/projects/wdte
[phpeclipse.git] / net.sourceforge.phpeclipse.core / src / net / sourceforge / phpeclipse / core / model / ISourceModel.java
1 /*
2  * Copyright (c) 2004 Christopher Lenz and others
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     Christopher Lenz - initial implementation
10  * 
11  * $Id: ISourceModel.java,v 1.1 2004-09-02 18:05:21 jsurfer Exp $
12  */
13
14 package net.sourceforge.phpeclipse.core.model;
15
16 /**
17  * 
18  */
19 public interface ISourceModel {
20
21         /**
22          * Returns the top-level elements of the source model.
23          * 
24          * @return an array of the top-level elements
25          */
26         ISourceReference[] getElements();
27
28         /**
29          * Returns the elements that are direct children of the given element.
30          * 
31          * @param element the element for which to return the child elements
32          * @return an array of child elements, or an empty array if the given
33          *         element has no children
34          */
35         ISourceReference[] getChildren(ISourceReference element);
36
37         /**
38          * Returns the direct parent element of the specified element.
39          * 
40          * @param element the element for which the parent should be returned
41          * @return the parent element, or <tt>null</tt> if the specified element
42          *         does not have a parent (meaning it is a top-level element)
43          */
44         ISourceReference getParent(ISourceReference element);
45
46 }