public class UserMap extends Object
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.
Modifier and Type | Field and Description |
---|---|
private Hashtable |
kownUsersMap
The knownUsers stored as a Hashtable
|
Constructor and Description |
---|
UserMap() |
UserMap(Hashtable map) |
UserMap(UserMap map)
Creates a new
PropertiesMap object initialized with the
given PropertiesMap . |
Modifier and Type | Method and Description |
---|---|
void |
clearProperties()
Removes all properties from the map.
|
protected Object |
clone()
Creates a copy of this
PropertiesMap . |
boolean |
equals(Object object)
Compares the specified
Object with this
PropertiesMap for equality. |
Enumeration |
getProperties()
Returns a list of all of the property names.
|
Property |
getProperty(String knownUserName)
Retrieves the property from the map, returning it to the user.
|
String |
getString(String knownUsersName)
Retrieves the String knownUsers from the map, returning it to the user.
|
int |
getType(String propertyName)
Determines the type of property stored in the map, returning it to the
user.
|
boolean |
hasProperty(String propertyName)
Returns whether the given property is contained in the property map.
|
void |
removeProperty(String propertyName)
Removes the property from the map.
|
void |
setAllProperties(Hashtable map)
Redefines all of the knownUser to the given
Hashtable unless
it is null . |
void |
setProperty(String knownUsersName,
Property property)
Stores a property in the map.
|
void |
setString(String knownUsersName,
String knownUsersValue)
Stores a String knownUsers in the map.
|
private Hashtable kownUsersMap
public UserMap()
public UserMap(Hashtable map)
public UserMap(UserMap map)
PropertiesMap
object initialized with the
given PropertiesMap
. Initializes the map of the properties
to a clone of the map of the given PropertiesMap
unless it
is null
. If it is null
, it initializes the map
of the properties to an empty Hashtable
.map
- The PropertiesMap
that will be used to initialize
the new PropertiesMap
if non-null
.public void setAllProperties(Hashtable map)
Hashtable
unless
it is null
. All current knownUser will be lost if the
map
- A Hashtable
that will be used to set the
properties if non-null
.public Property getProperty(String knownUserName)
knownUserName
- The name of the property to retrieve.public void setProperty(String knownUsersName, Property property)
knownUsersName
- The name of the knownUsers to store.property
- The property that matches the name given (in this case it is
a StringProperty)public String getString(String knownUsersName) throws PropertyException
knownUsersName
- The name of the property to retrieve.PropertyException
- If the given property is not a String property.public void setString(String knownUsersName, String knownUsersValue)
knownUsersName
- The name of the knownUsers to store.knownUsersValue
- The value of the knownUsers that matches the name
given.public int getType(String propertyName)
propertyName
- The name of the property of which we are curious about
the type.Property.BOOLEAN
Property.STRING
Property.INTEGER
Property.LONG
Property.FLOAT
Property.DOUBLE
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 given name
in the map; false
otherwise.public void removeProperty(String propertyName)
propertyName
- The name of the property to be removed.public Enumeration getProperties()
String
s in an
Enumeration
.public void clearProperties()
public boolean equals(Object object)
Object
with this
PropertiesMap
for equality. The two are equal if and only if
the Object
is an instance of PropertiesMap
and
all of their properties are equal.