Top Description Methods
uk.ac.ed.ph.snuggletex

public Interface InputContext

Known Direct Implementers
uk.ac.ed.ph.snuggletex.internal.WorkingDocument
Imports
uk.ac.ed.ph.snuggletex.internal.WorkingDocument

Read-only view of the current document being parsed, which will change shape as user-defined macros and environments are being expanded.

This is used by helper classes like NumberMatcher that let you change the way certain things get parsed.

The actual implementation of this is the (internal and very complicated) WorkingDocument class.

Author
David McKain
Since
1.3.0
Version
$Revision$

Method Summary

Modifier and TypeMethod and Description
public int
charAt(final int index)

Returns the character at the given index in the input document, or -1 if the index is not contained within the document.

public CharSequence
extract()

Extracts a copy of the current entire content of the input as a CharSequence

public CharSequence
extract(final int startIndex, final int endIndex)

Extracts a copy of a slice of the current entire content of the input as a CharSequence, including all characters with startIndex <= index < endIndex.

public SnuggleInput
getInput()

Accesses the underlying SnuggleInput

public int
indexOf(final int startSearchIndex, final char c)

Returns the first index of the given character, starting the search at the given index.

public int
indexOf(final int startSearchIndex, final String s)

Returns the first index of the given String, starting the search at the given index.

public boolean
isRegionWhitespace(final int startIndex, final int endIndex)

Tests whether all characters in the document with index satisfying startIndex <= index < endIndex are whitespace.

public int
length()

Current length of this input

public boolean
matchesAt(final int index, final char c)

Tests whether the character at the given index is equal to that specified.

public boolean
matchesAt(final int index, final String s)

Tests whether the characters at the given index are equal to the String specified.

Method Detail

charAtback to summary
public int charAt(final int index)

Returns the character at the given index in the input document, or -1 if the index is not contained within the document.

extractback to summary
public CharSequence extract()

Extracts a copy of the current entire content of the input as a CharSequence

extractback to summary
public CharSequence extract(final int startIndex, final int endIndex)

Extracts a copy of a slice of the current entire content of the input as a CharSequence, including all characters with startIndex <= index < endIndex.

getInputback to summary
public SnuggleInput getInput()

Accesses the underlying SnuggleInput

indexOfback to summary
public int indexOf(final int startSearchIndex, final char c)

Returns the first index of the given character, starting the search at the given index. Returns -1 if not found.

indexOfback to summary
public int indexOf(final int startSearchIndex, final String s)

Returns the first index of the given String, starting the search at the given index. Returns -1 if not found.

isRegionWhitespaceback to summary
public boolean isRegionWhitespace(final int startIndex, final int endIndex)

Tests whether all characters in the document with index satisfying startIndex <= index < endIndex are whitespace.

lengthback to summary
public int length()

Current length of this input

matchesAtback to summary
public boolean matchesAt(final int index, final char c)

Tests whether the character at the given index is equal to that specified.

matchesAtback to summary
public boolean matchesAt(final int index, final String s)

Tests whether the characters at the given index are equal to the String specified.