Package overit.geocall.util
Class NestableNameList
java.lang.Object
overit.geocall.util.NestableNameList
Utility class used to manage a nestable list of names (i.e. {toni,subbo{pollo,orpo},gigi})
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructorCreates an instance of NestableNameList -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a string inside the NestableNameListvoidadd(String name, NestableNameList nnl) Adds a string and another NestableNameList inside a NestableNameListbooleanTells if the string is contained inside the listgetSubList(String name) Returns a sub NestableNameListbooleanisEmpty()iterator()Iterator of the liststatic voidvoidRemove a string from the NestableNameListtoString()toString(int maxlength) Returns a string representation of the object as long as dosnt exceed maxlength
-
Field Details
-
_al
-
_hm
-
-
Constructor Details
-
NestableNameList
public NestableNameList()Empty constructor -
NestableNameList
Creates an instance of NestableNameList- Parameters:
s- String representing a NestableNameList (i.e. {toni,subbo{pollo,orpo},gigi})- Throws:
ParseException- if an error occurs during the parsing
-
-
Method Details
-
add
Adds a string inside the NestableNameList- Parameters:
name- The string to add
-
add
Adds a string and another NestableNameList inside a NestableNameList- Parameters:
name- The string to addnnl- The NestableNameList to add
-
isEmpty
public boolean isEmpty()- Returns:
trueif the NestableNameList is empty,falseotherwise
-
remove
Remove a string from the NestableNameList- Parameters:
name- The string to remove
-
toString
-
toString
Returns a string representation of the object as long as dosnt exceed maxlength- Parameters:
maxlength- Maximum lenght of the string- Returns:
- A string representation of the object as long as dosnt exceed maxlength
-
getSubList
Returns a sub NestableNameList- Parameters:
name- The string to get- Returns:
- A sub NestableNameList
-
contains
Tells if the string is contained inside the list- Parameters:
name- The string to search- Returns:
trueif the string is contained inside the list,falseotherwise
-
iterator
Iterator of the list- Returns:
- The iterator of the list
-
main
- Throws:
Exception
-