# Uses of Interface
madkit.message.MessageFilter

Packages that use MessageFilter
Package
Description
madkit.kernel
Provides classes that are fundamental to the design of MaDKit applications.
madkit.message
Contains subclasses of `Message` which could be easily reused.

- ## Uses of MessageFilter in madkit.kernel

  Methods in madkit.kernel with parameters of type MessageFilter
  Modifier and Type
  Method
  Description
  `Message`
  AbstractAgent.`getLastReceivedMessage(MessageFilter filter)`
  Gets the last received message according to a filter.
  `Message`
  AbstractAgent.`nextMessage(MessageFilter filter)`
  Retrieves and removes the first oldest message of the mailbox that matches the filter.
  `List<Message>`
  AbstractAgent.`nextMessages(MessageFilter filter)`
  Retrieves and removes all the messages of the mailbox that match the filter, in the order they were received.
  `Message`
  Agent.`waitNextMessage(Integer timeOutMilliseconds, MessageFilter filter)`
  This method gets the next message of the mailbox or waits for a new incoming acceptable message up to a certain delay.
  `Message`
  Agent.`waitNextMessage(MessageFilter filter)`
  Retrieves and removes the next message that complies with the filter, waiting for ever if necessary until a matching message becomes available.

- ## Uses of MessageFilter in madkit.message

  Classes in madkit.message that implement MessageFilter
  Modifier and Type
  Class
  Description
  `class`
  `ConversationFilter`
  A filter that selects messages based on their conversation ID.
  `class`
  `SenderRoleFilter`
  A filter that accepts message based on the sender's role.