org.apache.jdo.impl.model.jdo
Class JDOMemberImpl

java.lang.Object
  extended byorg.apache.jdo.impl.model.jdo.JDOElementImpl
      extended byorg.apache.jdo.impl.model.jdo.JDOMemberImpl
All Implemented Interfaces:
java.lang.Comparable, JDOElement, JDOMember
Direct Known Subclasses:
JDOClassImplDynamic, JDOFieldImplDynamic

public class JDOMemberImpl
extends JDOElementImpl
implements JDOMember

This is the super interface for named JDO metadata elements, such as JDOClass and JDOField.

Author:
Michael Bouschen

Field Summary
private  JDOClass declaringClass
          Relationship JDOClass<->JDOMember.
private  java.lang.String name
          Property name.
 
Fields inherited from class org.apache.jdo.impl.model.jdo.JDOElementImpl
 
Constructor Summary
JDOMemberImpl()
           
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares this object with the specified object for order.
 boolean equals(java.lang.Object obj)
          Overrides Object's equals method by comparing the name of this member with the name of the argument obj.
 JDOClass getDeclaringClass()
          Get the declaring class of this JDOMember.
 java.lang.String getName()
          Returns the name of this JDOMember.
 int hashCode()
          Overrides Object's hashCode method to return the hashCode of this name.
 void setDeclaringClass(JDOClass declaringClass)
          Set the declaring class of this JDOMember.
 void setName(java.lang.String name)
          Sets the name of this JDOMember.
 java.lang.String toString()
          Overrides Object's toString method to return the name of this persistence element.
 
Methods inherited from class org.apache.jdo.impl.model.jdo.JDOElementImpl
addPropertyChangeListener, addVetoableChangeListener, createJDOExtension, firePropertyChange, fireVetoableChange, getJDOExtensions, removeJDOExtension, removePropertyChangeListener, removeVetoableChangeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.jdo.model.jdo.JDOElement
addPropertyChangeListener, addVetoableChangeListener, createJDOExtension, getJDOExtensions, removeJDOExtension, removePropertyChangeListener, removeVetoableChangeListener
 

Field Detail

name

private java.lang.String name
Property name.


declaringClass

private JDOClass declaringClass
Relationship JDOClass<->JDOMember.

Constructor Detail

JDOMemberImpl

public JDOMemberImpl()
Method Detail

getName

public java.lang.String getName()
Returns the name of this JDOMember.

Specified by:
getName in interface JDOMember
Returns:
the name

setName

public void setName(java.lang.String name)
Sets the name of this JDOMember.

Specified by:
setName in interface JDOMember
Parameters:
name - the name

getDeclaringClass

public JDOClass getDeclaringClass()
Get the declaring class of this JDOMember.

Specified by:
getDeclaringClass in interface JDOMember
Returns:
the class that owns this JDOMember, or null if the element is not attached to any class

setDeclaringClass

public void setDeclaringClass(JDOClass declaringClass)
Set the declaring class of this JDOMember.

Specified by:
setDeclaringClass in interface JDOMember
Parameters:
declaringClass - the declaring class of this member element

toString

public java.lang.String toString()
Overrides Object's toString method to return the name of this persistence element.

Returns:
a string representation of the object

equals

public boolean equals(java.lang.Object obj)
Overrides Object's equals method by comparing the name of this member with the name of the argument obj. The method returns false if obj does not have the same dynamic type as this member.

Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

hashCode

public int hashCode()
Overrides Object's hashCode method to return the hashCode of this name.

Returns:
a hash code value for this object.

compareTo

public int compareTo(java.lang.Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The specified object must be a an instance of JDOMember, if not a ClassCastException is thrown. The order of JDOMember instances is defined by the order of their names. JDOMember instances without name are considered to be less than any named member.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - the Object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
java.lang.ClassCastException - - if the specified object is null or is not an instance of JDOMember