Source of program code.; supports
multiple modes of access to the text and its location.
Two available source sections are considered equal if their sources, start and length are equal.
Unavailable source sections are compared by identity. Source sections are
designed to be used as keys in hash maps.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final AbstractPolyglotImpl. | |
| pack-priv final Object | |
| pack-priv final Source |
| Access | Constructor and Description |
|---|---|
| pack-priv | SourceSection(Source source, AbstractPolyglotImpl.
|
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. Indicates whether some other object is "equal to" this one. |
| public CharSequence | Returns: the code as a string.Returns the source code fragment described by this section. |
| public int | Returns: the end position of the section.Returns the index of the text position immediately following the last character in the section. |
| public int | Returns: the starting character index.Returns the 0-based index of the first character in this section. |
| public int | Returns: the number of characters in the section.Returns the length of this section in characters. |
| public CharSequence | |
| public int | Returns: the starting column number.Returns the 1-based column number of the last character in this section (inclusive). |
| public int | Returns: the starting line number.Returns 1-based line number of the last character in this section (inclusive). |
| public Source | Returns: the source object.Representation of the source program that contains this section. |
| public int | Returns: the starting column number.Returns the 1-based column number of the first character in this section (inclusive). |
| public int | Returns: the starting line number.Returns 1-based line number of the first character in this section (inclusive). |
| public boolean | |
| public boolean | |
| public int | |
| public boolean | |
| public boolean | isAvailable()
Returns whether this is a special instance that signifies that source information is available. |
| public String | toString()
Overrides java. Returns an implementation-defined string representation of this source section to be used for debugging purposes only. |
| dispatch | back to summary |
|---|---|
| pack-priv final AbstractPolyglotImpl. | |
| receiver | back to summary |
|---|---|
| pack-priv final Object receiver | |
| source | back to summary |
|---|---|
| pack-priv final Source source | |
| SourceSection | back to summary |
|---|---|
| pack-priv SourceSection(Source source, AbstractPolyglotImpl. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getCharacters | back to summary |
|---|---|
| public CharSequence getCharacters() Returns the source code fragment described by this section. Returns an empty string for out
of bounds or
| |
| getCharEndIndex | back to summary |
|---|---|
| public int getCharEndIndex() Returns the index of the text position immediately following the last character in the
section. Returns
| |
| getCharIndex | back to summary |
|---|---|
| public int getCharIndex() Returns the 0-based index of the first character in this section. Returns
| |
| getCharLength | back to summary |
|---|---|
| public int getCharLength() Returns the length of this section in characters. Returns
| |
| getCode | back to summary |
|---|---|
public CharSequence getCode()
| |
| getEndColumn | back to summary |
|---|---|
| public int getEndColumn() Returns the 1-based column number of the last character in this section (inclusive). Returns
| |
| getEndLine | back to summary |
|---|---|
| public int getEndLine() Returns 1-based line number of the last character in this section (inclusive). Returns
| |
| getSource | back to summary |
|---|---|
| public Source getSource() Representation of the source program that contains this section.
| |
| getStartColumn | back to summary |
|---|---|
| public int getStartColumn() Returns the 1-based column number of the first character in this section (inclusive). Returns
| |
| getStartLine | back to summary |
|---|---|
| public int getStartLine() Returns 1-based line number of the first character in this section (inclusive). Returns
| |
| hasCharIndex | back to summary |
|---|---|
| public boolean hasCharIndex() Returns
| |
| hasColumns | back to summary |
|---|---|
| public boolean hasColumns() Returns
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| hasLines | back to summary |
|---|---|
| public boolean hasLines() Returns
| |
| isAvailable | back to summary |
|---|---|
| public boolean isAvailable() Returns whether this is a special instance that signifies that source information is
available. Available source sections are never equal to unavailable source sections.
Unavailable source sections return the same indices and lengths as empty source sections
starting at character index
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns an implementation-defined string representation of this source section to be used for debugging purposes only.
| |