Class DateQlt

  • All Implemented Interfaces:
    Querylet

    public final class DateQlt
    extends AbstractQlt<com.tibco.patterns.learn.jaxb.model.DateQueryType>
    A Date querylet for comparing the similarity of date values.
    • Constructor Summary

      Constructors 
      Constructor Description
      DateQlt​(int fieldIndex, java.util.List<java.lang.String> allFields)
      Creates date querylet with given parameters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String asJavaCode​(java.lang.String qltVarName, java.lang.String valuesVarName, java.lang.String fieldNamesVarName)
      Converts the querylet to a Java code string.
      java.lang.String getFieldName()  
      java.util.List<java.lang.String> getFieldNames()  
      com.netrics.likeit.NetricsQuery getNetricsQlt​(java.lang.String[] values)
      Constructs a NetricsQuery querylet from the stored XML structure and the given field values.
      java.lang.Boolean isMatchEmpty()  
      void setField​(int fieldIndex)
      Replaces the date field in the querylet.
      void setMatchEmpty​(boolean value)
      Sets the Match Empty parameter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DateQlt

        public DateQlt​(int fieldIndex,
                       java.util.List<java.lang.String> allFields)
        Creates date querylet with given parameters.
        Parameters:
        fieldIndex - - an index of the date field in the list of all fields
        allFields - - all non-key fields in the data table.
        Throws:
        java.lang.IllegalArgumentException - if no fields are specified in allFields.
    • Method Detail

      • setField

        public void setField​(int fieldIndex)
        Replaces the date field in the querylet.
        Parameters:
        fieldIndex - - an index of the date field in the list of all fields (which was passed to the constructor).
      • getNetricsQlt

        public com.netrics.likeit.NetricsQuery getNetricsQlt​(java.lang.String[] values)
        Description copied from interface: Querylet
        Constructs a NetricsQuery querylet from the stored XML structure and the given field values. The NetricsQuery can then be used to obtain a feature score from the Patterns server. The querylet must use symmetric score type (if it is supported by the NetricsQuery type that it constructs).
        Parameters:
        values - - The values of all non-key fields in the record. The index of the field value to be used is determined by the field name that is read from the list of all fields stored in XML querylet structure.
        Returns:
        the constructed NetricsQuery querylet.
        Throws:
        java.lang.IllegalArgumentException - if incorrect number of table field values is provided.
      • getFieldNames

        public java.util.List<java.lang.String> getFieldNames()
        Returns:
        a list with names of all fields used in the querylet.
      • asJavaCode

        public java.lang.String asJavaCode​(java.lang.String qltVarName,
                                           java.lang.String valuesVarName,
                                           java.lang.String fieldNamesVarName)
        Description copied from interface: Querylet
        Converts the querylet to a Java code string. Parameters are variable names in Java code. The new querylet must be assigned to qltVarName, then additional Java statements can be added to configure the querylet. The generated querylet must use symmetric score type (if it is supported by the NetricsQuery type that it constructs).
        Parameters:
        qltVarName - - the name of the variable to which the querylet is assigned.
        valuesVarName - - name of variable of type String[] that stores field values.
        fieldNamesVarName - - name of variable of type List<String> that stores all field names in the data table.
        Returns:
        a string with Java code that creates the given querylet.
      • getFieldName

        public java.lang.String getFieldName()
        Returns:
        the name of the date field used in the querylet.
      • setMatchEmpty

        public void setMatchEmpty​(boolean value)
        Sets the Match Empty parameter. If this is true, matching two empty dates results in an exact match score. If false (default), this results in an empty score.
        Parameters:
        value - - the value of the Match Empty parameter.
      • isMatchEmpty

        public java.lang.Boolean isMatchEmpty()
        Returns:
        the Match Empty parameter, or null if it was not set and the default is used.
        See Also:
        setMatchEmpty(boolean)