Package hydra.query

Class Query

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Query>

    public class Query
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Comparable<Query>
    A SELECT-style graph pattern matching query
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.List<Pattern> patterns
      The patterns to be matched
      static Name PATTERNS
      Name of the hydra.query.Query.patterns field.
      static Name TYPE_
      Name of the hydra.query.Query type.
      java.util.List<Variable> variables
      The variables selected by the query
      static Name VARIABLES
      Name of the hydra.query.Query.variables field.
    • Constructor Summary

      Constructors 
      Constructor Description
      Query​(java.util.List<Variable> variables, java.util.List<Pattern> patterns)
      Constructs an immutable Query.
    • Field Detail

      • TYPE_

        public static final Name TYPE_
        Name of the hydra.query.Query type.
      • VARIABLES

        public static final Name VARIABLES
        Name of the hydra.query.Query.variables field.
      • PATTERNS

        public static final Name PATTERNS
        Name of the hydra.query.Query.patterns field.
      • variables

        public final java.util.List<Variable> variables
        The variables selected by the query
      • patterns

        public final java.util.List<Pattern> patterns
        The patterns to be matched
    • Constructor Detail

      • Query

        public Query​(java.util.List<Variable> variables,
                     java.util.List<Pattern> patterns)
        Constructs an immutable Query.
        Parameters:
        variables - The variables selected by the query
        patterns - The patterns to be matched
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • compareTo

        public int compareTo​(Query other)
        Specified by:
        compareTo in interface java.lang.Comparable<Query>
      • withVariables

        public Query withVariables​(java.util.List<Variable> variables)
        Returns a copy of this Query with variables replaced.
      • withPatterns

        public Query withPatterns​(java.util.List<Pattern> patterns)
        Returns a copy of this Query with patterns replaced.