Class AbstractBitwiseHierarchyImpl<H,​J extends LatticeElement<H>>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean fixedRoot  
      protected java.util.SortedMap<java.util.BitSet,​J> line  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void add​(J node)  
      void clear()  
      protected boolean contains​(J node)  
      java.util.BitSet getCode​(H val)  
      H getMember​(java.util.BitSet key)  
      protected abstract J getNode​(H name)  
      protected J getNodeByKey​(java.util.BitSet key)  
      protected java.util.Collection<J> getNodes()  
      java.util.Map<H,​java.util.BitSet> getSortedMap()  
      java.util.List<H> getSortedMembers()  
      boolean hasKey​(java.util.BitSet key)  
      java.util.Collection<H> immediateChildren​(java.util.BitSet key)
      * Return the "ceiling" of the key's descendants, excluding the element whose code is key, if any
      java.util.Collection<H> immediateParents​(java.util.BitSet key)
      Return the "floor" of the key's ancetsors, down to and excluding the element whose code is key
      boolean isEmpty()  
      java.util.BitSet joinCode​(java.util.Collection<java.util.BitSet> codes)  
      java.util.BitSet jointMembersCode​(java.util.Collection<H> vals)  
      java.util.Collection<H> lowerBorder​(java.util.BitSet key)
      Return the "ceiling" of the key's descendants, up to and including the element whose code is key
      java.util.Collection<H> lowerDescendants​(java.util.BitSet key)
      Returns all elements whose code is a descendant of key
      java.util.BitSet meetCode​(java.util.Collection<java.util.BitSet> codes)  
      java.util.BitSet metMembersCode​(java.util.Collection<H> vals)  
      protected int numBit​(java.util.BitSet x)  
      java.util.Collection<H> parents​(H x)  
      java.util.Collection<H> parents​(java.util.BitSet x)  
      protected abstract java.util.Collection<H> parentValues​(J node)  
      void readExternal​(java.io.ObjectInput objectInput)  
      protected void remove​(J node)  
      void removeMember​(H val)  
      void removeMember​(java.util.BitSet key)  
      int size()  
      static java.util.BitSet stringToBitSet​(java.lang.String s)  
      int superset​(java.util.BitSet n1, java.util.BitSet n2)  
      protected java.lang.String toBinaryString​(java.util.BitSet mask)  
      protected java.lang.String toBinaryString​(java.util.BitSet mask, int len)  
      java.util.Collection<H> upperAncestors​(java.util.BitSet key)
      Returns all elements whose code is an ancestor of key
      java.util.Collection<H> upperBorder​(java.util.BitSet key)
      Return the "floor" of the key's ancestors, down to and including the element whose code is key, if any
      void writeExternal​(java.io.ObjectOutput objectOutput)  
      • Methods inherited from class java.lang.Object

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

      • line

        protected java.util.SortedMap<java.util.BitSet,​J extends LatticeElement<H>> line
      • fixedRoot

        protected boolean fixedRoot
    • Constructor Detail

      • AbstractBitwiseHierarchyImpl

        public AbstractBitwiseHierarchyImpl()
    • Method Detail

      • getNodeByKey

        protected J getNodeByKey​(java.util.BitSet key)
      • getNode

        protected abstract J getNode​(H name)
      • remove

        protected void remove​(J node)
      • contains

        protected boolean contains​(J node)
      • metMembersCode

        public java.util.BitSet metMembersCode​(java.util.Collection<H> vals)
        Specified by:
        metMembersCode in interface CodedHierarchy<H>
      • meetCode

        public java.util.BitSet meetCode​(java.util.Collection<java.util.BitSet> codes)
        Specified by:
        meetCode in interface CodedHierarchy<H>
      • joinCode

        public java.util.BitSet joinCode​(java.util.Collection<java.util.BitSet> codes)
        Specified by:
        joinCode in interface CodedHierarchy<H>
      • upperAncestors

        public java.util.Collection<H> upperAncestors​(java.util.BitSet key)
        Description copied from interface: CodedHierarchy
        Returns all elements whose code is an ancestor of key
        Specified by:
        upperAncestors in interface CodedHierarchy<H>
        Returns:
      • lowerBorder

        public java.util.Collection<H> lowerBorder​(java.util.BitSet key)
        Description copied from interface: CodedHierarchy
        Return the "ceiling" of the key's descendants, up to and including the element whose code is key
        Specified by:
        lowerBorder in interface CodedHierarchy<H>
        Parameters:
        key - a key, possibly the meet of a number of member keys
        Returns:
      • immediateChildren

        public java.util.Collection<H> immediateChildren​(java.util.BitSet key)
        Description copied from interface: CodedHierarchy
        * Return the "ceiling" of the key's descendants, excluding the element whose code is key, if any
        Specified by:
        immediateChildren in interface CodedHierarchy<H>
        Parameters:
        key - a key, possibly the meet of a number of member keys
        Returns:
      • toBinaryString

        protected java.lang.String toBinaryString​(java.util.BitSet mask)
      • toBinaryString

        protected java.lang.String toBinaryString​(java.util.BitSet mask,
                                                  int len)
      • superset

        public int superset​(java.util.BitSet n1,
                            java.util.BitSet n2)
      • numBit

        protected int numBit​(java.util.BitSet x)
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput objectOutput)
                           throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • readExternal

        public void readExternal​(java.io.ObjectInput objectInput)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • stringToBitSet

        public static java.util.BitSet stringToBitSet​(java.lang.String s)
      • hasKey

        public boolean hasKey​(java.util.BitSet key)
        Specified by:
        hasKey in interface CodedHierarchy<H>
      • lowerDescendants

        public java.util.Collection<H> lowerDescendants​(java.util.BitSet key)
        Description copied from interface: CodedHierarchy
        Returns all elements whose code is a descendant of key
        Specified by:
        lowerDescendants in interface CodedHierarchy<H>
        Returns:
      • parentValues

        protected abstract java.util.Collection<H> parentValues​(J node)
      • parents

        public java.util.Collection<H> parents​(java.util.BitSet x)
        Specified by:
        parents in interface CodedHierarchy<H>
      • upperBorder

        public java.util.Collection<H> upperBorder​(java.util.BitSet key)
        Description copied from interface: CodedHierarchy
        Return the "floor" of the key's ancestors, down to and including the element whose code is key, if any
        Specified by:
        upperBorder in interface CodedHierarchy<H>
        Parameters:
        key - a key, possibly the meet of a number of member keys
        Returns:
      • immediateParents

        public java.util.Collection<H> immediateParents​(java.util.BitSet key)
        Description copied from interface: CodedHierarchy
        Return the "floor" of the key's ancetsors, down to and excluding the element whose code is key
        Specified by:
        immediateParents in interface CodedHierarchy<H>
        Parameters:
        key - a key, possibly the meet of a number of member keys
        Returns:
      • isEmpty

        public boolean isEmpty()
      • clear

        public void clear()
      • add

        protected void add​(J node)
      • getNodes

        protected java.util.Collection<J> getNodes()