Two interfaces added for outlineable objects
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / parser / PHPSegment.java
1 package net.sourceforge.phpdt.internal.compiler.parser;
2
3 import org.eclipse.jface.text.Position;
4
5 /**
6  * 
7  * @author khartlage
8  */
9 public abstract class PHPSegment implements Outlineable {
10   protected String name;
11   private Position position;
12   private Object parent;
13
14   public PHPSegment(Object parent, String name, int index) {
15     this.parent = parent;
16     this.name = name;
17     this.position = new Position(index, name.length());
18   }
19
20   /**
21    * Return the name of the segment.
22    * @return the name of the segment
23    */
24   public String getName() {
25     return name;
26   }
27
28   public String toString() {
29     return name;
30   }
31
32   public Position getPosition() {
33     return position;
34   }
35
36   public Object getParent() {
37     return parent;
38   }
39
40 };