Package org.simpleframework.xml.core
Class FieldScanner.FieldKey
- java.lang.Object
-
- org.simpleframework.xml.core.FieldScanner.FieldKey
-
- Enclosing class:
- FieldScanner
private static class FieldScanner.FieldKey extends java.lang.ObjectTheFieldKeyobject is used to create a key that can store a contact using a field without using the methods ofhashCodeandequalson the field directly, as these can perform poorly on certain platforms.
-
-
Constructor Summary
Constructors Constructor Description FieldKey(java.lang.reflect.Field field)Constructor of theFieldKeyobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object value)This method is used to compare this key to other keys.private booleanequals(FieldScanner.FieldKey other)This method is used to compare this key to other keys.inthashCode()This is basically the hash code for the field name.
-
-
-
Method Detail
-
hashCode
public int hashCode()
This is basically the hash code for the field name. Because field names are unique within a class collisions using just the name for the hash code should be infrequent.- Overrides:
hashCodein classjava.lang.Object- Returns:
- this returns the hash code for this key
-
equals
public boolean equals(java.lang.Object value)
This method is used to compare this key to other keys. The declaring class and the name of the field are used to test for equality. If both are the same this returns true.- Overrides:
equalsin classjava.lang.Object- Parameters:
value- this is the value that is to be compared to- Returns:
- this returns true if the field values are equal
-
equals
private boolean equals(FieldScanner.FieldKey other)
This method is used to compare this key to other keys. The declaring class and the name of the field are used to test for equality. If both are the same this returns true.- Parameters:
other- this is the value that is to be compared to- Returns:
- this returns true if the field values are equal
-
-