Class OpenMessage
Object
OpenMessage
- All Implemented Interfaces:
Message
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBody()
Gets the body of the messagegetFrom()
Gets the "from" portion of the messageGets the subject of the messagegetTo()
Gets the "to" portion of the messageboolean
Searches for a particular term in a part of the message.boolean
searchFrom
(String term) Searches for a message by "from" portion of the message.boolean
searchSubject
(String term) Searches for a message by subject.boolean
Searches for a message by "to" portion of the message.
-
Field Details
-
to
-
from
-
subject
-
body
-
-
Constructor Details
-
OpenMessage
-
-
Method Details
-
getBody
Gets the body of the message -
getTo
Gets the "to" portion of the message -
getSubject
Gets the subject of the message- Specified by:
getSubject
in interfaceMessage
- Returns:
- String subject
-
getFrom
Gets the "from" portion of the message -
search
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. -
searchSubject
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 interfaceMessage
- Parameters:
term
- term used to see if contained in subject- Returns:
- boolean result if term was in the subject
-
searchTo
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? -
searchFrom
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 interfaceMessage
- Parameters:
term
- term used to see if contained in "from" portion- Returns:
- boolean result if term was in the "from" portion
-