選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

IMessageHolder.java 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* *******************************************************************
  2. * Copyright (c) 1999-2001 Xerox Corporation,
  3. * 2002 Palo Alto Research Center, Incorporated (PARC).
  4. * All rights reserved.
  5. * This program and the accompanying materials are made available
  6. * under the terms of the Eclipse Public License v1.0
  7. * which accompanies this distribution and is available at
  8. * http://www.eclipse.org/legal/epl-v10.html
  9. *
  10. * Contributors:
  11. * Xerox/PARC initial implementation
  12. * ******************************************************************/
  13. package org.aspectj.bridge;
  14. import java.util.List;
  15. /**
  16. * Hold and query a collection of messages.
  17. */
  18. public interface IMessageHolder extends IMessageHandler { // XXX do not extend - mix instead
  19. // XXX go to LT EQ GT GE LE rather than simple orGreater
  20. /** value for orGreater parameter */
  21. public static final boolean ORGREATER = true;
  22. /** value for orGreater parameter */
  23. public static final boolean EQUAL = false;
  24. /**
  25. * Tell whether this holder has any message of this kind (optionally or greater).
  26. *
  27. * @param kind the IMessage.Kind to check for - accept any if null
  28. * @param orGreater if true, also any greater than the target kind as determined by IMessage.Kind.COMPARATOR
  29. * @return true if this holder has any message of this kind, or if orGreater and any message has a greater kind, as determined
  30. * by IMessage.Kind.COMPARATOR
  31. */
  32. boolean hasAnyMessage(IMessage.Kind kind, boolean orGreater);
  33. /**
  34. * Count the messages currently held by this holder. Pass null to get all kinds.
  35. *
  36. * @param kind the IMessage.Kind expected, or null for all messages
  37. * @param orGreater if true, also any greater than the target kind as determined by IMessage.Kind.COMPARATOR
  38. * @return number of IMessage held (now) by this holder
  39. */
  40. int numMessages(IMessage.Kind kind, boolean orGreater);
  41. /**
  42. * Get all messages or those of a specific kind. Pass null to get all kinds.
  43. *
  44. * @param kind the IMessage.Kind expected, or null for all messages
  45. * @param orGreater if true, also get any greater than the target kind as determined by IMessage.Kind.COMPARATOR
  46. * @return IMessage[] of messages of the right kind, or IMessage.NONE
  47. */
  48. IMessage[] getMessages(IMessage.Kind kind, boolean orGreater);
  49. /** @return unmodifiable List view of underlying collection of IMessage */
  50. List<IMessage> getUnmodifiableListView();
  51. /**
  52. * Clear any messages.
  53. *
  54. * @throws UnsupportedOperationException if message list is read-only
  55. */
  56. void clearMessages() throws UnsupportedOperationException;
  57. }