1 /*_############################################################################ 2 _## 3 _## SNMP4J - TreeListener.java 4 _## 5 _## Copyright 2003-2007 Frank Fock and Jochen Katz (SNMP4J.org) 6 _## 7 _## Licensed under the Apache License, Version 2.0 (the "License"); 8 _## you may not use this file except in compliance with the License. 9 _## You may obtain a copy of the License at 10 _## 11 _## http://www.apache.org/licenses/LICENSE-2.0 12 _## 13 _## Unless required by applicable law or agreed to in writing, software 14 _## distributed under the License is distributed on an "AS IS" BASIS, 15 _## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 _## See the License for the specific language governing permissions and 17 _## limitations under the License. 18 _## 19 _##########################################################################*/ 20 21 package org.snmp4j.util; 22 23 import java.util.EventListener; 24 25 /** 26 * The <code>TreeListener</code> interface is implemented by objects 27 * listening for tree events. 28 * 29 * @author Frank Fock 30 * @version 1.8 31 * @since 1.8 32 * @see TreeUtils 33 */ 34 public interface TreeListener extends EventListener { 35 36 /** 37 * Consumes the next table event, which is typically the next row in a 38 * table retrieval operation. 39 * 40 * @param event 41 * a <code>TableEvent</code> instance. 42 * @return 43 * <code>true</code> if this listener wants to receive more events, 44 * otherwise return <code>false</code>. For example, a 45 * <code>TreeListener</code> can return <code>false</code> to stop 46 * tree retrieval. 47 */ 48 boolean next(TreeEvent event); 49 50 /** 51 * Indicates in a series of tree events that no more events will follow. 52 * @param event 53 * a <code>TreeEvent</code> instance that will either indicate an error 54 * ({@link TreeEvent#isError()} returns <code>true</code>) or success 55 * of the tree retrieval operation. 56 */ 57 void finished(TreeEvent event); 58 59 } 60