mx4j/src/core/javax/management/openmbean TabularType.java,1.14,1.15

Simone Bordet <[email protected]> Tue, 07 Sep 2004 13:03:10 +0000
Newsgroups gmane.comp.java.mx4j.cvs
Message-ID <[email protected]>
Update of /cvsroot/mx4j/mx4j/src/core/javax/management/openmbean
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20609/src/core/javax/management/openmbean

Modified Files:
	TabularType.java 
Log Message:
Cosmetics

Index: TabularType.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/javax/management/openmbean/TabularType.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** TabularType.java	4 Sep 2004 15:44:05 -0000	1.14
--- TabularType.java	7 Sep 2004 13:03:08 -0000	1.15
***************
*** 11,15 ****
  import java.util.ArrayList;
  import java.util.Collections;
- import java.util.Iterator;
  import java.util.List;
  
--- 11,14 ----
***************
*** 28,44 ****
     private transient String m_classDescription = null;
  
-    /**
-     * Constructs a TabularType instance
-     * <p><b>Parameters:</b></p>
-     * <p>typeName    - the name given to this tabularType instance, cannot be null or empty</p>
-     * <p>description - the human readable description of the tabularType this instance refers to cannot be null or empty</p>
-     * <p>rowType     - the type of the row elements of tabular data values described by this tabular type instance cannot be null</p>
-     * <p>indexNames  - the names of the items which are used to uniquely index each row element in the tabular data values, cannot be null or empty<br/>
-     * - each element should be an item name defined in rowType.
-     * - NOTE: The order of the itemNames is used by the methods <tt>get</tt> and <tt>remove</tt> of class TabularData to match their array of values to items</p>
-     * <p><b>Throws:</b></p>
-     * <p>IllegalArgumentException - if rowType is null, indexNames or any item in indexNames are null or empty, typeName or description are null or empty</p>
-     * <p>OpenDataException - if an element of indexNames is not an item defined in RowType</p>
-     */
     public TabularType(String typeName, String description, CompositeType rowType, String[] indexNames) throws OpenDataException
     {
--- 27,30 ----
***************
*** 54,59 ****
  
     /**
!     * checks if all of the values of indexNames match items defined in rowType, that the item is not null or zero length
!     * we then create an unmodifiable list from the "valid" string array. If any validity checks fail an OpenDataException is thrown
      */
     private void validate(CompositeType rowType, String[] indexNames) throws OpenDataException
--- 40,46 ----
  
     /**
!     * Checks if all of the values of indexNames match items defined in rowType, that the item is not null or zero length
!     * we then create an unmodifiable list from the "valid" string array.
!     * If any validity checks fail an OpenDataException is thrown
      */
     private void validate(CompositeType rowType, String[] indexNames) throws OpenDataException
***************
*** 76,82 ****
     }
  
-    /**
-     * @return CompositeType - the type of the row elements of tabular data values described by this TabularType instance
-     */
     public CompositeType getRowType()
     {
--- 63,66 ----
***************
*** 84,92 ****
     }
  
-    /**
-     * @return - Returns, in the same order as was given to this instance's constructor,
-     *         an unmodifiable List of the names of the items the values of which are used to uniquely index each row element
-     *         of tabular data values described by this TabularType instance
-     */
     public List getIndexNames()
     {
--- 68,71 ----
***************
*** 94,103 ****
     }
  
-    /**
-     * checks if the typeName of the object is the same as the typeName of this TabularType instance
-     *
-     * @param object - the tabularType instance to check if the typeName is a value of this instance
-     * @return true if the objects typeName is the same as that of this instance, false if either the object is not an instance of this class or the typeNames do not match
-     */
     public boolean isValue(Object object)
     {
--- 73,76 ----
***************
*** 107,117 ****
     }
  
-    /**
-     * determines if the object passed in is equal to this class instance
-     *
-     * @param object the object to test if equal to this class
-     * @return true if the object is equal to this class, false if the object is not an instance of this class or if the data
-     *         contained in the object is not the same as the data contained in this class instance
-     */
     public boolean equals(Object object)
     {
--- 80,83 ----
***************
*** 119,131 ****
        if (!(object instanceof TabularType)) return false;
        TabularType tabularType = (TabularType)object;
!       return (rowType.equals(tabularType.rowType) && indexNames.equals(tabularType.indexNames) && getTypeName().equals(tabularType.getTypeName()));
     }
  
-    /**
-     * computes a hashcode for this instance
-     *
-     * @return the int value of the hashcode.
-     *         As TabularTypeBackUP instances are immutable, the hash code for this instance is calculated once, on the first call to hashCode, and then the same value is returned for subsequent calls
-     */
     public int hashCode()
     {
--- 85,93 ----
        if (!(object instanceof TabularType)) return false;
        TabularType tabularType = (TabularType)object;
!       return getRowType().equals(tabularType.getRowType()) &&
!              getIndexNames().equals(tabularType.getIndexNames()) &&
!              getTypeName().equals(tabularType.getTypeName());
     }
  
     public int hashCode()
     {
***************
*** 133,141 ****
        {
           int result = getTypeName().hashCode();
!          result += rowType.hashCode();
!          Iterator i = indexNames.iterator();
!          while (i.hasNext())
           {
!             result += i.next().hashCode();
           }
           m_hashcode = result;
--- 95,104 ----
        {
           int result = getTypeName().hashCode();
!          result += 13 * getRowType().hashCode();
!          List names = getIndexNames();
!          for (int i = 0; i < names.size(); ++i)
           {
!             Object name = names.get(i);
!             result += 23 * name.hashCode();
           }
           m_hashcode = result;
***************
*** 144,166 ****
     }
  
-    /**
-     * creates a user friendly string value of the class
-     *
-     * @return the string representation of the class
-     *         As TabularTypeBackUP instances are immutable, the string representation for this instance is calculated once,
-     *         on the first call to toString, and then the same value is returned for subsequent calls ie. we use lazy initialization
-     */
     public String toString()
     {
        if (m_classDescription == null)
        {
!          StringBuffer classString = new StringBuffer();
!          classString.append("TabularType name: ").append(getTypeName()).append(" rowType: ").append(rowType.toString()).append("indexNames: (");
!          for (Iterator i = indexNames.iterator(); i.hasNext();)
!          {
!             classString.append(i.next().toString()).append(", ");
!          }
!          classString.delete(classString.length() - 2, classString.length());
!          classString.append(")");
           m_classDescription = classString.toString();
        }
--- 107,117 ----
     }
  
     public String toString()
     {
        if (m_classDescription == null)
        {
!          StringBuffer classString = new StringBuffer("TabularType name: ").append(getTypeName());
!          classString.append(" rowType: ").append(getRowType());
!          classString.append("indexNames: ").append(getIndexNames());
           m_classDescription = classString.toString();
        }



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click