Interface to navigate a sequence of ECIs and bytes. @author Alex Geller
| 22 | * @author Alex Geller |
| 23 | */ |
| 24 | public interface ECIInput { |
| 25 | |
| 26 | /** |
| 27 | * Returns the length of this input. The length is the number |
| 28 | * of {@code byte}s in or ECIs in the sequence. |
| 29 | * |
| 30 | * @return the number of {@code char}s in this sequence |
| 31 | */ |
| 32 | int length(); |
| 33 | |
| 34 | /** |
| 35 | * Returns the {@code byte} value at the specified index. An index ranges from zero |
| 36 | * to {@code length() - 1}. The first {@code byte} value of the sequence is at |
| 37 | * index zero, the next at index one, and so on, as for array |
| 38 | * indexing. |
| 39 | * |
| 40 | * @param index the index of the {@code byte} value to be returned |
| 41 | * |
| 42 | * @return the specified {@code byte} value as character or the FNC1 character |
| 43 | * |
| 44 | * @throws IndexOutOfBoundsException |
| 45 | * if the {@code index} argument is negative or not less than |
| 46 | * {@code length()} |
| 47 | * @throws IllegalArgumentException |
| 48 | * if the value at the {@code index} argument is an ECI (@see #isECI) |
| 49 | */ |
| 50 | char charAt(int index); |
| 51 | |
| 52 | /** |
| 53 | * Returns a {@code CharSequence} that is a subsequence of this sequence. |
| 54 | * The subsequence starts with the {@code char} value at the specified index and |
| 55 | * ends with the {@code char} value at index {@code end - 1}. The length |
| 56 | * (in {@code char}s) of the |
| 57 | * returned sequence is {@code end - start}, so if {@code start == end} |
| 58 | * then an empty sequence is returned. |
| 59 | * |
| 60 | * @param start the start index, inclusive |
| 61 | * @param end the end index, exclusive |
| 62 | * |
| 63 | * @return the specified subsequence |
| 64 | * |
| 65 | * @throws IndexOutOfBoundsException |
| 66 | * if {@code start} or {@code end} are negative, |
| 67 | * if {@code end} is greater than {@code length()}, |
| 68 | * or if {@code start} is greater than {@code end} |
| 69 | * @throws IllegalArgumentException |
| 70 | * if a value in the range {@code start}-{@code end} is an ECI (@see #isECI) |
| 71 | */ |
| 72 | CharSequence subSequence(int start, int end); |
| 73 | |
| 74 | /** |
| 75 | * Determines if a value is an ECI |
| 76 | * |
| 77 | * @param index the index of the value |
| 78 | * |
| 79 | * @return true if the value at position {@code index} is an ECI |
| 80 | * |
| 81 | * @throws IndexOutOfBoundsException |
no outgoing calls
no test coverage detected