Class LexBreadthFirstIterator.BucketList.Bucket

  • Enclosing class:
    LexBreadthFirstIterator.BucketList

    private class LexBreadthFirstIterator.BucketList.Bucket
    extends java.lang.Object
    Plays the role of the container of vertices. All vertices stored in a bucket have identical label. Labels aren't used explicitly.

    Encapsulates operations of addition and removal of vertices from the bucket and removal of a bucket from the data structure.

    • Constructor Summary

      Constructors 
      Constructor Description
      Bucket​(java.util.Collection<V> vertices)
      Creates a new bucket with all vertices stored in it.
      Bucket​(V vertex)
      Creates a new Bucket with a single vertex in it.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void addVertex​(V vertex)
      Adds the vertex to this bucket.
      (package private) void insertBefore​(LexBreadthFirstIterator.BucketList.Bucket bucket)
      Inserts this bucket in the data structure before the bucket.
      (package private) boolean isEmpty()
      Checks whether this bucket is empty.
      (package private) V poll()
      Retrieves one vertex from this bucket.
      (package private) void removeSelf()
      Removes this bucket from the data structure.
      (package private) void removeVertex​(V vertex)
      Removes the vertex from this bucket.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Bucket

        Bucket​(java.util.Collection<V> vertices)
        Creates a new bucket with all vertices stored in it.
        Parameters:
        vertices - vertices to store in this bucket.
      • Bucket

        Bucket​(V vertex)
        Creates a new Bucket with a single vertex in it.
        Parameters:
        vertex - the vertex to store in this bucket.
    • Method Detail

      • removeVertex

        void removeVertex​(V vertex)
        Removes the vertex from this bucket.
        Parameters:
        vertex - the vertex to remove.
      • removeSelf

        void removeSelf()
        Removes this bucket from the data structure.
      • insertBefore

        void insertBefore​(LexBreadthFirstIterator.BucketList.Bucket bucket)
        Inserts this bucket in the data structure before the bucket.
        Parameters:
        bucket - the bucket, that will be the next to this bucket.
      • addVertex

        void addVertex​(V vertex)
        Adds the vertex to this bucket.
        Parameters:
        vertex - the vertex to add.
      • poll

        V poll()
        Retrieves one vertex from this bucket.
        Returns:
        vertex, that was removed from this bucket, null if the bucket was empty.
      • isEmpty

        boolean isEmpty()
        Checks whether this bucket is empty.
        Returns:
        true if this bucket doesn't contain any elements, otherwise false.