input
stringlengths
10
828
output
stringlengths
5
107
public boolean is bulk load return bulk load
returns the bulk load
public int get nr of instances return nr of instances
returns the nr of instances to be inserted
private write pool thread create new write thread final thread group tg final boolean daemon thread final dbconnector db connector if db connector null log the fact that an empty dbconnector exists return null else return new write pool thread tg this daemon thread db connector
this method is called when a new write thread needs to be created
protected pool thread create new thread final thread group tg final boolean daemon thread final dbconnector db connector if db connector null return new pool thread tg this daemon thread else return new pool thread tg this daemon thread db connector
this method is called when a new thread needs to be created
public object get by key string key name object key value if this key name null if key name null throw new no index exception else if this key name equals key name throw new no index exception return map get key value
to be consistent with the documentation for query interface
public boolean handle return false default implementation do nothing
this method is called by play method for each part of blob
public object get object key entry e get entry key return e null persistent string get value e value null
returns the value to which this map maps the specified key
public void clear mod count root clear count 0
removes all mappings from this map
public set key set if key set null key set new abstract set public iterator iterator return new iterator private iterator i entry set iterator public boolean has next return i has next public object next return entry i next get key public void remove i remove public int size return persistent abstract map this size public boolean contains object k return persistent abstract map this contains key k return key set
returns a set view of the keys contained in this map
public set key set if key set null key set new abstract set public iterator iterator return get hash iterator keys public int size return count public boolean contains object o return contains key o public boolean remove object o int old size count persistent hash map this remove o return count old size public void clear persistent hash map this clear return key set
returns a set view of the keys contained in this map
public collection values if values null values new abstract collection public iterator iterator return new iterator private iterator i entry set iterator public boolean has next return i has next public object next return entry i next get value public void remove i remove public int size return persistent abstract map this size public boolean contains object v return persistent abstract map this contains value v return values
returns a collection view of the values contained in this map
public collection values if values null values new abstract collection public iterator iterator return get hash iterator values public int size return count public boolean contains object o return contains value o public void clear persistent hash map this clear return values
returns a collection view of the values contained in this map
public persistent put string key persistent value return put new persistent string key value
associate object with string key
public set entry set if entry set null entry set new abstract set public iterator iterator return get hash iterator entries public boolean contains object o if o instanceof map entry return false entry e get entry map entry o get key return e null e equals o public boolean remove object o if o instanceof map entry return false object key map entry o get key entry e get entry key if e null e equals o remove key return true return false public int size return count public void clear persistent hash map this clear return entry set
returns a collection view of the mappings contained in this map
public object clone try persistent hash set new set persistent hash set super clone new set map persistent hash map map clone return new set catch clone not supported exception e throw new internal error
returns a shallow copy of this tt hash set tt instance the elements
public void ensure capacity int min capacity mod count int old capacity element data length if min capacity old capacity persistent old data element data int new capacity old capacity 3 2 1 if new capacity min capacity new capacity min capacity element data new persistent new capacity system arraycopy old data 0 element data 0 size
increases the capacity of this tt persistent array list tt instance if
public object clone try persistent array list v persistent array list super clone v element data new persistent size system arraycopy element data 0 v element data 0 size v mod count 0 return v catch clone not supported exception e this shouldn t happen since we are cloneable throw new internal error
returns a shallow copy of this tt persistent array list tt instance
public object set int index object element range check index object old value element data index element data index persistent element return old value
replaces the element at the specified position in this list with
public boolean add object o ensure capacity size 1 increments mod count element data size persistent o return true
appends the specified element to the end of this list
public void add int index object element if index size index 0 throw new index out of bounds exception index index size size ensure capacity size 1 increments mod count system arraycopy element data index element data index 1 size index element data index persistent element size
inserts the specified element at the specified position in this
public boolean add all collection c mod count int num new c size ensure capacity size num new iterator e c iterator for int i 0 i num new i element data size persistent e next return num new 0
appends all of the elements in the specified collection to the end of
public boolean add all int index collection c if index size index 0 throw new index out of bounds exception index index size size int num new c size ensure capacity size num new increments mod count int num moved size index if num moved 0 system arraycopy element data index element data index num new num moved iterator e c iterator for int i 0 i num new i element data index persistent e next size num new return num new 0
inserts all of the elements in the specified collection into this
public void remove range int from index int to index mod count int num moved size to index system arraycopy element data to index element data from index num moved let gc do its work int new size size to index from index while size new size element data size null
removes from this list all of the elements whose index is between
public object get object key entry p get entry key return p null null persistent string get value p value
returns the value to which this map maps the specified key
public object first key return first null persistent string get value first key null
returns the first lowest key currently in this sorted map
public object last key return last null persistent string get value last key null
returns the last highest key currently in this sorted map
private entry get ceil entry object key return root null root find this height key null
gets the entry corresponding to the specified key if no such entry
private entry get preceding entry object key if root null entry e root find this height key if e null if e prev null return e prev else return last return null
returns the entry for the greatest key less than the specified key if
public object put object key object value if key instanceof string key new persistent string string key if value instanceof string value new persistent string string value if root null entry e first last e new entry persistent key persistent value root new bpage e page size height 1 increment size return null else persistent result root insert this height persistent key persistent value if result instanceof bpage root new bpage root bpage result page size height 1 return null return persistent string get value result
associates the specified value with the specified key in this map
public object remove object key if root null return null else persistent result root remove this height key if root m page size 1 if height 0 root null else root bpage root e page size 1 return persistent string get value result
removes the mapping for this key from this tree map if present
public void clear mod count size 0 root null height 0 first last null
removes all mappings from this tree map
public object clone persistent tree map clone null try clone persistent tree map super clone catch clone not supported exception e throw new internal error put clone into virgin state except for comparator clone root null clone size 0 clone height 0 clone first null clone last null clone mod count 0 clone key set clone entry set null clone values null initialize clone with our mappings clone put all this return clone
returns a shallow copy of this tt tree map tt instance
public set key set if key set null key set new abstract set public java util iterator iterator return new iterator keys public int size return persistent tree map this size public boolean contains object o return contains key o public boolean remove object o int old size size persistent tree map this remove o return size old size public void clear persistent tree map this clear return key set
returns a set view of the keys contained in this map
public collection values if values null values new persistent abstract collection public java util iterator iterator return new iterator values public int size return persistent tree map this size public boolean contains object o for entry e first e null e e next if val equals e value o return true return false public boolean remove object o for entry e first e null e e next if val equals e value o delete entry e return true return false public void clear persistent tree map this clear return values
returns a collection view of the values contained in this map
public iterator iterator if key set null key set m key set return key set iterator
returns an iterator over the elements in this set
public boolean add object o return m put o o null
adds the specified element to this set if it is not already present
public boolean remove object o return m remove o null
removes the given element from this set if it is present
public sorted set sub set object from element object to element return new persistent tree set m sub map from element to element
returns a view of the portion of this set whose elements range from
public sorted set head set object to element return new persistent tree set m head map to element
returns a view of the portion of this set whose elements are strictly
public sorted set tail set object from element return new persistent tree set m tail map from element
returns a view of the portion of this set whose elements are
public object clone persistent tree set clone null try clone persistent tree set super clone catch clone not supported exception e throw new internal error clone m new persistent tree map m clone key set clone m key set return clone
returns a shallow copy of this tt tree set tt instance
public void put spatial object obj if root null root new rtree page obj height 1 else rtree page p root insert obj height if p null root new rtree page root p height 1 n 1 update counter 1
put new spatial object in the index
public rectangle get wrapping rectangle if root null return root get rectangle return null
get wrapping rectangle
public void clear if root null root purge height root null height 0 n 0 update counter 1
remove all objects from the index
public iterator iterator return iterator get wrapping rectangle
get iterator through all members of the index
protected void rehash int old capacity table length hash table entry old table table int new capacity old capacity 2 1 hash table entry new table new hash table entry new capacity threshold int new capacity load factor table new table for int i old capacity i 0 for hash table entry old old table i old null hash table entry e old old old next int index e hash 0x7 fffffff new capacity e next new table index new table index e
rehashes the contents of the hash table into a hash table with a
public void set package final string package m package package
the package option advises the mop compiler what
public void set classes final file classes if classes exists throw new build exception classes file classes does not exist if classes is directory throw new build exception classes property classes should be a file not a directory m classes classes
the classes option sets the code classes code parameter to the goods
public void set srcdir final file src dir m src dir src dir if m src dir exists throw new build exception source directory m src dir does not exist if m src dir is file throw new build exception source directory m src dir is a file
sets the directory containing the source files to execute the mop compiler against
public void add classpath final path class path if m class path null m class path class path else m class path append class path
sets the classpath of libraries to include in the mop exercies
public void set classpath final path class path if m class path null m class path class path else m class path append class path
sets the classpath of libraries to include in the mop exercies
public path get classpath return m class path
sets the classpath of libraries to include in the mop exercies
public path create classpath if m class path null m class path new path project return m class path create path
sets the classpath of libraries to include in the mop exercies
public void set classpath ref final reference r create classpath set refid r
adds a reference to a classpath defined elsewhere
public void set goodshome final file goods home m goods home goods home if m goods home exists throw new build exception goods home directory m goods home does not exist if m goods home is file throw new build exception goods home directory m goods home is a file
the path where goods is installed on the system
public void end access persistent obj if obj state persistent transwrite persistent dirty persistent dirty cache manager mng cache manager get cache manager mng add to transaction obj obj state persistent optimistic
code end access code adds the object to the cache managers transaction
public int get oid return opid
get the dabase assigned id of the object
public void begin read access persistent obj if obj state persistent slocked persistent xlocked 0 obj storage lock obj protocol lck shared protocol lckattr wait obj state persistent slocked
code begin read access code locks the object in shared mode
protected void destroy object persistent obj if obj state persistent destructed 0 try field descriptor fd for fd obj desc ref fields fd null fd fd next ref fd field set obj null catch exception x throw new error x get message obj state persistent destructed persistent raw obj storage throw object obj
destoroy all object references to make it possible to provide
public void begin write access persistent obj if obj state persistent xlocked 0 obj storage lock obj protocol lck exclusive protocol lckattr wait obj state persistent xlocked
code begin write access code locks the object
public long get size int sid return storages sid get size
get size of the database file of the storage
public void set alloc buffer size int size alloc buf size size
set buffer size for bulk alloc
public persistent get object string oid try int id integer parse int oid return get object 0 id catch exception e return null
parse oid into number and get that id from the first storage
public persistent get object int storage id int oid return storages storage id get object oid
get object from the storage by oid
public void detach thread thread if thread instanceof pthread pthread thread set context null else cache manager hash remove thread
code detach code the given thread
synchronized public void clear entry tab table for int index tab length index 0 tab index null count 0
clears this hashtable so that it contains no keys
protected void rehash int old capacity table length identity hashtable entry old table table int new capacity old capacity 2 1 identity hashtable entry new table new identity hashtable entry new capacity threshold int new capacity load factor table new table for int i old capacity i 0 for identity hashtable entry old old table i old null identity hashtable entry e old old old next int index system identity hash code e key 0x7 fffffff new capacity e next new table index new table index e
rehashes the contents of the identity hashtable into a identity hashtable
private method method exists class target class end string method name try for method method this find methods in hierarchy target end if method get name equals method name return method return null catch exception e return null
check to see if the method exists somewhere in class hierarchy
public void start node node node if start element node get node name if node get attributes null for int i 0 i node get attributes get length i node attribute node get attributes item i set attribute attribute get node name attribute get node value inline traversal of the tree node list children node get child nodes gwt log children found children get length null if children null for int i 0 i children get length i start node children item i now go back end node node
client side code for code default parser
public void end node node node int n path size if n 1 path null else path remove n 1 element path get n 2 level
client side code for code default parser
public int get element count return elements size
returns the number of elements in this container
public element get element int n return elements get n
gets the n sup th sup element in this container
public element add element child return add child 1
adds the specified element to this container at the end of the element
public element add element element int index if element parent null element parent remove element if index 1 elements add element else elements add index element element parent this if gwt is client element added element return element
adds the specified element to this container at the specified index in the
public element remove int index element element element elements get index element parent null elements remove index if gwt is client element removed element return element
removes the element at the specified index from this container
public element remove element element return remove elements index of element
removes the specified element from this container
public void remove all for iterator element iter elements iterator iter has next element element iter next element parent null iter remove element removed element
removes all elements from this container
public void on module load application launch this application constants gwt create xulconstants class application image bundle gwt create xulimage bundle class
this is the entry point method
private void assert camel case string name assert name contains the style name name should be in camel case format
assert that the specified property does not contain a hyphen
public void create data base throws ioexception boolean db exist check data base if db exist do nothing database already exist else by calling this method and empty database will be created into the default system path of your application so we are gonna be able to overwrite that database with our database this get readable database try copy data base catch ioexception e throw new error error copying database
creates a empty database on the system and rewrites it with your own
private boolean check data base sqlite database check db null try string my path db path db name check db sqlite database open database my path null sqlite database open readonly catch sqlite exception e database does t exist yet if check db null check db close return check db null true false
check if the database already exist to avoid re copying the file each
private void copy data base throws ioexception open your local db as the input stream input stream my input my context get assets open db name path to the just created empty db string out file name db path db name open the empty db as the output stream output stream my output new file output stream out file name transfer bytes from the inputfile to the outputfile byte buffer new byte 1024 int length while length my input read buffer 0 my output write buffer 0 length close the streams my output flush my output close my input close
copies your database from your local assets folder to the just created
public notes db adapter open throws sqlexception m db helper new database helper m ctx m db m db helper get writable database return this
open the notes database
public long create note string zipcode string sfcode string dqcode string qxcode string zipname content values initial values new content values initial values put key zipcode zipcode initial values put key sfcode sfcode initial values put key dqcode dqcode initial values put key qxcode qxcode initial values put key zipname zipname return m db insert database table null initial values sql doesn t allow inserting a completely empty row so if initial values is empty this column will explicitly be assigned a null value
create a new note using the title and body provided
public boolean delete note long row id return m db delete database table key zipcode row id null 0
delete the note with the given row id
public cursor fetch all notes return m db query database table new string key zipcode key sfcode key dqcode key qxcode key zipname null null null null null query string table string columns string selection string selection args string group by string having string order by
return a cursor over the list of all notes in the database
public cursor fetch note string zipcode throws sqlexception cursor m cursor m db query true database table new string key zipcode key sfcode key dqcode key qxcode key zipname key zipcode zipcode null null null null null query boolean distinct string table string columns string selection string selection args string group by string having string order by string limit if m cursor null m cursor move to first move the cursor to the first row return m cursor
return a cursor positioned at the note that matches the given row id
public boolean update note string zipcode string sfcode string dqcode string qxcode string zipname content values args new content values args put key sfcode sfcode args put key dqcode dqcode args put key qxcode qxcode args put key zipname zipname return m db update database table args key zipcode zipcode null 0
update the note using the details provided
public void add contact listener contact listener listener if listener null return if contact listeners contains listener contact listeners add listener
registers a contact listener with this contact manager
public void remove contact listener contact listener listener if listener null return contact listeners remove listener
removes a contact listener from this contact manager
public void invoke contact listeners for contact listener listener contact listeners listener contact list update received
fires process message event to message listeners
public void disconnect log debug msimconnection disconnect send logout true sesskey session key final is connected false reader thread null try input stream close catch ioexception e finally input stream null try output stream close catch ioexception e finally output stream null try socket close catch ioexception e finally socket null userid 1 session key 1 contact manager null
closes the connection by closing the stream to my space img server
public void add message listener message listener listener if listener null return if message listeners contains listener message listeners add listener
registers a message listener with this connection
public void remove message listener message listener listener if listener null return message listeners remove listener
removes a message listener from this connection
public void invoke message listener instant message message for message listener listener message listeners listener process incoming message message
fires process message event to message listeners
public void invoke message listener status message message for message listener listener message listeners listener process incoming message message
fires process message event to message listeners
public void invoke message listener action message message for message listener listener message listeners listener process incoming message message
fires process message event to message listeners
public void invoke message listener media message message for message listener listener message listeners listener process incoming message message
fires process message event to message listeners
public void invoke message listener profile message message for message listener listener message listeners listener process incoming message message
fires process message event to message listeners
public void invoke message listener error message message for message listener listener message listeners listener process incoming message message
fires process message event to message listeners