@Immutable
public class MapKey
extends java.lang.Object
It is probably best to subclass this class for each type of map key so that you can make sure that the proper type of key is used for the map. Otherwise it could be confusing if one has multiple different MapKeys. An example of such a subclass is:
public static class TripStopKey extends MapKey {
private TripStopKey(String tripId, String stopId) {
super(tripId, stopId);
}
Constructor and Description |
---|
MapKey(java.lang.Object o1,
java.lang.Object o2)
For when need a key consisting of two objects.
|
MapKey(java.lang.Object o1,
java.lang.Object o2,
java.lang.Object o3)
For when need a key consisting of three objects.
|
MapKey(java.lang.Object o1,
java.lang.Object o2,
java.lang.Object o3,
java.lang.Object o4)
For when need a key consisting of four objects.
|
Modifier and Type | Method and Description |
---|---|
static MapKey |
create(java.lang.Object o1,
java.lang.Object o2)
A different way of creating a MapKey by using a static method instead of
using new MapKey().
|
static MapKey |
create(java.lang.Object o1,
java.lang.Object o2,
java.lang.Object o3)
A different way of creating a MapKey by using a static method instead of
using new MapKey().
|
static MapKey |
create(java.lang.Object o1,
java.lang.Object o2,
java.lang.Object o3,
java.lang.Object o4)
A different way of creating a MapKey by using a static method instead of
using new MapKey().
|
boolean |
equals(java.lang.Object obj)
Standard equals() override.
|
int |
hashCode() |
java.lang.String |
toString() |
public MapKey(java.lang.Object o1, java.lang.Object o2)
o1
- Object to be part of the keyo2
- Object to be part of the keypublic MapKey(java.lang.Object o1, java.lang.Object o2, java.lang.Object o3)
o1
- Object to be part of the keyo2
- Object to be part of the keyo3
- Object to be part of the keypublic MapKey(java.lang.Object o1, java.lang.Object o2, java.lang.Object o3, java.lang.Object o4)
o1
- Object to be part of the keyo2
- Object to be part of the keyo3
- Object to be part of the keyo4
- Object to be part of the keypublic static MapKey create(java.lang.Object o1, java.lang.Object o2)
o1
- Object to be part of the keyo2
- Object to be part of the keypublic static MapKey create(java.lang.Object o1, java.lang.Object o2, java.lang.Object o3)
o1
- Object to be part of the keyo2
- Object to be part of the keyo3
- Object to be part of the keypublic static MapKey create(java.lang.Object o1, java.lang.Object o2, java.lang.Object o3, java.lang.Object o4)
o1
- Object to be part of the keyo2
- Object to be part of the keyo3
- Object to be part of the keyo4
- Object to be part of the keypublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object