Class Variant


  • public class Variant
    extends TreeNode
    Rule variant node.

    One of the instruction decoder's task is to find out which variant of the particular rule matches against the part of the decoded instruction.

    • Constructor Detail

      • Variant

        public Variant()
    • Method Detail

      • getReturnString

        public java.lang.String getReturnString()
        Returns the string which this variant returns.
        Returns:
        the string, or null if the variant returns a subrule or nothing
      • setReturnString

        public void setReturnString​(java.lang.String returnString)
        Tells the variant to return the string on match.
        Parameters:
        returnString - the string to return
      • getReturnSubrule

        public Subrule getReturnSubrule()
        Returns the subrule which this variant returns.
        Returns:
        the subrule, or null if the variant returns a string or nothing
      • setReturnSubrule

        public void setReturnSubrule​(Subrule returnRule)
        Tells the variant to return the value of the specified subrule.
        Parameters:
        returnRule - the subrule, must be contained in the pattern
      • returns

        public boolean returns()
        Returns true if the variant returns a string or a subrule.
        Returns:
        true if the variant returns, false otherwise
      • getFieldName

        public java.lang.String getFieldName()
        Returns the generated field name if the variant returns a string.
        Returns:
        the field name, or null if the variant does not return a string
      • toString

        public java.lang.String toString()
        Returns the mask as a string in binary notation.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object