values() {
return hintmap.values();
}
/**
* Returns a Set view of the mappings contained
* in this RenderingHints. Each element in the
* returned Set is a Map.Entry.
* The Set is backed by the RenderingHints,
* so changes to the RenderingHints are reflected
* in the Set, and vice-versa. If the
* RenderingHints is modified while
* while an iteration over the Set is in progress,
* the results of the iteration are undefined.
*
* The entrySet returned from a RenderingHints object
* is not modifiable.
*
* @return a Set view of the mappings contained in
* this RenderingHints.
*/
public Set> entrySet() {
return Collections.unmodifiableMap(hintmap).entrySet();
}
/**
* Compares the specified Object with this
* RenderingHints for equality.
* Returns true if the specified object is also a
* Map and the two Map objects represent
* the same mappings. More formally, two Map objects
* t1 and t2 represent the same mappings
* if t1.keySet().equals(t2.keySet()) and for every
* key k in t1.keySet(),
*
* (t1.get(k)==null ? t2.get(k)==null : t1.get(k).equals(t2.get(k)))
* .
* This ensures that the equals method works properly across
* different implementations of the Map interface.
*
* @param o Object to be compared for equality with
* this RenderingHints.
* @return true if the specified Object
* is equal to this RenderingHints.
*/
public boolean equals(Object o) {
if (o instanceof RenderingHints) {
return hintmap.equals(((RenderingHints) o).hintmap);
} else if (o instanceof Map) {
return hintmap.equals(o);
}
return false;
}
/**
* Returns the hash code value for this RenderingHints.
* The hash code of a RenderingHints is defined to be
* the sum of the hashCodes of each Entry in the
* RenderingHints object's entrySet view. This ensures that
* t1.equals(t2) implies that
* t1.hashCode()==t2.hashCode() for any two Map
* objects t1 and t2, as required by the general
* contract of Object.hashCode.
*
* @return the hash code value for this RenderingHints.
* @see java.util.Map.Entry#hashCode()
* @see Object#hashCode()
* @see Object#equals(Object)
* @see #equals(Object)
*/
public int hashCode() {
return hintmap.hashCode();
}
/**
* Creates a clone of this RenderingHints object
* that has the same contents as this RenderingHints
* object.
* @return a clone of this instance.
*/
public Object clone() {
RenderingHints rh;
try {
rh = (RenderingHints) super.clone();
if (hintmap != null) {
rh.hintmap = (HashMap) hintmap.clone();
}
} catch (CloneNotSupportedException e) {
// this shouldn't happen, since we are Cloneable
throw new InternalError();
}
return rh;
}
/**
* Returns a rather long string representation of the hashmap
* which contains the mappings of keys to values for this
* RenderingHints object.
* @return a string representation of this object.
*/
public String toString() {
if (hintmap == null) {
return getClass().getName() + "@" +
Integer.toHexString(hashCode()) +
" (0 hints)";
}
return hintmap.toString();
}
}