diff options
author | Brian P. Hinz <bphinz@users.sf.net> | 2016-12-10 19:14:55 -0500 |
---|---|---|
committer | Brian P. Hinz <bphinz@users.sf.net> | 2016-12-10 19:14:55 -0500 |
commit | bcaadbe7ae3dcb18375bcb878a7794058b96aeee (patch) | |
tree | c1f91b2ce3cd4ca34440bb681cfd10184df58471 /java/com/tigervnc/rfb/ScreenSet.java | |
parent | 7ea19d8f89633cc940227e94238df0e357ebe054 (diff) | |
download | tigervnc-bcaadbe7ae3dcb18375bcb878a7794058b96aeee.tar.gz tigervnc-bcaadbe7ae3dcb18375bcb878a7794058b96aeee.zip |
Method cleanup.
Sync various methods and filenames with C++ versions
Diffstat (limited to 'java/com/tigervnc/rfb/ScreenSet.java')
-rw-r--r-- | java/com/tigervnc/rfb/ScreenSet.java | 14 |
1 files changed, 10 insertions, 4 deletions
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<Screen>(); } + public final ListIterator<Screen> begin() { return screens.listIterator(0); } + public final ListIterator<Screen> 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<Screen> 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<Screen> 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+")"); |