public final class AdvertisementDescriptor extends Object
AdvertisementDescriptor
object is used to describe an advertisement that an agent has placed about one of its services with a yellow pages agent. It consists of a URLDescriptor
that is used to locate the agent and a PropertiesMap
that is used to describe the agent. There is onlt one defined field at this time, and that is the "service" field. It describes what service the agent is advertising in this advertisement. Copyright: Copyright 2003-2014, Knowledge Science Group, University of Calgary. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The Knowledge Science Group makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
TransientAgent
Modifier and Type | Field and Description |
---|---|
(package private) URLDescriptor |
advertisor |
(package private) PropertiesMapXML |
properties |
Constructor and Description |
---|
AdvertisementDescriptor(String serializedDescriptor) |
AdvertisementDescriptor(URLDescriptor newAdvertisor,
PropertiesMap newProperties) |
AdvertisementDescriptor(URLDescriptor newAdvertisor,
String newService) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object) |
static AdvertisementDescriptor |
fromString(TokenParser parser) |
URLDescriptor |
getAdvertisor() |
boolean |
getBooleanProperty(String name)
Retrieves the boolean property, returning it to the user.
|
double |
getDoubleProperty(String name)
Retrieves the double precision floating point property, returning it to
the user.
|
float |
getFloatProperty(String name)
Retrieves the floating point property, returning it to the user.
|
int |
getIntegerProperty(String name)
Retrieves the integer property, returning it to the user.
|
long |
getLongProperty(String name)
Retrieves the long integer property, returning it to the user.
|
String |
getStringProperty(String name)
Retrieves the String property, returning it to the user.
|
boolean |
hasProperty(String propertyName)
Returns whether the specified property is contained in the properties.
|
void |
removeProperty(String propertyName)
Removes the property from the properties.
|
void |
setAdvertisor(URLDescriptor newAdvertisor) |
void |
setBooleanProperty(String name,
boolean value)
Stores a boolean property.
|
void |
setDoubleProperty(String name,
double value)
Stores a double precision floating point property.
|
void |
setFloatProperty(String name,
float value)
Stores a floating point property.
|
void |
setIntegerProperty(String name,
int value)
Stores an integer property.
|
void |
setLongProperty(String name,
long value)
Stores a long integer property.
|
void |
setStringProperty(String name,
String value)
Stores a String property.
|
String |
toString() |
URLDescriptor advertisor
PropertiesMapXML properties
public AdvertisementDescriptor(URLDescriptor newAdvertisor, String newService)
public AdvertisementDescriptor(URLDescriptor newAdvertisor, PropertiesMap newProperties)
public AdvertisementDescriptor(String serializedDescriptor) throws ParseException
ParseException
public static AdvertisementDescriptor fromString(TokenParser parser) throws ParseException
ParseException
public URLDescriptor getAdvertisor()
public void setAdvertisor(URLDescriptor newAdvertisor)
newAdvertisor
- public void setBooleanProperty(String name, boolean value)
name
- The name of the property to store.value
- The value of the property that matches the name given.public boolean getBooleanProperty(String name) throws PropertyException
name
- The name of the property to retrieve.PropertyException
- If the given property is not a boolean property.public void setStringProperty(String name, String value)
name
- The name of the property to store.value
- The value of the property that matches the name given.public String getStringProperty(String name) throws PropertyException
name
- The name of the property to retrieve.PropertyException
- If the given property is not a String property.public void setIntegerProperty(String name, int value)
name
- The name of the property to store.value
- The value of the property that matches the name given.public int getIntegerProperty(String name) throws PropertyException
name
- The name of the property to retrieve.PropertyException
- If the given property is not an integer
property.public void setLongProperty(String name, long value)
name
- The name of the property to store.value
- The value of the property that matches the name given.public long getLongProperty(String name) throws PropertyException
name
- The name of the property to retrieve.PropertyException
- If the given property is not a long integer
property.public void setFloatProperty(String name, float value)
name
- The name of the property to store.value
- The value of the property that matches the name given.public float getFloatProperty(String name) throws PropertyException
name
- The name of the property to retrieve.PropertyException
- If the given property is not a floating point
property.public void setDoubleProperty(String name, double value)
name
- The name of the property to store.value
- The value of the property that matches the name given.public double getDoubleProperty(String name) throws PropertyException
name
- The name of the property to retrieve.PropertyException
- If the given property is not a double precision
floating point property.public boolean hasProperty(String propertyName)
propertyName
- The name of the property that we are checking for.true
if there exists a property with the specified
name; false
otherwise.public void removeProperty(String propertyName)
propertyName
- The name of the property to be removed.