2002/css-validator/org/w3c/css/properties/css2 CssLetterSpacing.java,1.1,1.2

Update of /sources/public/2002/css-validator/org/w3c/css/properties/css2
In directory hutz:/tmp/cvs-serv14870/css2

Modified Files:
	CssLetterSpacing.java 
Log Message:
use the root class CssValue

Index: CssLetterSpacing.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css2/CssLetterSpacing.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssLetterSpacing.java	9 Feb 2012 17:36:30 -0000	1.1
+++ CssLetterSpacing.java	4 Sep 2012 08:36:29 -0000	1.2
@@ -6,7 +6,6 @@
 // Please first read the full copyright statement in file COPYRIGHT.html
 package org.w3c.css.properties.css2;
 
-import org.w3c.css.properties.css.CssProperty;
 import org.w3c.css.util.ApplContext;
 import org.w3c.css.util.InvalidParamException;
 import org.w3c.css.values.CssExpression;
@@ -16,90 +15,57 @@
 import org.w3c.css.values.CssValue;
 
 /**
- * @spec  http://www.w3.org/TR/2008/REC-CSS2-20080411/text.html#propdef-letter-spacing
- * @version $Revision$
+ * @spec http://www.w3.org/TR/2008/REC-CSS2-20080411/text.html#propdef-letter-spacing
  */
 public class CssLetterSpacing extends org.w3c.css.properties.css.CssLetterSpacing {
 
-    private CssValue value;
-    private static CssIdent normal = CssIdent.getIdent("normal");
-
-    /**
-     * Create a new CssLetterSpacing.
-     */
-    public CssLetterSpacing() {
-        value = normal;
-    }
-
-    /**
-     * Create a new CssLetterSpacing with an expression
-     *
-     * @param expression The expression
-     * @throws org.w3c.css.util.InvalidParamException The expression is incorrect
-     */
-    public CssLetterSpacing(ApplContext ac, CssExpression expression,
-                            boolean check) throws InvalidParamException {
-
-        if (check && expression.getCount() > 1) {
-            throw new InvalidParamException("unrecognize", ac);
-        }
-
-        CssValue val = expression.getValue();
+	private static CssIdent normal = CssIdent.getIdent("normal");
 
-        setByUser();
+	/**
+	 * Create a new CssLetterSpacing.
+	 */
+	public CssLetterSpacing() {
+		value = normal;
+	}
 
-        switch (val.getType()) {
-            case CssTypes.CSS_NUMBER:
-                val = ((CssNumber) val).getLength();
-            case CssTypes.CSS_LENGTH:
-                value = val;
-                break;
-            case CssTypes.CSS_IDENT:
-                if (inherit.equals(val) || normal.equals(val)) {
-                    value = val;
-                    break;
-                }
-            default:
-                throw new InvalidParamException("value", expression.getValue(),
-                        getPropertyName(), ac);
-        }
-        expression.next();
-    }
+	/**
+	 * Create a new CssLetterSpacing with an expression
+	 *
+	 * @param expression The expression
+	 * @throws org.w3c.css.util.InvalidParamException
+	 *          The expression is incorrect
+	 */
+	public CssLetterSpacing(ApplContext ac, CssExpression expression,
+							boolean check) throws InvalidParamException {
 
-    public CssLetterSpacing(ApplContext ac, CssExpression expression)
-            throws InvalidParamException {
-        this(ac, expression, false);
-    }
+		if (check && expression.getCount() > 1) {
+			throw new InvalidParamException("unrecognize", ac);
+		}
 
-    /**
-     * Returns the value of this property
-     */
-    public Object get() {
-        return value;
-    }
+		CssValue val = expression.getValue();
 
-    /**
-     * Returns true if this property is "softly" inherited
-     * e.g. his value equals inherit
-     */
-    public boolean isSoftlyInherited() {
-        return value == inherit;
-    }
+		setByUser();
 
-    /**
-     * Returns a string representation of the object.
-     */
-    public String toString() {
-        return value.toString();
-    }
+		switch (val.getType()) {
+			case CssTypes.CSS_NUMBER:
+				val = ((CssNumber) val).getLength();
+			case CssTypes.CSS_LENGTH:
+				value = val;
+				break;
+			case CssTypes.CSS_IDENT:
+				if (inherit.equals(val) || normal.equals(val)) {
+					value = val;
+					break;
+				}
+			default:
+				throw new InvalidParamException("value", expression.getValue(),
+						getPropertyName(), ac);
+		}
+		expression.next();
+	}
 
-    /**
-     * Compares two properties for equality.
-     *
-     * @param property The other property.
-     */
-    public boolean equals(CssProperty property) {
-        return (property instanceof CssLetterSpacing &&
-                value.equals(((CssLetterSpacing) property).value));
-    }
+	public CssLetterSpacing(ApplContext ac, CssExpression expression)
+			throws InvalidParamException {
+		this(ac, expression, false);
+	}
 }

Received on Tuesday, 4 September 2012 08:36:32 UTC