Class Production

    • Field Detail

      • replacing

        protected boolean replacing
        True to add, false to replace, default true
    • Constructor Detail

      • Production

        public Production()
        Creates a produced template term with no label and the default type
    • Method Detail

      • setReplacing

        public void setReplacing​(boolean replacing)
        True to replace, false to add, if this production can do both. Default true.
      • getPosition

        public int getPosition()
      • setPosition

        public void setPosition​(int position)
      • setWeight

        public void setWeight​(int weight)
        Sets the weight of this production as a percentage (default is 100)
      • getWeight

        public int getWeight()
        Returns the weight of this production as a percentage (default is 100)
      • produce

        public abstract void produce​(RuleEvaluation e,
                                     int offset)
        Produces this at the current match
        Parameters:
        e - the evaluation context containing the current match and the query
        offset - the offset position at which to produce this. Offsets are used to produce multiple items at one position, inserted in the right order.
      • toString

        public final String toString()
        All instances of this produces a parseable string output
        Overrides:
        toString in class Object
      • toInnerString

        protected abstract String toInnerString()
        All instances of this produces a parseable string output