diff options
author | Sven Gothel <[email protected]> | 2021-08-04 06:01:22 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-08-04 06:01:22 +0200 |
commit | 75df7a20a2c84de38a049974165434a85420b7ba (patch) | |
tree | a0a41e9a598d8fa95f696306a422f027fd2b46a7 /java/org/direct_bt/BTDeviceRegistry.java | |
parent | e4d18c7c17c1e6356747e5ad17c85ed9a47cc2da (diff) |
BTDeviceRegistry: Replace print*() to get*String() and clarify method names (C++ and Java)
Diffstat (limited to 'java/org/direct_bt/BTDeviceRegistry.java')
-rw-r--r-- | java/org/direct_bt/BTDeviceRegistry.java | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/java/org/direct_bt/BTDeviceRegistry.java b/java/org/direct_bt/BTDeviceRegistry.java index 15ba0b76..fc309b3a 100644 --- a/java/org/direct_bt/BTDeviceRegistry.java +++ b/java/org/direct_bt/BTDeviceRegistry.java @@ -136,8 +136,8 @@ public class BTDeviceRegistry { public static int getWaitForDevicesCount() { return waitForDevices.size(); } - public static void printWaitForDevices(final PrintStream out, final String msg) { - BTUtils.println(out, msg+" "+Arrays.toString(waitForDevices.toArray())); + public static String getWaitForDevicesString() { + return Arrays.toString(waitForDevices.toArray()); } /** * Returns the reference of the current list of {@link DeviceQuery}, not a copy. @@ -152,16 +152,16 @@ public class BTDeviceRegistry { waitForDevices.clear(); } - public static void addToDevicesProcessed(final BDAddressAndType a, final String n) { + public static void addToProcessedDevices(final BDAddressAndType a, final String n) { devicesProcessed.add( new DeviceID(a, n) ); } public static boolean isDeviceProcessed(final BDAddressAndType a) { return devicesProcessed.contains( new DeviceID(a, null) ); } - public static int getDeviceProcessedCount() { + public static int getProcessedDeviceCount() { return devicesProcessed.size(); } - public static boolean allDevicesProcessed() { + public static boolean areAllDevicesProcessed() { for(final Iterator<DeviceQuery> it1=waitForDevices.iterator(); it1.hasNext(); ) { final DeviceQuery q = it1.next(); final Iterator<DeviceID> it2=devicesProcessed.iterator(); @@ -178,9 +178,10 @@ public class BTDeviceRegistry { } return true; } - public static void printDevicesProcessed(final PrintStream out, final String msg) { - BTUtils.println(out, msg+" "+Arrays.toString(devicesProcessed.toArray())); + public static String getProcessedDevicesString() { + return Arrays.toString(devicesProcessed.toArray()); } + /** * Returns a copy of the current collection of processed {@link DeviceID}. */ @@ -194,16 +195,16 @@ public class BTDeviceRegistry { devicesProcessed.clear(); } - public static void addToDevicesProcessing(final BDAddressAndType a, final String n) { + public static void addToProcessingDevices(final BDAddressAndType a, final String n) { devicesInProcessing.add( new DeviceID(a, n) ); } - public static boolean removeFromDevicesProcessing(final BDAddressAndType a) { + public static boolean removeFromProcessingDevices(final BDAddressAndType a) { return devicesInProcessing.remove( new DeviceID(a, null) ); } public static boolean isDeviceProcessing(final BDAddressAndType a) { return devicesInProcessing.contains( new DeviceID(a, null) ); } - public static int getDeviceProcessingCount() { + public static int getProcessingDeviceCount() { return devicesInProcessing.size(); } /** |