public class

Category

extends Object
implements ICategory
java.lang.Object
   ↳ com.google.gdata.data.Category

Class Overview

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.

Summary

Nested Classes
class Category.AtomHandler <atom:category> parser. 
Constants
char SCHEME_PREFIX The character used to prefix any (optional) scheme in the compound scheme+term Category format.
char SCHEME_SUFFIX The character used to suffix any (optional) scheme in the compound scheme+term Category format.
Fields
private static final Pattern categoryPattern
protected String label Human-readable label.
protected String labelLang Language.
protected String scheme Scheme (domain).
protected String term Term.
Public Constructors
Category()
Category(String category)
Constructs a new category from a Category string.
Category(String scheme, String term)
Constructs a new category.
Category(String scheme, String term, String label)
Constructs a new category.
Public Methods
boolean equals(Object obj)
void generateAtom(XmlWriter w)
Generates XML in the Atom format.
void generateRss(XmlWriter w)
Generates XML in the RSS format.
String getLabel()
Returns the category label or null if there is no label value.
String getLabelLang()
String getScheme()
Returns the category scheme or null if the category does not have a scheme.
String getTerm()
Returns the category term.
int hashCode()
void setLabel(String v)
void setLabelLang(String v)
void setScheme(String v)
void setTerm(String v)
String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.google.gdata.data.ICategory

Constants

public static final char SCHEME_PREFIX

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

Constant Value: 123 (0x0000007b)

public static final char SCHEME_SUFFIX

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

Constant Value: 125 (0x0000007d)

Fields

private static final Pattern categoryPattern

protected String label

Human-readable label.

protected String labelLang

Language.

protected String scheme

Scheme (domain).

protected String term

Term.

Public Constructors

public Category ()

public Category (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

public Category (String scheme, String term)

Constructs a new category.

Parameters
scheme
term

public Category (String scheme, String term, String label)

Constructs a new category.

Parameters
scheme
term
label

Public Methods

public boolean equals (Object obj)

Parameters
obj

public void generateAtom (XmlWriter w)

Generates XML in the Atom format.

Parameters
w Output writer.
Throws
IOException

public void generateRss (XmlWriter w)

Generates XML in the RSS format.

Parameters
w Output writer.
Throws
IOException

public String getLabel ()

Returns the category label or null if there is no label value.

Returns
  • category label (or @code null}.

public String getLabelLang ()

public String getScheme ()

Returns the category scheme or null if the category does not have a scheme.

Returns
  • category scheme or null.

public String getTerm ()

Returns the category term.

Returns
  • category term value.

public int hashCode ()

public void setLabel (String v)

Parameters
v

public void setLabelLang (String v)

Parameters
v

public void setScheme (String v)

Parameters
v

public void setTerm (String v)

Parameters
v

public String toString ()