Package org.aksw.commons.util.triplet
Class TripletImpl<V,E>
- java.lang.Object
-
- org.aksw.commons.util.triplet.TripletImpl<V,E>
-
-
Constructor Summary
Constructors Constructor Description TripletImpl(V subject, E predicate, V object)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <V,E>
Triplet<V,E>create(V s, E e, V o, boolean reverse)booleanequals(Object obj)static intgetDirection(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.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.VgetObject()EgetPredicate()static <V> VgetSource(Triplet<V,?> triplet, boolean reverse)VgetSubject()static <V> VgetTarget(Triplet<V,?> triplet, boolean reverse)static <V> VgetTarget(Triplet<V,?> triplet, Object source)inthashCode()static <V,E>
Triplet<V,Directed<E>>makeDirected(Triplet<V,E> in, V source)static <V,E>
Triplet<V,E>makeUndirected(Triplet<V,Directed<E>> in)StringtoString()
-
-
-
Method Detail
-
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)
-
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:
-
getSubject
public V getSubject()
- Specified by:
getSubjectin interfaceTriplet<V,E>
-
getPredicate
public E getPredicate()
- Specified by:
getPredicatein interfaceTriplet<V,E>
-
-