Class ReferenceTermProduction


  • public class ReferenceTermProduction
    extends TermProduction
    A term produced by a production rule which takes it's actual term value from one or more terms matched in the condition
    Author:
    bratseth
    • Constructor Detail

      • ReferenceTermProduction

        public ReferenceTermProduction​(java.lang.String reference)
        Creates a new produced reference term
        Parameters:
        reference - the label of the condition this should take it's value from
      • ReferenceTermProduction

        public ReferenceTermProduction​(java.lang.String reference,
                                       TermType termType)
        Creates a new produced reference term
        Parameters:
        reference - the label of the condition this should take it's value from
        termType - the type of the term to produce
      • ReferenceTermProduction

        public ReferenceTermProduction​(java.lang.String label,
                                       java.lang.String reference)
        Creates a new produced reference term
        Parameters:
        label - the label of the produced term
        reference - the label of the condition this should take it's value from
      • ReferenceTermProduction

        public ReferenceTermProduction​(java.lang.String label,
                                       java.lang.String reference,
                                       TermType termType)
        Creates a new produced reference term
        Parameters:
        label - the label of the produced term
        reference - the label of the condition this should take it's value from
        termType - the type of term to produce
    • Method Detail

      • setReference

        public void setReference​(java.lang.String reference)
        The label of the condition this should take its value from, never null
      • getReference

        public java.lang.String getReference()
        Returns the label of the condition this should take its value from, never null
      • produce

        public void produce​(RuleEvaluation e,
                            int offset)
        Description copied from class: Production
        Produces this at the current match
        Specified by:
        produce in class Production
        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.