From: Marcus <the...@us...> - 2004-03-22 12:44:27
|
Update of /cvsroot/junk/junk/WEB-INF/classes/junk/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5629 Modified Files: HostMap.java Log Message: new code conventions Index: HostMap.java =================================================================== RCS file: /cvsroot/junk/junk/WEB-INF/classes/junk/util/HostMap.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** HostMap.java 18 Dec 2003 15:27:22 -0000 1.3 --- HostMap.java 22 Mar 2004 12:34:09 -0000 1.4 *************** *** 2,6 **** * juNK - a file search system for smb shares * ! * Copyright 2003 by Marcus Proest (theevilflow at users dot sf dot net) * * This file is part of junk (java useful net kollektor). --- 2,8 ---- * juNK - a file search system for smb shares * ! * Copyright 2004 by ! * Marcus Proest (theevilflow at users dot sf dot net) ! * Uwe van Heeschh (tyron_e at users dot sf dot net) * * This file is part of junk (java useful net kollektor). *************** *** 21,32 **** * */ package junk.util; import java.util.HashMap; import java.util.Iterator; import java.util.Map; - import junk.util.NameOnline; - /** Hashmap Wrapper to provide additional functionality --- 23,35 ---- * */ + package junk.util; + import junk.util.NameOnline; + import java.util.HashMap; import java.util.Iterator; import java.util.Map; /** Hashmap Wrapper to provide additional functionality *************** *** 34,38 **** --- 37,50 ---- */ public class HostMap extends HashMap implements HostIteratorProvider, Map { + /** returns an Iterator over the online computers + * @see junk.util.Computer + * @return an Iterator over the online computers + */ + public Iterator getOnlineComputerIterator() { + return new OnlineComputerIterator(this); + } + /** returns an Iterator over the online ip addresses + * @see junk.util.NameOnline * @return an Iterator over the online ip addresses */ *************** *** 41,48 **** } - public Iterator getOnlineComputerIterator() { - return new OnlineComputerIterator(this); - } - /** implements an iterator over the online ip addresses */ class OnlineIpStringIterator implements Iterator { --- 53,56 ---- *************** *** 65,69 **** } ! /** Returns true if the iteration has more elements. (In other words, * returns true if next would return an element rather than throwing * an exception.) --- 73,77 ---- } ! /** Returns true if the iteration has more elements. (In other words, * returns true if next would return an element rather than throwing * an exception.) *************** *** 73,82 **** public boolean hasNext() { while (this.keys.hasNext()) { ! if (((NameOnline) this.h.get(ip)).getOnline() ! .equals(Boolean.TRUE)) { return true; //return true if we get an online ip } - //if it was false (or null), try the next one this.ip = (String) this.keys.next(); --- 81,88 ---- public boolean hasNext() { while (this.keys.hasNext()) { ! if (((NameOnline) this.h.get(ip)).getOnline().equals(Boolean.TRUE)) { return true; //return true if we get an online ip } //if it was false (or null), try the next one this.ip = (String) this.keys.next(); *************** *** 88,97 **** /** Returns the next element in the iteration. * @return the next element in the iteration. - * */ public Object next() { while (this.keys.hasNext()) { ! if (((NameOnline) this.h.get(ip)).getOnline() ! .equals(Boolean.TRUE)) { String temp = this.ip; //save current value this.ip = (String) keys.next(); //forward iterator --- 94,101 ---- /** Returns the next element in the iteration. * @return the next element in the iteration. */ public Object next() { while (this.keys.hasNext()) { ! if (((NameOnline) this.h.get(ip)).getOnline().equals(Boolean.TRUE)) { String temp = this.ip; //save current value this.ip = (String) keys.next(); //forward iterator *************** *** 133,137 **** } ! /** Returns true if the iteration has more elements. (In other words, * returns true if next would return an element rather than throwing * an exception.) --- 137,141 ---- } ! /** Returns true if the iteration has more elements. (In other words, * returns true if next would return an element rather than throwing * an exception.) *************** *** 141,150 **** public boolean hasNext() { while (this.keys.hasNext()) { ! if (((NameOnline) this.h.get(ip)).getOnline() ! .equals(Boolean.TRUE)) { return true; //return true if we get an online ip } - //if it was false (or null), try the next one this.ip = (String) this.keys.next(); --- 145,152 ---- public boolean hasNext() { while (this.keys.hasNext()) { ! if (((NameOnline) this.h.get(ip)).getOnline().equals(Boolean.TRUE)) { return true; //return true if we get an online ip } //if it was false (or null), try the next one this.ip = (String) this.keys.next(); *************** *** 160,165 **** public Object next() { while (this.keys.hasNext()) { ! if (((NameOnline) this.h.get(ip)).getOnline() ! .equals(Boolean.TRUE)) { //assemble Computer Computer c = new Computer(); --- 162,166 ---- public Object next() { while (this.keys.hasNext()) { ! if (((NameOnline) this.h.get(ip)).getOnline().equals(Boolean.TRUE)) { //assemble Computer Computer c = new Computer(); *************** *** 187,189 **** } } ! } \ No newline at end of file --- 188,190 ---- } } ! } |