input
stringlengths
10
828
output
stringlengths
5
107
public tssearch results get music results return music results
get music category torrent search results
public tssearch results get pictures results return pictures results
get pictures category torrent search results
public tssearch results get software results return software results
get pictures category torrent search results
public tssearch results get tvresults return tv results
get tv category torrent search results
public tssearch results get other results return other results
get category torrent search results that dont fall into any of the
public int get all results count return all results size
get the torrent search results count
private void init plugin view model plugin interface pi final basic plugin view model view model pi get uimanager create basic plugin view model torrent search log view model get activity set visible false view model get progress set visible false view model attach logger channel logger channel
initialize the plugin view model
public void set page link url page link this page link page link
set the url web page link for this torrent search item
private date extract first torrent date matcher m simple date format sdf new simple date format mmm dd yyyy date date null debug match count 0 if m find debug re parsers show regular expression match m try date sdf parse m group 1 catch parse exception e e print stack trace return date
extract the date of the first torrent item
private string get category string category string cat category to lower case if cat contains isohunt category audio return tsconstants category music else if cat contains isohunt category apps return tsconstants category software else if cat contains isohunt category pics return tsconstants category pictures else return cat
get the general category for the given sumo torrent category designation
public void set download link url download link this download link download link
set the url for the
private int get swtsort direction for sort order tssort order sort order if sort order tssort order ascending return swt up else if sort order tssort order descending return swt down else return swt none never reached
get the swt sort direction corresponding to the specified sort order
public void set size float size string size unit this size size this size unit size unit if size unit equals size kb size in bytes size kb factor else if size unit equals size mb size in bytes size mb factor else if size unit equals size gb size in bytes size gb factor else if size unit equals size tb size in bytes size tb factor else this size in bytes size
set the size for this torrent search item
private int get column index tssort field sort field switch sort field case date return tsview date column idx case name return tsview name column idx case size return tsview size column idx case seeds return tsview seeds column idx case peers return tsview peers column idx case engine return tsview engine column idx default return 1
gets the index of the table column for the specified sort field
private string get category string category string cat category to lower case if cat contains demonoid category application return tsconstants category software else return cat
get the general category for the given demonoid category designation
public void set seeds int seeds this seeds seeds
set the number of seeds for this torrent search item
private string get category string category string cat category to lower case if cat contains piratebay category application return tsconstants category software else return cat
get the general category for the given pirate bay category designation
private void reset table table table table set sort column table get column tsview seeds column idx table set sort direction swt down table remove all
resets the specified table
public void set peers int peers this peers peers
set the number of peers for this torrent search item
private int reverse sort direction int sort direction if sort direction swt up return swt down else if sort direction swt down return swt up else return swt none
get the reverse sort direction of the sort direction specified
public url get page link return page link
get the url web page for the torrent search item
public url get download link return download link
get the url for the
public float get size in bytes return size in bytes
get the size in bytes of the torrent search item
public string get size unit return size unit
get the size unit of the torrent search item
public int get peers return peers
get the number of peers for the torrent search item
public int get seeds return seeds
get the number of seeds for the torrent search item
private tssearch item get search item at index table table int index tssearch results search results this get search results for table table return search results element at index
get the search item at the specified index in the table
public void set controller tscontroller controller ts controller controller
sets the controller responder to user level interface events
private void create ts search composite grid layout grid layout new grid layout grid layout num columns 1 grid layout margin height 0 grid layout vertical spacing 0 ts search composite new composite ts tab folder swt none ts search composite set layout grid layout create ts search text button composite create ts message version composite create ts category ctab folder
this method initializes ts search composite
private void create ts engines composite grid layout grid layout2 new grid layout ts engines composite new composite ts tab folder swt none ts engines composite set layout grid layout2 create ts active engines group create ts engine options group
this method initializes ts engines composite
public table get all table return ts category all table
get the table holding all torrent search results
public table get books table return ts category books table
get the table holding only book torrent search results
public table get games table return ts category games table
get the table holding only game torrent search results
public table get movies table return ts category movies table
get the table holding only movie torrent search results
public table get music table return ts category music table
get the table holding only music torrent search results
public table get pictures table return ts category pictures table
get the table holding only picture torrent search results
public table get software table return ts category software table
get the table holding only software torrent search results
public table get tvtable return ts category tvtable
get the table holding only tv torrent search results
public table get other table return ts category other table
get the table holding other torrent search results
private tree create tree jsonarray ja tree tree new tree tree item pitem tree add item root tree item item null int size ja size for int i 0 i size i jsonobject jo ja get i is object item pitem add item jo get n is string string value jsonvalue jv jo get p if i 0 item set html a href test a if jv null append child item item jv is array return the tree return tree
create a static tree with some data in it
private void initialize this set size 600 400 this set modal true this set default close operation window constants dispose on close this set content pane get jcontent pane
this method initializes this
private void initialize this set default close operation jframe exit on close toolkit tk toolkit get default toolkit dimension screen size tk get screen size int screen height screen size height int screen width screen size width this set location screen width 4 screen height 8
this method initializes this
private void shuffle long times int x 0 int y 0 for long t 0 true t x int math random 4 y int math random 4 if t times buttons 3 3 get label equals break swap x y
shuffle game field
public void action performed action event event int x 1 int y 1 for int j 0 j 4 j for int i 0 i 4 i if buttons i j event get source x i y j swap x y
action event handler
public int compare to object o1 string name1 package o1 get name return name compare to ignore case name1
required when implementing comparable
public file locate source file string class name if source dir null source dir exists nothing to do return null we first check if we are searching for inner classes int index class name index of if index 1 class name class name substring 0 index java factory trace factory trace reporting locating class name we check our cache file file search cache class name if file null we need to check the file system file search file system source dir class name return file
locates the given source file
private file search cache string class name factory trace factory trace reporting searching cache for int i 0 i cache size i string file string cache get i if file ends with class name factory trace factory trace reporting found in cache return new file file factory trace factory trace reporting nothing found return null
searches the cache for the given class name
private void cleanup output directory if output dir exists empty the output dir list children new array list children add output dir while children size 0 file file file children get 0 if file is directory file files file list files if files length 0 for int j 0 j files length j children add 0 files j continue file delete children remove file re create output dir output dir mkdir
we cleanup the output directory if not empty
private void print file footer print stream out boolean signature if signature out println div class footer out println reports generated by a href http www cobertura4j2me org target blank cobertura for j2 me a version copyright version out println br out println date format get instance format new date time in millis out println div if copyright notice null out print br div class footer align center out print copyright notice out println div out println body out println html
prints out the footer of an html file
public void set keepdata boolean keep data this keep data keep data
allows user to specify wheather data currently in the data file should be
public void set devicepath string device path this device path device path
sets the data file path on device information
public void set format string format if format equals ignore case html format equals ignore case xml throw new build exception format must be either html or xml this format format
sets the format of the report
public void set title string title if title equals this title title
sets the report title
public void set logo string logo if logo equals this logo logo
sets the logo to use in the html report if any
public void set copyright string notice if notice equals this copyright notice notice
sets the copyright notice to add to the html report if any
public void set datafile path data file this data file data file to string
allows user to set the data file to use
private void add file to instrument string filename if base dir null files add new file filename else files add new file base dir filename
adds a file to instrument
private void instrument for int i 0 i files size i instrument file files get i
instruments the classes
private void generate device path file throws ioexception the path file should be in the same directory as midpcoverage data persistence string path org cobertura4j2me runtime midp file path dir new file destination directory path if path dir exists path dir mkdirs file path file new file path dir factory midp path file name file writer writer new file writer path file writer write device path writer close
generates the file containing the coverage data file path information
public coverage data new coverage data string class name return persistence new coverage data class name
creates a new coverage data instance for the given
public void add line int line number string method name string method descriptor if method name null method descriptor null throw new null pointer exception if line number 1 throw new illegal argument exception line information line information get line information line number if line information null line information new line information line number method name method descriptor lines put new integer line number line information else todo
adds a new line to the list of instrumented lines
public coverage data persistence get coverage data persistence return persistence
answers the coverage data persistence implementation associated
public void stop timer if timer null timer cancel timer null
stops the timer used to save coverage data
public double get branch coverage rate int branches get number of valid branches if branches 0 no conditional branches therefore 100 branch coverage return 1d return double get number of covered branches branches
answers the branch coverage rate for this class
public void set data file string path if path null throw new illegal argument exception invalid data file persistence set data file path
sets the data file path
public double get branch coverage rate string method name and descriptor if method name and descriptor null throw new null pointer exception int total 0 int hits 0 enumeration elements lines elements while elements has more elements line information next line information elements next element if next is conditional method name and descriptor equals next get method name next get method descriptor total if next get hits 0 hits return double hits total return double hits total
answers the branch coverage rate for a particular method
public int get hit count int line number integer line num new integer line number if lines contains key line num return 0 return line information lines get line num get hits
answers the number of hits a particular line of code has
private file get data file if data file path null return new file data file path else return new file system get property user dir default file name
answers the data file to use
public boolean is data complete return method name null method descriptor null
answers whether we have all the data necessary
protected void release stream throws ioexception nothing to do here
this method is invoked upon data saving loading completion and can be
public void merge line information line info if method name null method name line info method name if method descriptor null method descriptor line info method descriptor hits line info hits if is conditional is conditional line info is conditional
merges this line number with code line info code
public double get line coverage rate string method name and descriptor if method name and descriptor null throw new null pointer exception int total 0 int hits 0 enumeration elements lines elements while elements has more elements line information next line information elements next element if method name and descriptor equals next get method name next get method descriptor total if next get hits 0 hits return double hits total
answers the line coverage rate for the given method
private line information get line information int line number return line information lines get new integer line number
answers the information for the given line
public int get number of covered methods int num 0 enumeration enumeration get method names and descriptors while enumeration has more elements string method string enumeration next element if get line coverage rate method 0 num return num
answers the number of covered methods in the
public int get number of valid methods return new method enumeration get number of methods
answers the number of valid methods in the
public boolean is valid source line number int line number return lines contains key new integer line number
determines if a given line number is a valid line of code
public void mark line as conditional int line number line information line information get line information line number if line information null line information mark as conditional
marks the given line as conditional i
public void merge coverage data coverage data merge lines merge coverage data lines lines
merges some existing instrumentation with this instrumentation
private void merge hashtable src hashtable dest enumeration enumeration src keys while enumeration has more elements integer line number integer enumeration next element object line info dest get line number if line info null line information line info merge line information src get line number else dest put line number src get line number
copy data from code src code to code dest code
public void remove line int line number lines remove new integer line number
removes the given line number from this coverage data
public void touch int line number line information line information get line information line number we create a new line number if none if line information null this means that some instrumented code is running but the original data is not present so merging is needed line information new line information line number lines put new integer line number line information line information touch
increments the number of hits for a particular line of code
private void go new thread this start
the go method
public boolean is data complete enumeration enumeration lines keys while enumeration has more elements integer line number integer enumeration next element if line information lines get line number is data complete return false return true
answers whether we have all the data necessary
private void create composite before grid data grid data composite new grid data todo 2 values are because swt border adds those pixels in composite why grid data composite width hint before image get bounds width 2 grid data composite height hint before image get bounds height 2 composite before new composite s shell swt border composite before set layout new grid layout composite before set layout data grid data composite composite before set background image before image
this method initializes composite before
private void create composite after grid data grid data composite new grid data todo 2 values are because swt border adds those pixels in composite why grid data composite width hint after image get bounds width 2 grid data composite height hint after image get bounds height 2 composite after new composite s shell swt border composite after set layout new grid layout composite after set layout data grid data composite composite after set background image after image
this method initializes composite after
private void create sshell s shell new shell parent swt application modal swt dialog trim s shell set text messages get string photo browser window title s shell set layout new grid layout label before new label s shell swt none label before set text messages get string photo browser window label create composite buttons create composite bottom dispose the two created images on disposing this dialog s shell add dispose listener new dispose listener public void widget disposed dispose event e
this method initializes s shell
private buffered image resize image buffered image image int width int height int resize quality double ratio image utils get resizing ratio image width height affine transform tx new affine transform tx scale ratio ratio affine transform op op null switch resize quality case affine transform op type nearest neighbor op new affine transform op tx affine transform op type nearest neighbor break case affine transform op type bicubic op new affine transform op tx affine transform op type bicubic break default return null create the resized image return op filter image null
resize the given image to the desired width and height
private void create composite image grid data grid data composite new grid data todo 2 values are because swt border adds those pixels in composite why grid data composite width hint swt selected image get bounds width 2 grid data composite height hint swt selected image get bounds height 2 composite image new composite s shell swt border composite image set layout new grid layout composite image set layout data grid data composite composite image set background image swt selected image
this method initializes composite image
private void check image errors raster src raster dst in writable raster dst out if src get sample model get data type data buffer type int dst in get sample model get data type data buffer type int dst out get sample model get data type data buffer type int todo translation throw new illegal state exception source and destination must store pixels as int
check if the both images has the
public void paint graphics g graphics2 d g2d paint image g draw the rectangle around the image g2d set color border color g2d draw rect 0 0 get width 1 get height 1
every time a paint request is done
public general path open open the shell and wait to finish s shell open while s shell is disposed if s shell get display read and dispatch s shell get display sleep clear paths and image in awt dc gp lips null return the final result return lips path
makes the dialog visible and brings it to the front
public buffered image get sub image return sub image
returns the clipped image
private buffered image resize image buffered image image double width factor double height factor affine transform tx new affine transform use affine transform class to do the resizing tx scale width factor height factor affine transform op op new affine transform op tx affine transform op type bicubic return op filter image null
resize the given image to the desired width and height factors
public general path get small path general path general path return new general path general path create transformed shape transform to small path
converts a given path to its equivalent relative to the small
private void process hbar scroll bar h bar scroll composite get horizontal bar int h selection h bar get selection drawing container set bounds h selection drawing container get bounds y drawing container get bounds width drawing container get bounds height
change the awt container composite horizontal position
private void process vbar scroll bar v bar scroll composite get vertical bar int v selection v bar get selection drawing container set bounds drawing container get bounds x v selection drawing container get bounds width drawing container get bounds height
change the awt container composite vertical position
public void paint graphics g graphics2 d g2d graphics2 d g draw the white background g2d set color color white g2d fill rect 0 0 get width get height use antialias for drawings g2d set rendering hint rendering hints key antialiasing rendering hints value antialias on g2d set rendering hint rendering hints key rendering rendering hints value render quality draw the final result g draw image resized rotated image offset x offset y null g draw image template image drawing area width 2 template image get width 2 drawing area height 2 template image get height 2 null
method that draws the image behind the face template on an white background
public project window main window parent string file name this parent parent messages loader get messages read image file name
creates a new instance of this class given its parent
public void set template string name try read the template from the resources folder template image image io read new file system get property program pixmapspath face templates folder file separator name png repaint update the drawing area with the new template catch ioexception e todo auto generated catch block e print stack trace
method that initializes the template image with the given template
private void load main window if display is disposed return display async exec new runnable public void run label loading info set text messages get string main window title main window new main window main window get sshell open shell current shell s shell s shell main window get sshell current shell close
open the main window and close the loader window