Project 1

cscie259.project1.mf
Class Attributes

java.lang.Object
  extended bycscie259.project1.mf.Attributes

public class Attributes
extends java.lang.Object

A simplified version of org.xml.sax.helpers.AttributesImpl. An Attributes object stores zero or more attributes. You MAY modify this file to whatever extent you see fit, provided you do not change the declarations of addAttribute, getLength, getName, or getValue.

Version:
6.0
Author:
Computer Science E-259, YOUR NAME GOES HERE

Constructor Summary
Attributes()
           
 
Method Summary
 void addAttribute(java.lang.String name, java.lang.String value)
          Adds a new attribute (i.e., name/value pair) to the collection.
 int getLength()
          Return the number of attributes in the list.
 java.lang.String getName(int index)
          Return an attribute's name by index.
 java.lang.String getValue(int index)
          Return an attribute's value by index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Attributes

public Attributes()
Method Detail

addAttribute

public void addAttribute(java.lang.String name,
                         java.lang.String value)
Adds a new attribute (i.e., name/value pair) to the collection.

Parameters:
name - new attribute's name
value - new attribute's value

getLength

public int getLength()
Return the number of attributes in the list.

Returns:
the number of attributes in the list

getName

public java.lang.String getName(int index)
Return an attribute's name by index.

Parameters:
index - the attribute's index (zero-based).
Returns:
the attribute's name if available else null if the attribute's name is not available or the index is out of range

getValue

public java.lang.String getValue(int index)
Return an attribute's value by index.

Parameters:
index - the attribute's index (zero-based)
Returns:
the attribute's value or null if the index is out of range

Project 1