Class OpenMessage

Object
OpenMessage
All Implemented Interfaces:
Message

public class OpenMessage extends Object implements Message
  • Field Details

  • Constructor Details

  • Method Details

    • getBody

      public String getBody()
      Gets the body of the message
      Specified by:
      getBody in interface Message
      Returns:
      String body
    • getTo

      public String getTo()
      Gets the "to" portion of the message
      Specified by:
      getTo in interface Message
      Returns:
      String to
    • getSubject

      public String getSubject()
      Gets the subject of the message
      Specified by:
      getSubject in interface Message
      Returns:
      String subject
    • getFrom

      public String getFrom()
      Gets the "from" portion of the message
      Specified by:
      getFrom in interface Message
      Returns:
      String from
    • search

      public boolean search(String term, String part)
      Searches for a particular term in a part of the message. For example, if we were in a foreach loop and were looping through each message in the message list (m), and we reach the OpenMessage object that has the subject "Important Meeting" from Quick Rabbit, m.search("meeting", m.subject) should convert both term and part to lower case, and return true since the part, subject, contains the term.
      Specified by:
      search in interface Message
      Parameters:
      term - String term to check
      part - Portion of OpenMessage to check in
      Returns:
      boolean value of the term being in the part (not worrying about case)
    • searchSubject

      public boolean searchSubject(String term)
      Searches for a message by subject. Tip: Remember your search() method you just implemented! You can call on that method to do the work for you. What arguments does search() take, and what variables do you have?
      Specified by:
      searchSubject in interface Message
      Parameters:
      term - term used to see if contained in subject
      Returns:
      boolean result if term was in the subject
    • searchTo

      public boolean searchTo(String term)
      Searches for a message by "to" portion of the message. Tip: Remember your search() method you just implemented! You can call on that method to do the work for you. What arguments does search() take, and what variables do you have?
      Specified by:
      searchTo in interface Message
      Parameters:
      term - term used to see if contained in "to" portion
      Returns:
      boolean result if term was in the "to" portion
    • searchFrom

      public boolean searchFrom(String term)
      Searches for a message by "from" portion of the message. Tip: Remember your search() method you just implemented! You can call on that method to do the work for you. What arguments does search() take, and what variables do you have?
      Specified by:
      searchFrom in interface Message
      Parameters:
      term - term used to see if contained in "from" portion
      Returns:
      boolean result if term was in the "from" portion