tico.rules
Class TUser

java.lang.Object
  extended by tico.rules.TUser

public class TUser
extends java.lang.Object

The TUser object stores all features of an user, its name, and a list of attributes that represents its limitations.

Version:
1.0 Sep 27, 2007
Author:
Beatriz Mateo

Constructor Summary
TUser()
          Creates a new empty TUser with no initial name.
TUser(java.lang.String name)
          Creates a new empty TUser with the specified initial name.
 
Method Summary
 void addAttribute(TAttribute attribute)
          Add an attribute to the user.
 TAttribute getAttribute(int index)
          Returs the user attribute in the specified index.
 TAttribute getAttribute(java.lang.String name)
          Returs the user attribute with the specified name.
 int getAttributeCount()
          Returns the number of attributes contained by the user
 java.util.List getAttributeList()
          Returs the user attribute list.
 java.lang.String getName()
          Returns the user name.
 void removeAttribute(TAttribute attribute)
          Removes the specified attribute from the user.
 void setName(java.lang.String name)
          Sets the user name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TUser

public TUser()
Creates a new empty TUser with no initial name.


TUser

public TUser(java.lang.String name)
Creates a new empty TUser with the specified initial name.

Parameters:
name - The specified initial name
Method Detail

getName

public java.lang.String getName()
Returns the user name.

Returns:
The user name

setName

public void setName(java.lang.String name)
Sets the user name.

Parameters:
name - The user name to set

addAttribute

public void addAttribute(TAttribute attribute)
Add an attribute to the user.

Parameters:
attribute - The attribute to add

removeAttribute

public void removeAttribute(TAttribute attribute)
Removes the specified attribute from the user.

Parameters:
attribute - The attribute to delete

getAttribute

public TAttribute getAttribute(java.lang.String name)
Returs the user attribute with the specified name.

Parameters:
name - The specified attribute name
Returns:
The user attribute with the specified name. If the user does not contain any attribute with that name, returns null

getAttribute

public TAttribute getAttribute(int index)
Returs the user attribute in the specified index.

Parameters:
index - The specified attribute index
Returns:
The user attribute in the specified index

getAttributeCount

public int getAttributeCount()
Returns the number of attributes contained by the user

Returns:
The user number of attributes

getAttributeList

public java.util.List getAttributeList()
Returs the user attribute list.

Returns:
The user attribute list. If the user does not contain any attribute, returns null