Class BaseOpenMessage

    • Constructor Detail

      • BaseOpenMessage

        protected BaseOpenMessage​(String frame)
    • Method Detail

      • isCommand

        public boolean isCommand()
        Description copied from class: OpenMessage
        Is this OpenMessage a command? (*WHO..).
        Specified by:
        isCommand in class OpenMessage
        Returns:
        true if it's a command frame
      • getWho

        public Who getWho()
        Returns message WHO
        Returns:
        message WHO
      • getWhat

        public What getWhat()
        Returns message WHAT or null if message has no valid WHAT part
        Returns:
        message WHAT
      • getWhere

        public Where getWhere()
        Returns message WHERE or null if message has no valid WHERE part
        Returns:
        message WHERE
      • getDim

        public Dim getDim()
        Returns message DIM (dimension, *#WHO*#DIM*...##) or null id not DIM is present
        Returns:
        message DIM, or null if no DIM is present
      • isDimWriting

        public boolean isDimWriting()
        Check if message is a dimension writing message *#WHO*#DIM*...##
        Returns:
        true if it's a dimension writing message
      • parseWhere

        protected abstract void parseWhere()
                                    throws FrameException
        Parse WHERE and assigns it to where attribute
        Throws:
        FrameException - in case of error in frame
      • dimFromValue

        protected abstract Dim dimFromValue​(int i)
      • whatFromValue

        protected abstract What whatFromValue​(int i)
      • isCommandTranslation

        public boolean isCommandTranslation()
                                     throws FrameException
        Check if message is a command translation (*WHO*1000#WHAT*...##)
        Returns:
        true if the WHAT part is prefixed with command translation: 1000#
        Throws:
        FrameException - in case of error in frame
      • getCommandParams

        public int[] getCommandParams()
                               throws FrameException
        Returns message command parameters (*WHO*WHAT#Param1#Param2...#ParamN*...), or empty array if no parameters are present
        Returns:
        int[] of command parameters, or empty array if no parameters are present
        Throws:
        FrameException - in case of error in frame
      • getDimParams

        public int[] getDimParams()
                           throws FrameException
        Returns an array with DIM parameters PAR1..PARN (*#WHO*DIM#PAR1..#PARN*...##), or empty array if no parameters are present
        Returns:
        a int[] of DIM parameters, or empty array if no parameters are present
        Throws:
        FrameException - in case of error in frame
      • getDimValues

        public String[] getDimValues()
                              throws FrameException
        Returns and array with DIM values, or empty array if no values are present
        Returns:
        a String[] of DIM values, or empty array if no values are present
        Throws:
        FrameException - in case of error in frame
      • addValues

        protected static String addValues​(String msgStr,
                                          String... vals)
        Helper method to add to the given msg frame a list of values separated by * at the end of the frame: *frame## --> *frame*val1*val2*..*valN##
        Parameters:
        msgStr - the input frame String
        vals - Strings containing values to be added to the frame
        Returns:
        a String with the new message frame with values added at the end
      • toStringVerbose

        public String toStringVerbose()
        Description copied from class: OpenMessage
        Get a verbose representation of this message.
        Specified by:
        toStringVerbose in class OpenMessage
        Returns:
        verbose string representation