Class VertexViewImpl<V,​E>

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

    public class VertexViewImpl<V,​E>
    extends AbstractVertex<V,​E>
    implements VertexView<V,​E>

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

    Since:
    1.0
    Author:
    Andreas Pointner
    • Constructor Detail

      • VertexViewImpl

        public VertexViewImpl()
    • Method Detail

      • 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
      • 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.
      • getElement

        public V getElement()
        Specified by:
        getElement in interface Vertex<V,​E>
        Returns:
        returns the decorated element
      • setElement

        public void setElement​(V element)
        Description copied from class: AbstractVertex
        Method that allows to change the decorated element - this is especially needed at graph creation time.
        Specified by:
        setElement in class AbstractVertex<V,​E>
        Parameters:
        element - The new decorated element.