Class TripletImpl<V,​E>

  • All Implemented Interfaces:
    Triplet<V,​E>

    public class TripletImpl<V,​E>
    extends Object
    implements Triplet<V,​E>
    • Field Detail

      • subject

        protected V subject
      • predicate

        protected E predicate
      • object

        protected V object
    • Constructor Detail

      • TripletImpl

        public TripletImpl​(V subject,
                           E predicate,
                           V object)
    • Method Detail

      • makeDirected

        public static <V,​E> Triplet<V,​Directed<E>> makeDirected​(Triplet<V,​E> in,
                                                                            V source)
      • create

        public static <V,​E> Triplet<V,​E> create​(V s,
                                                            E e,
                                                            V o,
                                                            boolean reverse)
      • getSource

        public static <V> V getSource​(Triplet<V,​?> triplet,
                                      boolean reverse)
      • getTarget

        public static <V> V getTarget​(Triplet<V,​?> triplet,
                                      boolean reverse)
      • getTarget

        public static <V> V getTarget​(Triplet<V,​?> triplet,
                                      Object source)
      • getDirections

        public static List<Boolean> getDirections​(Triplet<?,​?> triplet,
                                                  Object node)
        Return a list of indices based on whether the given node is equal to the triple's subject and/or object.
        Parameters:
        triplet -
        node -
        Returns:
      • getDirection

        public static int getDirection​(Triplet<?,​?> triplet,
                                       Object node)
        Returns a bit mask: index: 1 0 [bwdBit] [fwdBit] The first bit indicates whether the subject was equal to the given node, the second bit whether the object was equal to the given node. Possible values are therefore 0 (no match), 3 (both subject and object matched) or 1 and 2.
        Parameters:
        triplet -
        node -
        Returns:
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object