public class Event extends Object
| Constructor and Description |
|---|
Event(ArrayList<HashMap<String,String>> events,
String eventType)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
HashMap |
addEvent(String date,
boolean useTemp)
Add a new event into array with selected event type and input date.
|
HashMap |
getCurrentEvent()
Get the current pointed event, if not available will return empty map
|
boolean |
isEventExist()
Check if the selected event is existed in the array
|
void |
removeEvent()
Remove the current planting event data if available
|
void |
setEventType(String eventType)
Set event type and refresh the internal attributes
|
void |
setTemplate()
Set template with selected event type
|
void |
updateEvent(String key,
String value)
Update the current event with given key and value, if current event not
available, add a new one into array
|
void |
updateEvent(String key,
String value,
boolean toNext)
Update the current event with given key and value, if current event not
available, add a new one into array
|
void |
updateEvent(String key,
String value,
boolean useTemp,
boolean toNext)
Update the current event with given key and value, if current event not
available, add a new one into array
|
public void setEventType(String eventType)
eventType - The event type for handlingpublic final void setTemplate()
public void removeEvent()
public void updateEvent(String key, String value)
key - The variable's key for a eventvalue - The input value for the keypublic void updateEvent(String key, String value, boolean toNext)
key - The variable's key for a eventvalue - The input value for the keytoNext - The flag for if move the pointer to the next eventpublic void updateEvent(String key, String value, boolean useTemp, boolean toNext)
key - The variable's key for a eventvalue - The input value for the keyuseTemp - The flag for if using the template to build new eventtoNext - The flag for if move the pointer to the next eventpublic HashMap addEvent(String date, boolean useTemp)
date - The event dateuseTemp - True for using template to create new datapublic boolean isEventExist()
public HashMap getCurrentEvent()
Copyright © 2014. All Rights Reserved.