Class BiLinkMap<B extends BiLink>

  • Type Parameters:
    B - the type of bi-link subclass
    Direct Known Subclasses:
    BaseLinkMap

    public abstract class BiLinkMap<B extends BiLink>
    extends Object
    Represents a collection of BiLink concrete classes. These maps are used to collate a set of unidirectional Links into a smaller set of bi-directional BiLink derivatives.

    • Constructor Detail

      • BiLinkMap

        public BiLinkMap()
    • Method Detail

      • create

        protected abstract B create​(LinkKey key,
                                    Link link)
        Creates a new instance of a bi-link. Concrete subclasses should instantiate and return the appropriate bi-link subclass.
        Parameters:
        key - the link key
        link - the initial link
        Returns:
        a new instance
      • add

        public B add​(Link link)
        Adds the given link to our collection, returning the corresponding bi-link (creating one if needed necessary).
        Parameters:
        link - the link to add to the collection
        Returns:
        the corresponding bi-link wrapper
      • biLinks

        public Collection<B> biLinks()
        Returns the bi-link instances in the collection.
        Returns:
        the bi-links in this map
      • size

        public int size()
        Returns the number of bi-links in the collection.
        Returns:
        number of bi-links