idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
11,400 | public static ApruveResponse < SubscriptionAdjustment > get ( String subscriptionId , String adjustmentId ) { return ApruveClient . getInstance ( ) . get ( getSubscriptionAdjustmentsPath ( subscriptionId ) + adjustmentId , SubscriptionAdjustment . class ) ; } | Get the SubscriptionAdjustment with the given ID |
11,401 | public static ApruveResponse < List < SubscriptionAdjustment > > getAllAdjustments ( String subscriptionId ) { return ApruveClient . getInstance ( ) . index ( getSubscriptionAdjustmentsPath ( subscriptionId ) , new GenericType < List < SubscriptionAdjustment > > ( ) { } ) ; } | Get all SubscriptionAdjustments for the specified Subscription . |
11,402 | public ApruveResponse < SubscriptionAdjustmentCreateResponse > create ( String subscriptionId ) { return ApruveClient . getInstance ( ) . post ( getSubscriptionAdjustmentsPath ( subscriptionId ) , this , SubscriptionAdjustmentCreateResponse . class ) ; } | Create this SubscriptionAdjustment on the Apruve servers . |
11,403 | public static ApruveResponse < SubscriptionAdjustmentDeleteResponse > delete ( String subscriptionId , String adjustmentId ) { return ApruveClient . getInstance ( ) . delete ( getSubscriptionAdjustmentsPath ( subscriptionId ) + adjustmentId , SubscriptionAdjustmentDeleteResponse . class ) ; } | Delete the specified SubscriptionAdjustment from the Apruve servers . This is only allowed for SubscriptionAdjustments that are not in APPLIED status . |
11,404 | public String wrap ( String text ) { StringBuilder sb = new StringBuilder ( ) ; int continuationLength = continuation . length ( ) ; int currentPosition = 0 ; for ( String word : text . split ( " " ) ) { String lastWord ; int wordLength = word . length ( ) ; if ( currentPosition + wordLength <= width ) { if ( currentPo... | Wrap the specified text . |
11,405 | public void printMessage ( Diagnostic . Kind kind , CharSequence msg , Element e , AnnotationMirror a , AnnotationValue v ) { JavaFileObject oldSource = null ; JavaFileObject newSource = null ; JCDiagnostic . DiagnosticPosition pos = null ; JavacElements elemUtils = processingEnv . getElementUtils ( ) ; Pair < JCTree ,... | Prints a message of the specified kind at the location of the annotation value inside the annotation mirror of the annotated element . |
11,406 | public void addWhereClause ( FreemarkerWhereClause freemarkerWhereClause ) { String outputBody = freemarkerWhereClause . getOutputBody ( ) ; if ( StringUtils . isNotBlank ( outputBody ) ) freemarkerWhereClauses . add ( outputBody ) ; } | Adds a where clause to the current context . Only performed on where clauses which are rendered . |
11,407 | public static Object invoke ( Object object , String methodName , Object ... parameters ) { Method method = getMethodThatMatchesParameters ( object . getClass ( ) , methodName , parameters ) ; if ( method != null ) { try { return method . invoke ( object , parameters ) ; } catch ( IllegalAccessException e ) { throw new... | Silently invoke the specified methodName using reflection . |
11,408 | public byte [ ] getContents ( FileColumn [ ] columns , List < String [ ] > lines ) throws IOException { byte [ ] ret ; if ( format . isExcel ( ) ) { ret = getExcelOutput ( columns , lines ) ; } else { ret = getCSVOutput ( lines ) ; } return ret ; } | Returns the formatted output file contents . |
11,409 | private byte [ ] getCSVOutput ( List < String [ ] > lines ) { StringWriter writer = new StringWriter ( ) ; csv = new CSVWriter ( writer , delimiter . separator ( ) . charAt ( 0 ) ) ; for ( int i = 0 ; i < lines . size ( ) ; i ++ ) { csv . writeNext ( ( String [ ] ) lines . get ( i ) , quotes ) ; } return writer . toStr... | Returns the CSV output file data . |
11,410 | private byte [ ] getExcelOutput ( FileColumn [ ] columns , List < String [ ] > lines ) throws IOException { baos = new ByteArrayOutputStream ( 1024 ) ; if ( existing != null ) workbook = Workbook . createWorkbook ( format , baos , existing ) ; else workbook = Workbook . createWorkbook ( format , baos ) ; workbook . set... | Returns the XLS or XLSX output file data . |
11,411 | public MainFrame put ( Widget widget ) { widget . addTo ( user ) ; content = widget != null ? widget . getID ( ) : - 1 ; this . sendElement ( ) ; return this ; } | Adds widget to page |
11,412 | public static < T extends Comparable < ? super T > > boolean greaterThanOrEquals ( final T object , final T other ) { return JudgeUtils . greaterThanOrEquals ( object , other ) ; } | Returns true if object equals other or object greater than other ; false otherwise . |
11,413 | public static < T extends Comparable < ? super T > > boolean greaterThan ( final T object , final T other ) { return JudgeUtils . greaterThan ( object , other ) ; } | Returns true if object greater than other ; false otherwise . |
11,414 | public static < T extends Comparable < ? super T > > boolean lessThanOrEquals ( final T object , final T other ) { return JudgeUtils . lessThanOrEquals ( object , other ) ; } | Returns true if object equals other or object less than other ; false otherwise . |
11,415 | public static < T extends Comparable < ? super T > > boolean lessThan ( final T object , final T other ) { return JudgeUtils . lessThan ( object , other ) ; } | Returns true if object less than other ; false otherwise . |
11,416 | public static < T extends Comparable < ? super T > > void ascDeep ( final T [ ] comparableArray ) { if ( ArrayUtils . isEmpty ( comparableArray ) ) { return ; } ascByReflex ( comparableArray ) ; } | Orders given comparable array by ascending . |
11,417 | public static < T extends Comparable < ? super T > > void descDeep ( final T [ ] comparableArray ) { if ( ArrayUtils . isEmpty ( comparableArray ) ) { return ; } descByReflex ( comparableArray ) ; } | Orders given comparable array by descending . |
11,418 | public static < T > void reverse ( final T array ) { if ( ArrayUtils . isArray ( array ) ) { int mlength = Array . getLength ( array ) - 1 ; Object temp = null ; for ( int i = 0 , j = mlength ; i < mlength ; i ++ , j -- ) { Object arg0 = Array . get ( array , i ) ; Object arg1 = Array . get ( array , j ) ; temp = arg0 ... | Sort the array in reverse order . |
11,419 | public void contextInitialized ( ServletContextEvent event ) { _registry . put ( INSTANCE , new Pair < Service , Persistence > ( this , null ) ) ; _context = event . getServletContext ( ) ; _application = _context . getContextPath ( ) ; _logger . config ( "application: " + _application ) ; if ( _application . charAt ( ... | Initializes the servlet context . |
11,420 | final public void plugInterfaces ( RobotAction newControl , RobotStatus newStatus , WorldInfo newWorld ) { SecurityManager sm = System . getSecurityManager ( ) ; if ( sm != null ) { sm . checkPermission ( new GamePermission ( "connectBank" ) ) ; } control = newControl ; info = newStatus ; world = newWorld ; } | Attaches a control to a bank |
11,421 | final public void setTeamId ( int newId ) { if ( teamId != - 1 ) { throw new IllegalStateException ( "Team Id cannot be modified" ) ; } SecurityManager sm = System . getSecurityManager ( ) ; if ( sm != null ) { sm . checkPermission ( new GamePermission ( "setTeamId" ) ) ; } teamId = newId ; } | Sets the team id . Can only be called once otherwise it will throw an exception |
11,422 | public static String stringFor ( int m ) { if ( m == CUFFT_COMPATIBILITY_NATIVE ) { return "CUFFT_COMPATIBILITY_NATIVE" ; } if ( ( m & CUFFT_COMPATIBILITY_FFTW_ALL ) == CUFFT_COMPATIBILITY_FFTW_ALL ) { return "CUFFT_COMPATIBILITY_FFTW_ALL" ; } StringBuilder sb = new StringBuilder ( ) ; if ( ( m & CUFFT_COMPATIBILITY_FF... | Returns the String identifying the given cufftCompatibility |
11,423 | static public String getFormattedBytes ( long bytes , String units , String format ) { double num = bytes ; String [ ] prefix = { "" , "K" , "M" , "G" , "T" } ; int count = 0 ; while ( num >= 1024.0 ) { num = num / 1024.0 ; ++ count ; } DecimalFormat f = new DecimalFormat ( format ) ; return f . format ( num ) + " " + ... | Returns the given bytes number formatted as KBytes MBytes or GBytes as appropriate . |
11,424 | static public String getFormattedDate ( long dt ) { String ret = "" ; SimpleDateFormat df = null ; try { if ( dt > 0 ) { df = formatPool . getFormat ( DATE_FORMAT ) ; df . setTimeZone ( DateUtilities . getCurrentTimeZone ( ) ) ; ret = df . format ( new Date ( dt ) ) ; } } catch ( Exception e ) { } if ( df != null ) for... | Returns the given date parsed using dd - MM - yyyy . |
11,425 | static public String getLongFormattedDays ( long dt ) { StringBuffer ret = new StringBuffer ( ) ; long days = dt / 86400000L ; long millis = dt - ( days * 86400000L ) ; if ( days > 0 ) { ret . append ( Long . toString ( days ) ) ; ret . append ( " day" ) ; if ( days > 1 ) ret . append ( "s" ) ; } long hours = millis / ... | Returns the given time formatted as a number of days hours and minutes . |
11,426 | public ClassDocImpl loadClass ( String name ) { try { ClassSymbol c = reader . loadClass ( names . fromString ( name ) ) ; return getClassDoc ( c ) ; } catch ( CompletionFailure ex ) { chk . completionError ( null , ex ) ; return null ; } } | Load ClassDoc by qualified name . |
11,427 | protected void buildProfileIndexFile ( String title , boolean includeScript ) throws IOException { String windowOverview = configuration . getText ( title ) ; Content body = getBody ( includeScript , getWindowTitle ( windowOverview ) ) ; addNavigationBarHeader ( body ) ; addOverviewHeader ( body ) ; addIndex ( body ) ;... | Generate and prints the contents in the profile index file . Call appropriate methods from the sub - class in order to generate Frame or Non Frame format . |
11,428 | protected void buildProfilePackagesIndexFile ( String title , boolean includeScript , String profileName ) throws IOException { String windowOverview = configuration . getText ( title ) ; Content body = getBody ( includeScript , getWindowTitle ( windowOverview ) ) ; addNavigationBarHeader ( body ) ; addOverviewHeader (... | Generate and prints the contents in the profile packages index file . Call appropriate methods from the sub - class in order to generate Frame or Non Frame format . |
11,429 | protected void addIndex ( Content body ) { addIndexContents ( profiles , "doclet.Profile_Summary" , configuration . getText ( "doclet.Member_Table_Summary" , configuration . getText ( "doclet.Profile_Summary" ) , configuration . getText ( "doclet.profiles" ) ) , body ) ; } | Adds the frame or non - frame profile index to the documentation tree . |
11,430 | protected void addProfilePackagesIndex ( Content body , String profileName ) { addProfilePackagesIndexContents ( profiles , "doclet.Profile_Summary" , configuration . getText ( "doclet.Member_Table_Summary" , configuration . getText ( "doclet.Profile_Summary" ) , configuration . getText ( "doclet.profiles" ) ) , body ,... | Adds the frame or non - frame profile packages index to the documentation tree . |
11,431 | protected void addIndexContents ( Profiles profiles , String text , String tableSummary , Content body ) { if ( profiles . getProfileCount ( ) > 0 ) { HtmlTree div = new HtmlTree ( HtmlTag . DIV ) ; div . addStyle ( HtmlStyle . indexHeader ) ; addAllClassesLink ( div ) ; addAllPackagesLink ( div ) ; body . addContent (... | Adds profile index contents . Call appropriate methods from the sub - classes . Adds it to the body HtmlTree |
11,432 | protected void addProfilePackagesIndexContents ( Profiles profiles , String text , String tableSummary , Content body , String profileName ) { HtmlTree div = new HtmlTree ( HtmlTag . DIV ) ; div . addStyle ( HtmlStyle . indexHeader ) ; addAllClassesLink ( div ) ; addAllPackagesLink ( div ) ; addAllProfilesLink ( div ) ... | Adds profile packages index contents . Call appropriate methods from the sub - classes . Adds it to the body HtmlTree |
11,433 | public Iterable < DContact > queryByBirthday ( Object parent , java . util . Date birthday ) { return queryByField ( parent , DContactMapper . Field . BIRTHDAY . getFieldName ( ) , birthday ) ; } | query - by method for field birthday |
11,434 | public Iterable < DContact > queryByCompanyName ( Object parent , java . lang . String companyName ) { return queryByField ( parent , DContactMapper . Field . COMPANYNAME . getFieldName ( ) , companyName ) ; } | query - by method for field companyName |
11,435 | public Iterable < DContact > queryByEmail ( Object parent , java . lang . String email ) { return queryByField ( parent , DContactMapper . Field . EMAIL . getFieldName ( ) , email ) ; } | query - by method for field email |
11,436 | public Iterable < DContact > queryByFacebook ( Object parent , java . lang . String facebook ) { return queryByField ( parent , DContactMapper . Field . FACEBOOK . getFieldName ( ) , facebook ) ; } | query - by method for field facebook |
11,437 | public Iterable < DContact > queryByHomePhone ( Object parent , java . lang . String homePhone ) { return queryByField ( parent , DContactMapper . Field . HOMEPHONE . getFieldName ( ) , homePhone ) ; } | query - by method for field homePhone |
11,438 | public Iterable < DContact > queryByLatitude ( Object parent , java . lang . Float latitude ) { return queryByField ( parent , DContactMapper . Field . LATITUDE . getFieldName ( ) , latitude ) ; } | query - by method for field latitude |
11,439 | public Iterable < DContact > queryByLinkedIn ( Object parent , java . lang . String linkedIn ) { return queryByField ( parent , DContactMapper . Field . LINKEDIN . getFieldName ( ) , linkedIn ) ; } | query - by method for field linkedIn |
11,440 | public Iterable < DContact > queryByLongitude ( Object parent , java . lang . Float longitude ) { return queryByField ( parent , DContactMapper . Field . LONGITUDE . getFieldName ( ) , longitude ) ; } | query - by method for field longitude |
11,441 | public Iterable < DContact > queryByMobilePhone ( Object parent , java . lang . String mobilePhone ) { return queryByField ( parent , DContactMapper . Field . MOBILEPHONE . getFieldName ( ) , mobilePhone ) ; } | query - by method for field mobilePhone |
11,442 | public Iterable < DContact > queryByOtherEmail ( Object parent , java . lang . String otherEmail ) { return queryByField ( parent , DContactMapper . Field . OTHEREMAIL . getFieldName ( ) , otherEmail ) ; } | query - by method for field otherEmail |
11,443 | public Iterable < DContact > queryByOtherPhone ( Object parent , java . lang . String otherPhone ) { return queryByField ( parent , DContactMapper . Field . OTHERPHONE . getFieldName ( ) , otherPhone ) ; } | query - by method for field otherPhone |
11,444 | public Iterable < DContact > queryByPrimaryCustomIndex ( Object parent , java . lang . String primaryCustomIndex ) { return queryByField ( parent , DContactMapper . Field . PRIMARYCUSTOMINDEX . getFieldName ( ) , primaryCustomIndex ) ; } | query - by method for field primaryCustomIndex |
11,445 | public Iterable < DContact > queryBySecondaryCustomIndex ( Object parent , java . lang . String secondaryCustomIndex ) { return queryByField ( parent , DContactMapper . Field . SECONDARYCUSTOMINDEX . getFieldName ( ) , secondaryCustomIndex ) ; } | query - by method for field secondaryCustomIndex |
11,446 | public Iterable < DContact > queryByTags ( Object parent , java . lang . Object tags ) { return queryByField ( parent , DContactMapper . Field . TAGS . getFieldName ( ) , tags ) ; } | query - by method for field tags |
11,447 | public Iterable < DContact > queryByTwitter ( Object parent , java . lang . String twitter ) { return queryByField ( parent , DContactMapper . Field . TWITTER . getFieldName ( ) , twitter ) ; } | query - by method for field twitter |
11,448 | public DContact findByUniqueTag ( Object parent , java . lang . String uniqueTag ) { return queryUniqueByField ( parent , DContactMapper . Field . UNIQUETAG . getFieldName ( ) , uniqueTag ) ; } | find - by method for unique field uniqueTag |
11,449 | public Iterable < DContact > queryByWebPage ( Object parent , java . lang . String webPage ) { return queryByField ( parent , DContactMapper . Field . WEBPAGE . getFieldName ( ) , webPage ) ; } | query - by method for field webPage |
11,450 | public Iterable < DContact > queryByWorkPhone ( Object parent , java . lang . String workPhone ) { return queryByField ( parent , DContactMapper . Field . WORKPHONE . getFieldName ( ) , workPhone ) ; } | query - by method for field workPhone |
11,451 | public static int string2int ( String s , int radix ) throws NumberFormatException { if ( radix == 10 ) { return Integer . parseInt ( s , radix ) ; } else { char [ ] cs = s . toCharArray ( ) ; int limit = Integer . MAX_VALUE / ( radix / 2 ) ; int n = 0 ; for ( int i = 0 ; i < cs . length ; i ++ ) { int d = Character . ... | Convert string to integer . |
11,452 | public static long string2long ( String s , int radix ) throws NumberFormatException { if ( radix == 10 ) { return Long . parseLong ( s , radix ) ; } else { char [ ] cs = s . toCharArray ( ) ; long limit = Long . MAX_VALUE / ( radix / 2 ) ; long n = 0 ; for ( int i = 0 ; i < cs . length ; i ++ ) { int d = Character . d... | Convert string to long integer . |
11,453 | public static String getResponseMaybe ( SocketManager socketManager , String message ) throws IOException { try { return socketManager . sendAndWait ( message ) ; } catch ( ResponseTimeoutException e ) { socketManager . send ( "help" ) ; return "" ; } } | Send a message and wait for a short period for a response . If no response comes in that time it is assumed that there will be no response from the frontend . This is useful for commands that get a response when there is data available and silence otherwise . |
11,454 | public static String parsePropertyName ( Method method ) { String name = method . getName ( ) ; int i = 0 ; if ( name . startsWith ( "get" ) || name . startsWith ( "set" ) ) { i = 3 ; } else if ( name . startsWith ( "is" ) ) { i = 2 ; } return Character . toLowerCase ( name . charAt ( i ) ) + name . substring ( i + 1 )... | Parses the method name to return a property name if it is a getter or a setter . |
11,455 | public static < E > OptionalFunction < Selection < Method > , E > invoke ( Object ... args ) { return OptionalFunction . of ( selection -> factory . createInvoker ( selection . result ( ) ) . on ( selection . target ( ) ) . withArgs ( args ) ) ; } | Returns a function that invokes a selected method . |
11,456 | public static < E > OptionalFunction < Selection < Constructor < ? > > , E > instantiate ( Object ... args ) { return OptionalFunction . of ( selection -> factory . createInvoker ( selection . result ( ) ) . withArgs ( args ) ) ; } | Returns a function that invokes a selected constructor . |
11,457 | public static < E > OptionalFunction < Selection < Field > , E > getValue ( ) { return OptionalFunction . of ( selection -> factory . createHandler ( selection . result ( ) ) . on ( selection . target ( ) ) . getValue ( ) ) ; } | Returns a function that gets the value of a selected field . |
11,458 | public static Consumer < Selection < Field > > setValue ( Object newValue ) { return selection -> factory . createHandler ( selection . result ( ) ) . on ( selection . target ( ) ) . setValue ( newValue ) ; } | Returns a consumer that sets the value of a selected field . |
11,459 | public Object users ( ) { return new ArrayList < Map < String , Object > > ( ) { { add ( new HashMap < String , Object > ( ) { { put ( "username" , "testUser1" ) ; put ( "groups" , Arrays . asList ( "group1" ) ) ; put ( "password" , "thisMechWillChange" ) ; } } ) ; add ( new HashMap < String , Object > ( ) { { put ( "u... | Avoiding adding extra dependencies so using hash map . |
11,460 | public boolean nextKeyValue ( ) throws IOException , InterruptedException { if ( ! deserializer . hasNextEvent ( ) ) { return false ; } else { value = deserializer . getNextEvent ( ) ; key = value . getEventDateTime ( ) ; return true ; } } | Read the next key value pair . |
11,461 | public float getProgress ( ) throws IOException , InterruptedException { if ( start == end ) { return 0.0f ; } else { return Math . min ( 1.0f , ( pos - start ) / ( float ) ( end - start ) ) ; } } | The current progress of the record reader through its data . |
11,462 | public void addAttr ( HtmlAttr attrName , String attrValue ) { if ( attrs . isEmpty ( ) ) attrs = new LinkedHashMap < HtmlAttr , String > ( 3 ) ; attrs . put ( nullCheck ( attrName ) , escapeHtmlChars ( attrValue ) ) ; } | Adds an attribute for the HTML tag . |
11,463 | public void addContent ( Content tagContent ) { if ( tagContent instanceof ContentBuilder ) { for ( Content content : ( ( ContentBuilder ) tagContent ) . contents ) { addContent ( content ) ; } } else if ( tagContent == HtmlTree . EMPTY || tagContent . isValid ( ) ) { if ( content . isEmpty ( ) ) content = new ArrayLis... | Adds content for the HTML tag . |
11,464 | public static HtmlTree A_NAME ( String name , Content body ) { HtmlTree htmltree = HtmlTree . A_NAME ( name ) ; htmltree . addContent ( nullCheck ( body ) ) ; return htmltree ; } | Generates an HTML anchor tag with name attribute and content . |
11,465 | public static HtmlTree A_NAME ( String name ) { HtmlTree htmltree = new HtmlTree ( HtmlTag . A ) ; htmltree . addAttr ( HtmlAttr . NAME , nullCheck ( name ) ) ; return htmltree ; } | Generates an HTML anchor tag with name attribute . |
11,466 | public static HtmlTree FRAME ( String src , String name , String title , String scrolling ) { HtmlTree htmltree = new HtmlTree ( HtmlTag . FRAME ) ; htmltree . addAttr ( HtmlAttr . SRC , nullCheck ( src ) ) ; htmltree . addAttr ( HtmlAttr . NAME , nullCheck ( name ) ) ; htmltree . addAttr ( HtmlAttr . TITLE , nullCheck... | Generates a FRAME tag . |
11,467 | public static HtmlTree FRAME ( String src , String name , String title ) { return FRAME ( src , name , title , null ) ; } | Generates a Frame tag . |
11,468 | public static HtmlTree FRAMESET ( String cols , String rows , String title , String onload ) { HtmlTree htmltree = new HtmlTree ( HtmlTag . FRAMESET ) ; if ( cols != null ) htmltree . addAttr ( HtmlAttr . COLS , cols ) ; if ( rows != null ) htmltree . addAttr ( HtmlAttr . ROWS , rows ) ; htmltree . addAttr ( HtmlAttr .... | Generates a FRAMESET tag . |
11,469 | public static HtmlTree TABLE ( HtmlStyle styleClass , int border , int cellPadding , int cellSpacing , String summary , Content body ) { HtmlTree htmltree = new HtmlTree ( HtmlTag . TABLE , nullCheck ( body ) ) ; if ( styleClass != null ) htmltree . addStyle ( styleClass ) ; htmltree . addAttr ( HtmlAttr . BORDER , Int... | Generates a Table tag with style class border cell padding cellspacing and summary attributes and some content . |
11,470 | public static String execute ( final boolean withResponse , final String ... command ) throws IOException { final List < String > commands = new ArrayList < > ( ) ; commands . add ( "bash" ) ; commands . add ( "-c" ) ; commands . addAll ( Arrays . asList ( command ) ) ; String response = "" ; final ProcessBuilder pb = ... | Execute the given commands and return the result . |
11,471 | private static int checkResult ( int result ) { if ( exceptionsEnabled && result != cufftResult . CUFFT_SUCCESS ) { throw new CudaException ( cufftResult . stringFor ( result ) ) ; } return result ; } | If the given result is different to cufftResult . CUFFT_SUCCESS and exceptions have been enabled this method will throw a CudaException with an error message that corresponds to the given result code . Otherwise the given result is simply returned . |
11,472 | public Object invoke ( Object proxy , Method method , Object [ ] args ) throws Throwable { return connectionHandler . remoteInvocation ( proxy , method , args ) ; } | Delegates call to this proxy to it s ConnectionHandler |
11,473 | public static ImageReader getImageReader ( final Object sourceImage ) throws IOException { ImageInputStream imageInputStream = ImageIO . createImageInputStream ( sourceImage ) ; Iterator < ImageReader > imageReaders = ImageIO . getImageReaders ( imageInputStream ) ; ImageReader destinationImageReader = null ; if ( imag... | Get image reader from given source image . |
11,474 | public static ImageReader getImageReaderFromHttpImage ( final String sourceImageHttpURL ) throws IOException { InputStream inputStream = new URL ( sourceImageHttpURL ) . openConnection ( ) . getInputStream ( ) ; return getImageReader ( inputStream ) ; } | Get image reader from given web image . |
11,475 | public < T > T get ( Key < T > key ) { checkState ( ht ) ; Object o = ht . get ( key ) ; if ( o instanceof Factory < ? > ) { Factory < ? > fac = ( Factory < ? > ) o ; o = fac . make ( this ) ; if ( o instanceof Factory < ? > ) throw new AssertionError ( "T extends Context.Factory" ) ; Assert . check ( ht . get ( key ) ... | Get the value for the key in this context . |
11,476 | protected void configure ( Properties p ) { _properties = p ; _host = ( String ) p . remove ( HOST ) ; if ( _host == null ) throw new NoSuchElementException ( HOST ) ; _path = ( String ) p . remove ( PATH ) ; if ( _path == null ) throw new NoSuchElementException ( PATH ) ; } | Configures the RemoteServiceChannel with given properties . |
11,477 | public < T > RemoteService . Response call ( long pause , Functor < T , String > reporter ) throws Exception { String message = null ; while ( true ) { RemoteService . Response response = _caller . call ( ) ; String news = response . params . get ( "message" ) ; if ( news == null ) { if ( _state != null && message != n... | Calls the remote service continuously until a final response is received reporting progress messages via the reporter . |
11,478 | public synchronized V invalidate ( K key ) { Singleton < V > singleton = _cache . get ( key ) ; if ( singleton != null ) { return singleton . clear ( ) ; } else { return null ; } } | Invalidates an entry in the cache . This operation does not constitute a cache replacement . |
11,479 | public List < Attribute . Compound > getRawAttributes ( ) { return ( metadata == null ) ? List . < Attribute . Compound > nil ( ) : metadata . getDeclarationAttributes ( ) ; } | An accessor method for the attributes of this symbol . Attributes of class symbols should be accessed through the accessor method to make sure that the class symbol is loaded . |
11,480 | public List < Attribute . TypeCompound > getRawTypeAttributes ( ) { return ( metadata == null ) ? List . < Attribute . TypeCompound > nil ( ) : metadata . getTypeAttributes ( ) ; } | An accessor method for the type attributes of this symbol . Attributes of class symbols should be accessed through the accessor method to make sure that the class symbol is loaded . |
11,481 | public ClassSymbol enclClass ( ) { Symbol c = this ; while ( c != null && ( ( c . kind & TYP ) == 0 || ! c . type . hasTag ( CLASS ) ) ) { c = c . owner ; } return ( ClassSymbol ) c ; } | The closest enclosing class of this symbol s declaration . |
11,482 | public static int floor ( int n , int m ) { return n >= 0 ? ( n / m ) * m : ( ( n - m + 1 ) / m ) * m ; } | Rounds n down to the nearest multiple of m |
11,483 | public static int ceiling ( int n , int m ) { return n >= 0 ? ( ( n + m - 1 ) / m ) * m : ( n / m ) * m ; } | Rounds n up to the nearest multiple of m |
11,484 | public void add ( Collection < PluginComponent > components ) { for ( PluginComponent component : components ) this . components . put ( component . getId ( ) , component ) ; } | Adds the plugin component list to the plugin components for the account . |
11,485 | private void checkIndex ( ) throws IOException { boolean isUpToDate = true ; if ( ! isUpToDate ( ) ) { closeFile ( ) ; isUpToDate = false ; } if ( zipRandomFile != null || isUpToDate ) { lastReferenceTimeStamp = System . currentTimeMillis ( ) ; return ; } hasPopulatedData = true ; if ( readIndex ( ) ) { lastReferenceTi... | Here we need to make sure that the ZipFileIndex is valid . Check the timestamp of the file and if its the same as the one at the time the index was build we don t need to reopen anything . |
11,486 | synchronized Entry getZipIndexEntry ( RelativePath path ) { try { checkIndex ( ) ; DirectoryEntry de = directories . get ( path . dirname ( ) ) ; String lookFor = path . basename ( ) ; return ( de == null ) ? null : de . getEntry ( lookFor ) ; } catch ( IOException e ) { return null ; } } | Returns the ZipFileIndexEntry for a path if there is one . |
11,487 | public synchronized com . sun . tools . javac . util . List < String > getFiles ( RelativeDirectory path ) { try { checkIndex ( ) ; DirectoryEntry de = directories . get ( path ) ; com . sun . tools . javac . util . List < String > ret = de == null ? null : de . getFiles ( ) ; if ( ret == null ) { return com . sun . to... | Returns a javac List of filenames within a directory in the ZipFileIndex . |
11,488 | public synchronized boolean contains ( RelativePath path ) { try { checkIndex ( ) ; return getZipIndexEntry ( path ) != null ; } catch ( IOException e ) { return false ; } } | Tests if a specific path exists in the zip . This method will return true for file entries and directories . |
11,489 | public static List < Event > fromFile ( final File file ) throws IOException , ClassNotFoundException { return fromInputStream ( new FileInputStream ( file ) ) ; } | Given a file written by the serialization - writer library extract all events . This assumes the file was written using ObjectOutputStream . |
11,490 | public boolean add ( String field , List < RDFNode > result ) { this . result . put ( field , result ) ; return true ; } | Add a new result |
11,491 | public boolean add ( String field , RDFNode result ) { if ( ! this . result . containsKey ( field ) ) { this . result . put ( field , new ArrayList < RDFNode > ( ) ) ; } this . result . get ( field ) . add ( result ) ; return true ; } | Add a single result |
11,492 | public Manifest getManifest ( MavenProject project , ManifestConfiguration config ) throws ManifestException , DependencyResolutionRequiredException { Manifest m = new Manifest ( ) ; Manifest . Attribute buildAttr = new Manifest . Attribute ( "Built-By" , System . getProperty ( "user.name" ) ) ; m . addConfiguredAttrib... | Return a pre - configured manifest |
11,493 | @ SuppressWarnings ( "unchecked" ) public Map marshal ( ) { HashMap map = new HashMap ( ) ; map . put ( "jsonrpc" , "2.0" ) ; if ( id != null ) map . put ( "id" , id ) ; if ( error != null ) map . put ( "error" , error . toMap ( ) ) ; else map . put ( "result" , result ) ; return map ; } | Marshals this response to a Map that can be serialized |
11,494 | public static void scan ( ServletContext c , Set < String > jars , Functor < Void , ServiceModule > collector , Logger logger ) { for ( String j : jars ) { logger . config ( "... " + j ) ; try ( JarInputStream jis = new JarInputStream ( j . startsWith ( "/" ) ? c . getResourceAsStream ( j ) : new URL ( j ) . openStream... | Scans a collection of jar files passing recognized Xillium application modules as ServiceModule objects to a collector . |
11,495 | public void writeToJsonGenerator ( final JsonGenerator gen ) throws IOException { gen . writeStartObject ( ) ; gen . writeStringField ( "eventName" , eventName ) ; gen . writeFieldName ( "payload" ) ; getObjectMapper ( ) . writeTree ( gen , root ) ; gen . writeEndObject ( ) ; } | having to know all the events ahead of time . |
11,496 | public synchronized boolean waitForValidValues ( ) throws IOException , FileNotFoundException { for ( int tries = 0 ; tries < 50 ; tries ++ ) { lock ( ) ; getValues ( ) ; unlock ( ) ; if ( containsPortInfo ) { Log . debug ( "Found valid values in port file after waiting " + ( tries * 100 ) + "ms" ) ; return true ; } tr... | Wait for the port file to contain values that look valid . Return true if a - ok false if the valid values did not materialize within 5 seconds . |
11,497 | public synchronized boolean stillMyValues ( ) throws IOException , FileNotFoundException { for ( ; ; ) { try { lock ( ) ; getValues ( ) ; unlock ( ) ; if ( containsPortInfo ) { if ( serverPort == myServerPort && serverCookie == myServerCookie ) { return true ; } return false ; } return false ; } catch ( FileLockInterru... | Check if the portfile still contains my values assuming that I am the server . |
11,498 | @ SuppressWarnings ( "unchecked" ) public static < T > T instantiateDefault ( Class < T > someClass ) { if ( someClass . isArray ( ) ) { return ( T ) Array . newInstance ( someClass . getComponentType ( ) , 0 ) ; } else { if ( boolean . class . equals ( someClass ) || Boolean . class . equals ( someClass ) ) { return (... | Instantiate a class by invoking its default constructor . If the specified class denotes an array an empty array of the correct component type is created . If the specified class denotes a primitive the primitive is created with its default value . |
11,499 | @ SuppressWarnings ( "unchecked" ) public static < T > Optional < Class < T > > optional ( String dependency ) { try { return Optional . of ( ( Class < T > ) Class . forName ( dependency ) ) ; } catch ( ClassNotFoundException | NoClassDefFoundError e ) { return Optional . empty ( ) ; } } | Checks if a class exists in the classpath . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.