ecash.kernel
Class RevealedNotesList

java.lang.Object
  |
  +--ecash.kernel.RevealedNotesList

public class RevealedNotesList
extends java.lang.Object

This class, which represents a list of RevealedNote objects, is used by buyers to reveal at the bank the secret information used to build all the notes.

Author:
Michel Deriaz
See Also:
RevealedNote

Constructor Summary
RevealedNotesList(FullNotesList fullNotesList, BankChoice bankChoice)
          Creates a revealed notes list from the information found in a FullNotesList object.
RevealedNotesList(java.lang.String value)
          Re-build the object from it's string representation.
 
Method Summary
 RevealedNote get(int index)
          Gets the revealed note designed by the specific index.
 java.lang.String getAmount()
          Returns the amount of the notes if they are all the same, "-1" otherwise.
static RevealedNotesList load(java.lang.String filename)
          Re-build the object from it's file representation.
 void save(java.lang.String filename)
          Saves this object into it's file representation.
 int size()
          Returns the number of notes.
 java.lang.String toString()
          Returns a string representation of this RevealedNotesList.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RevealedNotesList

public RevealedNotesList(FullNotesList fullNotesList,
                         BankChoice bankChoice)
Creates a revealed notes list from the information found in a FullNotesList object. This will be done except for the note designated by the bank choice.

Parameters:
fullNotesList - the FullNotesList
bankChoice - the bank choice

RevealedNotesList

public RevealedNotesList(java.lang.String value)
Re-build the object from it's string representation.

Parameters:
value - the string representation of the object
Method Detail

save

public void save(java.lang.String filename)
Saves this object into it's file representation.

Parameters:
filename - the filename

size

public int size()
Returns the number of notes.

Returns:
the number of notes

get

public RevealedNote get(int index)
Gets the revealed note designed by the specific index.

Returns:
the revealed note designed by the specific index

getAmount

public java.lang.String getAmount()
Returns the amount of the notes if they are all the same, "-1" otherwise.

Returns:
the amount of the notes if they are all the same, "-1" otherwise

load

public static RevealedNotesList load(java.lang.String filename)
Re-build the object from it's file representation.

Parameters:
filename - the filename

toString

public java.lang.String toString()
Returns a string representation of this RevealedNotesList.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this RevealedNotesList