src/main/java/pityoulish/msgboard/MixedMessageBoardImpl.java
protected String addMessageToBoard(MTMsg msg)
  {
    if (msg == null)
       throw new NullPointerException("TypedMessage");

    String key = boardSequencer.createMessageID();
    boardMessages.put(key, msg);

    // if the capacity remains constant, at most one message will be dropped
    while (boardMessages.size() > boardCapacity)
     {
       Map.Entry<String,MTMsg> entry = boardMessages.pollFirstEntry();
       if (entry.getValue().getType() == MT.USER)
          lastDroppedUserMessageID = entry.getKey();
     }

    return key;
  }
/**
   * Adds a message to the board.
   * This might drop an old message. All book-keeping is taken care of here.
   *
   * @param msg   the message to add
   *
   * @return      ID of the added message
   */
Adds a message to the board.
This might drop an old message. All book-keeping is taken care of here.

@param msg   the message to add

@return      ID of the added message
Adds a message to the board . This might drop an old message . All book - keeping is taken care of here . @param msg the message to add @return ID of the added message
protected String addMessageToBoard(MTMsg msg)
  {
    if (msg == null)
       throw new NullPointerException("TypedMessage");
    String key = boardSequencer.createMessageID();
    boardMessages.put(key, msg);
    while (boardMessages.size() > boardCapacity)
     {
       Map.Entry<String,MTMsg> entry = boardMessages.pollFirstEntry();
       if (entry.getValue().getType() == MT.USER)
          lastDroppedUserMessageID = entry.getKey();
     }
    return key;
  }
protected String addMessageToBoard ( MTMsg msg ) { if ( msg == null ) throw new NullPointerException ( "TypedMessage" ) ; String key = boardSequencer . createMessageID ( ) ; boardMessages . put ( key , msg ) ; while ( boardMessages . size ( ) > boardCapacity ) { Map . Entry < String , MTMsg > entry = boardMessages . pollFirstEntry ( ) ; if ( entry . getValue ( ) . getType ( ) == MT . USER ) lastDroppedUserMessageID = entry . getKey ( ) ; } return key ; }
Adds a message to the board.
Adds a message to the board .
// if the capacity remains constant, at most one message will be dropped