From 0fe147164761c9c25a46f239aeac9261bd428c37 Mon Sep 17 00:00:00 2001 From: Marco Zanon Date: Sun, 5 Feb 2012 13:46:14 +0000 Subject: [PATCH] Modified code to comply with the guidelines. --- src/java/com/marcozanon/macaco/json/MJsonArray.java | 10 +++++----- src/java/com/marcozanon/macaco/json/MJsonObject.java | 2 +- src/java/com/marcozanon/macaco/web/ui/MWebView.java | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/java/com/marcozanon/macaco/json/MJsonArray.java b/src/java/com/marcozanon/macaco/json/MJsonArray.java index 63e7bad..c5bc2f1 100644 --- a/src/java/com/marcozanon/macaco/json/MJsonArray.java +++ b/src/java/com/marcozanon/macaco/json/MJsonArray.java @@ -52,7 +52,7 @@ public class MJsonArray extends MJsonValue { } public void setValue(int index, MJsonValue x) { - if ((index < 0) || (index > (this.countValues() - 1))) { + if ((index < 0) || (index > (this.getValueCount() - 1))) { throw new IllegalArgumentException(String.format("Invalid 'index': %s: out of range.", index)); } if (null == x) { @@ -67,19 +67,19 @@ public class MJsonArray extends MJsonValue { } public MJsonValue getValue(int index) { - if ((index < 0) || (index > (this.countValues() - 1))) { + if ((index < 0) || (index > (this.getValueCount() - 1))) { throw new IllegalArgumentException(String.format("Invalid 'index': %s: out of range.", index)); } // return this.getValuesReference().get(index).clone(); } - public int countValues() { + public int getValueCount() { return this.getValuesReference().size(); } public void removeValue(int index) { - if ((index < 0) || (index > (this.countValues() - 1))) { + if ((index < 0) || (index > (this.getValueCount() - 1))) { throw new IllegalArgumentException(String.format("Invalid 'index': %s: out of range.", index)); } // @@ -194,7 +194,7 @@ public class MJsonArray extends MJsonValue { public String getJsonValue() { StringBuilder s = new StringBuilder(""); s.append("["); - for (int i = 0; i < this.countValues(); i++) { + for (int i = 0; i < this.getValueCount(); i++) { if (i > 0) { s.append(", "); } diff --git a/src/java/com/marcozanon/macaco/json/MJsonObject.java b/src/java/com/marcozanon/macaco/json/MJsonObject.java index 3c96038..75bfb0b 100644 --- a/src/java/com/marcozanon/macaco/json/MJsonObject.java +++ b/src/java/com/marcozanon/macaco/json/MJsonObject.java @@ -72,7 +72,7 @@ public class MJsonObject extends MJsonValue { return this.getValuesReference().get(key).clone(); } - public int countValues() { + public int getValueCount() { return this.getValuesReference().size(); } diff --git a/src/java/com/marcozanon/macaco/web/ui/MWebView.java b/src/java/com/marcozanon/macaco/web/ui/MWebView.java index 6b07106..9b90f4e 100644 --- a/src/java/com/marcozanon/macaco/web/ui/MWebView.java +++ b/src/java/com/marcozanon/macaco/web/ui/MWebView.java @@ -217,7 +217,7 @@ public class MWebView extends MObject implements Runnable { throw new MDownloaderNotFoundWebException(String.format("Invalid 'id': %s.", id)); } - public int countDownloaders() { + public int getDownloaderCount() { return this.getDownloadersReference().size(); } -- 2.30.2