FileDocCategorySizeDatePackage
UPCCode.javaAPI DocExample2323Thu Oct 13 14:56:44 BST 2005com.samscdrental.model.adt

UPCCode

public class UPCCode extends Object implements Serializable

Title: Sams CD Rental Store

Description:

Copyright: Copyright (c) 2004

Company:

author
Ken Pugh
version
1.0

Fields Summary
private static final long
serialVersionUID
private String
theValue
private static final int
LENGTH_OF_VALUE
private static final String
ERROR_UPCCODE_BAD_FORMAT
Constructors Summary
public UPCCode()

 

/*	public String getValue()
	{
		return theValue;
	}
*/
	 
	
	
public UPCCode(String aString)
UPCCode

param
aString String


		fromString( aString );

	
Methods Summary
public booleanequals(com.samscdrental.model.adt.UPCCode aUPCCode)
Indicates whether some other object is "equal to" this one.

param
obj the reference object with which to compare.
return
true if this object is the same as the obj argument; false otherwise.
todo
Implement this java.lang.Object method

		return aUPCCode.theValue.equals( this.theValue );

	
public booleanequals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.

param
obj the reference object with which to compare.
return
true if this object is the same as the obj argument; false otherwise.
todo
Implement this java.lang.Object method

		return equals( ( UPCCode ) obj );
	
private voidfromString(java.lang.String aString)
fromString

param
aString String
return
boolean

		if ( aString.length() == LENGTH_OF_VALUE )
		{
			theValue = aString;
		}
		else
		{
			throw new UPCCodeFormatDeviation( ERROR_UPCCODE_BAD_FORMAT );
		}
	
public static com.samscdrental.model.adt.UPCCodeparseString(java.lang.String aString)

		return new UPCCode( aString );
	
public java.lang.StringtoString()
Returns a string representation of the object.

return
a string representation of the object.
todo
Implement this java.lang.Object method

		return theValue;