Skip to main content
summaryrefslogtreecommitdiffstats
blob: 2e98b4b2063e07790a3bbb40661f29ba9909f41c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*******************************************************************************
 * Copyright (c) 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.wst.command.internal.env.core.common;

import org.eclipse.wst.common.environment.uri.IURI;

/**
 * Carries position information within a resource.
 */
public interface Range
{
  public static final int UNKNOWN = -1;

  /**
   * Returns the identifier of the resource the range applies to.
   */
  public IURI getURI ();

  /**
   * Returns the index, zero-indexed, of the first line
   * of the range.
   */
  public int getStartingLineNumber ();

  /**
   * Returns the index, zero-indexed, of the first character
   * of the range relative to the beginning of the line.
   */
  public int getStartingCharNumberInLine ();

  /**
   * Returns the index, zero-indexed, of the first character
   * of the range relative to the beginning of the file.
   */
  public int getStartingCharNumberInURI ();

  /**
   * Returns the index, zero-indexed, of the last line
   * of the range.
   */
  public int getEndingLineNumber ();

  /**
   * Returns the offset, zero-indexed, of the last character
   * of the range relative to the beginning of the line.
   */
  public int getEndingCharNumberInLine ();

  /**
   * Returns the index, zero-indexed, of the last character
   * of the range relative to the beginning of the file.
   */
  public int getEndingCharNumberInURI ();
}

Back to the top