Package com.google.zxing.common
Interface ECIInput
- All Known Implementing Classes:
MinimalECIInput
public interface ECIInput
Interface to navigate a sequence of ECIs and bytes.
- Author:
- Alex Geller
-
Method Summary
Modifier and TypeMethodDescriptioncharcharAt(int index) Returns thebytevalue at the specified index.intgetECIValue(int index) Returns theintECI value at the specified index.booleanhaveNCharacters(int index, int n) booleanisECI(int index) Determines if a value is an ECIintlength()Returns the length of this input.subSequence(int start, int end) Returns aCharSequencethat is a subsequence of this sequence.
-
Method Details
-
length
int length()Returns the length of this input. The length is the number ofbytes in or ECIs in the sequence.- Returns:
- the number of
chars in this sequence
-
charAt
char charAt(int index) Returns thebytevalue at the specified index. An index ranges from zero tolength() - 1. The firstbytevalue of the sequence is at index zero, the next at index one, and so on, as for array indexing.- Parameters:
index- the index of thebytevalue to be returned- Returns:
- the specified
bytevalue as character or the FNC1 character - Throws:
IndexOutOfBoundsException- if theindexargument is negative or not less thanlength()IllegalArgumentException- if the value at theindexargument is an ECI (@see #isECI)
-
subSequence
Returns aCharSequencethat is a subsequence of this sequence. The subsequence starts with thecharvalue at the specified index and ends with thecharvalue at indexend - 1. The length (inchars) of the returned sequence isend - start, so ifstart == endthen an empty sequence is returned.- Parameters:
start- the start index, inclusiveend- the end index, exclusive- Returns:
- the specified subsequence
- Throws:
IndexOutOfBoundsException- ifstartorendare negative, ifendis greater thanlength(), or ifstartis greater thanendIllegalArgumentException- if a value in the rangestart-endis an ECI (@see #isECI)
-
isECI
boolean isECI(int index) Determines if a value is an ECI- Parameters:
index- the index of the value- Returns:
- true if the value at position
indexis an ECI - Throws:
IndexOutOfBoundsException- if theindexargument is negative or not less thanlength()
-
getECIValue
int getECIValue(int index) Returns theintECI value at the specified index. An index ranges from zero tolength() - 1. The firstbytevalue of the sequence is at index zero, the next at index one, and so on, as for array indexing.- Parameters:
index- the index of theintvalue to be returned- Returns:
- the specified
intECI value. The ECI specified the encoding of all bytes with a higher index until the next ECI or until the end of the input if no other ECI follows. - Throws:
IndexOutOfBoundsException- if theindexargument is negative or not less thanlength()IllegalArgumentException- if the value at theindexargument is not an ECI (@see #isECI)
-
haveNCharacters
boolean haveNCharacters(int index, int n)
-