Class GroupKey
java.lang.Object
de.renebergelt.quiterables.grouping.GroupKey
Represents a group key (All group key instances with the same elements
(value-wise) are considered equal and have the same hashCode
- Author:
- René Bergelt
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares this group key to the given one for data (!)booleanfirst()Returns the first key part of this GroupKey (use get(...) to receive the other parts) Internally calls get(0)get(int index)Returns the key part with the given indexinthashCode()intReturn the number of key parts this group key consists of
-
Constructor Details
-
GroupKey
Create a new group key- Parameters:
parts- The parts which compose this group key (order is critical!)
-
-
Method Details
-
equals
Compares this group key to the given one for data (!) equality (not only reference equality)- Parameters:
gk- The group key to compare to- Returns:
- True if the keys are considered equal
-
equals
-
hashCode
public int hashCode() -
partCount
public int partCount()Return the number of key parts this group key consists of- Returns:
- The number of key parts this group key consists of
-
get
Returns the key part with the given index- Parameters:
index- Index of the key part- Returns:
- The value of the key part at the given index
-
first
Returns the first key part of this GroupKey (use get(...) to receive the other parts) Internally calls get(0)- Returns:
- The first key part
-