Example #1
0
    public Object get(final int index) {

      switch (index) {
        case 0:
          return _flow.getNextIncomingId();
        case 1:
          return _flow.getIncomingWindow();
        case 2:
          return _flow.getNextOutgoingId();
        case 3:
          return _flow.getOutgoingWindow();
        case 4:
          return _flow.getHandle();
        case 5:
          return _flow.getDeliveryCount();
        case 6:
          return _flow.getLinkCredit();
        case 7:
          return _flow.getAvailable();
        case 8:
          return _flow.getDrain();
        case 9:
          return _flow.getEcho();
        case 10:
          return _flow.getProperties();
      }

      throw new IllegalStateException("Unknown index " + index);
    }
Example #2
0
 public int size() {
   return _flow.getProperties() != null
       ? 11
       : _flow.getEcho()
           ? 10
           : _flow.getDrain()
               ? 9
               : _flow.getAvailable() != null
                   ? 8
                   : _flow.getLinkCredit() != null
                       ? 7
                       : _flow.getDeliveryCount() != null
                           ? 6
                           : _flow.getHandle() != null ? 5 : 4;
 }