Top Fields Constructors Methods
org.apache.pdfbox.debugger.hexviewer

pack-priv Class HexModel

extends Object
implements HexChangeListener
Class Inheritance
All Implemented Interfaces
org.apache.pdfbox.debugger.hexviewer.HexChangeListener
Imports
java.util.ArrayList, .List

Author
Khyrul Bashar A class that acts as a model for the hex viewer. It holds the data and provide the data as necessary. It'll let listen for any underlying data changes.

Field Summary

Modifier and TypeField and Description
private final List<Byte>
private final List<HexModelChangeListener>

Constructor Summary

AccessConstructor and Description
pack-priv
HexModel(byte[]
Byte array.
bytes
)

Constructor

Method Summary

Modifier and TypeMethod and Description
public void
public static int
elementIndexInLine(int index)

private void
fireModelChanged(int index)

public byte

Returns:

byte instance
getByte
(int
int.
index
)

provides the byte for a specific index of the byte array.

public byte[]
getBytesForLine(int lineNumber)

public char[]

Returns:

A char array.
getLineChars
(int
int. The line number of the characters. Line counting starts from 1.
lineNumber
)

Provides a character array of 16 characters on availability.

public void
private static boolean
public static int
lineNumber(int index)

public int

Returns:

int value.
size
()

Provides the size of the model i.e. size of the input.

public int
public void
updateModel(int index, byte value)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databack to summary
private final List<Byte> data
modelChangeListenersback to summary
private final List<HexModelChangeListener> modelChangeListeners

Constructor Detail

HexModelback to summary
pack-priv HexModel(byte[] bytes)

Constructor

Parameters
bytes:byte[]

Byte array.

Method Detail

addHexModelChangeListenerback to summary
public void addHexModelChangeListener(HexModelChangeListener listener)
elementIndexInLineback to summary
public static int elementIndexInLine(int index)
fireModelChangedback to summary
private void fireModelChanged(int index)
getByteback to summary
public byte getByte(int index)

provides the byte for a specific index of the byte array.

Parameters
index:int

int.

Returns:byte

byte instance

getBytesForLineback to summary
public byte[] getBytesForLine(int lineNumber)
getLineCharsback to summary
public char[] getLineChars(int lineNumber)

Provides a character array of 16 characters on availability.

Parameters
lineNumber:int

int. The line number of the characters. Line counting starts from 1.

Returns:char[]

A char array.

hexChangedback to summary
public void hexChanged(HexChangedEvent event)

Implements org.apache.pdfbox.debugger.hexviewer.HexChangeListener.hexChanged.

Annotations
@Override
isAsciiPrintableback to summary
private static boolean isAsciiPrintable(char ch)
lineNumberback to summary
public static int lineNumber(int index)
sizeback to summary
public int size()

Provides the size of the model i.e. size of the input.

Returns:int

int value.

totalLineback to summary
public int totalLine()
updateModelback to summary
public void updateModel(int index, byte value)