org.caida.otter
Class AttributeSet

java.lang.Object
  |
  +--org.caida.otter.AttributeSet

public class AttributeSet
extends java.lang.Object

This is a hash of hashes. At the top level a category defines a top level name category. Under this top level, there may be several key->value pairs. The following is a schematic of how data is represented.

  [Set of categories]-  category 1 			(i.e. inbound path info)
                     |    |------> attribute1:value1 	(i.e. from host 1: 70%)
                     |    |------> attribute2:value2	(i.e. from host 2: 90%)
                     |
                     -  category 2		(i.e. outbound path info)
                     |    |------> attribute1:value1 	(i.e. to host 1: 70%)
                     |    |------> attribute2:value2	(i.e. to host 2: 90%)
                        etc.
  


Constructor Summary
AttributeSet()
          Create an empty attribute set.
 
Method Summary
 java.lang.Object addAttribute(java.lang.Object category, java.lang.Object attribute, java.lang.Object value)
          Add an attribute to inside a category
 java.lang.Object addCategory(java.lang.Object category)
          Add a category to the set.
 java.lang.Object changeAttribute(java.lang.Object category, java.lang.Object attribute, java.lang.Object value)
          Replace an attribute inside a category
 java.lang.Object deleteAttribute(java.lang.Object category, java.lang.Object attribute)
          Remove an attribute from inside a category
 java.lang.Object deleteCategory(java.lang.Object category)
          Remove a category from the set of categories.
 java.lang.Object[] enumerateAttributes(java.lang.Object category)
          Get a list of attributes in a given category
 java.lang.Object[] enumerateCategories()
          Get a list of objects that represent all of the categories contained in this node's category set.
 java.lang.Object getAttribute(java.lang.Object category, java.lang.Object attribute)
          Get an attribute from inside a category
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeSet

public AttributeSet()
Create an empty attribute set.
Method Detail

addCategory

public java.lang.Object addCategory(java.lang.Object category)
Add a category to the set.
Parameters:
category - An object that will represent a category in the attribute set.

addAttribute

public java.lang.Object addAttribute(java.lang.Object category,
                                     java.lang.Object attribute,
                                     java.lang.Object value)
Add an attribute to inside a category
Parameters:
category - The category to insert the new object in.
attribute - The attribute we're setting.
value - The value we're assigning to that attribute.
Returns:
The previous value of the attribute, null otherwise.

getAttribute

public java.lang.Object getAttribute(java.lang.Object category,
                                     java.lang.Object attribute)
Get an attribute from inside a category
Parameters:
category - The category to look for the attribute in.
attribute - The value of the attribute to retrieve.
Returns:
The value associated with that attribute, null otherwise.

deleteCategory

public java.lang.Object deleteCategory(java.lang.Object category)
Remove a category from the set of categories.
Parameters:
category - The category to remove from the set.
Returns:
The category that is being removed, null if it didn't exist.

deleteAttribute

public java.lang.Object deleteAttribute(java.lang.Object category,
                                        java.lang.Object attribute)
Remove an attribute from inside a category
Parameters:
category - The category to look for the attribute in.
attribute - The attribute to remove from the set.
Returns:
The value of the attribute being removed.

changeAttribute

public java.lang.Object changeAttribute(java.lang.Object category,
                                        java.lang.Object attribute,
                                        java.lang.Object value)
Replace an attribute inside a category
Parameters:
category - The category to look for the attribute in.
attribute - The attribute we want to change the value of.
value - The new value to assign to the attribute.
Returns:
The old value of the attribute.

enumerateCategories

public java.lang.Object[] enumerateCategories()
Get a list of objects that represent all of the categories contained in this node's category set.
Returns:
an array of objects that correspond to this set's categories.

enumerateAttributes

public java.lang.Object[] enumerateAttributes(java.lang.Object category)
Get a list of attributes in a given category
Parameters:
category - The category to list the attributes in.
Returns:
an array of objects representing the attributes in the specified category.