Class HostScreenSnapshot

java.lang.Object
com.iizix.term.HostScreenSnapshot

public class HostScreenSnapshot extends Object
An immutable, consistent copy of a host session's screen mirror: characters, attributes, size, cursor position, field model and the screen generation, all captured in one hold of the session monitor by HostSession.snapshot() - see that method's Javadoc for the full contract (MCP/out-of-process infrastructure; consistent is NOT settled). All arrays are the holder's own copies, never aliases of live state; the snapshot silently becomes stale as the session moves on, never invalid and never torn.
Author:
Christopher Mindus
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    An immutable copy of one host field's value data (see HostField for the meaning of each member; nextField is not carried - the enclosing array is in screen order).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int[]
    The screen attributes, row by row, width*height long: CGA color in the low byte, HostScreen.ATTR_* flags above it.
    final char[]
    The screen characters, row by row, width*height long.
    final int
    The cursor X position (column, 0-based).
    final int
    The cursor Y position (row, 0-based).
    The field model at snapshot time, in screen order.
    final long
    The screen generation at snapshot time.
    final int
    The screen height in characters.
    final int
    The screen width in characters.
  • Method Summary

  • Field Details

    • width

      public final int width
      The screen width in characters.
    • height

      public final int height
      The screen height in characters.
    • chars

      public final char[] chars
      The screen characters, row by row, width*height long. The mirror's convention: field attribute positions and null characters hold '\0'.
    • attrs

      public final int[] attrs
      The screen attributes, row by row, width*height long: CGA color in the low byte, HostScreen.ATTR_* flags above it.
    • cursorX

      public final int cursorX
      The cursor X position (column, 0-based).
    • cursorY

      public final int cursorY
      The cursor Y position (row, 0-based).
    • fields

      public final HostScreenSnapshot.HostFieldInfo[] fields
      The field model at snapshot time, in screen order. Empty when the screen is unformatted (or the session is disconnected - the mirror's field model is cleared on disconnect).
    • generation

      public final long generation
      The screen generation at snapshot time. Equal to a later HostSession.getScreenGeneration() read = nothing captured here has changed since.