public class ListAccumulator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.lang.String> |
currentEntries |
private java.util.Map<java.lang.String,java.lang.String> |
currentProperties |
private java.util.List<java.util.List<java.lang.String>> |
entries |
private int |
listCount |
private java.util.Map<java.lang.String,java.lang.Integer> |
names |
private java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
properties |
Constructor and Description |
---|
ListAccumulator() |
Modifier and Type | Method and Description |
---|---|
boolean |
addEntry(java.lang.String list,
java.lang.String entry)
Adds a new entry to a list identified by a given name.
|
boolean |
addEntryToCurrent(java.lang.String entry)
Adds a new entry to the list which has been added as the latest.
|
boolean |
addList(java.lang.String name)
Adds a new list if a list by that name does not exist yet.
|
boolean |
addProperty(java.lang.String list,
java.lang.String property,
java.lang.String value)
Adds a new property to a list identified by a given name.
|
boolean |
addPropertyToCurrent(java.lang.String property,
java.lang.String value)
Adds a new property to the list which has been added as the latest.
|
java.util.List<java.util.List<java.lang.String>> |
getEntryLists()
Returns a
List which contains all the Lists of entries. |
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
getPropertyMaps()
Returns a
List which contains all the Maps of entries. |
private final java.util.Map<java.lang.String,java.lang.Integer> names
private final java.util.List<java.util.List<java.lang.String>> entries
private final java.util.List<java.util.Map<java.lang.String,java.lang.String>> properties
private int listCount
private java.util.List<java.lang.String> currentEntries
private java.util.Map<java.lang.String,java.lang.String> currentProperties
public boolean addList(java.lang.String name)
name
- The name of the list to be added.public boolean addEntry(java.lang.String list, java.lang.String entry)
key
- The name of the list the entry is to be added to.entry
- The new entry.public boolean addEntryToCurrent(java.lang.String entry)
entry
- The new entry.public boolean addProperty(java.lang.String list, java.lang.String property, java.lang.String value)
list
- The name of the list.property
- The name of the property.value
- The value of the property.public boolean addPropertyToCurrent(java.lang.String property, java.lang.String value)
list
- The name of the list.property
- The name of the property.value
- The value of the property.public java.util.List<java.util.List<java.lang.String>> getEntryLists()
List
which contains all the Lists
of entries.public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getPropertyMaps()
List
which contains all the Maps
of entries.