From bcaadbe7ae3dcb18375bcb878a7794058b96aeee Mon Sep 17 00:00:00 2001 From: "Brian P. Hinz" Date: Sat, 10 Dec 2016 19:14:55 -0500 Subject: Method cleanup. Sync various methods and filenames with C++ versions --- java/com/tigervnc/rfb/ScreenSet.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'java/com/tigervnc/rfb/ScreenSet.java') diff --git a/java/com/tigervnc/rfb/ScreenSet.java b/java/com/tigervnc/rfb/ScreenSet.java index a14f561d..173dd101 100644 --- a/java/com/tigervnc/rfb/ScreenSet.java +++ b/java/com/tigervnc/rfb/ScreenSet.java @@ -31,13 +31,18 @@ public class ScreenSet { screens = new ArrayList(); } + public final ListIterator begin() { return screens.listIterator(0); } + public final ListIterator end() { + return screens.listIterator(screens.size()); + } public final int num_screens() { return screens.size(); } public final void add_screen(Screen screen) { screens.add(screen); } public final void remove_screen(int id) { - for (Iterator iter = screens.iterator(); iter.hasNext(); ) { - Screen refScreen = (Screen)iter.next(); - if (refScreen.id == id) + ListIterator iter, nextiter; + for (iter = begin(); iter != end(); iter = nextiter) { + nextiter = iter; nextiter.next(); + if (((Screen)iter.next()).id == id) iter.remove(); } } @@ -68,9 +73,10 @@ public class ScreenSet { } public final void debug_print() { + vlog.debug(num_screens()+" screen(s)"); for (Iterator iter = screens.iterator(); iter.hasNext(); ) { Screen refScreen = (Screen)iter.next(); - vlog.error(" "+refScreen.id+" (0x"+refScreen.id+"): "+ + vlog.debug(" "+refScreen.id+" (0x"+refScreen.id+"): "+ refScreen.dimensions.width()+"x"+refScreen.dimensions.height()+ "+"+refScreen.dimensions.tl.x+"+"+refScreen.dimensions.tl.y+ " (flags 0x"+refScreen.flags+")"); -- cgit v1.2.3