input
stringlengths
10
828
output
stringlengths
5
107
public date get previous month date int year this year int month this month 1 int day this day if month 0 month 12 year year 1 return easy calendar get date year month day
gets the previous month date
public date get previous day date int year this year int month this month int day this day 1 if day 0 month month 1 if month 0 month 12 year year 1 day easy calendar get last day year month return easy calendar get date year month day
gets the previous day date
public date get next year date int year this year 1 int month this month int day this day return easy calendar get date year month day
gets the next year date
public date get next month date int year this year int month this month 1 int day this day if month 13 month 1 year year 1 return easy calendar get date year month day
gets the next month date
public session get session session session null if is session session new session this else log info domain model session is configured as false return session
gets a new session
public date get next day date int year this year int month this month int day this day 1 int last day easy calendar get last day year month if day last day day 1 month month 1 if month 13 month 1 year year 1 return easy calendar get date year month day
gets the next day date
public boolean is equal to easy date easy date if this get year easy date get year this get month easy date get month this get day easy date get day return true return false
checks if this easy date is equal to a given easy date
public boolean is greater than easy date easy date if this get year easy date get year return true else if this get year easy date get year if this get month easy date get month return true else if this get month easy date get month if this get day easy date get day return true return false
checks if this easy date is greater than a given easy date
public boolean is less than easy date easy date if this get year easy date get year return true else if this get year easy date get year if this get month easy date get month return true else if this get month easy date get month if this get day easy date get day return true return false
checks if this easy date is less than a given easy date
public int compare object object1 object object2 if object1 instanceof easy date object2 instanceof easy date easy date easy date1 easy date object1 easy date easy date2 easy date object2 if easy date1 is equal to easy date2 return 0 if easy date1 is greater than easy date2 return 1 return 1 return 0
compares two easy dates
public boolean equals object value if value instanceof easy date easy date easy date easy date value return this is equal to easy date else if value instanceof date date date date value easy date easy date new easy date date return this is equal to easy date return false
checks if two easy dates are equal
public string to string return get date string
provides an easy date as a string
public string get date time string if date time pattern null date time pattern easy calendar default date time pattern return transformer string get date time date time pattern
gets a date time string
public void set hour int hour this hour hour set date time get easy calendar get date time get year get month get day hour minute second
sets an hour
public void set display type string display type this display type display type
sets the display concept type table list or slide
public void set second int second this second second set date time get easy calendar get date time get year get month get day hour minute second
sets a second
public date get date int year int month int day short lived calendar just for this conversion gregorian calendar calendar new gregorian calendar calendar set calendar year year calendar set calendar month month 1 months start with 0 calendar set calendar day of month day date date calendar get time return date
gets a date from year month and day numbers
public void set hour string string hour string integer hour integer transformer integer hour string set hour hour integer int value
sets an hour string
public string get hour string return new integer hour to string
gets an hour string
public date get date string year string string month string string day string date date null integer year integer transformer integer year string integer month integer transformer integer month string integer day integer transformer integer day string if year integer null month integer null day integer null int year year integer int value int month month integer int value int day day integer int value date get date year month day return date
gets a date from year month and day strings
public string get minute string return new integer minute to string
gets a minute string
public void set second string string second string integer second integer transformer integer second string set day second integer int value
sets a second string
public string get display type if display type null if is extension is display return table return display type
gets the display concept type table list or slide
public string get second string return new integer second to string
gets a second string
public string get year string date date string date text get date string date string year text date text substring 0 4 return year text
gets a year string
public int compare object object1 object object2 if object1 instanceof easy date time object2 instanceof easy date time easy date time easy date time1 easy date time object1 easy date time easy date time2 easy date time object2 if easy date time1 is equal to easy date time2 return 0 if easy date time1 is greater than easy date time2 return 1 return 1 return 0
compares two easy date times
public string get month string date date string date text get date string date string month text date text substring 5 7 return month text
gets a month string
public boolean equals object value if value instanceof easy date time easy date time easy date time easy date time value return this is equal to easy date time else if value instanceof date date date date value easy date time easy date time new easy date time date return this is equal to easy date time return false
checks if two easy date times are equal
public void add t entity index combination ix entity get index combination list t index list ix index map get ix if index list null index list new array list t index list add entity ix index map put ix index list else index list add entity
adds an entity
public string get hour string date date string date time text get date time string date string hour text date time text substring 11 13 return hour text
gets an hour string
public void remove t entity index combination ix entity get index combination list t index list ix index map get ix if index list null index list remove entity
removes an entity
public void empty ix index map new hash map index combination list t
empties the index
public int size return ix index map size
returns the index size
public void add action action if actions contains action remove right of cursor actions add action move cursor forward
adds an action
public void empty cursor 0 actions remove all actions fire no history
empties the history of actions
public boolean undo boolean undone false if actions size 0 move cursor backward action action action actions get cursor try if action get status equals executed action undo action set status undone undone true catch action exception e log error error in history undo e get message return undone
undos the current action
public string get second string date date string date time text get date time string date string second text date time text substring 16 18 return second text
gets a second string
public void add history observer ihistory observer history observer if history observers contains history observer history observers add history observer
adds a history observer
public void remove history observer ihistory observer history observer if history observers contains history observer history observers remove history observer
removes a history observer
private void remove right of cursor for int i actions size 1 i cursor i actions remove i
removes actions right of the action cursor
public int get year date date string year text get year string date integer year integer transformer integer year text return year integer int value
gets a year
private void move cursor forward cursor fire yes history
moves the action cursor forward
private void move cursor backward if cursor 0 return if cursor 0 fire no history
moves the action cursor backward
private void fire no history collection observers synchronized this observers collection history observers clone for object observer observers ihistory observer history observer ihistory observer observer history observer no history
informs observers that there is no history of actions
private void fire yes history collection observers synchronized this observers collection history observers clone for object observer observers ihistory observer history observer ihistory observer observer history observer yes history
informs observers that there is history of actions
public int get month date date string month text get month string date integer month integer transformer integer month text return month integer int value
gets a month
public boolean execute throws action exception string error execute is not supported on an entity throw new action exception error this
executes the action
public boolean undo throws action exception string error undo is not supported on an entity throw new action exception error this
undos the action
public boolean is executed if get status equals executed return true return false
checks if the action is undone
public boolean is undone if get status equals undone return true return false
checks if the action is undone
public boolean execute throws action exception boolean executed false if get session null get transaction null string error action must be within a session or within a transaction throw new action exception error this if get name equals add executed get entities add update entity else if get name equals remove executed get entities remove entity else if get name equals update executed get entities update entity update entity if executed set status executed if get transaction null model domain model model get session get model domain model notify observers this return executed
executes the action
public boolean is add boolean result true if add null if add trim equals ignore case false result false return result
checks if the concept entity is allowed to be added
public boolean undo throws action exception boolean undone false if is executed string error an action must be executed first throw new action exception error this if get name equals add undone get entities remove update entity else if get name equals remove undone get entities add entity else if get name equals update undone get entities update update entity entity if undone set status undone if get transaction null model domain model model get session get model domain model notify observers this return undone
undos the action
public int get second date date string second text get second string date integer second integer transformer integer second text return second integer int value
gets a second
public ihistory get history return actions
gets the transaction history
public boolean execute throws action exception model model model get session get model if model is session string error the domain model is not configured for transactions throw new action exception error this else if get session null string error transaction must be within a session throw new action exception error this boolean executed actions execute all if executed set status executed model notify observers this else actions undo all return executed
executes the transaction
public boolean undo throws action exception if is executed string error a transaction must be executed first throw new action exception error this boolean undone actions undo all if undone set status undone model model model get session get model model notify observers this else actions execute all return undone
undos the transaction
public int get last day int year int month gregorian calendar calendar new gregorian calendar calendar set calendar year year calendar set calendar month month 1 months start with 0 int day calendar get actual maximum calendar day of month return day
gets the last day in year month
public date get current date int year this get current year int month this get current month int day this get current day return get date year month day
gets the current date
public date get current date time int year this get current year int month this get current month int day this get current day int hour this get current hour int minute this get current minute int second this get current second return get date time year month day hour minute second
gets the current date time
public string get current date string date date get current date return get date string date
gets the current date string
public string get current date time string date date get current date time return get date time string date
gets the current date time string
public int get current year int year gregorian calendar get calendar year return year
gets the current year
public string get current year string int year get current year return year
gets the current year string
public int get current month int month gregorian calendar get calendar month return month 1
gets the current month
public string get current month string int month get current month return month
gets the current month string
public int get current day int day gregorian calendar get calendar day of month return day
gets the current day
public string get current day string int day get current day return day
gets the current day string
public boolean is remove boolean result true if remove null if remove trim equals ignore case false result false return result
checks if the concept entity is allowed to be removed
public int get current hour int hour gregorian calendar get calendar hour return hour
gets the current hour
public string get current hour string int hour get current hour return hour
gets the current hour string
public int get current minute int minute gregorian calendar get calendar minute return minute
gets the current minute
public string get current minute string int minute get current minute return minute
gets the current minute string
public int get current second int second gregorian calendar get calendar second return second
gets the current second
public string get current second string int second get current second return second
gets the current second string
public ientity create entity ientity entity throws meta exception concept config concept config entity get concept config string entity class name concept config get entity class ientity created entity create entity entity class name if created entity null string model code model get model config get code string error error in model meta create entity ientity model code entity class name throw new meta exception error set parents created entity entity return created entity
creates an entity given another entity
public int compare ientity entity1 ientity entity2 int result 0 object property1 entity1 get property property code object property2 entity2 get property property code if property1 null property2 null if comparator null if property1 instanceof comparable result comparable property1 compare to property2 else if property2 instanceof comparable result comparable property2 compare to property1 else string string1 string value of property1 string string2 string value of property2 result string1 compare to string2 else result comparator compare property1 property2 return result
compares two entities by comparing the entity properties
private void create persistent models throws persistency exception persistent models new persistent models list imodel model list domain get models get list for imodel model model list ipersistent model persistent model create persistent model model if persistent model null persistent models add persistent model else throw new persistency exception model get model config get code persistent model could not be created
creates persistent models
public void load throws persistency exception persistent models load
loads the persistent domain
public void save throws persistency exception persistent models save
saves the persistent domain
public void close persistent models close domain close
closes the persistent domain
public ipersistent model get persistent model return store entities get persistent model
gets the persistent model
public ientities get entities return store entities get entities
gets the entities
public void load throws persistency exception store entities load
loads the entities
public void save throws persistency exception store entities save
saves the entities
public ientity create entity ientities entities throws meta exception concept config concept config entities get concept config string entity class name concept config get entity class ientity created entity create entity entity class name if created entity null string model code model get model config get code string error error in model meta create entity ientities model code entity class name throw new meta exception error set parents created entity entities return created entity
creates an entity given other entities
public void load throws persistency exception for ipersistent model persistent model persistent models if persistent model get model get model config is default load save persistent model load
loads the persistent models if they are not configured for the default
public void save throws persistency exception for ipersistent model persistent model persistent models if persistent model get model get model config is default load save persistent model save
saves the persistent models if they are not configured for the default
public void close for ipersistent model persistent model persistent models persistent model close
closes the persistent models
public ipersistent model get persistent model return persistent model
gets the persistent model
public ientities get entities return entities
gets the entities
public void load throws persistency exception db4o model set loaded true
loads the entities
public void save throws persistency exception try object container db db4o model get db db set this db commit catch exception e log error error in db4o entities save e get message throw new persistency exception e get message
saves the entities
public object container get db return db
gets the database
public void load throws persistency exception set loaded true
loads the domain model from db4o
public void save throws persistency exception db set this db commit
saves the domain model to db4o
public void close db close super close
closes the database
public ipersistent entity get store entity return store entity
gets a persistent store entity
public ipersistent model get persistent model return store entity get persistent model
gets the persistent model
public ientity get entity return store entity get entity
gets the entity