Enum QuadTableForm

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<QuadTableForm>, java.util.function.Predicate<java.util.Set<TupleSlot>>, java.util.function.Supplier<QuadTable>

    public enum QuadTableForm
    extends java.lang.Enum<QuadTableForm>
    implements java.util.function.Supplier<QuadTable>, java.util.function.Predicate<java.util.Set<TupleSlot>>
    Six covering table forms and machinery to determine which of them is best suited to answer a given query. Please notice that the individual values of this enum are what implement the various interfaces named in the signature of this type. In particular, any value from this enum is a complete implementation of QuadTable. HexTable binds up all these six forms into a single implementation of QuadTable that selects the most useful table form(s) for any given operation.
    See Also:
    HexTable
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      GOPS
      Graph-object-predicate-subject.
      GSPO
      Graph-subject-predicate-object.
      OPSG
      Object-predicate-subject-graph.
      OSGP
      Object-subject-graph-predicate.
      PGSO
      Predicate-graph-subject-object.
      SPOG
      Subject-predicate-object-graph.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.List<TupleSlot> fullpattern
      The full pattern of this table form.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static QuadTableForm chooseFrom​(java.util.Set<TupleSlot> pattern)  
      PMapQuadTable get()  
      static java.util.stream.Stream<QuadTableForm> tableForms()  
      boolean test​(java.util.Set<TupleSlot> pattern)  
      static QuadTableForm valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static QuadTableForm[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.function.Predicate

        and, negate, or
    • Enum Constant Detail

      • GSPO

        public static final QuadTableForm GSPO
        Graph-subject-predicate-object.
      • GOPS

        public static final QuadTableForm GOPS
        Graph-object-predicate-subject.
      • SPOG

        public static final QuadTableForm SPOG
        Subject-predicate-object-graph.
      • OSGP

        public static final QuadTableForm OSGP
        Object-subject-graph-predicate.
      • PGSO

        public static final QuadTableForm PGSO
        Predicate-graph-subject-object.
      • OPSG

        public static final QuadTableForm OPSG
        Object-predicate-subject-graph.
    • Field Detail

      • fullpattern

        public final java.util.List<TupleSlot> fullpattern
        The full pattern of this table form.
    • Method Detail

      • values

        public static QuadTableForm[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (QuadTableForm c : QuadTableForm.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static QuadTableForm valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • test

        public boolean test​(java.util.Set<TupleSlot> pattern)
        Specified by:
        test in interface java.util.function.Predicate<java.util.Set<TupleSlot>>
        Parameters:
        pattern -
        Returns:
        whether this table form avoids traversal for a query of this pattern
      • chooseFrom

        public static QuadTableForm chooseFrom​(java.util.Set<TupleSlot> pattern)
        Parameters:
        pattern -
        Returns:
        the most appropriate choice of table form for that query
      • tableForms

        public static java.util.stream.Stream<QuadTableForm> tableForms()
        Returns:
        a stream of these table forms