Class OpenMessage
Object
OpenMessage
- All Implemented Interfaces:
Message
- Direct Known Subclasses:
CaesarMessage,SubstitutionMessage
-
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 messagebooleanSearches for a particular term in a part of the message.booleansearchFrom(String term) Searches for a message by "from" portion of the message.booleansearchSubject(String term) Searches for a message by subject.booleanSearches for a message by "to" portion of the message.toString()Creates and returns a String that represents our OpenMessage object.
-
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:
getSubjectin interfaceMessage- Returns:
- String subject
-
getFrom
Gets the "from" portion of the message -
search
Searches for a particular term in a part of the message. Implemented in Lab 10. -
searchSubject
Searches for a message by subject. Implemented in Lab 10.- Specified by:
searchSubjectin 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. Implemented in Lab 10. -
searchFrom
Searches for a message by "from" portion of the message. Implemented in Lab 10.- Specified by:
searchFromin interfaceMessage- Parameters:
term- term used to see if contained in "from" portion- Returns:
- boolean result if term was in the "from" portion
-
toString
Creates and returns a String that represents our OpenMessage object. Implemented in Lab 12, make sure toString() returns a newline character "\n" at the end of the message (after the body).
-