97 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
98 * system exceptions.
99 * @see NextOne
100 */
101 public synchronized boolean next_n(int how_many,
102 org.omg.CosNaming.BindingListHolder blh)
103 {
104 if( how_many == 0 ) {
105 throw new BAD_PARAM( " 'how_many' parameter is set to 0 which is" +
106 " invalid" );
107 }
108 return list( how_many, blh );
109 }
110
111 /**
112 * lists next n bindings. It returns true or false, indicating
113 * whether there were more bindings. This method has the package private
114 * scope, It will be called from NamingContext.list() operation or
115 * this.next_n().
116 * @param how_many The number of requested bindings in the BindingList.
117 * @param bl The BindingList as an out parameter.
118 * @return true if there were more bindings.
119 */
120 public boolean list( int how_many, org.omg.CosNaming.BindingListHolder blh)
121 {
122 // Take the smallest of what's left and what's being asked for
123 int numberToGet = Math.min(RemainingElements(),how_many);
124
125 // Create a resulting BindingList
126 Binding[] bl = new Binding[numberToGet];
127 BindingHolder bh = new BindingHolder();
128 int i = 0;
129 // Keep iterating as long as there are entries
130 while (i < numberToGet && this.NextOne(bh) == true) {
131 bl[i] = bh.value;
132 i++;
133 }
134 // Found any at all?
135 if (i == 0) {
136 // No
137 blh.value = new Binding[0];
|
97 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
98 * system exceptions.
99 * @see NextOne
100 */
101 public synchronized boolean next_n(int how_many,
102 org.omg.CosNaming.BindingListHolder blh)
103 {
104 if( how_many == 0 ) {
105 throw new BAD_PARAM( " 'how_many' parameter is set to 0 which is" +
106 " invalid" );
107 }
108 return list( how_many, blh );
109 }
110
111 /**
112 * lists next n bindings. It returns true or false, indicating
113 * whether there were more bindings. This method has the package private
114 * scope, It will be called from NamingContext.list() operation or
115 * this.next_n().
116 * @param how_many The number of requested bindings in the BindingList.
117 * @param blh The BindingList as an out parameter.
118 * @return true if there were more bindings.
119 */
120 public boolean list( int how_many, org.omg.CosNaming.BindingListHolder blh)
121 {
122 // Take the smallest of what's left and what's being asked for
123 int numberToGet = Math.min(RemainingElements(),how_many);
124
125 // Create a resulting BindingList
126 Binding[] bl = new Binding[numberToGet];
127 BindingHolder bh = new BindingHolder();
128 int i = 0;
129 // Keep iterating as long as there are entries
130 while (i < numberToGet && this.NextOne(bh) == true) {
131 bl[i] = bh.value;
132 i++;
133 }
134 // Found any at all?
135 if (i == 0) {
136 // No
137 blh.value = new Binding[0];
|