Skip to content

Commit

Permalink
Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
kasemir committed May 26, 2017
1 parent 8b75cac commit 8786e29
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/etherip/types/CNSymbolPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@
@SuppressWarnings("nls")
public class CNSymbolPath extends CNPath
{
/** One element of a path
*
* <p>Contains a string path and an optional array index
*/
class PathAndIndex
{
private String path;
private Integer index;

public PathAndIndex(String path, Integer index)
public PathAndIndex(final String path, final Integer index)
{
this.path = path;
this.index = index;
Expand All @@ -48,7 +52,7 @@ public String toString()
{
if (index == null)
return path;
return path + "(" + index + ")";
return path + "[" + index + "]";
}
};

Expand Down Expand Up @@ -94,16 +98,16 @@ public void encode(final ByteBuffer buf, final StringBuilder log)
{
// spec 4 p.21: "ANSI extended symbol segment"
buf.put((byte) (getRequestSize() / 2));
for(PathAndIndex pi : paths)
for (PathAndIndex pi : paths)
{
String s = pi.getPath();
final String s = pi.getPath();
buf.put((byte) 0x91);
buf.put((byte) s.length());
buf.put(s.getBytes());
if (needPad(s))
buf.put((byte) 0);
Integer index = pi.getIndex();
if (index!=null)
final Integer index = pi.getIndex();
if (index != null)
{
// Path Segment 28, from wireshark
buf.put((byte) 0x28);
Expand Down

0 comments on commit 8786e29

Please sign in to comment.