Class Term.Terminal

  • All Implemented Interfaces:
    Term
    Direct Known Subclasses:
    Constants.Value, Maps.Value, Sets.Value, Term.MultiItemTerminal, Tuples.InValue
    Enclosing interface:
    Term

    public abstract static class Term.Terminal
    extends java.lang.Object
    implements Term
    A terminal term, one that can be reduced to a byte buffer directly. This includes most terms that don't have a bind marker (an exception being delayed call for non pure function that are NonTerminal even if they don't have bind markers). This can be only one of: - a constant value - a collection value Note that a terminal term will always have been type checked, and thus consumer can (and should) assume so.
    • Constructor Detail

      • Terminal

        public Terminal()
    • Method Detail

      • collectMarkerSpecification

        public void collectMarkerSpecification​(VariableSpecifications boundNames)
        Description copied from interface: Term
        Collects the column specification for the bind variables in this Term. This is obviously a no-op if the term is Terminal.
        Specified by:
        collectMarkerSpecification in interface Term
        Parameters:
        boundNames - the variables specification where to collect the bind variables of this term in.
      • bind

        public Term.Terminal bind​(QueryOptions options)
        Description copied from interface: Term
        Bind the values in this term to the values contained in values. This is obviously a no-op if the term is Terminal.
        Specified by:
        bind in interface Term
        Parameters:
        options - the values to bind markers to.
        Returns:
        the result of binding all the variables of this NonTerminal (or 'this' if the term is terminal).
      • addFunctionsTo

        public void addFunctionsTo​(java.util.List<Function> functions)
        Specified by:
        addFunctionsTo in interface Term
      • containsBindMarker

        public boolean containsBindMarker()
        Description copied from interface: Term
        Whether or not that term contains at least one bind marker. Note that this is slightly different from being or not a NonTerminal, because calls to non pure functions will be NonTerminal (see #5616) even if they don't have bind markers.
        Specified by:
        containsBindMarker in interface Term
      • isTerminal

        public boolean isTerminal()
        Description copied from interface: Term
        Whether that term is terminal (this is a shortcut for this instanceof Term.Terminal).
        Specified by:
        isTerminal in interface Term
      • bindAndGet

        public java.nio.ByteBuffer bindAndGet​(QueryOptions options)
                                       throws InvalidRequestException
        Description copied from interface: Term
        A shorter for bind(values).get(). We expose it mainly because for constants it can avoids allocating a temporary object between the bind and the get (note that we still want to be able to separate bind and get for collections).
        Specified by:
        bindAndGet in interface Term
        Throws:
        InvalidRequestException