Package com.google.zxing.common
Interface ECIInput
-
- All Known Implementing Classes:
MinimalECIInput
,MinimalEncoder.Input
,PDF417HighLevelEncoder.NoECIInput
public interface ECIInput
Interface to navigate a sequence of ECIs and bytes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description char
charAt(int index)
Returns thebyte
value at the specified index.int
getECIValue(int index)
Returns theint
ECI value at the specified index.boolean
haveNCharacters(int index, int n)
boolean
isECI(int index)
Determines if a value is an ECIint
length()
Returns the length of this input.java.lang.CharSequence
subSequence(int start, int end)
Returns aCharSequence
that is a subsequence of this sequence.
-
-
-
Method Detail
-
length
int length()
Returns the length of this input. The length is the number ofbyte
s in or ECIs in the sequence.- Returns:
- the number of
char
s in this sequence
-
charAt
char charAt(int index)
Returns thebyte
value at the specified index. An index ranges from zero tolength() - 1
. The firstbyte
value of the sequence is at index zero, the next at index one, and so on, as for array indexing.- Parameters:
index
- the index of thebyte
value to be returned- Returns:
- the specified
byte
value as character or the FNC1 character - Throws:
java.lang.IndexOutOfBoundsException
- if theindex
argument is negative or not less thanlength()
java.lang.IllegalArgumentException
- if the value at theindex
argument is an ECI (@see #isECI)
-
subSequence
java.lang.CharSequence subSequence(int start, int end)
Returns aCharSequence
that is a subsequence of this sequence. The subsequence starts with thechar
value at the specified index and ends with thechar
value at indexend - 1
. The length (inchar
s) of the returned sequence isend - start
, so ifstart == end
then an empty sequence is returned.- Parameters:
start
- the start index, inclusiveend
- the end index, exclusive- Returns:
- the specified subsequence
- Throws:
java.lang.IndexOutOfBoundsException
- ifstart
orend
are negative, ifend
is greater thanlength()
, or ifstart
is greater thanend
java.lang.IllegalArgumentException
- if a value in the rangestart
-end
is 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
index
is an ECI - Throws:
java.lang.IndexOutOfBoundsException
- if theindex
argument is negative or not less thanlength()
-
getECIValue
int getECIValue(int index)
Returns theint
ECI value at the specified index. An index ranges from zero tolength() - 1
. The firstbyte
value of the sequence is at index zero, the next at index one, and so on, as for array indexing.- Parameters:
index
- the index of theint
value to be returned- Returns:
- the specified
int
ECI 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 theindex
argument is negative or not less thanlength()
java.lang.IllegalArgumentException
- if the value at theindex
argument is not an ECI (@see #isECI)
-
haveNCharacters
boolean haveNCharacters(int index, int n)
-
-