edu.northwestern.at.utils
Class IDList

java.lang.Object
  extended by edu.northwestern.at.utils.IDList

public class IDList
extends java.lang.Object

A list of Longs, typically used as database IDs.


Field Summary
protected  java.util.ArrayList ids
          The IDs in the list, in order.
 
Constructor Summary
IDList()
          Create an empty ID list.
IDList(java.util.Collection ids)
          Create a list with specified IDs.
IDList(java.lang.Long[] ids)
          Create a list with specified IDs.
 
Method Summary
 void add(java.lang.Long id)
          Add an ID to the end of the list.
 void clear()
          Clears the ids.
 boolean equals(java.lang.Object obj)
          Returns true if some other id list is equal to this one.
 java.util.ArrayList getIDs()
          Gets IDs.
 int getNumIDs()
          Get the number of IDs.
 int hashCode()
          Returns a hash code for the object.
 java.lang.String toString()
          Gets a string representation of the phrase.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ids

protected java.util.ArrayList ids
The IDs in the list, in order.

Constructor Detail

IDList

public IDList()
Create an empty ID list.


IDList

public IDList(java.lang.Long[] ids)
Create a list with specified IDs.

Parameters:
ids - The IDs.

IDList

public IDList(java.util.Collection ids)
Create a list with specified IDs.

Parameters:
ids - Collection of IDs.
Method Detail

add

public void add(java.lang.Long id)
Add an ID to the end of the list.

Parameters:
id - The ID to add to the end of the list.

getIDs

public java.util.ArrayList getIDs()
Gets IDs.

Returns:
The IDs.

getNumIDs

public int getNumIDs()
Get the number of IDs.

Returns:
Number of IDs.

clear

public void clear()
Clears the ids.


toString

public java.lang.String toString()
Gets a string representation of the phrase.

Overrides:
toString in class java.lang.Object
Returns:
The word tags in the phrase set.

equals

public boolean equals(java.lang.Object obj)
Returns true if some other id list is equal to this one.

The two lists are equal if their id entries are equal.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The other object.
Returns:
True if this object equals the other object.

hashCode

public int hashCode()
Returns a hash code for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code.