Top Description Fields Constructors Methods
uk.ac.ed.ph.snuggletex.internal

public final Class SnuggleInputReader

extends Object
implements SourceContext
Class Inheritance
All Implemented Interfaces
uk.ac.ed.ph.snuggletex.internal.WorkingDocument.SourceContext
Imports
uk.ac.ed.ph.snuggletex.InputError, .SnuggleInput, .SnuggleLogicException, uk.ac.ed.ph.snuggletex.definitions.CoreErrorCode, java.io.BufferedReader, .FileInputStream, .IOException, .InputStream, .InputStreamReader, .Reader, .UnsupportedEncodingException, java.util.ArrayList, .List

Helper class that does the job of taking a SnuggleInput, checking its contents for allowed Unicode characters, working out how to map absolute offsets into (line,column) pairs and producing a WorkingDocument for later use.
Author
David McKain
Version
$Revision$

Field Summary

Modifier and TypeField and Description
private final SnuggleInput
private int
private int[]
private WorkingDocument
private final SessionContext

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private int[]
private Reader
createReader(InputStream inputStream, String encoding)

public WorkingDocument
public SnuggleInput
public int[]
getLineAndColumn(int index)

public SessionContext
private StringBuilder
private StringBuilder
private void
recordSurrogateError(StringBuilder inputData, int index, char codePoint)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

inputback to summary
private final SnuggleInput input
inputLengthback to summary
private int inputLength
newlineIndicesback to summary
private int[] newlineIndices
resultingDocumentback to summary
private WorkingDocument resultingDocument
sessionContextback to summary
private final SessionContext sessionContext

Constructor Detail

SnuggleInputReaderback to summary
public SnuggleInputReader(SessionContext sessionContext, SnuggleInput input)

Method Detail

calculateNewlineIndicesAndCheckCodePointsback to summary
private int[] calculateNewlineIndicesAndCheckCodePoints(StringBuilder inputData) throws SnuggleParseException
createReaderback to summary
private Reader createReader(InputStream inputStream, String encoding) throws UnsupportedEncodingException
createWorkingDocumentback to summary
public WorkingDocument createWorkingDocument() throws IOException, SnuggleParseException
getInputback to summary
public SnuggleInput getInput()
getLineAndColumnback to summary
public int[] getLineAndColumn(int index)
getSessionContextback to summary
public SessionContext getSessionContext()
readCharacterStreamback to summary
private StringBuilder readCharacterStream(Reader reader) throws IOException
readInputDataback to summary
private StringBuilder readInputData() throws IOException
recordSurrogateErrorback to summary
private void recordSurrogateError(StringBuilder inputData, int index, char codePoint) throws SnuggleParseException