[PATCH 5/9] Fix javadoc comments in Format.java

Nigel Hawkins n.hawkins at gmx.com
Thu Oct 28 01:45:33 PDT 2010


---
 .../xmerge/converter/xml/sxc/Format.java           |  186 +++++++++----------
 1 files changed, 88 insertions(+), 98 deletions(-)

diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/Format.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/Format.java
index a3abda0..9e3e1a9 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/Format.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/Format.java
@@ -1,7 +1,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -42,12 +42,12 @@ public class Format implements Cloneable {
     final public static int CENTER_ALIGN	= 0x02;
     final public static int LEFT_ALIGN		= 0x03;
     final public static int JUST_ALIGN		= 0x04;
-    
+
     /**  Vertical Alignment Constants. */
     final public static int TOP_ALIGN		= 0x01;
     final public static int MIDDLE_ALIGN	= 0x02;
     final public static int BOTTOM_ALIGN	= 0x03;
-    
+
     /** Indicates <i>bold</i> text. */
     final public static int BOLD        = 0x01;
     /** Indicates <i>italic</i> text. */
@@ -60,12 +60,12 @@ public class Format implements Cloneable {
     final public static int SUPERSCRIPT = 0x10;
     /** Indicates <i>subscripted</i> text. */
     final public static int SUBSCRIPT   = 0x20;
-    
+
     final public static int LEFT_BORDER		= 0x40;
     final public static int RIGHT_BORDER	= 0x80;
     final public static int TOP_BORDER   	= 0x100;
     final public static int BOTTOM_BORDER   = 0x200;
-    
+
     final public static int WORD_WRAP		= 0x400;
 
     private int align;
@@ -74,14 +74,14 @@ public class Format implements Cloneable {
     private String value;
     private String formatSpecifier;
     private int decimalPlaces;
-    
+
     /** Font name. */
     private String fontName;
     /** Font size in points. */
     protected int sizeInPoints;
-    
+
     private Color foreground, background;
-    
+
     /** Values of text attributes. */
     protected int attributes = 0;
     /** Bitwise mask of text attributes. */
@@ -91,13 +91,16 @@ public class Format implements Cloneable {
      *  Constructor for creating a new <code>Format</code>.
      */
     public Format() {
-        clearFormatting();    
+        clearFormatting();
     }
-   
+
     /**
      * Constructor that creates a new <code>Format</code> object
      * by setting all the format attributes.
      *
+     * @param attributes  Attributes flags (alignment, bold, etc.)
+     * @param fontSize    Size of the font in points.
+     * @param fontName    Name of the font to use.
      */
        public Format(int attributes, int fontSize, String fontName) {
 
@@ -107,7 +110,7 @@ public class Format implements Cloneable {
     }
 
     /**
-     *  Constructor for creating a new <code>Format</code> object 
+     *  Constructor for creating a new <code>Format</code> object
      *  based on an existing one.
      *
      *  @param  fmt  <code>Format</code> to copy.
@@ -117,7 +120,7 @@ public class Format implements Cloneable {
         value = fmt.getValue();
         formatSpecifier = fmt.getFormatSpecifier();
         decimalPlaces = fmt.getDecimalPlaces();
-        
+
         attributes = fmt.attributes;
         mask = fmt.mask;
 
@@ -128,7 +131,6 @@ public class Format implements Cloneable {
         background = fmt.getBackground();
         sizeInPoints = fmt.sizeInPoints;
     }
-    
 
     /**
      *  Reset this <code>Format</code> description.
@@ -147,32 +149,33 @@ public class Format implements Cloneable {
        foreground = null;
        background = null;
     }
-     
+
     /**
-     *  Set one or more text attributes to <i>on</i>.
+     *  Set one or more text attributes.
      *
-     *  @param  flags  Flag attributes to set <i>on</i>.
+     *  @param  flags  Flag attributes to set.
+     *  @param  toggle True to set flags, false to clear them.
      */
     public void setAttribute(int flags, boolean toggle) {
         mask |= flags;
         if(toggle) {
             attributes |= flags;
-        } else { 
+        } else {
             attributes &= ~flags;
         }
     }
- 
+
     /**
      *  Return true if the <code>attribute</code> is set to <i>on</i>
      *
      *  @param  attribute  Attribute to check ({@link #BOLD},
      *                     {@link #ITALIC}, etc.)
      *
-     *  @return  true if <code>attribute</code> is set to <i>on</i>, 
+     *  @return  true if <code>attribute</code> is set to <i>on</i>,
      *           otherwise false.
      */
     public boolean getAttribute(int attribute) {
-        if ((mask & attribute) == 0) 
+        if ((mask & attribute) == 0)
             return false;
         return (!((attributes & attribute) == 0));
     }
@@ -191,13 +194,12 @@ public class Format implements Cloneable {
     public boolean isSet(int attribute) {
         return (!((mask & attribute) == 0));
     }
-    
-    
+
     /**
      *  Set the formatting category of this object, ie number, date,
-     *  currency.The <code>OfficeConstants</code> class contains string 
+     *  currency.The <code>OfficeConstants</code> class contains string
      *  constants for the category types.
-     * 
+     *
      *  @see  org.openoffice.xmerge.converter.xml.OfficeConstants
      *
      *  @param   newCategory  The name of the category to be set.
@@ -205,7 +207,7 @@ public class Format implements Cloneable {
     public void setCategory(String newCategory) {
         category = newCategory;
     }
-    
+
      /**
       *  Return the formatting category of the object.
       *
@@ -220,22 +222,21 @@ public class Format implements Cloneable {
      /**
       *  In the case of Formula returns the value of the formula.
       *
-      *  @return  The value of the formula 
+      *  @return  The value of the formula
       */
      public String getValue() {
          return value;
      }
-     
+
      /**
      *  In the case of formula the contents are set as the formula string and
      *  the value of the formula is a formatting attribute.
      *
-     *  @param   newValue the formuala value 
+     *  @param   newValue the formuala value
      */
     public void setValue(String newValue) {
         value = newValue;
     }
-    
 
      /**
       *  Set the <code>Format</code> specifier for this category.
@@ -245,7 +246,6 @@ public class Format implements Cloneable {
      public void setFormatSpecifier(String formatString) {
          formatSpecifier = formatString;
      }
-     
 
      /**
       *  Get the <code>Format</code> specifier for this category.
@@ -255,17 +255,15 @@ public class Format implements Cloneable {
      public String getFormatSpecifier() {
          return formatSpecifier;
      }
-     
-     
+
      /**
       *  Set the precision of the number to be displayed.
-      * 
+      *
       *  @param  precision  The number of decimal places to display.
       */
      public void setDecimalPlaces(int precision) {
          decimalPlaces = precision;
      }
-     
 
      /**
       *  Get the number of decimal places displayed.
@@ -275,17 +273,15 @@ public class Format implements Cloneable {
      public int getDecimalPlaces() {
          return decimalPlaces;
      }
-     
-     
+
      /**
       *  Set the font used for this cell.
-      * 
+      *
       *  @param  fontName  The name of the font.
       */
      public void setFontName(String fontName) {
          this.fontName = fontName;
      }
-     
 
      /**
       *  Get the font used for this cell.
@@ -295,74 +291,71 @@ public class Format implements Cloneable {
      public String getFontName() {
          return fontName;
      }
-     
+
      /**
-      *  Set the font used for this cell.
-      * 
-      *  @param  fontName  The name of the font.
+      *  Set the font size (in points) used for this cell.
+      *
+      *  @param  fontSize  The font size in points.
       */
      public void setFontSize(int fontSize) {
          sizeInPoints = fontSize;
      }
-     
 
      /**
-      *  Get the font used for this cell.
+      *  Get the font size (in points) used for this cell.
       *
-      *  @return  The font name.
+      *  @return  The font size in points.
       */
      public int getFontSize() {
          return sizeInPoints;
-     } 
+     }
 
       /**
-      *  Set the alignmen used for this cell.
-      * 
-      *  @param  fontName  The name of the font.
+      *  Set the vertical alignment used for this cell.
+      *
+      *  @param  vertAlign  The vertical alignment.
       */
      public void setVertAlign(int vertAlign) {
          this.vertAlign = vertAlign;
      }
-     
 
      /**
-      *  Get the alignment used for this cell.
+      *  Get the vertical alignment used for this cell.
       *
-      *  @return  The font name.
+      *  @return  The vertical alignment.
       */
      public int getVertAlign() {
          return vertAlign;
-     }  
+     }
 
       /**
-      *  Set the alignmen used for this cell.
-      * 
-      *  @param  fontName  The name of the font.
+      *  Set the alignment used for this cell.
+      *
+      *  @param  align The alignment to use.
       */
      public void setAlign(int align) {
          this.align = align;
      }
-     
 
      /**
       *  Get the alignment used for this cell.
       *
-      *  @return  The font name.
+      *  @return  The alignment.
       */
      public int getAlign() {
          return align;
-     }    
+     }
+
      /**
       *  Set the Foreground <code>Color</code> for this cell.
-      * 
-      *  @param  color  A <code>Color</code> object representing the
+      *
+      *  @param  c  A <code>Color</code> object representing the
       *                 foreground color.
       */
      public void setForeground(Color c) {
          if(c!=null)
             foreground = new Color(c.getRGB());
      }
-     
 
      /**
       *  Get the Foreground <code>Color</code> for this cell.
@@ -372,12 +365,11 @@ public class Format implements Cloneable {
      public Color getForeground() {
          return foreground;
      }
-     
 
      /**
       *  Set the Background <code>Color</code> for this cell
-      * 
-      *  @param  color  A <code>Color</code> object representing
+      *
+      *  @param  c  A <code>Color</code> object representing
       *                 the background color.
       */
      public void setBackground(Color c) {
@@ -385,9 +377,8 @@ public class Format implements Cloneable {
              background = new Color(c.getRGB());
      }
 
-     
      /**
-      *  Get the Foreground <code>Color</code> for this cell
+      *  Get the Background <code>Color</code> for this cell
       *
       *  @return  Background <code>Color</code> value
       */
@@ -396,80 +387,79 @@ public class Format implements Cloneable {
      }
 
      /**
-      *  Get the Foreground <code>Color</code> for this cell
+      *  Get a string representation of this <code>Format</code>
       *
-      *  @return  Background <code>Color</code> value
+      *  @return  A string indicating the value and category.
       */
      public String toString() {
          return new String("Value : " + getValue() + " Category : " + getCategory());
      }
 
-    /** 
+    /**
      * Tests if the current <code>Format</code> object has default attribute
      * values.
      *
-     * @return true if it contains default value 
+     * @return true if it contains default value
      */
     public boolean isDefault() {
 
         Format rhs = new Format();
 
-        if (rhs.attributes!= attributes) 
+        if (rhs.attributes!= attributes)
                 return false;
-        
-        if (foreground!=rhs.foreground) 
+
+        if (foreground!=rhs.foreground)
             return false;
-            
-        if (background!=rhs.background) 
+
+        if (background!=rhs.background)
             return false;
 
-        if (rhs.align!= align) 
+        if (rhs.align!= align)
                 return false;
 
-        if (rhs.vertAlign!= vertAlign) 
+        if (rhs.vertAlign!= vertAlign)
                 return false;
-        
+
         return true;
     }
-    
+
     /**
-     *  Return true if <code>style</code> specifies as much or less 
-     *  than this <code>Style</code>, and nothing it specifies
-     *  contradicts this <code>Style</code>.
+     *  Return true if passed <code>Format</code> specifies as much or less
+     *  than this <code>Format</code>, and nothing it specifies
+     *  contradicts this <code>Format</code>.
      *
-     *  @param  style  The <code>Style</code> to check.
+     *  @param  rhs  The <code>Format</code> to check.
      *
-     *  @return  true if <code>style</code> is a subset, false
+     *  @return  true if <code>rhs</code> is a subset, false
      *           otherwise.
      */
     public boolean isSubset(Format rhs) {
-        if (rhs.getClass() != this.getClass()) 
+        if (rhs.getClass() != this.getClass())
                 return false;
-        
-        if (rhs.attributes!= attributes) 
+
+        if (rhs.attributes!= attributes)
                 return false;
-        
+
         if (rhs.sizeInPoints != 0) {
-            if (sizeInPoints != rhs.sizeInPoints) 
+            if (sizeInPoints != rhs.sizeInPoints)
                 return false;
         }
 
         if (fontName!=rhs.fontName)
             return false;
-            
-        if (foreground!=rhs.foreground) 
+
+        if (foreground!=rhs.foreground)
             return false;
-            
-        if (background!=rhs.background) 
+
+        if (background!=rhs.background)
             return false;
 
-        if (rhs.align!= align) 
+        if (rhs.align!= align)
                 return false;
 
-        if (rhs.vertAlign!= vertAlign) 
+        if (rhs.vertAlign!= vertAlign)
                 return false;
 
         return true;
-    }	 
+    }
 }
-
-- 
1.7.0.4


--=-yxF8B8fCXhdiVRLw7V8t
Content-Disposition: attachment; filename="0006-Fix-javadoc-comments-in-NameDefinition.java.patch"
Content-Type: text/x-patch; name="0006-Fix-javadoc-comments-in-NameDefinition.java.patch"; charset="UTF-8"
Content-Transfer-Encoding: 7bit



More information about the LibreOffice mailing list