input
stringlengths
10
828
output
stringlengths
5
107
private boolean equals string first string second return first null second null first equals second first second
compares two strings and returns code true code if they are equal
public string get login return f login
returns the login
public string get password return f password
returns the password
public credential info get credentials site url url string path get path url credential info result f map get nearest value path return result
returns credentials corresponding to the given url
private string get path site url url site url path new site url uri to path get path new uri url to string return path to string
returns the path corresponding to the given url
public void set credentials site url url credential info credentials string path get path url f map add path credentials
sets new credentials corresponding to the given url
public void add all iterable site url urls for site url url urls add url url
adds all urls from the specified list or collection to this queue
public void add url site url url if f queue contains url f processed contains url f queue add url
adds the given url to this queue
public void add url string url add url new site url url
adds the given url to this queue
public int get wait cycle counter return f wait cycle counter
returns the number of failed attempts to get an url from the queue
public site url peek return f queue peek
returns the next url to handle
public site url poll site url result f queue poll f processed add result return result
removes the url from the queue if any and returns it
public void reset wait cycle counter f wait cycle counter 0
this method resets the internal counter of failed attempts to get an url
public void print line println println
method print line
private void do init jsobject conf f config get config object string base url get base url f manifest url f extension object call init base url conf
calls the init method on the underlying manifest object with the
private void do load css jsarray styles f extension object get as object list styles int len styles null styles get length 0 if len 0 css loader loader new css loader string css urls get resolved urls styles loader load css urls
loads all css class files associated with this extension
protected string get base url uri manifest url uri base url manifest url get resolved this return base url to string
returns the base url for all extension files
protected string get manifest load url uri url return url to string
this method should be overloaded to define the full url of the extension
protected string get resolved url string url uri u new uri url uri result f manifest url get resolved u return result to string
this method resolves the given dependency or css url relative to the
public string get name return f config get name
returns the name of the extension
public void on module load new test on module load final formatter module module new formatter module history add value change handler new value change handler string public void on value change value change event string event try module reload window scroll to 0 0 catch exception e gwt log error e new history watchdog start
this is the entry point method
public boolean is immutable layout fixme immutable of layouts should be defined in an another way page link link get link new page link abc return link null link is empty
returns code true code if this layout is immutable ie it does not
private boolean is empty element e node child e get first child while child null if child get node type node text node return false text text child cast string str text get data if equals str trim return false child child get next sibling return true
returns true if the given element contains another elements or non empty
private boolean delete animal string name throws database exception database entry key new database entry key binding object to entry name key operation status status animal db delete null key return status operation status success
deletes an animal
private void print by index secondary database sec db throws database exception database entry sec key new database entry database entry pri key new database entry database entry pri data new database entry secondary cursor cursor sec db open secondary cursor null null try while cursor get next sec key pri key pri data null operation status success person person person binding entry to object pri data person name key binding entry to object pri key system out println index key key binding entry to object sec key maps to primary key person name finally cursor close
prints all person records by a given secondary index
private void print person string name throws database exception database entry key new database entry key binding object to entry name key database entry data new database entry operation status status person db get null key data null if status operation status success person person person binding entry to object data person name key binding entry to object key system out println person else system out println person not found name
gets a person by name and prints it
public void on module load new test on module load final formatter module module new formatter module history add value change handler new value change handler string public void on value change value change event string event try module reload catch exception e gwt log error e new history watchdog start
this is the entry point method
public t next return step false get object null
returns the next object
private boolean step boolean result if f done f object shift item f done result return f object null
go to the next node
private void add slot slot slot if slot has next int pos collections binary search f list slot if pos 0 pos pos 1 f list add pos slot
adds a new slot to the internal list
protected void on new value slot slot
this method is called to notify that the given iterator just returned a
protected void on repeated value slot slot
this method is called to notify that the given iterator just returned the
public int read byte buffer throws ioexception return read buffer 0 buffer length
reads bytes from this stream into the byte array code buffer code
public void set iterators collection iterator t iterators f list clear for iterator t iterator iterators slot slot new slot iterator add slot slot
sets the iterators of objects used as sources of iterated entries
public void set iterators iterable t iterables f list clear for iterable t i iterables slot slot new slot i iterator add slot slot
sets the iterators of objects used as sources of iterated entries
public int skip bytes int count throws ioexception if count 0 long current pos get pointer eof length int new count int current pos count eof eof current pos count seek current pos new count return new count return 0
skips code count code number of bytes in this stream
public void set iterators iterator t iterators f list clear for iterator t iterator iterators slot slot new slot iterator add slot slot
sets the iterators of objects used as sources of iterated entries
public void write int one byte throws ioexception byte bytes new byte 1 bytes 0 byte one byte 0xff write bytes 0 1
writes the specified byte code one byte code to this stream starting at
private void flush block throws ioexception if f is modified long length length write block length f block position f block write length f length f is modified false
flushs the currently loaded block if it was modified
public void flush block throws ioexception if f is modified int block size f block get block size long block position f block id block size long len get length f block manager write block block position f block len f is modified false
flushs the currently loaded block if it was modified
private void load block boolean expand throws ioexception long length length long block id f pointer f empty block length long block number length f empty block length 1 f empty block length if f block position 0 block id f block position f empty block length flush block if block id block number read block length block id f empty block length f block if expand while block id block number write block length block number f empty block length f empty block block number f block position block id f empty block length
tries to set the given position and returns a really setted position
public int skip bytes int count throws ioexception if count 0 long current pos get pointer eof get length int new count int current pos count eof eof current pos count seek current pos new count return new count return 0
skips code count code number of bytes in this stream
private void load block throws ioexception long length get length long block id f pointer f block size long block number length f block size 1 f block size if f block position 0 block id f block position f block size if block id block number f reader read block block id f block size f block f block position block id f block size
tries to set the given position and returns a really setted position
private void flush block throws ioexception if f is modified long length length f block manager write length f block position f block f is modified false
flushs the currently loaded block if it was modified
private void load block boolean expand throws ioexception long length length int block len f block get length long block id f pointer block len long block number length block len 1 block len if f block position 0 block id f block position block len flush block if block id block number f block manager read block id block len f block if expand if block id block number f block clear f block position block id block len
tries to set the given position and returns a really setted position
protected void on activate
this method is called to notify that the screen is activated
protected void on update
this method is called to notify that the screen is updated
protected void begin load java script object window java script object doc
this method could be overloaded in subclasses to perform some specific
protected void end load java script object window java script object doc
this method could be overloaded in subclasses to perform some specific
private void check activation if f success list null throw new runtime exception the barrieer is already activated
checks that this barrier was not activated yet that the
private void check end if f success list size f failure list size len on finish f success list f failure list
this method checks if all loaders finish their work and if so
protected request builder new request return new request builder request builder get f url
returns a new http request object
protected void on load window alert wtf
this method is called when all scripts are loaded
public throwable get exception return f exception
returns a wrapped exception error
public request get request return f request
returns the http request corresponding to this exception
public response get response return f response
returns the http response corresponding to this exception
public void parse input stream input throws exception parse new input stream reader input utf 8
this method parse the given input stream as the xml stream
public void parse reader reader throws exception saxparser factory factory saxparser factory new instance input source source new input source reader saxparser sax parser factory new saxparser sax parser parse source f xml handler
this method parse the given input and uses this class as the default
public void parse resource string resource name throws exception class loader class loader get class get class loader parse resource class loader resource name
this methods loads a resource with the given resource name and tries to
public void close throws exception for object service tracker tracker f trackers tracker close
closes all underlying trackers
public void open throws exception for object service tracker tracker f trackers tracker open
opens all underlying trackers
protected boolean check properties modifications dictionary properties return f properties null f properties equals properties
this method checks that the specified properties were modified and that
public void close throws exception f tracker close dec
closes the underlying tracker
protected void dec throws exception boolean dec false synchronized this dec f counter f min cardinality f counter if dec dec reference
decrements the internal counter and if this counter equals to the
protected void inc throws exception boolean inc false synchronized this f counter inc f counter f min cardinality if inc inc reference
increments the internal counter and if this counter equals to the
public void open throws exception inc f tracker open
opens the underlying tracker
private boolean add object service method method if method get annotation osgiservice class null return false class params method get parameter types if params length 1 throw new illegal argument exception the service method method get name can not have arguments else if params length 1 dictionary class is assignable from params 0 throw new illegal argument exception bad service parameters in the method method get name dictionary class get name is expected f object service getters add method return true
checks if the given method is getter method returning a service exposed
private object call method method object params throws exception if method null return method invoke f object params return null
tries to call the given method with specified parameters
public void close throws exception if f trackers is empty dec reference else for track helper tracker f trackers tracker close
closes this tracker
private void dec reference throws exception if f counter f trackers size for service registration r f service registrations r unregister f service registrations clear for method deactivator f object deactivators call deactivator if f counter 0 f counter
decrements the number of available services
public void open throws exception if f trackers is empty inc reference else for track helper tracker f trackers tracker open
opens all underlying trackers
private void append authority string buffer buf if f user info null buf append f user info buf append if f host null buf append f host if f port 0 buf append buf append f port
appends authority information to the given buffer string
public t append full path abstract path path if path null return cast t result get clone result f path segments add all path f path segments result f path trailing separator path f path trailing separator if path instanceof abstract uri abstract uri uri abstract uri path result set internal query list uri f query result f fragment uri f fragment return result check clone path
returns a copy of this path with appended full path local path queries
public string add string prefix t value prefix get canonical path prefix int pos find prefix if pos 0 pos pos 1 slot t slot new slot t prefix value f list add pos slot return prefix
adds a new path with the corresponding logical prefix
public boolean exists string path path get canonical path path int pos find path return pos 0
returns code true code if the given path is regestered
public t append full path string path t result append full path path decode path return result
returns a copy of this path with appended full path local path queries
public string get canonical path string path character delimiter get segment delimiter if path null return get empty path if path starts with string value of delimiter path delimiter path if path ends with string value of delimiter path delimiter return path
returns the canonical form of the given path
protected string get empty path return get segment delimiter
returns the empty path
public t get exact value string path entry string t entry get exact entry path return entry null entry get value null
returns a value corresponding to the specified path
public string get nearest path string path map entry string t result get nearest entry path return result null result get key get empty path
returns a registered path prefix nearest to the given path
public t append full path string path boolean decode if path null return cast t result get clone parse path path result decode false result f path segments add all 0 f path segments result f path absolute f path absolute result set internal query list null result f fragment null return result check clone path
returns a copy of this path with appended full path local path queries
protected character get segment delimiter return
returns a path segment delimiter
public t append scheme segments string segments boolean begin t uri get clone list string old segments uri f scheme segments uri f scheme segments new array list string parse scheme uri segments if begin uri f scheme segments add all old segments else uri f scheme segments add all 0 old segments return uri
returns a copy of this uri with added scheme segments
public t append scheme segments string segments boolean begin t uri get clone int pos begin 0 f scheme segments size for string segment segments uri f scheme segments add pos segment pos return uri
returns a copy of this uri with added scheme segments
public t append path string path t result append path path false decode path return result check clone path
returns a copy of this path with appended path segments
public t append path string path boolean begin return append path path begin true
returns a copy of this path with appended given segments
public string get full path return get full path encode path
returns a full path containing query string and fragment
public t append path string segments boolean begin boolean decode if segments null return cast t result get clone list string old segments result f path segments result f path segments new array list string parse path segments result decode false if begin result f path segments add all old segments else if old segments is empty result f path absolute f path absolute result f path segments add all 0 old segments return result check clone path
returns a copy of this path with appended given segments
public string get full path boolean encode return get full path true encode
returns a full path containing query string and fragment
public string get full path boolean escape boolean encode string buffer buf new string buffer append full path buf escape encode return buf to string
returns a full path containing query string and fragment
public t get full path as uri t uri get clone uri f scheme segments clear uri f user info null uri f host null uri f port 0 return uri
returns a full path containing query string and fragment
public t append path segments abstract path path boolean begin t result get clone int pos begin 0 result f path segments size result f path segments add all pos path f path segments return result check clone path
returns a copy of this path with appended or prepended path segments
public t append path segments boolean begin string segments t result get clone int pos begin 0 result f path segments size for string segment segments result f path segments add pos segment pos return result check clone path
returns a copy of this path with appended path segments
public t append path segments string segments return append path segments false segments
returns a copy of this path with appended path segments
public t append path segments string segments boolean begin return append path segments begin decode path
returns a copy of this path with appended segments
protected boolean equals string first string second return first null second null first second first equals second
compares the given parameters and returns code true code if they are
public string get scheme int count if f scheme segments is empty return null int size f scheme segments size count math min count size if count 0 count size string buffer buf new string buffer for int i 0 i count i string segment f scheme segments get i if i 0 buf append if segment null buf append segment return buf to string
returns the specified number of scheme segments serialized as a string
public string get directory return get directory encode path
returns the path without file name
public string get scheme segment int pos if pos 0 pos f scheme segments size return null return f scheme segments get pos
returns a scheme segment from the given position
public string get directory boolean escape segments return get directory escape segments true
returns the path without file name