You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2018/03/02 07:50:46 UTC
[incubator-plc4x] branch refactoring/ads_use_byte_array updated:
implement too more methods to improve performance
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch refactoring/ads_use_byte_array
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git
The following commit(s) were added to refs/heads/refactoring/ads_use_byte_array by this push:
new 8117160 implement too more methods to improve performance
8117160 is described below
commit 81171608ab0e020bb7438f0bbae2c45fd3db8c66
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Fri Mar 2 08:50:42 2018 +0100
implement too more methods to improve performance
---
.../java/org/apache/plc4x/java/ads/api/generic/types/Command.java | 5 +++++
.../src/main/java/org/apache/plc4x/java/ads/api/util/ByteValue.java | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/generic/types/Command.java b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/generic/types/Command.java
index d7ba4e0..c59c473 100644
--- a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/generic/types/Command.java
+++ b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/generic/types/Command.java
@@ -82,6 +82,11 @@ public enum Command implements ByteReadable {
return Unpooled.buffer().writeBytes(value);
}
+ @Override
+ public long getCalculatedLength() {
+ return NUM_BYTES;
+ }
+
public static Command of(byte... bytes) {
// TODO: improve by using a map
for (Command command : values()) {
diff --git a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/util/ByteValue.java b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/util/ByteValue.java
index d211e18..0da050d 100644
--- a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/util/ByteValue.java
+++ b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/util/ByteValue.java
@@ -65,6 +65,11 @@ public class ByteValue implements ByteReadable {
}
@Override
+ public long getCalculatedLength() {
+ return value.length;
+ }
+
+ @Override
public boolean equals(Object o) {
if (this == o)
return true;
--
To stop receiving notification emails like this one, please contact
sruehl@apache.org.