Home | History | Annotate | Download | only in protobuf

Lines Matching defs:messages

41  * message uses to hold a repeated field of other protocol messages. It supports
53 * to messages when build is called on the root or when any method is called
56 * classes cache messages that were created so that messages only need to be
75 // List of messages. Never null. It may be immutable, in which case
77 private List<MType> messages;
79 // Whether messages is an mutable array that can be modified.
86 // Here are the invariants for messages and builders:
87 // 1. messages is never null and its count corresponds to the number of items
89 // 2. If builders is non-null, messages and builders MUST always
92 // either a Message in messages or a builder in builders.
95 // Any message in the messages array MUST be ignored.
96 // t. If the builder at an index is null, the message in the messages
104 // A view of this builder that exposes a List interface of messages. This is
117 // implemented by messages and builders. This is initialized on demand. This
125 * Constructs a new builder with an empty list of messages.
127 * @param messages the current list of messages
128 * @param isMessagesListMutable Whether the messages list is mutable
133 List<MType> messages,
137 this.messages = messages;
149 * Ensures that the list of messages is mutable so it can be updated. If it's
154 messages = new ArrayList<MType>(messages);
161 * created and initialized to be the same size as the messages list with
168 messages.size());
169 for (int i = 0; i < messages.size(); i++) {
181 return messages.size();
190 return messages.isEmpty();
220 return messages.get(index);
228 return messages.get(index);
247 MType message = messages.get(index);
268 return (IType) messages.get(index);
276 return (IType) messages.get(index);
297 messages.set(index, message);
322 messages.add(message);
346 messages.add(index, message);
356 * Appends all of the messages in the specified collection to the end of
360 * @param values the messages to add
371 // If we can inspect the size, we can more efficiently add messages.
383 if (size >= 0 && messages instanceof ArrayList) {
384 ((ArrayList<MType>) messages)
385 .ensureCapacity(messages.size() + size);
409 messages.add(null);
431 messages.add(index, null);
447 messages.remove(index);
464 messages = Collections.emptyList();
480 * Builds the list of messages from the builder and returns them.
482 * @return an immutable list of messages
491 return messages;
498 for (int i = 0; i < messages.size(); i++) {
499 Message message = messages.get(i);
510 return messages;
514 // Need to make sure messages is up to date
516 for (int i = 0; i < messages.size(); i++) {
517 messages.set(i, getMessage(i, true));
522 messages = Collections.unmodifiableList(messages);
524 return messages;
528 * Gets a view of the builder as a list of messages. The returned list is live
531 * @return the messages in the list
605 * Provides a live view of the builder as a list of messages.