3m9 compatible;
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / core / CompilationUnitElementInfo.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation 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  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.internal.core;
12
13 import net.sourceforge.phpdt.core.ISourceRange;
14
15
16 /* package */ class CompilationUnitElementInfo extends OpenableElementInfo {
17
18         /**
19          * The length of this compilation unit's source code <code>String</code>
20          */
21         protected int sourceLength;
22         
23         /** 
24          * Timestamp of original resource at the time this element
25          * was opened or last updated.
26          */
27         protected long timestamp;
28 /**
29  * Returns the length of the source string.
30  */
31 public int getSourceLength() {
32         return sourceLength;
33 }
34 protected ISourceRange getSourceRange() {
35         return new SourceRange(0, sourceLength);
36 }
37 protected boolean isOpen() {
38         return true;
39 }
40 /**
41  * Sets the length of the source string.
42  */
43 public void setSourceLength(int newSourceLength) {
44         sourceLength = newSourceLength;
45 }
46 }