1 2 5 14 package org.jacorb.trading.impl; 15 16 17 import org.omg.CosTrading.*; 18 20 21 24 public class OfferIteratorImpl extends OfferIteratorPOA 25 { 26 private Offer[] m_offers; 27 private int m_start; 28 29 30 private OfferIteratorImpl() 31 { 32 } 33 34 35 public OfferIteratorImpl(Offer[] offers, int start) 36 { 37 m_offers = offers; 38 m_start = start; 39 } 40 41 42 public int max_left() throws UnknownMaxLeft 43 { 44 return (m_offers.length - m_start); 45 } 46 47 48 public boolean next_n(int n, OfferSeqHolder offers) 49 { 50 boolean result; 51 52 int count; 53 if (n > (m_offers.length - m_start)) 54 count = m_offers.length - m_start; 55 else 56 count = n; 57 58 offers.value = new Offer[count]; 59 java.lang.System.arraycopy(m_offers, m_start, offers.value, 0, count); 63 64 m_start += count; 65 result = (m_offers.length - m_start > 0); 67 return result; 68 } 69 70 76 public Offer[] getOffers(){ 77 return m_offers; 78 } 79 81 public void destroy() 82 { 83 } 85 } 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | Popular Tags |