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 TypeMethodDescriptionvoidstatic intelementIndexInLine(int index) private voidfireModelChanged(int index) bytegetByte(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.voidhexChanged(HexChangedEvent event) private static booleanisAsciiPrintable(char ch) static intlineNumber(int index) intsize()Provides the size of the model i.e.intvoidupdateModel(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:
hexChangedin interfaceHexChangeListener
-