| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private String |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| private HashMap | |
| public final Object | |
| protected abstract Object | |
| private Object | |
| protected Object | |
| private Object | doSpecialCaseCopy(Map<Object, Object>
a map of already copied objects and their corresponding copies. oldToNew, Object the object to copy. source)Sometimes the internal representation of an object will be violated by our field-by-field copy. |
| public final boolean | equals(Object obj)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public final int | |
| private boolean | isEmptyHashMap(Object
the object to copy. source)As of JDK 1.7-40, the JDK relies on the HashMap#table field being identical to a constant. |
| public boolean | isReflectiveClassCopier()
Implements org. We need to know whether this class copier operates via reflection or not, as the reflective class copier must be able to tell when a super class is copied by an incompatible copier. |
| public final String |
| isReflective | back to summary |
|---|---|
| private boolean isReflective | |
| name | back to summary |
|---|---|
| private String name | |
| ClassCopierBase | back to summary |
|---|---|
| protected ClassCopierBase(String name) Pass a name here that can be used for toString, hashCode, and equals. All different ClassCopier classes derived from this base should have unique names. | |
| ClassCopierBase | back to summary |
|---|---|
| protected ClassCopierBase(String name, boolean isReflective) | |
| cloneEmptyHashMap | back to summary |
|---|---|
| private HashMap | |
| copy | back to summary |
|---|---|
| public final Object copy(Map<Object, Object> oldToNew, Object source) throws ReflectiveCopyException Implements org. Make the actual copy of source, using oldToNew to preserve aliasing. This first checks to see whether source has been previously copied. If so, the value obtained from oldToNew is returned. Otherwise,
| |
| createCopy | back to summary |
|---|---|
| protected abstract Object createCopy(Object source) throws ReflectiveCopyException Create a copy of source. The copy may or may not be fully initialized. This method must always be overridden in a subclass. | |
| doByFieldCopy | back to summary |
|---|---|
| private Object doByFieldCopy(Map<Object, Object> oldToNew, Object source) | |
| doCopy | back to summary |
|---|---|
| protected Object doCopy(Map<Object, Object> oldToNew, Object source, Object result) throws ReflectiveCopyException Do the copying of data from source to result. This just returns the result by default, but it may be overrideden in a subclass. When this method completes, result must be fully initialized. | |
| doSpecialCaseCopy | back to summary |
|---|---|
| private Object doSpecialCaseCopy(Map<Object, Object> oldToNew, Object source) Sometimes the internal representation of an object will be violated by our field-by-field copy. This method handles those special cases. It suggests that there may be a basic problem with our code logic. | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isEmptyHashMap | back to summary |
|---|---|
| private boolean isEmptyHashMap(Object source) As of JDK 1.7-40, the JDK relies on the HashMap#table field being identical to a constant. That will not be true if we invoke #doByFieldCopy to copy it, so we need special processing.
| |
| isReflectiveClassCopier | back to summary |
|---|---|
| public boolean isReflectiveClassCopier() Implements org. Doc from org. We need to know whether this class copier operates via reflection or not, as the reflective class copier must be able to tell when a super class is copied by an incompatible copier.
| |
| toString | back to summary |
|---|---|
| public final String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |