The possible framing for sequences.
| 34 | * |
| 35 | */ |
| 36 | public interface Frame { |
| 37 | |
| 38 | /** |
| 39 | * Get a unique integer code for the frame. |
| 40 | * @return a unique integer code. |
| 41 | */ |
| 42 | int ordinal(); |
| 43 | |
| 44 | /** |
| 45 | * Get a code with respect to the frame. |
| 46 | * @param codes the underlying array of codes. |
| 47 | * @param length the number of valid entries in codes. |
| 48 | * @param index the position to access with respect to this frame. |
| 49 | * note that it is in the units of codes not of the translated |
| 50 | * results - for example in translated frames index will typically |
| 51 | * be incremented by 3 to get succesive translated codes. |
| 52 | * @return the code at the position specified by index. |
| 53 | */ |
| 54 | byte code(byte[] codes, int length, int index); |
| 55 | |
| 56 | /** |
| 57 | * Get a code with respect to the frame. |
| 58 | * @param codes the underlying array of codes. |
| 59 | * @param length the number of valid entries in codes. |
| 60 | * @param index the position to access with respect to this frame. |
| 61 | * note that it is in the units of codes not of the translated |
| 62 | * results - for example in translated frames index will typically |
| 63 | * be incremented by 3 to get succesive translated codes. |
| 64 | * @param firstValid start position of first valid code in code array material (inclusive). |
| 65 | * @param lastValid last valid code in code array material (exclusive). for a translated frame this will be the |
| 66 | * position of the first code that cannot be included in a valid translated result. |
| 67 | * @return the code at the position specified by index. |
| 68 | */ |
| 69 | byte code(byte[] codes, int length, int index, int firstValid, int lastValid); |
| 70 | |
| 71 | /** |
| 72 | * Calculate the first valid code. (inclusive) |
| 73 | * @param offset position into source material that array starts |
| 74 | * @param length length of data in array |
| 75 | * @param fullLength length of source material |
| 76 | * @return the first valid code to pass to code method |
| 77 | */ |
| 78 | int calculateFirstValid(int offset, int length, int fullLength); |
| 79 | |
| 80 | /** |
| 81 | * Calculate the last valid code. (exclusive) |
| 82 | * @param offset position into source material that array starts |
| 83 | * @param length length of data in array |
| 84 | * @param fullLength length of source material |
| 85 | * @return the last valid code to pass to code method |
| 86 | */ |
| 87 | int calculateLastValid(int offset, int length, int fullLength); |
| 88 | |
| 89 | |
| 90 | /** |
| 91 | * Get the string to be used in output formats for describing the frame. |
| 92 | * @return a string to be used in output formats. |
| 93 | */ |
no outgoing calls
no test coverage detected