input
stringlengths 10
828
| output
stringlengths 5
107
|
|---|---|
public selector order by ascending file comparator c object a work set to array arrays sort a c get comparator extractor work set new linked hash set a length 2 for int i 0 i a length i work set add a i return this
|
order by ascending content
|
public file view get selected iterator it work set iterator if it has next return new file view it next extractor else return null
|
gets the first selected or null
|
public file view get selected max file comparator c try object header collections max work set c get comparator extractor return new file view header extractor catch no such element exception ex return null
|
get the largest content selected
|
public file view get selected min file comparator c try object header collections min work set c get comparator extractor return new file view header extractor catch no such element exception ex return null
|
get the smallest content selected
|
public selector order by descending file comparator c object a work set to array arrays sort a collections reverse order c get comparator extractor work set new linked hash set a length 2 for int i 0 i a length i work set add a i return this
|
order by descending content
|
public input stream get input stream throws ioexception return delegator get input stream header
|
return a input stream of a file
|
public void write into output stream out throws ioexception delegator write into header out
|
writes compressed archive into a output stream
|
public string get file path return delegator get file path header
|
return the file path of a file
|
public string get file name return delegator get file name header
|
return the file name of a file
|
public date get modification date return delegator get modification date header
|
return the file modification date on a implementation of a kind of header
|
public contents iterator iterator int number to extract int to extract math max 0 math min number to extract work set size return new contents iterator work set iterator to extract extractor
|
as iterator only the first number to extract files specified
|
public long get file size return delegator get file size header
|
return the file size on a implementation of a kind of header
|
public long get compressed file size return delegator get compressed file size header
|
return the compressed file size on a implementation of a kind of header
|
public long get crc32 return delegator get crc32 header 0 x00000000ffffffff l
|
return the file crc32 on a implementation of a kind of header
|
public boolean is directory return delegator is directory header
|
return if the file is a directory
|
public void dispose view pm close
|
closes the view if it is open
|
public skip string builder append char str int offset int len int new count count len if new count value length expand capacity new count final int jmax offset len char c while offset jmax c str offset offset if unmappable c continue value count c count return this
|
as this is a perfomance aid class im not going to test negative
|
public void set search text string new word if new word equals word word new word chars new word to char array library invariant if equals word preprocessed boyer moore process chars chars
|
sets the new word to search if different from the old
|
public void remove last if text list is empty try doc remove doc get length 1 1 catch bad location exception ex throw new runtime exception ex else text list remove last text list remove last text list remove last buffered chars buffered chars 1
|
removes the last inserted n
|
public void append end attribute set current attributes system out println end element spec element spec new element spec current attributes copy attributes element spec content type par 0 1 text list add element spec add paragraph end add paragraph start buffered chars 1
|
you need to call this to signal the end of
|
public void append char chars attribute set current attributes system out println new string s text list add new element spec current attributes copy attributes element spec content type chars 0 chars length buffered chars chars length if buffered chars memory capacity chars flush
|
append all the char s
|
public void append char chars int len attribute set current attributes system out println new string s 0 len text list add new element spec current attributes copy attributes element spec content type chars 0 len buffered chars len if buffered chars memory capacity chars flush
|
append only part of the given char s starting at 0
|
public void append char chars int index int len attribute set current attributes system out println new string s 0 len text list add new element spec current attributes copy attributes element spec content type chars index len buffered chars len if buffered chars memory capacity chars flush
|
append only part of the given char s
|
public void commit if flushed throw new illegal state exception already flushed once flush flushed true
|
call this after adding everything
|
public flow panel builder add label and component string label name jcomponent c size config size config if c null size config null label name null throw new illegal argument exception null argument jlabel label new jlabel label name label set label for c sg sg add component label pg pg add component label add c size config return this
|
add a label if name in component null a component to
|
public flow panel builder add jcomponent c size config size config if c null throw new illegal argument exception null component if size config preferred size size config sg sg add component c group layout preferred size group layout default size group layout preferred size pg pg add component c group layout preferred size group layout default size group layout preferred size else if size config fill size size config sg sg add component c pg pg add component c else throw new illegal argument exception null size config return this
|
add a component to the horizontal panel left to right
|
public flow panel builder add escape action action a if a null throw new illegal argument exception close action can t be null view get input map jcomponent when ancestor of focused component put key stroke get key stroke escape escape view get action map put escape a return this
|
adds a action on the view when escape is pressed
|
public void defer image final object value as key if value as key null throw new illegal argument exception can t return a null argument if swing utilities is event dispatch thread memory cache remove value as key else swing utilities invoke later new runnable override public void run memory cache remove value as key
|
use this to make the image list retry the request
|
public void set frame interval int interval repaint interval interval if interval 0 if timer null timer new timer interval new animation updater this timer set repeats true else timer set delay interval else if timer null timer stop timer null
|
setting a frame interval of zero stops automatic animation
|
public int get frame count return frame count
|
returns the total number of frames
|
public void next frame set frame get frame 1
|
advance to the next animation frame
|
public void put image final object value as key final buffered image image if image null value as key null throw new illegal argument exception can t return a null argument if swing utilities is event dispatch thread repaint for object value as key image see http www pushing pixels org p 369 else if list is visible list is showing swing utilities invoke later new runnable override public void run repaint for object value as key image
|
use this to put a image into a cell of the list
|
public void set frame int f this frame f if frame count 0 frame frame frame count repaint
|
set the current animation frame number
|
public int get frame return frame
|
returns the current animation frame number
|
protected void register repaint area component c int x int y int w int h repaints add new repaint area c x y w h
|
register repaint areas which get get cleared once the repaint request
|
public int get delay int n delay 1 if n 0 n frame count delay gif frame frames get n delay return delay
|
gets display duration for specified frame
|
private component find non renderer ancestor component c component ancestor swing utilities get ancestor of class cell renderer pane class c if ancestor null ancestor c ancestor get parent null c find non renderer ancestor ancestor get parent return c
|
find the first ancestor em not em descending from a
|
public void repaint component repaint x y w h
|
queue a repaint request for this area
|
public buffered image get image return get frame 0
|
gets the first or only image read
|
public int get loop count return loop count
|
gets the netscape iteration count if any
|
public boolean image update image img int flags int x int y int width int height if flags framebits allbits 0 animated icon anim icon animated icon ref get if anim icon null anim icon repaint else original set image observer null return true if we want to keep painting return flags allbits abort 0
|
queue repaint requests for all known painted areas
|
public buffered image get frame int n buffered image im null if n 0 n frame count im gif frame frames get n image return im
|
gets the image contents of frame n
|
public void install actions enum values action actions if actions length values length values length 0 throw new illegal argument exception number of actions actions length should be equal to enum length values length and greater than 0 create binding map values 0 for int i 0 i actions length i action map put values i actions i
|
sets each enum value as key of a
|
public int read input stream is init if is null try if is instanceof buffered input stream is new buffered input stream is read header buffered input stream is if err read contents buffered input stream is if frame count 0 status status format error finally try is close catch ioexception ex status status open error else status status open error return status
|
reads gif image from stream
|
public void install key strokes enum values string key strokes if key strokes length values length values length 0 throw new illegal argument exception number of key strokes key strokes length should be equal to enum length values length and greater than 0 create binding map values 0 for int i 0 i key strokes length i key stroke k key stroke get key stroke key strokes i if k null throw new illegal argument exception key strokes i is an invalid keystroke binding map put values i k keystrokes changed key strokes length 0 change
|
as install default key strokes but unconditional
|
public void install key strokes iterable entry enum key stroke iterable iterator entry enum key stroke iterator iterable iterator keystrokes changed iterator has next if keystrokes changed return create binding map iterator next get key iterator iterable iterator while iterator has next entry enum key stroke e iterator next binding map put e get key e get value change
|
as install default key strokes but unconditional
|
public boolean is object invisible final object obj if event queue is dispatch thread return inner is object visible obj future task boolean result new future task boolean new callable boolean override public boolean call throws exception return inner is object visible obj event queue invoke later result try return result get catch exception ex throw tests assertion error impossible ex
|
returns if the list object is not visible in the viewport
|
private boolean err return status status ok
|
returns true if an error was encountered during reading decoding
|
private void init status status ok frame count 0 frames new array list gct null lct null
|
initializes or re initializes reader
|
private int read aux buffered input stream is int cur byte 0 try cur byte is read catch ioexception e status status format error return cur byte
|
reads a single byte from the input stream
|
public jcomponent get view return layer
|
to display the image list
|
private int read block buffered input stream in block size read aux in int n 0 if block size 0 try int count 0 while n block size count in read block n block size n if count 1 break n count catch ioexception e if n block size status status format error return n
|
reads next variable length block from input
|
public void start view in edt final component owner if swing utilities is event dispatch thread throw new illegal state exception called from the edt if is done view created view created true swing utilities invoke later new create view owner total
|
starts the view on the edt eventually
|
public void set total int total set total aux total fire change event
|
set a new total
|
private void read graphic control ext buffered input stream is read aux is block size int packed read aux is packed fields dispose packed 0x1c 2 disposal method if dispose 0 dispose 1 elect to keep old image if discretionary transparency packed 1 0 delay read short is 10 delay in milliseconds trans index read aux is transparent color index read aux is block terminator
|
reads graphics control extension values
|
public int get progress return current
|
returns the current progress or
|
private void read header buffered input stream is string builder id new string builder for int i 0 i 6 i id append char read aux is if id to string starts with gif status status format error return read lsd is if gct flag err gct read color table gct size is bg color gct bg index
|
reads gif file header information
|
public void close if closed closed true dispose view fire change event
|
close and dispose the view if visible
|
public boolean is done int size total return size 1 size current
|
can only return true
|
public void set current final string status final int current if current 0 throw new illegal state exception not started yet boolean value not equals current this current if value not equals this current current boolean status not equals status null status equals this status if status not equals this status status if value not equals status not equals if view created swing utilities invoke later update view fire change event
|
update the progress monitor and fire listeners
|
private void read lsd buffered input stream is logical screen size width read short is height read short is packed fields int packed read aux is gct flag packed 0x80 0 1 global color table flag 2 4 color resolution 5 gct sort flag gct size 2 packed 7 6 8 gct size bg index read aux is background color index read aux is pixel aspect ratio
|
reads logical screen descriptor
|
private void read netscape ext buffered input stream is do read block is if block 0 1 loop count sub block int b1 block 1 0xff int b2 block 2 0xff loop count b2 8 b1 while block size 0 err
|
reads netscape extenstion to obtain iteration count
|
private int read short buffered input stream is read 16 bit value lsb first return read aux is read aux is 8
|
reads next 16 bit value lsb first
|
private void reset frame last dispose dispose last rect new rectangle ix iy iw ih last image image last bg color bg color dispose 0 was local transparency false was local delay 0 was local lct null
|
resets frame state for reading next image
|
private void skip buffered input stream is do read block is while block size 0 err
|
skips variable length blocks up to and including next zero length
|
public human time y return y 1
|
adds one year to the time delta
|
public human time y int n delta year n return this
|
adds n years to the time delta
|
public human time d return d 1
|
adds one day to the time delta
|
public human time d int n delta day math abs n return this
|
adds n days to the time delta
|
public human time h return h 1
|
adds one hour to the time delta
|
public human time h int n delta hour math abs n return this
|
adds n hours to the time delta
|
public human time m return m 1
|
adds one month to the time delta
|
public human time m int n delta minute math abs n return this
|
adds n months to the time delta
|
public human time s return s 1
|
adds one second to the time delta
|
public human time s int n delta second math abs n return this
|
adds n seconds to the time delta
|
public human time ms return ms 1
|
adds one millisecond to the time delta
|
public human time ms int n delta math abs n return this
|
adds n milliseconds to the time delta
|
public string get exactly return get exactly new string builder to string
|
returns a human formatted representation of the time delta
|
public string get approximately return get approximately new string builder to string
|
returns an approximate human formatted representation of the time delta
|
public long get delta return delta
|
returns the time delta
|
public int compare to human time t return delta t delta 0 delta t delta 1 1
|
compares this human time to another human time
|
private void invalidate cache log d tag invalidate cache is removing in memory cache package mapping clear valid cache false
|
invalidate any in memory cache probably after resolving a
|
public void clear cache synchronized mapping lock invalidate cache
|
externally visible method to clear any internal cache
|
public void add mapping string package name string category name string descrip content values values new content values values put field app package package name values put field app category category name values put field app descrip descrip sqlite database db this get writable database db insert table app null values synchronized mapping lock invalidate cache
|
insert a known mapping into database
|
public void delete all mappings sqlite database db this get writable database db delete table app null null synchronized mapping lock invalidate cache
|
remove all known mappings from database
|
public void end result result
|
runs on the ui thread after
|
public void process progress progress values
|
runs on the ui thread after
|
private void add mapping helper map string list entry info entry map entry info entry string category name if entry map contains key category name entry map put category name new array list entry info entry map get category name add entry
|
helper function to correctly add categorized apps to entry map
|
private void update columns group adapter adapter configuration config adapter set columns config orientation configuration orientation portrait 4 6
|
force columns shown in adapter based on orientation
|
public void set columns int columns this columns columns this notify data set invalidated
|
force the number of columns to use when wrapping child elements
|
public cursor get scripts sqlite database db this get readable database return db query table scripts new string id field script name field script author field script descrip field script domainregex field script enabled null null null null null
|
return cursor across all scripts
|
public void toggle enabled long id sqlite database db this get writable database first read the existing status cursor cur db query table scripts new string field script enabled id new string long to string id null null null if cur null cur move to first return int value cur get int cur get column index field script enabled cur close update to have the opposite value content values values new content values values put field script enabled value 0 1 0 db update table scripts values id new string long to string id
|
toggle the enabled state of the given script
|
protected void on activity result int request code int result code intent data this result code result code this result data data this result wait release
|
pass a resulting intent down to the waiting script call
|
private string prepare script string script string jsonlib try jsonlib util get raw string get resources r raw json2 catch exception e log e tag problem loading raw json library e script string format javascript function s s jsonlib script script script replace match string format s d match magickey script script replace match result string format s d match result magickey return script
|
prepare the given script for execution specifically by injecting our
|
private string get constant string key try key string intent class get field key get null catch exception e return key
|
resolve intent constants like intent
|
public void start activity string trykey string json if magickey long parse long trykey log e tag magic key from caller doesn t match so we might have a malicious caller return intent intent parse json if intent null return try browser activity this start activity intent catch activity not found exception e log e tag couldn t find activity to handle the requested intent e toast make text browser activity this r string browse nointent toast length short show
|
launch the intent described by json
|
public void on page finished web view view string url if scriptdb null log e tag script database wasn t ready for finished page return for each finished page try looking for active scripts list string active scriptdb get active url log d tag string format found d active scripts on url s active size url if active size 0 return inject each applicable script into page for string script active script browser activity this prepare script script webview load url script
|
handle finished loading of each page
|
public au processor add au processor string prefix au processor processor check au procesor prefix processor if procs get prefix processor speed up to avoid sync return processor nothing changed to avoid using sync in do get we make a copy here final au processor old synchronized this final map string au processor ps new hash map string au processor procs old au processor ps put prefix processor procs ps return old
|
adds an au processor and associates it with the specified prefix
|
private au processor get au processor by path string path for iterator map entry string au processor it procs entry set iterator it has next final map entry string au processor me map entry string au processor it next if path starts with string me get key return au processor me get value return null
|
returns the first au processor matches the specified path
|
public void add components left button button if button map contains key button get id button map put button get id button pnl btn left append child button
|
add button to the left side of the confirm panel
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.