Package com.google.zxing.common
Interface ECIInput
-
- All Known Implementing Classes:
MinimalECIInput,MinimalEncoder.Input,PDF417HighLevelEncoder.NoECIInput
public interface ECIInputInterface to navigate a sequence of ECIs and bytes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description charcharAt(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.java.lang.CharSequencesubSequence(int start, int end)Returns aCharSequencethat is a subsequence of this sequence.
-
-
-
Method Detail
-
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:
java.lang.IndexOutOfBoundsException- if theindexargument is negative or not less thanlength()java.lang.IllegalArgumentException- if the value at theindexargument is an ECI (@see #isECI)
-
subSequence
java.lang.CharSequence subSequence(int start, int end)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:
java.lang.IndexOutOfBoundsException- ifstartorendare negative, ifendis greater thanlength(), or ifstartis greater thanendjava.lang.IllegalArgumentException- 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:
java.lang.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:
java.lang.IndexOutOfBoundsException- if theindexargument is negative or not less thanlength()java.lang.IllegalArgumentException- if the value at theindexargument is not an ECI (@see #isECI)
-
haveNCharacters
boolean haveNCharacters(int index, int n)
-
-