Class HexModel
java.lang.Object
org.apache.pdfbox.debugger.hexviewer.HexModel
- All Implemented Interfaces:
HexChangeListener
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
static int
elementIndexInLine
(int index) private void
fireModelChanged
(int index) byte
getByte
(int index) provides the byte for a specific index of the byte array.byte[]
getBytesForLine
(int lineNumber) char[]
getLineChars
(int lineNumber) Provides a character array of 16 characters on availability.void
hexChanged
(HexChangedEvent event) private static boolean
isAsciiPrintable
(char ch) static int
lineNumber
(int index) int
size()
Provides the size of the model i.e.int
void
updateModel
(int index, byte value)
-
Field Details
-
data
-
modelChangeListeners
-
-
Constructor Details
-
HexModel
HexModel(byte[] bytes) Constructor- Parameters:
bytes
- Byte array.
-
-
Method Details
-
getByte
public byte getByte(int index) provides the byte for a specific index of the byte array.- Parameters:
index
- int.- Returns:
- byte instance
-
getLineChars
public char[] getLineChars(int lineNumber) Provides a character array of 16 characters on availability.- Parameters:
lineNumber
- int. The line number of the characters. Line counting starts from 1.- Returns:
- A char array.
-
getBytesForLine
public byte[] getBytesForLine(int lineNumber) -
size
public int size()Provides the size of the model i.e. size of the input.- Returns:
- int value.
-
totalLine
public int totalLine()- Returns:
-
lineNumber
public static int lineNumber(int index) -
elementIndexInLine
public static int elementIndexInLine(int index) -
isAsciiPrintable
private static boolean isAsciiPrintable(char ch) -
addHexModelChangeListener
-
updateModel
public void updateModel(int index, byte value) -
fireModelChanged
private void fireModelChanged(int index) -
hexChanged
- Specified by:
hexChanged
in interfaceHexChangeListener
-