@NotThreadSafe public class CommentBlock extends Object
| Constructor and Description |
|---|
CommentBlock() |
| Modifier and Type | Method and Description |
|---|---|
void |
addInt(String parameter,
int value)
Add integer value
|
void |
addLine(String line)
Add line containing comment block
|
void |
addString(String parameter,
String value)
Add key value pair with string value
|
void |
addTimestamp(Date timestamp)
Add timestamp
|
boolean |
contains(String parameter)
Determine if parameter exists in comment block
|
String |
encode()
Encode comment block in 80 character lines
|
String |
encode(int maxLen)
Encode comment block in a number of lines
|
Integer |
getInt(String parameter)
Get integer value of parameter code
|
String |
getLastGroupId()
Get id of last group
|
Long |
getLong(String parameter)
Get long value of parameter code
|
int |
getSize()
Get number of entries in comment block
|
String |
getString(String parameter)
Get string value for parameter code
|
Long |
getTimestamp()
Get timestamp in tag
|
int |
getTotalLines()
Get total number of lines in last group
|
static boolean |
hasCommentBlock(String line)
Determine if a line contains comment block
|
boolean |
isEmpty()
Determine if comment block contains any key value pairs
|
boolean |
isFinished()
Determine if comment block is completed.
|
String |
toString() |
public void addLine(String line) throws CommentBlockException
line - the lineCommentBlockException - the comment block exceptionpublic int getSize()
public String getString(String parameter)
parameter - the parameterpublic void addString(String parameter, String value)
parameter - the parametervalue - the valuepublic void addInt(String parameter, int value)
parameter - the parametervalue - the valuepublic void addTimestamp(Date timestamp)
timestamp - the timestamppublic Integer getInt(String parameter)
parameter - the parameterpublic Long getLong(String parameter)
parameter - the parameterpublic Long getTimestamp()
public boolean contains(String parameter)
parameter - the parameterpublic static boolean hasCommentBlock(String line)
line - the linepublic boolean isFinished()
public String getLastGroupId()
public int getTotalLines()
public boolean isEmpty()
public String encode()
public String encode(int maxLen)
maxLen - Maximum line lengthCopyright © 2011–2019 Danish Maritime Authority. All rights reserved.