# Google Data APIs Client Library (1.43.0)

## com.google.gdata.data
Class Category

    java.lang.Object
      com.google.gdata.data.Category

All Implemented Interfaces:
  ICategory

    public class Category

extends java.lang.Object
implements ICategory

Category type.

For the purposes of comparison, two Category instances are considered to be identical if they have matching schemes and terms. The label attributes are not used for the purpose of testing equality.

Nested Class Summary
`class` `Category.AtomHandler` `<atom:category>` parser.

Field Summary
`protected java.lang.String` `label` Human-readable label.
`protected java.lang.String` `labelLang` Language.
`protected java.lang.String` `scheme` Scheme (domain).
`static char` `SCHEME_PREFIX` The character used to prefix any (optional) scheme in the compound scheme+term Category format.
`static char` `SCHEME_SUFFIX` The character used to suffix any (optional) scheme in the compound scheme+term Category format.
`protected java.lang.String` `term` Term.

Constructor Summary
`Category()`
`Category(java.lang.String category)` Constructs a new category from a Category string.
`Category(java.lang.String scheme, java.lang.String term)` Constructs a new category.
`Category(java.lang.String scheme, java.lang.String term, java.lang.String label)` Constructs a new category.

Method Summary
`boolean` `equals(java.lang.Object obj)`
`void` `generateAtom(com.google.gdata.util.common.xml.XmlWriter w)` Generates XML in the Atom format.
`void` `generateRss(com.google.gdata.util.common.xml.XmlWriter w)` Generates XML in the RSS format.
`java.lang.String` `getLabel()` Returns the category label or `null` if there is no label value.
`java.lang.String` `getLabelLang()`
`java.lang.String` `getScheme()` Returns the category scheme or `null` if the category does not have a scheme.
`java.lang.String` `getTerm()` Returns the category term.
`int` `hashCode()`
`void` `setLabel(java.lang.String v)`
`void` `setLabelLang(java.lang.String v)`
`void` `setScheme(java.lang.String v)`
`void` `setTerm(java.lang.String v)`
`java.lang.String` `toString()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### SCHEME_PREFIX

    public static final char SCHEME_PREFIX

  The character used to prefix any (optional) scheme in the compound scheme+term Category format.

  See Also:
    Constant Field Values

### SCHEME_SUFFIX

    public static final char SCHEME_SUFFIX

  The character used to suffix any (optional) scheme in the compound scheme+term Category format.

  See Also:
    Constant Field Values

### scheme

    protected java.lang.String scheme

  Scheme (domain).

### term

    protected java.lang.String term

  Term.

### label

    protected java.lang.String label

  Human-readable label.

### labelLang

    protected java.lang.String labelLang

  Language.

Constructor Detail

### Category

    public Category()

### Category

    public Category(java.lang.String category)

  Constructs a new category from a Category string. The format of the String is the same as the one used to represent a category in a GData query: an optional scheme surrounded by braces, followed by a term.

  Parameters:
    `category` - the category string

### Category

    public Category(java.lang.String scheme,
                    java.lang.String term)

  Constructs a new category.

### Category

    public Category(java.lang.String scheme,
                    java.lang.String term,
                    java.lang.String label)

  Constructs a new category.

Method Detail

### getScheme

    public java.lang.String getScheme()

  Description copied from interface: `ICategory`
  Returns the category scheme or `null` if the category does not have a scheme.

  Specified by:
    `getScheme` in interface `ICategory`
  Returns:
    category scheme or `null`.

### setScheme

    public void setScheme(java.lang.String v)

### getTerm

    public java.lang.String getTerm()

  Description copied from interface: `ICategory`
  Returns the category term.

  Specified by:
    `getTerm` in interface `ICategory`
  Returns:
    category term value.

### setTerm

    public void setTerm(java.lang.String v)

### getLabel

    public java.lang.String getLabel()

  Description copied from interface: `ICategory`
  Returns the category label or `null` if there is no label value.

  Specified by:
    `getLabel` in interface `ICategory`
  Returns:
    category label (or @code null}.

### setLabel

    public void setLabel(java.lang.String v)

### getLabelLang

    public java.lang.String getLabelLang()

### setLabelLang

    public void setLabelLang(java.lang.String v)

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### equals

    public boolean equals(java.lang.Object obj)

  Overrides:
    `equals` in class `java.lang.Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `java.lang.Object`

### generateAtom

    public void generateAtom(com.google.gdata.util.common.xml.XmlWriter w)
                      throws java.io.IOException

  Generates XML in the Atom format.

  Parameters:
    `w` - Output writer.
  Throws:
    `java.io.IOException`

### generateRss

    public void generateRss(com.google.gdata.util.common.xml.XmlWriter w)
                     throws java.io.IOException

  Generates XML in the RSS format.

  Parameters:
    `w` - Output writer.
  Throws:
    `java.io.IOException`