FileDocCategorySizeDatePackage
ListEntry.javaAPI DocAndroid 1.5 API2264Wed May 06 22:41:16 BST 2009com.google.wireless.gdata.spreadsheets.data

ListEntry

public class ListEntry extends com.google.wireless.gdata.data.Entry
Represents an entry in a GData Spreadsheets List feed.

Fields Summary
private Hashtable
values
Map containing the values in the row.
private Vector
names
Caches the list of names, so they don't need to be recomputed.
Constructors Summary
Methods Summary
public java.util.VectorgetNames()
Retrieves the column names present in this row.

return
a Set of Strings, one per column where data exists


                             
       
        if (names != null) {
            return names;
        }
        names = new Vector();
        Enumeration e = values.keys();
        while (e.hasMoreElements()) {
            names.add(e.nextElement());
        }
        return names;
    
public java.lang.StringgetValue(java.lang.String name)
Fetches the value for a column. Equivalent to getValue(name, null).

param
name the name of the column whose row is to be fetched
return
the value of the column, or null if the column is not present

        return getValue(name, null);
    
public java.lang.StringgetValue(java.lang.String name, java.lang.String defaultValue)
Fetches the value for a column.

param
name the name of the column whose row is to be fetched
param
defaultValue the value to return if the row has no value for the requested column; may be null
return
the value of the column, or null if the column is not present

        if (StringUtils.isEmpty(name)) {
            return defaultValue;
        }
        String val = (String) values.get(name);
        if (val == null) {
            return defaultValue;
        }
        return val;
    
public voidsetValue(java.lang.String name, java.lang.String value)
Sets the value of a column.

param
name the name of the column
param
value the value for the column

        values.put(name, value == null ? "" : value);