|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.dream.message.MessageTypeImpl
Basic Implementation of MessageType
Field Summary | |
protected String[] |
chkNames
The chunk names |
protected Hashtable |
chunkTypes
Hashtable associating names and chunk types |
static MessageType |
EMPTY_MESSAGE_TYPE
A constant designating the empty message type. |
protected LinkedList |
subMessageTypes
List of sub message types |
protected MessageType[] |
subMessageTypesArray
The sub message types |
Fields inherited from interface org.objectweb.dream.message.MessageType |
EMPTY_MESSAGE_TYPE_ARRAY |
Fields inherited from interface org.objectweb.dream.util.EmptyStringArray |
EMPTY_STRING_ARRAY |
Constructor Summary | |
protected |
MessageTypeImpl()
Creates an empty message type. |
|
MessageTypeImpl(String[] chkNames,
ChunkType[] chkTypes,
MessageType[] msgTypes)
Creates a message type with the specified chunk types and sub message types. |
|
MessageTypeImpl(String chkName,
ChunkType chkType)
Creates a message type that contains a chunk type. |
|
MessageTypeImpl(String chkName1,
ChunkType chkType1,
String chkName2,
ChunkType chkType2)
Creates a message type that contains two chunk types. |
Method Summary | |
void |
addChunkType(String chunkName,
ChunkType chunkType)
Adds a chunk type |
void |
addSubMessageType(MessageType msgType)
Adds a sub message type |
String[] |
getChunkNames()
Returns an (eventually empty) array containing the chunk's names of messages of this type. |
Iterator |
getChunkNamesIterator()
Returns an iterator over the chunk's names of messages of this type. |
ChunkType |
getChunkType(String name)
Returns a chunk type of this message type from its name. |
MessageType[] |
getSubMessageTypes()
Returns an (eventually empty) array containing the types of the sub messages of messages of this type. |
Iterator |
getSubMessageTypesIterator()
Returns an iterator over the types of the sub messages of messages of this type. |
boolean |
isEmpty()
Returns true if this message type is empty (ie : does not
contains any chunk types and any sub message types) |
boolean |
isSubTypeOf(MessageType t)
Returns true if this message type if a sub type of the given
message type. |
ChunkType |
removeChunkType(String name)
removes a chunk type |
boolean |
removeSubMessageType(MessageType msgType)
Removes a sub message type |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final MessageType EMPTY_MESSAGE_TYPE
protected Hashtable chunkTypes
protected LinkedList subMessageTypes
protected String[] chkNames
protected MessageType[] subMessageTypesArray
Constructor Detail |
protected MessageTypeImpl()
EMPTY_MESSAGE_TYPE
constant.
public MessageTypeImpl(String[] chkNames, ChunkType[] chkTypes, MessageType[] msgTypes) throws ChunkAlreadyExistsException
chkNames
array contains the name of chunk types,
which are specified in chkTypes
array (as a consequence
these two arrays must have the same length). Names and types are associated
following their order in arrays.
chkNames
- array of chunk names can be null
.chkTypes
- array of chunk types (ignored if chkNames
is
null
).msgTypes
- array of sub message types can be null
.
IllegalArgumentException
- If chkNames
and
chkTypes
do not have the same length.
ChunkAlreadyExistsException
- If the same name appears twice in
chkNames
public MessageTypeImpl(String chkName, ChunkType chkType)
chkName
- the name of the chunk typechkType
- the chunk typepublic MessageTypeImpl(String chkName1, ChunkType chkType1, String chkName2, ChunkType chkType2) throws ChunkAlreadyExistsException
chkName1
- the name of the first chunk typechkType1
- the first chunk typechkName2
- the name of the second chunk typechkType2
- the second chunk type
ChunkAlreadyExistsException
- if chkname1
and
chkName2
are equalsMethod Detail |
public ChunkType getChunkType(String name)
MessageType
getChunkType
in interface MessageType
name
- the name of one of the chunk types returned by
MessageType.getChunkNames()
.
null
if no chunk with the specified name can be
found.MessageType.getChunkType(java.lang.String)
public String[] getChunkNames()
MessageType
getChunkNames
in interface MessageType
MessageType.getChunkNames()
public Iterator getChunkNamesIterator()
MessageType
getChunkNamesIterator
in interface MessageType
MessageType.getChunkNamesIterator()
public MessageType[] getSubMessageTypes()
MessageType
getSubMessageTypes
in interface MessageType
MessageType.getSubMessageTypes()
public Iterator getSubMessageTypesIterator()
MessageType
getSubMessageTypesIterator
in interface MessageType
MessageType.getSubMessageTypesIterator()
public boolean isEmpty()
MessageType
true
if this message type is empty (ie : does not
contains any chunk types and any sub message types)
isEmpty
in interface MessageType
true
if this message type is emptyMessageType.isEmpty()
public boolean isSubTypeOf(MessageType t)
MessageType
true
if this message type if a sub type of the given
message type.
isSubTypeOf
in interface MessageType
t
- a message type
true
if this message type if a sub type of the given
message type.MessageType.isSubTypeOf(org.objectweb.dream.message.MessageType)
public void addChunkType(String chunkName, ChunkType chunkType) throws ChunkAlreadyExistsException
chunkName
- the name of the chunk typechunkType
- the chunk type
ChunkAlreadyExistsException
- if this type already contains a chunk
type with the specified namepublic void addSubMessageType(MessageType msgType)
msgType
- the message type to addpublic ChunkType removeChunkType(String name)
name
- the name of the chunk type.
null
if no chunk type with the
specified name exists.public boolean removeSubMessageType(MessageType msgType)
msgType
- the message type to remove
true
if the specified message type can be removed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |