Class Term

java.lang.Object
io.inversion.rql.Term
All Implemented Interfaces:
Comparable<Term>

public class Term extends Object implements Comparable<Term>
  • Field Details

    • terms

      public final List<Term> terms
    • parent

      public Term parent
    • quote

      public char quote
    • token

      public String token
  • Constructor Details

    • Term

      protected Term()
    • Term

      protected Term(Term parent, String token)
  • Method Details

    • term

      public static Term term(Term parent, String token, Object... terms)
    • copy

      public Term copy()
    • compareTo

      public int compareTo(Term o)
      Specified by:
      compareTo in interface Comparable<Term>
    • getToken

      public String getToken(int childIndex)
    • getToken

      public String getToken()
    • hasToken

      public boolean hasToken(String... tokens)
    • hasChildLeafToken

      public boolean hasChildLeafToken(String... tokens)
    • withToken

      public Term withToken(String token)
    • getParent

      public Term getParent()
    • withParent

      public Term withParent(Term parent)
    • isLeaf

      public boolean isLeaf()
    • isLeaf

      public boolean isLeaf(int childIndex)
    • size

      public int size()
    • indexOf

      public int indexOf(Term child)
    • getNumTerms

      public int getNumTerms()
    • getTerms

      public List<Term> getTerms()
    • getTerm

      public Term getTerm(int index)
    • replaceTerm

      public Term replaceTerm(Term oldTerm, Term newTerm)
    • withTerms

      public Term withTerms(Term... terms)
    • withTerm

      public Term withTerm(Term term)
    • withTerm

      public Term withTerm(String token, Object... terms)
    • withTerm

      public Term withTerm(int index, Term term)
    • removeTerm

      public void removeTerm(Term term)
    • clear

      public void clear()
    • isQuoted

      public boolean isQuoted()
    • getQuote

      public char getQuote()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • stream

      public Stream<Term> stream()
      Returns a stream containing all Terms recursively.
      Returns:
      this term and all children recursively