KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > dream > message > MessageType


1 /**
2  * Dream
3  * Copyright (C) 2003-2004 INRIA Rhone-Alpes
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Contact : dream@objectweb.org
20  *
21  * Initial developer(s): Matthieu Leclercq
22  * Contributor(s): Vivien Quema
23  */

24
25 package org.objectweb.dream.message;
26
27 import java.util.Iterator JavaDoc;
28
29 /**
30  * A message type is a collection of pairs (name,
31  * {@link org.objectweb.dream.message.ChunkType}) and sub message types.
32  */

33 public interface MessageType
34 {
35
36   /**
37    * An empty <code>MessageType</code> array constant. This constant should be
38    * used by classes requiring an empty <code>MessageType</code> array.
39    */

40   MessageType[] EMPTY_MESSAGE_TYPE_ARRAY = new MessageType[0];
41
42   /**
43    * Returns a chunk type of this message type from its name.
44    *
45    * @param name the name of one of the chunk types returned by
46    * {@link #getChunkNames()}.
47    * @return a chunk type of this message type from its name or
48    * <code>null</code> if no chunk with the specified name can be
49    * found.
50    */

51   ChunkType getChunkType(String JavaDoc name);
52
53   /**
54    * Returns an (eventually empty) array containing the chunk's names of
55    * messages of this type.
56    *
57    * @return an array containing the chunk's names of messages of this type.
58    */

59   String JavaDoc[] getChunkNames();
60
61   /**
62    * Returns an iterator over the chunk's names of messages of this type.
63    *
64    * @return an iterator over the chunk's names of messages of this type.
65    */

66   Iterator JavaDoc getChunkNamesIterator();
67
68   /**
69    * Returns an (eventually empty) array containing the types of the sub
70    * messages of messages of this type.
71    *
72    * @return an array containing the types of the sub messages of messages of
73    * this type.
74    */

75   MessageType[] getSubMessageTypes();
76
77   /**
78    * Returns an iterator over the types of the sub messages of messages of this
79    * type.
80    *
81    * @return an iterator over the types of the sub messages of messages of this
82    * type.
83    */

84   Iterator JavaDoc getSubMessageTypesIterator();
85
86   /**
87    * Returns <code>true</code> if this message type is empty (ie : does not
88    * contains any chunk types and any sub message types)
89    *
90    * @return <code>true</code> if this message type is empty
91    */

92   boolean isEmpty();
93
94   /**
95    * Returns <code>true</code> if this message type if a sub type of the given
96    * message type.
97    *
98    * @param t a message type
99    * @return <code>true</code> if this message type if a sub type of the given
100    * message type.
101    */

102   boolean isSubTypeOf(MessageType t);
103 }
Popular Tags