Interface DSPage

  • All Superinterfaces:
    DSData, DSPacket, DSSerializable, java.lang.Iterable<DSField>

    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
    • Field Detail


        static final java.lang.String BIGPAGE_TYPE
        The pagetype String used to identify a standard 80x25 page.
        See Also:
        Constant Field Values

        static final java.lang.String SMALLPAGE_TYPE
        The pageType String used to identify a standard 64x16 page.
        See Also:
        Constant Field Values

        static final int FIELD_OFFSET
        The offset applied to page fields added using addPageField(int, String). This offset will be present in any page fields (e.g. non-page data) contained in pages received by a DataSource.
        See Also:
        Constant Field Values
    • Method Detail

      • addPageRow

        void addPageRow​(int x,
                        int y,
                        java.lang.String text)

        Adds text data to this DSPagebased 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.
      • addPageField

        void addPageField​(int fieldNumber,
                          java.lang.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-16383
        value - the value to be stored in the page field.
        java.lang.IllegalArgumentException - if fieldNumber is outside the range 0-16383