byucc.jhdl.Fsm
Class StringList

java.lang.Object
  extended bybyucc.jhdl.Fsm.StringList
All Implemented Interfaces:
java.io.Serializable

public class StringList
extends java.lang.Object
implements java.io.Serializable

A class to model a list of strings.

Author:
Brent Nelson
See Also:
Serialized Form

Constructor Summary
StringList()
          Construct an empty string list.
StringList(int siz)
          Construct a string list containing "siz" null entries
 
Method Summary
 void addElement(java.lang.String s)
          Add a new string to the end of the list, making the list grow by one in size.
 java.lang.String elementAt(int i)
          Get a string from a StringList
 int findString(java.lang.String s)
           
 java.lang.String firstElement()
          Return the first element of the list
 java.lang.String lastElement()
          Return the last element of the list
 void setElement(int i, java.lang.String s)
          Set the element at location i with string s.
 int size()
          Tell how many strings are in stringlist
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringList

public StringList()
Construct an empty string list.


StringList

public StringList(int siz)
Construct a string list containing "siz" null entries

Parameters:
siz - the size of the string list
Method Detail

addElement

public void addElement(java.lang.String s)
Add a new string to the end of the list, making the list grow by one in size.

Parameters:
s - the string to be added to the list

setElement

public void setElement(int i,
                       java.lang.String s)
Set the element at location i with string s.

Parameters:
i - the index of the string to set in the StringList
s - the string to set it to

elementAt

public java.lang.String elementAt(int i)
Get a string from a StringList

Parameters:
i - the index of the string to get
Returns:
the string

size

public int size()
Tell how many strings are in stringlist

Returns:
the size as an int

lastElement

public java.lang.String lastElement()
Return the last element of the list


firstElement

public java.lang.String firstElement()
Return the first element of the list


findString

public int findString(java.lang.String s)

toString

public java.lang.String toString()


Copyright ? 2006 Brigham Young University, Configurable Computing Laboratory. All Rights Reserved.