Class StringSwitcher.Generator

    • Field Detail

      • strings

        private java.lang.String[] strings
      • ints

        private int[] ints
      • fixedInput

        private boolean fixedInput
    • Constructor Detail

      • Generator

        public Generator()
    • Method Detail

      • setStrings

        public void setStrings​(java.lang.String[] strings)
        Set the array of recognized Strings.
        Parameters:
        strings - the array of String keys; must be the same length as the value array
        See Also:
        setInts(int[])
      • setInts

        public void setInts​(int[] ints)
        Set the array of integer results.
        Parameters:
        ints - the array of integer results; must be the same length as the key array
        See Also:
        setStrings(java.lang.String[])
      • setFixedInput

        public void setFixedInput​(boolean fixedInput)
        Configure how unknown String keys will be handled.
        Parameters:
        fixedInput - if false, an unknown key will be returned from StringSwitcher.intValue(java.lang.String) as -1; if true, the result will be undefined, and the resulting code will be faster
      • create

        public StringSwitcher create()
        Generate the StringSwitcher.
      • generateClass

        public void generateClass​(org.objectweb.asm.ClassVisitor v)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception