Class AttributePartitionImpl

  • All Implemented Interfaces:
    Partition

    public class AttributePartitionImpl
    extends PartitionImpl
    Author:
    mbastian
    • Field Detail

      • column

        protected final WeakReference<org.gephi.graph.api.Column> column
    • Constructor Detail

      • AttributePartitionImpl

        public AttributePartitionImpl​(org.gephi.graph.api.Column column)
    • Method Detail

      • getValue

        public Object getValue​(org.gephi.graph.api.Element element,
                               org.gephi.graph.api.Graph graph)
        Description copied from interface: Partition
        Returns the element's value for this partition.
        Parameters:
        element - element to get the value for
        graph - graph this element belongs to
        Returns:
        the value for this partition
      • getIndex

        private org.gephi.graph.api.Index<org.gephi.graph.api.Element> getIndex​(org.gephi.graph.api.Graph graph)
      • getValues

        public Collection getValues​(org.gephi.graph.api.Graph graph)
        Description copied from interface: Partition
        Returns the collection of values this partition represents. Each value has at least one element.
        Parameters:
        graph - graph this partition applies to
        Returns:
        values
      • getElementCount

        public int getElementCount​(org.gephi.graph.api.Graph graph)
        Description copied from interface: Partition
        Returns the number of elements that have a value in this partition.
        Parameters:
        graph - graph this partition applies to
        Returns:
        element count
      • count

        public int count​(Object value,
                         org.gephi.graph.api.Graph graph)
        Description copied from interface: Partition
        Returns the number of elements for the given value.
        Parameters:
        value - value
        graph - graph this partition applies to
        Returns:
        value count
      • percentage

        public float percentage​(Object value,
                                org.gephi.graph.api.Graph graph)
        Description copied from interface: Partition
        Returns the percentage of elements with the given value.
        Parameters:
        value - value
        Returns:
        percentage, between zero and 100
      • size

        public int size​(org.gephi.graph.api.Graph graph)
        Description copied from interface: Partition
        Returns the number of values this partition represents.
        Parameters:
        graph - this element belongs to
        Returns:
        value count
      • getColumn

        public org.gephi.graph.api.Column getColumn()
        Description copied from interface: Partition
        Returns the column associated with this partition.
        Returns:
        column or null if partition not based on a column
      • isValid

        public boolean isValid​(org.gephi.graph.api.Graph graph)
        Specified by:
        isValid in class PartitionImpl
      • getVersion

        public int getVersion​(org.gephi.graph.api.Graph graph)
        Specified by:
        getVersion in class PartitionImpl
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object