Class LazyEdge

  • All Implemented Interfaces:
    Serializable, EdgeId, ElementId

    public class LazyEdge
    extends Edge
    An LazyEdge wraps an Edge and lazily loads identifiers and properties when requested using a provided ElementValueLoader. This will avoid loading all of an edge's properties just for it to be filtered out by a filter function.
    See Also:
    Serialized Form
    • Constructor Detail

      • LazyEdge

        public LazyEdge​(Edge edge,
                        ElementValueLoader valueLoader)
        Constructs a by wrapping the provided Edge and using the ElementValueLoader to lazily load the element's identifiers and properties when requested.
        Parameters:
        edge - the edge to wrap.
        valueLoader - the element value loader to use to lazily load the element's identifiers and properties
    • Method Detail

      • setIdentifiers

        public void setIdentifiers​(Object source,
                                   Object destination,
                                   boolean directed,
                                   EdgeId.MatchedVertex matchedVertex)
        Description copied from class: Edge
        Sets the identifiers for an Edge.

        If the edge is undirected the the source and destination vertices may get swapped to ensure undirected edges are consistently constructed.

        Overrides:
        setIdentifiers in class Edge
        Parameters:
        source - the source vertex
        destination - the destination vertex
        directed - true if the edge is directed
        matchedVertex - the vertex that matched a query seed
      • getSource

        public Object getSource()
        Description copied from interface: EdgeId
        Get the source vertex.
        Specified by:
        getSource in interface EdgeId
        Overrides:
        getSource in class Edge
        Returns:
        the object at the edge source
      • getDestination

        public Object getDestination()
        Description copied from interface: EdgeId
        Get the destination vertex.
        Specified by:
        getDestination in interface EdgeId
        Overrides:
        getDestination in class Edge
        Returns:
        the object at the edge destination
      • isDirected

        public boolean isDirected()
        Specified by:
        isDirected in interface EdgeId
        Overrides:
        isDirected in class Edge
        Returns:
        true if directed is DIRECTED, EITHER or null. Otherwise false.
      • setIdentifiers

        public void setIdentifiers​(Object source,
                                   Object destination,
                                   DirectedType directedType)
        Description copied from class: Edge
        Sets the identifiers for an Edge.

        If the edge is undirected the the source and destination vertices may get swapped to ensure undirected edges are consistently constructed.

        Specified by:
        setIdentifiers in interface EdgeId
        Overrides:
        setIdentifiers in class Edge
        Parameters:
        source - the source vertex
        destination - the destination vertex
        directedType - the edge directedType
      • equals

        public boolean equals​(Object element)
        Description copied from class: Edge
        Note this does not include the matchedVertex field.
        Overrides:
        equals in class Edge
        Parameters:
        element - the reference object with which to compare.
        Returns:
        true if this object is the same as the obj argument; false otherwise.
      • hashCode

        public int hashCode()
        Description copied from class: Edge
        Note this does not include the matchedVertex field.
        Overrides:
        hashCode in class Edge
        Returns:
        a hash code value for this edge.