コード例 #1
0
 @Override
 public int serializedSize() {
   int size = 0;
   size += 2;
   for (int i = 0; i < this.contentsSelection.size(); ++i) {
     final ContentSelection contentsSelection_element = this.contentsSelection.get(i);
     size += contentsSelection_element.serializedSize();
   }
   return size;
 }
コード例 #2
0
 public final void internalToString(final StringBuilder repr, final String prefix) {
   repr.append(prefix).append("contentsSelection=");
   if (this.contentsSelection.isEmpty()) {
     repr.append("{}").append('\n');
   } else {
     repr.append("(").append(this.contentsSelection.size()).append(" elements)...\n");
     for (int i = 0; i < this.contentsSelection.size(); ++i) {
       final ContentSelection contentsSelection_element = this.contentsSelection.get(i);
       contentsSelection_element.internalToString(repr, prefix + i + "/ ");
     }
   }
 }
コード例 #3
0
 private boolean unserialize_v0(final ByteBuffer buffer) {
   final int contentsSelection_size = buffer.getShort() & 0xFFFF;
   this.contentsSelection.clear();
   this.contentsSelection.ensureCapacity(contentsSelection_size);
   for (int i = 0; i < contentsSelection_size; ++i) {
     final ContentSelection contentsSelection_element = new ContentSelection();
     final boolean contentsSelection_element_ok =
         contentsSelection_element.unserializeVersion(buffer, 0);
     if (!contentsSelection_element_ok) {
       return false;
     }
     this.contentsSelection.add(contentsSelection_element);
   }
   return true;
 }
コード例 #4
0
 @Override
 public boolean serialize(final ByteBuffer buffer) {
   if (this.contentsSelection.size() > 65535) {
     return false;
   }
   buffer.putShort((short) this.contentsSelection.size());
   for (int i = 0; i < this.contentsSelection.size(); ++i) {
     final ContentSelection contentsSelection_element = this.contentsSelection.get(i);
     final boolean contentsSelection_element_ok = contentsSelection_element.serialize(buffer);
     if (!contentsSelection_element_ok) {
       return false;
     }
   }
   return true;
 }