- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Tue, 28 Aug 2012 15:07:07 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/values
In directory hutz:/tmp/cvs-serv24534
Added Files:
CssLayerList.java
Log Message:
added Layer List
--- NEW FILE: CssLayerList.java ---
// $Id: CssLayerList.java,v 1.1 2012/08/28 15:07:04 ylafon Exp $
// @author Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2010.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.values;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import java.util.ArrayList;
/**
* A comma separated value list.
*
*/
public class CssLayerList extends CssValue {
public static final int type = CssTypes.CSS_LAYER_LIST;
public ArrayList<CssValue> value;
public final int getType() {
return type;
}
public int size() {
return value.size();
}
/**
* Create a new CssLayerList
*/
public CssLayerList() {
value = new ArrayList<CssValue>();
}
/**
* Create a new CssLayerList
*
* @param val the <EM>ArrayList</EM> of CssValue
*/
public CssLayerList(ArrayList<CssValue> val) {
value = val;
}
/**
* Set the value of this string.
*
* @param s the ArrayList of CSS values
* @param ac For errors and warnings reports.
* @throws org.w3c.css.util.InvalidParamException
* The unit is incorrect
*/
public void set(String s, ApplContext ac)
throws InvalidParamException {
throw new InvalidParamException("invalid-class", s, ac);
}
public void add(CssValue val) {
value.add(val);
}
/**
* Returns the value
*/
public Object get() {
return value;
}
/**
* return a stored value
*/
public CssValue get(int idx) {
return value.get(idx);
}
/**
* Returns a string representation of the object.
*/
public String toString() {
StringBuilder sb = new StringBuilder();
boolean first = true;
for (CssValue aCssValue: value) {
if (!first) {
sb.append(", ");
} else {
first = false;
}
sb.append(aCssValue.toString());
}
return sb.toString();
}
/**
* Get the hash code of the internal string.
*/
public int hashCode() {
return value.hashCode();
}
/**
* Compares two values for equality.
*
* @param value The other value.
*/
public boolean equals(Object value) {
return (value instanceof CssLayerList &&
this.value.equals(((CssLayerList) value).value));
}
}
Received on Tuesday, 28 August 2012 15:07:12 UTC