jpl.eda.archive
Class ProductList

java.lang.Object
  extended byjpl.eda.archive.ProductList
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class ProductList
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

This class builds a list of items that make up a product. Product items are identified by their reference and reference type, defined as follows:

Version:
$Revision: 1.3 $
Author:
D. Crichton, S. Hardman
See Also:
Serialized Form

Constructor Summary
ProductList()
          Constructor given no arguments.
 
Method Summary
 void addProductItem(java.lang.String productRefType, java.lang.String productRef)
          Add an item to the product list.
 void addProductItem(java.lang.String productRefType, java.lang.String productRef, java.lang.String archiveRef)
          Deprecated. Replaced by either addProductItem(String, String) or addProductItem(String, String, String, long).
 void addProductItem(java.lang.String productRefType, java.lang.String productRef, java.lang.String archiveRef, long length)
          Add an item to the product list.
 java.lang.Object clone()
          Local clone() implementation.
 boolean equals(java.lang.Object rhs)
          Local equals() implementation.
 java.lang.String getArchiveRef(int index)
          Get the archive reference.
 Reference getArchiveRefUrl(int index)
          Get the archive reference URL.
 int getCount()
          Get the number of items in the product list.
 long getLength(int index)
          Get the product item length.
 java.lang.String getProductRef(int index)
          Get the product reference.
 java.lang.String getProductRefType(int index)
          Get the product item reference type.
 Reference getProductRefUrl(int index)
          Get the product reference URL.
 int hashCode()
          Local hashCode() implementation.
 void setLength(int index, long length)
          Set the product item length.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProductList

public ProductList()
Constructor given no arguments. This constructor creates an empty product list.

Method Detail

addProductItem

public void addProductItem(java.lang.String productRefType,
                           java.lang.String productRef)
                    throws ReferenceException
Add an item to the product list. This method is meant to be called on the client side.

Parameters:
productRefType - The type of the reference.
productRef - The reference to the product item.
Throws:
ReferenceException - If the reference is malformed.

addProductItem

public void addProductItem(java.lang.String productRefType,
                           java.lang.String productRef,
                           java.lang.String archiveRef)
                    throws ReferenceException
Deprecated. Replaced by either addProductItem(String, String) or addProductItem(String, String, String, long).

Add an item to the product list.

Parameters:
productRefType - The type of the reference.
productRef - The reference to the product item.
archiveRef - The reference to the product item on the server side. This may be NULL.
Throws:
ReferenceException - If the reference is malformed.

addProductItem

public void addProductItem(java.lang.String productRefType,
                           java.lang.String productRef,
                           java.lang.String archiveRef,
                           long length)
                    throws ReferenceException
Add an item to the product list. This method is meant to be called on the server side.

Parameters:
productRefType - The type of the reference.
productRef - The reference to the product item.
archiveRef - The reference to the product item on the server side. This may be NULL.
length - The length of the product item.
Throws:
ReferenceException - If the reference is malformed.

getCount

public int getCount()
Get the number of items in the product list. This ought to be called size to match the rest of Java, but instead it matches the rest of OODT.

Returns:
The number of items in the list.

getProductRefType

public java.lang.String getProductRefType(int index)
Get the product item reference type.

Parameters:
index - The index of the item representing its location in the list.
Returns:
The product reference type or null if the index is out of bounds.

getProductRef

public java.lang.String getProductRef(int index)
Get the product reference.

Parameters:
index - The index of the item representing its location in the list.
Returns:
The product reference or null if the index is out of bounds.

getProductRefUrl

public Reference getProductRefUrl(int index)
Get the product reference URL.

Parameters:
index - The index of the item representing its location in the list.
Returns:
The product reference URL or null if the index is out of bounds.

getArchiveRef

public java.lang.String getArchiveRef(int index)
Get the archive reference.

Parameters:
index - The index of the item representing its location in the list.
Returns:
The archive reference or null if the index is out of bounds.

getArchiveRefUrl

public Reference getArchiveRefUrl(int index)
Get the archive reference URL.

Parameters:
index - The index of the item representing its location in the list.
Returns:
The archive reference URL or null if the index is out of bounds.

getLength

public long getLength(int index)
Get the product item length.

Parameters:
index - The index of the item representing its location in the list.
Returns:
The product length or null if the index is out of bounds.

setLength

public void setLength(int index,
                      long length)
Set the product item length.

Parameters:
index - The index of the item representing its location in the list.
length - The length of the product item in bytes.

equals

public boolean equals(java.lang.Object rhs)
Local equals() implementation.


hashCode

public int hashCode()
Local hashCode() implementation.


clone

public java.lang.Object clone()
Local clone() implementation.


toString

public java.lang.String toString()


Copyright © 1999-2005 NASA Jet Propulsion Laboratory, California Institute of Technology. All Rights Reserved.