Interface Swift_CharacterReader

Implemented bySwift_CharacterReader_GenericFixedWidthReader, Swift_CharacterReader_UsAsciiReader, Swift_CharacterReader_Utf8Reader

Analyzes characters for a specific character set.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
getCharPositions() Returns the complete character map. Swift_CharacterReader
getInitialByteSize() Returns the number of bytes which should be read to start each character. Swift_CharacterReader
getMapType() Returns the mapType, see constants. Swift_CharacterReader
validateByteSequence() Returns an integer which specifies how many more bytes to read. Swift_CharacterReader

Method Details

getCharPositions() public abstract method

Returns the complete character map.

public abstract int getCharPositions ( $string, $startOffset, <b>&</b>$currentMap, <b>&</b>$ignoredChars )
$string string
$startOffset int
$currentMap array
$ignoredChars mixed
getInitialByteSize() public abstract method

Returns the number of bytes which should be read to start each character.

For fixed width character sets this should be the number of octets-per-character. For multibyte character sets this will probably be 1.

public abstract int getInitialByteSize ( )
getMapType() public abstract method

Returns the mapType, see constants.

public abstract int getMapType ( )
validateByteSequence() public abstract method

Returns an integer which specifies how many more bytes to read.

A positive integer indicates the number of more bytes to fetch before invoking this method again.

A value of zero means this is already a valid character. A value of -1 means this cannot possibly be a valid character.

public abstract int validateByteSequence ( $bytes, $size )
$bytes integer[]
$size int