import MailMessage;

/** Class MessageInfoList
 *
 * Represents a list of messages that can be passed to the sort
 * procedures.
 *
 * @author Chris Kern
 * @author Erin Nichols
 * @author Joe Simonson
 * @version 0.20 of Oct 1999
 */

public class MessageInfoList {

    /*+--------------+
     *|    Fields    |
     *+--------------+
     */

    /** An array of mail messages. */
    private MailMessage[] messageList;

    /*+--------------+
     *| Constructors |
     *+--------------+
     */

    /** A null constructor */

    public MessageInfoList() {

    }// MessageInfoList()
 
    /** A constructor that takes an array of messages */

    public MessageInfoList(MailMessage curMessages[]) {
        this.messageList = curMessages;

    }//MessageInfoList(MailMessage)

    /*+---------------+
     *|    Methods    |
     *+---------------+
     */

    /** Extract the original array */
    public MailMessage[] getMessageList(){
        return this.messageList;

    }//getMessageList()

    /** Input an entirely new set of messages */
    public void setMessageList(MailMessage[] setter){
        this.messageList = setter;

    }//setMessageList


    /** Purpose       - Returns the array of mail messages as a single string
     * Parameters     - none
     * Preconditions  - none
     * Postconditions - none
     * Produces       - A string
     * Problems       - none
     */
    public String toString() {
        return "This is the messageInfoList!";

    }//toString()

    /** Purpose       - Swaps two messages in the list.
     * Parameters     - none
     * Preconditions  - Two positive integers.
     * Postconditions - The messages have been swaped.
     * Produces       - none
     * Problems       - The integers could be too large or out of the range.
     */

    public void swap(int pos1, int pos2) {

        MailMessage temp = messageList[pos1];

        messageList[pos1] = messageList[pos2];
        messageList[pos2] = temp;

    }//swap(int,int)
    

    /** Purpose       - Insert a message at a given point in the list
     * Parameters     - 1. The mail message to insert
     *                  2. The position
     * Preconditions  - Valid Mailmessage, valid integer that is within the range
     * Postconditions - The message is inserted at the point
     * Produces       - nothing
     * Problems       - The integers could be too large or out of the range.
     */
    public void insertMessage(MailMessage toInsert, int position) {

    }//insertMessage(MailMessage, int)

    public void deleteMessage(int position) {

    }//deleteMessage(int)

}// class MessageInfoList

