Class BinnableGroup<T>

    • Field Detail

      • m_ID

        protected String m_ID
        the ID of the group.
      • m_Members

        protected List<Binnable<T>> m_Members
        the grouped items.
    • Constructor Detail

      • BinnableGroup

        public BinnableGroup​(String id)
        Initializes an empty group with the ID.
        Parameters:
        id - the ID to use
      • BinnableGroup

        public BinnableGroup​(String id,
                             List<Binnable<T>> members)
        Initializes the group with the ID and members.
        Parameters:
        id - the ID to use
        members - the members to add
    • Method Detail

      • add

        public void add​(Binnable<T> member)
        Adds the member.
        Parameters:
        member - the member to add
      • addAll

        public void addAll​(Collection<Binnable<T>> members)
        Adds all the members.
        Parameters:
        members - the members to add
      • size

        public int size()
        Returns the number of members.
        Returns:
        the member count
      • get

        public List<Binnable<T>> get()
        Returns the list of members.
        Returns:
        the members
      • getID

        public String getID()
        Returns the ID.
        Specified by:
        getID in interface IDHandler
        Returns:
        the ID
      • mergeWith

        public void mergeWith​(BinnableGroup<T> other)
        Just adds all the members of the other group. Ignores the ID.
        Specified by:
        mergeWith in interface Mergeable<T>
        Parameters:
        other - the object to merge with
      • compareTo

        public int compareTo​(BinnableGroup<T> o)
        Returns the comparison of the two group IDs
        Specified by:
        compareTo in interface Comparable<T>
        Parameters:
        o - the other group to compare with
        Returns:
        the result of the string comparison of the IDs
      • equals

        public boolean equals​(Object obj)
        Checks wether the object is a BinnableGroup with the same ID.
        Overrides:
        equals in class Object
        Parameters:
        obj - the object to check
        Returns:
        true if BinnableGroup and same ID
      • toString

        public String toString()
        Returns a short description of the group.
        Overrides:
        toString in class Object
        Returns:
        the description
      • toString

        public String toString​(int decimals)
        Returns a short description of the group.
        Parameters:
        decimals - the number of decimals to use for printing, -1 for no limit
        Returns:
        the description