3ec282a9b676bce0c55db5f0dd3633a8be3698ed
[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 /* package */class CompilationUnitElementInfo extends OpenableElementInfo {
16
17         /**
18          * The length of this compilation unit's source code <code>String</code>
19          */
20         protected int sourceLength;
21
22         /**
23          * Timestamp of original resource at the time this element was opened or
24          * last updated.
25          */
26         protected long timestamp;
27
28         /**
29          * Returns the length of the source string.
30          */
31         public int getSourceLength() {
32                 return sourceLength;
33         }
34
35         protected ISourceRange getSourceRange() {
36                 return new SourceRange(0, sourceLength);
37         }
38
39         protected boolean isOpen() {
40                 return true;
41         }
42
43         /**
44          * Sets the length of the source string.
45          */
46         public void setSourceLength(int newSourceLength) {
47                 sourceLength = newSourceLength;
48         }
49 }