mpoeschl    2002/11/26 14:32:55

  Modified:    src/java/org/apache/torque/om BaseObject.java ComboKey.java
                        DateKey.java NumberKey.java ObjectKey.java
                        StringKey.java
  Log:
  o javadocs
  o checkstyle fixes
  
  Revision  Changes    Path
  1.14      +8 -7      
jakarta-turbine-torque/src/java/org/apache/torque/om/BaseObject.java
  
  Index: BaseObject.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/om/BaseObject.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- BaseObject.java   24 May 2002 23:44:08 -0000      1.13
  +++ BaseObject.java   26 Nov 2002 22:32:55 -0000      1.14
  @@ -245,7 +245,7 @@
        * Sets the primaryKey for the object as an int.
        *
        * @param primaryKey The new primaryKey for the object.
  -     * @exception Exception, This method will not throw any exceptions
  +     * @exception Exception This method will not throw any exceptions
        * but this allows for children to override the method more easily
        *
        * @deprecated
  @@ -259,7 +259,7 @@
        * Sets the PrimaryKey for the object as an long.
        *
        * @param primaryKey The new PrimaryKey for the object.
  -     * @exception Exception, This method will not throw any exceptions
  +     * @exception Exception This method will not throw any exceptions
        * but this allows for children to override the method more easily
        *
        * @deprecated
  @@ -273,7 +273,7 @@
        * Sets the PrimaryKey for the object.
        *
        * @param primaryKey The new PrimaryKey for the object.
  -     * @exception Exception, This method will not throw any exceptions
  +     * @exception Exception This method will not throw any exceptions
        * but this allows for children to override the method more easily
        *
        */
  @@ -286,9 +286,8 @@
        * Sets the PrimaryKey for the object as an Object.
        *
        * @param primaryKey The new PrimaryKey for the object.
  -     * @exception Exception, This method will not throw any exceptions
  +     * @exception Exception This method will not throw any exceptions
        * but this allows for children to override the method more easily
  -     *
        */
       public void setPrimaryKey(SimpleKey[] primaryKey) throws Exception
       {
  @@ -299,6 +298,8 @@
        * Sets the PrimaryKey for the object as an Object.
        *
        * @param primaryKey The new PrimaryKey for the object.
  +     * @exception Exception This method will not throw any exceptions
  +     * but this allows for children to override the method more easily
        */
       public void setPrimaryKey(ObjectKey primaryKey) throws Exception
       {
  @@ -411,7 +412,7 @@
       public int hashCode()
       {
           ObjectKey ok = getPrimaryKey();
  -        if ( ok == null)
  +        if (ok == null)
           {
               return super.hashCode();
           }
  
  
  
  1.11      +31 -9     
jakarta-turbine-torque/src/java/org/apache/torque/om/ComboKey.java
  
  Index: ComboKey.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/om/ComboKey.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ComboKey.java     19 Nov 2002 17:35:11 -0000      1.10
  +++ ComboKey.java     26 Nov 2002 22:32:55 -0000      1.11
  @@ -71,16 +71,13 @@
   {
       // might want to shift these to TR.props
   
  -    /**
  -     * The single character used to separate key values in a string.
  -     */
  +    /** The single character used to separate key values in a string. */
       public static final char SEPARATOR = ':';
   
  -    /**
  -     * The single character used to separate key values in a string.
  -     */
  +    /** The single character used to separate key values in a string. */
       public static final String SEPARATOR_STRING = ":";
   
  +    /** The array of the keys */
       private SimpleKey[] key;
   
       /**
  @@ -94,6 +91,8 @@
       /**
        * Creates a ComboKey whose internal representation is an
        * array of SimpleKeys.
  +     *
  +     * @param keys the key values
        */
       public ComboKey(SimpleKey[] keys)
       {
  @@ -103,6 +102,8 @@
       /**
        * Creates a compound ComboKey whose internal representation is a
        * String array.
  +     *
  +     * @param keys the key values
        * @deprecated ambiguous unnecessary ctor will be removed.
        */
       public ComboKey(String[] keys)
  @@ -113,6 +114,7 @@
       /**
        * Sets the internal representation to a String array.
        *
  +     * @param keys the key values
        * @see toString()
        */
       public ComboKey(String keys)
  @@ -122,6 +124,8 @@
   
       /**
        * Sets the internal representation using a SimpleKey array.
  +     *
  +     * @param keys the key values
        */
       public void setValue(SimpleKey[] keys)
       {
  @@ -130,6 +134,8 @@
   
       /**
        * Sets the internal representation using a String array.
  +     *
  +     * @param keys the key values
        * @deprecated ambiguous unnecessary method will be removed.
        */
       public void setValue(String[] keys)
  @@ -144,6 +150,8 @@
       /**
        * Sets the internal representation using a String of the
        * form produced by the toString method.
  +     *
  +     * @param keys the key values
        */
       public void setValue(String keys)
       {
  @@ -196,14 +204,20 @@
           }
       }
   
  +    /**
  +     * Sets the internal representation using a ComboKey.
  +     *
  +     * @param keys the key values
  +     */
       public void setValue(ComboKey keys)
       {
           setValue((SimpleKey[]) keys.getValue());
       }
   
  -
       /**
        * Get the underlying object.
  +     *
  +     * @return the underlying object
        */
       public Object getValue()
       {
  @@ -213,6 +227,9 @@
       /**
        * This method will return true if the conditions for a looseEquals
        * are met and in addition no parts of the keys are null.
  +     *
  +     * @param keyObj the comparison value
  +     * @return whether the two objects are equal
        */
       public boolean equals(Object keyObj)
       {
  @@ -248,6 +265,9 @@
        * allow any null keys parts, while the internal key may not be null
        * portions may be, and the two object will be considered equal if
        * their null portions match.
  +     *
  +     * @param keyObj the comparison value
  +     * @return whether the two objects are equal
        */
       public boolean looseEquals(Object keyObj)
       {
  @@ -295,7 +315,7 @@
   
       /**
        *
  -     * @param sb
  +     * @param sb the StringBuffer to append
        * @see toString()
        */
       public void appendTo(StringBuffer sb)
  @@ -362,6 +382,8 @@
        * Example: <br/>
        * the ComboKey(StringKey("key1"), NumberKey(2)) is represented as
        * <code><b>Skey1:N2:</b></code>
  +     *
  +     * @return a String representation
        */
       public String toString()
       {
  
  
  
  1.9       +19 -6     
jakarta-turbine-torque/src/java/org/apache/torque/om/DateKey.java
  
  Index: DateKey.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/om/DateKey.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DateKey.java      26 Nov 2002 21:27:47 -0000      1.8
  +++ DateKey.java      26 Nov 2002 22:32:55 -0000      1.9
  @@ -77,6 +77,9 @@
       /**
        * Creates a DateKey whose internal representation is a Date
        * given by the long number given by the String
  +     *
  +     * @param key the key value
  +     * @throws NumberFormatException if key is not valid
        */
       public DateKey(String key) throws NumberFormatException
       {
  @@ -85,6 +88,8 @@
   
       /**
        * Creates a DateKey
  +     *
  +     * @param key the key value
        */
       public DateKey(Date key)
       {
  @@ -93,10 +98,12 @@
   
       /**
        * Creates a DateKey that is equivalent to key.
  +     *
  +     * @param key the key value
        */
       public DateKey(DateKey key)
       {
  -        if( key != null )
  +        if (key != null)
           {
               this.key = key.getValue();
           }
  @@ -108,6 +115,8 @@
   
       /**
        * Sets the internal representation to a String
  +     *
  +     * @param key the key value
        */
       public void setValue(String key)
       {
  @@ -115,8 +124,9 @@
       }
   
       /**
  -     * Sets the internal representation to the same object used
  -     * by key.
  +     * Sets the internal representation to the same object used by key.
  +     *
  +     * @param key the key value
        */
       public void setValue(DateKey key)
       {
  @@ -144,12 +154,15 @@
        * keyObj is equal to this DateKey if keyObj is a DateKey or String
        * that contains the same information this key contains.  Two ObjectKeys
        * that both contain null values are not considered equal.
  +     *
  +     * @param keyObj the comparison value
  +     * @return whether the two objects are equal
        */
       public boolean equals(Object keyObj)
       {
           boolean isEqual = false;
   
  -        if ( key != null )
  +        if (key != null)
           {
               if (keyObj instanceof String)
               {
  @@ -157,7 +170,7 @@
               }
               // check against a DateKey. Two keys are equal, if their
               // internal keys equivalent.
  -            else if ( keyObj instanceof DateKey)
  +            else if (keyObj instanceof DateKey)
               {
                   Object obj = ((DateKey) keyObj).getValue();
                   isEqual =  key.equals(obj);
  
  
  
  1.14      +26 -4     
jakarta-turbine-torque/src/java/org/apache/torque/om/NumberKey.java
  
  Index: NumberKey.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/om/NumberKey.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- NumberKey.java    26 Nov 2002 21:22:00 -0000      1.13
  +++ NumberKey.java    26 Nov 2002 22:32:55 -0000      1.14
  @@ -78,6 +78,8 @@
   
       /**
        * Creates a NumberKey equivalent to <code>key</code>.
  +     *
  +     * @param key the key value
        */
       public NumberKey(String key)
       {
  @@ -86,6 +88,8 @@
   
       /**
        * Creates a NumberKey equivalent to <code>key</code>.
  +     *
  +     * @param key the key value
        */
       public NumberKey(BigDecimal key)
       {
  @@ -94,6 +98,8 @@
   
       /**
        * Creates a NumberKey equivalent to <code>key</code>.
  +     *
  +     * @param key the key value
        */
       public NumberKey(NumberKey key)
       {
  @@ -109,6 +115,8 @@
   
       /**
        * Creates a NumberKey equivalent to <code>key</code>.
  +     *
  +     * @param key the key value
        */
       public NumberKey(long key)
       {
  @@ -118,6 +126,8 @@
       /**
        * Creates a NumberKey equivalent to <code>key</code>.
        * Convenience only. Not very efficient at all.
  +     *
  +     * @param key the key value
        */
       public NumberKey(int key)
       {
  @@ -127,6 +137,8 @@
       /**
        * Creates a NumberKey equivalent to <code>key</code>.
        * Convenience only.
  +     *
  +     * @param key the key value
        */
       public NumberKey(Number key)
       {
  @@ -143,6 +155,9 @@
       /**
        * Sets the internal representation using a String representation
        * of a number
  +     *
  +     * @param key the key value
  +     * @throws NumberFormatException if key is not a valid number
        */
       public void setValue(String key) throws NumberFormatException
       {
  @@ -151,6 +166,8 @@
   
       /**
        * Sets the underlying object
  +     *
  +     * @param key the key value
        */
       public void setValue(BigDecimal key)
       {
  @@ -158,8 +175,9 @@
       }
   
       /**
  -     * Sets the internal representation to the same object used
  -     * by key.
  +     * Sets the internal representation to the same object used by key.
  +     *
  +     * @param key the key value
        */
       public void setValue(NumberKey key)
       {
  @@ -177,7 +195,8 @@
       }
   
       /**
  -     * Two ObjectKeys that both contain null values <strong>are not</strong> 
considered equal.
  +     * Two ObjectKeys that both contain null values <strong>are not</strong>
  +     * considered equal.
        *
        * @param keyObj the key to compare values to
        * @return whether the two objects are equal
  @@ -230,6 +249,7 @@
       }
   
       /**
  +     * @param o the comparison value
        * @return a numeric comparison of the two values
        * @throws NullPointerException when the value of the NumberKey or the
        *         comparison value is null
  @@ -242,6 +262,8 @@
       /**
        * Invokes the toString() method on the object.  An empty string
        * is returned is the value is null.
  +     *
  +     * @return a String representation of the key value
        */
       public String toString()
       {
  
  
  
  1.6       +5 -2      
jakarta-turbine-torque/src/java/org/apache/torque/om/ObjectKey.java
  
  Index: ObjectKey.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/om/ObjectKey.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ObjectKey.java    26 Jul 2002 22:30:35 -0000      1.5
  +++ ObjectKey.java    26 Nov 2002 22:32:55 -0000      1.6
  @@ -89,7 +89,7 @@
        */
       public int hashCode()
       {
  -        if ( key == null )
  +        if (key == null)
           {
               return super.hashCode();
           }
  @@ -98,6 +98,8 @@
   
       /**
        * Get the underlying object.
  +     *
  +     * @return the underlying object
        */
       public Object getValue()
       {
  @@ -118,6 +120,7 @@
        * Implements the compareTo method.
        *
        * @param obj the object to compare to this object
  +     * @return a numeric comparison of the two values
        */
       public int compareTo(Object obj)
       {
  
  
  
  1.7       +19 -7     
jakarta-turbine-torque/src/java/org/apache/torque/om/StringKey.java
  
  Index: StringKey.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/om/StringKey.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- StringKey.java    26 Nov 2002 21:27:47 -0000      1.6
  +++ StringKey.java    26 Nov 2002 22:32:55 -0000      1.7
  @@ -75,6 +75,8 @@
   
       /**
        * Creates a StringKey whose internal representation is a String
  +     *
  +     * @param key the key value
        */
       public StringKey(String key)
       {
  @@ -83,10 +85,12 @@
   
       /**
        * Creates a StringKey that is equivalent to key.
  +     *
  +     * @param key the key value
        */
       public StringKey(StringKey key)
       {
  -        if( key != null )
  +        if (key != null)
           {
               this.key = key.getValue();
           }
  @@ -98,6 +102,8 @@
   
       /**
        * Sets the internal representation to a String
  +     *
  +     * @param key the key value
        */
       public void setValue(String key)
       {
  @@ -105,8 +111,9 @@
       }
   
       /**
  -     * Sets the internal representation to the same object used
  -     * by key.
  +     * Sets the internal representation to the same object used by key.
  +     *
  +     * @param key the key value
        */
       public void setValue(StringKey key)
       {
  @@ -134,12 +141,15 @@
        * keyObj is equal to this StringKey if keyObj is a StringKey or String
        * that contains the same information this key contains.  Two ObjectKeys
        * that both contain null values are not considered equal.
  +     *
  +     * @param keyObj the comparison value
  +     * @return whether the two objects are equal
        */
       public boolean equals(Object keyObj)
       {
           boolean isEqual = false;
   
  -        if ( key != null )
  +        if (key != null)
           {
               if (keyObj instanceof String)
               {
  @@ -147,7 +157,7 @@
               }
               // check against a StringKey. Two keys are equal, if their
               // internal keys equivalent.
  -            else if ( keyObj instanceof StringKey)
  +            else if (keyObj instanceof StringKey)
               {
                   Object obj = ((StringKey) keyObj).getValue();
                   isEqual =  key.equals(obj);
  @@ -157,11 +167,13 @@
       }
   
       /**
  +     * get a String representation
        *
  +     * @return a String representation of an empty String if the value is null
        */
       public String toString()
       {
  -        if ( key != null )
  +        if (key != null)
           {
               return (String) key;
           }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to