Class EdgeViewImpl<V,​E>

  • Type Parameters:
    V - the type of the decorated vertex value
    E - the type of the decorated edge value
    All Implemented Interfaces:
    Edge<V,​E>, EdgeView<V,​E>, MetaTagCollection

    public class EdgeViewImpl<V,​E>
    extends AbstractEdge<V,​E>
    implements EdgeView<V,​E>

    This class is used to provide a view on a given edge, this means, that it decorates an existing edge but uses its own graph state which does only contain a view on the graph.

    Since:
    1.0
    Author:
    Andreas Pointner
    • Constructor Detail

      • EdgeViewImpl

        public EdgeViewImpl​(Edge<V,​E> viewedEdge)
    • Method Detail

      • getElement

        public E getElement()
        Description copied from interface: Edge
        Returns the element associated with the edge
        Specified by:
        getElement in interface Edge<V,​E>
        Returns:
        the element associated with the edge, or null if not present
      • getMetaTagValue

        public <T> T getMetaTagValue​(String key,
                                     Class<T> clazz)
        Description copied from interface: MetaTagCollection
        Returns the value for a meta tag with a given key
        Specified by:
        getMetaTagValue in interface MetaTagCollection
        Type Parameters:
        T - the type of the meta tag value
        Parameters:
        key - the key of the meta tag
        clazz - the class of the meta tag value
        Returns:
        the value of the meta tag, if there are multiple elements with the same key and class type, the first one which is matching will be returned
      • tryGetMetaTagValue

        public <T> Optional<T> tryGetMetaTagValue​(String key,
                                                  Class<T> clazz)
        Description copied from interface: MetaTagCollection
        Tries to get a value for a given meta tag with a given key
        Specified by:
        tryGetMetaTagValue in interface MetaTagCollection
        Type Parameters:
        T - the type of the meta tag value
        Parameters:
        key - the key of the meta tag
        clazz - the class of the meta tag value
        Returns:
        the value of the meta tag, if there are multiple elements with the same key class type, the first one which is matching will be returned
      • removeMetaTag

        public void removeMetaTag​(String key,
                                  Class<?>... clazz)
        Description copied from interface: MetaTagCollection

        Removes all meta that, where the key of the meta tag equals the key parameter. Optionally it also checks if the value type is one of the given classes. If classes is null or empty it will only check for the key. After calling this method the meta tag with the associated key will be removed. In case the key does not exist, no error will occur.

        Specified by:
        removeMetaTag in interface MetaTagCollection
        Parameters:
        key - the key of the meta tag to be removed
        clazz - optional: a list of possible types where the meta tag must be one of them.
      • addMetaTag

        public <T> boolean addMetaTag​(MetaTag<T> metaTag)
        Description copied from interface: MetaTagCollection
        Adds a meta tag to the current vertex
        Specified by:
        addMetaTag in interface MetaTagCollection
        Overrides:
        addMetaTag in class MetaTagCollectionImpl
        Type Parameters:
        T - the type of the meta tag to add
        Parameters:
        metaTag - the meta tag
        Returns:
        a flag which indicates if the element was added
      • removeMetaTag

        public <T> boolean removeMetaTag​(MetaTag<T> metaTag)
        Description copied from interface: MetaTagCollection
        Removes a meta tag from the current vertex
        Specified by:
        removeMetaTag in interface MetaTagCollection
        Overrides:
        removeMetaTag in class MetaTagCollectionImpl
        Type Parameters:
        T - the type of the meta tag to remove
        Parameters:
        metaTag - the meta tag
        Returns:
        a flag which indicates if the element was removed