Oracle Application Server Wireless Java API Reference
B14043-01


oracle.panama.spatial.yp
Class YPCategory

java.lang.Object
  extended byoracle.panama.spatial.yp.YPCategory

All Implemented Interfaces:
java.io.Serializable

public class YPCategory
extends java.lang.Object
implements java.io.Serializable

This class defines a category in the customized hierarchy tree. It has a customized name and a list of references to external YP provider categories. The names of the external categories might be different from the customized local name. The list of external categories is a list of alternatives for where to request data. The content of the customized local category is created from EXACTLY ONE of the external categories references. The external categories are NOT merged. This class defines immutable objects and is thread-safe.

See Also:
Serialized Form

Method Summary
static YPCategory fromFullyQualifiedName(java.lang.String name)
This retrieves a category from its fully qualified name (including names of supercategories).
YPBusiness[] getBusinessesInCity(java.lang.String country, java.lang.String state, java.lang.String city, java.util.Locale locale)
This returns all businesses in this category in a specified city
YPBusiness[] getBusinessesInPCode(java.lang.String country, java.lang.String postalCode, java.util.Locale locale)
This returns all businesses in this category in a specified postal code
YPBusiness[] getBusinessesInRadius(oracle.panama.spatial.core.PointImpl location, double metersRadius, java.util.Locale locale)
This returns all businesses in this category in a specified radius around a specified center point
YPBusiness[] getBusinessesInState(java.lang.String country, java.lang.String state, java.util.Locale locale)
This returns all businesses in this category in a specified state
YPCategory[] getCategoriesMatchingName(java.lang.String pattern)
This function returns the direct and indirect subcategories of a given category matching a given keyword.
java.lang.String getFullyQualifiedName()
This returns the fully qualified name of the category (including names of supercategories).
java.lang.String getName()
This returns the name of the category.
YPCategory getParentCategory()
This returns the parent-/supercategory
java.lang.String getProviderParameter(java.lang.String name)
This returns the requested provider parameter
java.util.Iterator getProviderParameters(java.lang.String name)
This returns the requested provider parameters
YPCategory[] getSubCategories()
This returns all subcategories.
YPCategory getSubCategory(java.lang.String name)
This returns a subcategory with a specified name
boolean isLeaf()
This returns whether the category is a leaf in the customized hierarchy.
boolean isRoot()
This returns whether the category is the root of the customized hierarchy.
static YPCategory readCategoryTree(java.util.HashMap categoriesByID)
This reads the local customized category hierarchy from the file YPCategories.xml.
java.lang.String toString()
Returns the name of the category

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Method Detail

fromFullyQualifiedName

public static YPCategory fromFullyQualifiedName(java.lang.String name)
This retrieves a category from its fully qualified name (including names of supercategories).
Parameters:
name - a String representing the name
Returns:
the YPCategory represented by the given name

getBusinessesInCity

public YPBusiness[] getBusinessesInCity(java.lang.String country,
                                        java.lang.String state,
                                        java.lang.String city,
                                        java.util.Locale locale)
This returns all businesses in this category in a specified city
Parameters:
country - a String representing the country (must not be null)
state - a String representing the state (must not be null)
city - a String representing the city (must not be null)
locale - a Locale that can affect language, measures of distance, ... (may be null)
Returns:
an array of YPBusiness representing all businesses

getBusinessesInPCode

public YPBusiness[] getBusinessesInPCode(java.lang.String country,
                                         java.lang.String postalCode,
                                         java.util.Locale locale)
This returns all businesses in this category in a specified postal code
Parameters:
country - a String representing the country (must not be null)
postalCode - a String representing the postal code (must not be null)
locale - a Locale that can affect language, measures of distance, ... (may be null)
Returns:
an array of YPBusiness representing all businesses

getBusinessesInRadius

public YPBusiness[] getBusinessesInRadius(oracle.panama.spatial.core.PointImpl location,
                                          double metersRadius,
                                          java.util.Locale locale)
This returns all businesses in this category in a specified radius around a specified center point
Parameters:
location - a PointImpl representing the center coordinates of the circle (must not be null)
metersRadius - a double representing the radius in meters (must not be null)
locale - a Locale that can affect language, measures of distance, ... (may be null)
Returns:
an array of YPBusiness representing all businesses

getBusinessesInState

public YPBusiness[] getBusinessesInState(java.lang.String country,
                                         java.lang.String state,
                                         java.util.Locale locale)
This returns all businesses in this category in a specified state
Parameters:
country - a String representing the country (must not be null)
state - a String representing the state (must not be null)
locale - a Locale that can affect language, measures of distance, ... (may be null)
Returns:
an array of YPBusiness representing all businesses

getCategoriesMatchingName

public YPCategory[] getCategoriesMatchingName(java.lang.String pattern)
This function returns the direct and indirect subcategories of a given category matching a given keyword.
Parameters:
pattern - a String representing a keyword to look for
Returns:
an array of YPCategory representing the matching subcategories (direct and indirect)

getFullyQualifiedName

public java.lang.String getFullyQualifiedName()
This returns the fully qualified name of the category (including names of supercategories). Given this String, the Category can be retrieved at a later point. This String can thus be used to pass a category identifier as a String parameter.
Returns:
a String representing the name

getName

public java.lang.String getName()
This returns the name of the category. This is the customized name as it is specified in the file YPCategories.xml.
Returns:
a String representing the name

getParentCategory

public YPCategory getParentCategory()
This returns the parent-/supercategory
Returns:
a YPCategory representing the parent category (null if this category is the root)

getProviderParameter

public java.lang.String getProviderParameter(java.lang.String name)
This returns the requested provider parameter
Parameters:
name - the name of the parameter to return
Returns:
the value of the requested parameter

getProviderParameters

public java.util.Iterator getProviderParameters(java.lang.String name)
This returns the requested provider parameters
Parameters:
name - the name of the parameters to return
Returns:
the iterator containing the values of the requested parameter

getSubCategories

public YPCategory[] getSubCategories()
This returns all subcategories.
Returns:
an array of YPCategory representing all subcategories

getSubCategory

public YPCategory getSubCategory(java.lang.String name)
This returns a subcategory with a specified name
Returns:
a YPCategory representing the requested subcategory (must not be null)

isLeaf

public boolean isLeaf()
This returns whether the category is a leaf in the customized hierarchy.
Returns:
a boolean representing whether this category is a leaf

isRoot

public boolean isRoot()
This returns whether the category is the root of the customized hierarchy.
Returns:
a boolean representing whether this category is the root

readCategoryTree

public static YPCategory readCategoryTree(java.util.HashMap categoriesByID)
This reads the local customized category hierarchy from the file YPCategories.xml. The function returns the hierarchy root.
Returns:
a YPCategory object representing the hierarchy root

toString

public java.lang.String toString()
Returns the name of the category
Returns:
the name of the category

Oracle Application Server Wireless Java API Reference
B14043-01


Copyright © 2004 Oracle Corporation. All Rights Reserved.