public interface DSPage extends DSData
The interface that should be implemented by an instance of DSPage
of the type page. This interface extends DSData
, and provides an
additional method that allow text to be added by row and column.
The first packet for a page (the image) should include the
DSData.F_IMAGE
flag. This is more important for
pages than other data types as it allows the Liberator (or other DataSource) to
initialise the object to the correct page dimensions.
The DSPage views an object in terms of row and column values as opposed to field numbers and values.
Each unique row and column combination maps to a cell on this page. When text is
added to the page using addPageRow(int, int, java.lang.String)
the text is inserted at the specified
row / column position. To place text at the start of a page would require setting
both the row and column to 0.
For example, below shows what an existing page looks like before and after a DSPage instance is created, addPageRow(2, 11, "02") has been called, and the page is then sent with DSPage.send:
Before: After:
FX Price Page FX Price Page
GBP 1.7942/48 GBP 1.7942/48
EUR 1.2393/99 EUR 1.2393/02
JPY 110.44/49 JPY 110.44/49
Modifier and Type | Field and Description |
---|---|
static String |
BIGPAGE_TYPE
The pagetype String used to identify a standard 80x25 page.
|
static int |
FIELD_OFFSET
The offset applied to page fields added using
addPageField(int, String) . |
static String |
SMALLPAGE_TYPE
The pageType String used to identify a standard 64x16 page.
|
CONTAINER_TYPE, F_AUTH_UPDATE, F_AUTHGLOBAL, F_CHANGEDFIELDS, F_CLEAR_PERMISSIONS, F_CLEAR_TYPE2, F_CLEAR_TYPE3, F_CREATEOBJECT, F_CREATEPARENT, F_DELETE_PERMISSION, F_FILTER_TYPE2, F_FILTER_TYPE3, F_IMAGE, F_NONACTIVE, GENERIC_TYPE, NEWS_TYPE, PAGE_TYPE, PERMISSION_TYPE, RECORD_TYPE, STORY_TYPE, TYPE2_RECORD_TYPE, TYPE3_RECORD_TYPE, UNKNOWN_TYPE
Modifier and Type | Method and Description |
---|---|
void |
addPageField(int fieldNumber,
String value)
Adds field data to a page.
|
void |
addPageRow(int x,
int y,
String text)
Adds text data to this
DSPage based on row and column. |
addBinaryData, addBinaryData, addBinaryData, addBinaryData, addBinaryData, addBinaryData, addBinaryData, addBinaryData, addData, addData, addData, addData, addData, addData, addData, addData, clearFields, count, elements, getFieldByFieldNumber, getFieldByFieldNumber, getFlags, getKeys, getSubject, getType, getValues, iterator, removeField, setFlags, setSubject, setType, updateData, updateData
send, sendDirect, sendToPeer
toBytes
static final String BIGPAGE_TYPE
static final String SMALLPAGE_TYPE
static final int FIELD_OFFSET
addPageField(int, String)
.
This offset will be present in any page fields (e.g. non-page data) contained in
pages received by a DataSource.void addPageRow(int x, int y, String text)
Adds text data to this DSPage
based on row and column. The latter
two values indicate where the start of the text is placed.
x
- the row where the text begins - zero indexed.y
- the column where the text begins - zero indexed.text
- the text to be inserted into the page.void addPageField(int fieldNumber, String value)
Adds field data to a page. This is stored as additional information and not part of the page text itself. Useful for content-based permissioning or other metadata requirements.
fieldNumber
- the field number for the page field to be added. N.B. This will be offset by
FIELD_OFFSET
in the packet sent to peers so it is identified as a field not a page data
update. Field range for page fields is 0-16383value
- the value to be stored in the page field.IllegalArgumentException
- if fieldNumber is outside the range 0-16383Please send bug reports and comments to Caplin support