| java.lang.Object org.jfree.data.KeyToGroupMap
KeyToGroupMap | public class KeyToGroupMap implements Cloneable,PublicCloneable,Serializable(Code) | | A class that maps keys (instances of Comparable ) to groups.
|
Constructor Summary | |
public | KeyToGroupMap() Creates a new map with a default group named 'Default Group'. | public | KeyToGroupMap(Comparable defaultGroup) Creates a new map with the specified default group. |
Method Summary | |
public Object | clone() Returns a clone of the map. | public boolean | equals(Object obj) Tests the map for equality against an arbitrary object.
Parameters: obj - the object to test against (null permitted). | public Comparable | getGroup(Comparable key) Returns the group that a key is mapped to.
Parameters: key - the key (null not permitted). | public int | getGroupCount() Returns the number of groups in the map. | public int | getGroupIndex(Comparable group) Returns the index for the group.
Parameters: group - the group. | public List | getGroups() Returns a list of the groups (always including the default group) in the
map. | public int | getKeyCount(Comparable group) Returns the number of keys mapped to the specified group. | public void | mapKeyToGroup(Comparable key, Comparable group) Maps a key to a group. |
KeyToGroupMap | public KeyToGroupMap()(Code) | | Creates a new map with a default group named 'Default Group'.
|
KeyToGroupMap | public KeyToGroupMap(Comparable defaultGroup)(Code) | | Creates a new map with the specified default group.
Parameters: defaultGroup - the default group (null not permitted). |
equals | public boolean equals(Object obj)(Code) | | Tests the map for equality against an arbitrary object.
Parameters: obj - the object to test against (null permitted). A boolean. |
getGroup | public Comparable getGroup(Comparable key)(Code) | | Returns the group that a key is mapped to.
Parameters: key - the key (null not permitted). The group (never null , returns the default group ifthere is no mapping for the specified key). |
getGroupCount | public int getGroupCount()(Code) | | Returns the number of groups in the map.
The number of groups in the map. |
getGroupIndex | public int getGroupIndex(Comparable group)(Code) | | Returns the index for the group.
Parameters: group - the group. The group index (or -1 if the group is not represented within the map). |
getGroups | public List getGroups()(Code) | | Returns a list of the groups (always including the default group) in the
map. The returned list is independent of the map, so altering the list
will have no effect.
The groups (never null ). |
getKeyCount | public int getKeyCount(Comparable group)(Code) | | Returns the number of keys mapped to the specified group. This method
won't always return an accurate result for the default group, since
explicit mappings are not required for this group.
Parameters: group - the group (null not permitted). The key count. |
mapKeyToGroup | public void mapKeyToGroup(Comparable key, Comparable group)(Code) | | Maps a key to a group.
Parameters: key - the key (null not permitted). Parameters: group - the group (null permitted, clears any existing mapping). |
|
|