idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
6,400 | void computeScroll ( ) { if ( ! overScroller . computeScrollOffset ( ) ) { isScrollingFast = false ; return ; } int distanceX = overScroller . getCurrX ( ) - view . getScrollX ( ) ; int distanceY = overScroller . getCurrY ( ) - view . getScrollY ( ) ; int dX = ( int ) calculateDx ( distanceX ) ; int dY = ( int ) calcul... | Computes the current scroll using a OverScroller instance and the time lapsed from the previous call . Also controls if the view is performing a fast scroll after a fling gesture . |
6,401 | private GestureDetectorCompat getGestureDetector ( ) { if ( gestureDetector == null ) { gestureDetector = new GestureDetectorCompat ( view . getContext ( ) , gestureListener ) ; } return gestureDetector ; } | Returns the GestureDetectorCompat instance where the view should delegate touch events . |
6,402 | private float calculateDx ( float distanceX ) { int currentX = view . getScrollX ( ) ; float nextX = distanceX + currentX ; boolean isInsideHorizontally = nextX >= minX && nextX <= maxX ; return isInsideHorizontally ? distanceX : 0 ; } | Returns the distance in the X axes to perform the scroll taking into account the view boundary . |
6,403 | private float calculateDy ( float distanceY ) { int currentY = view . getScrollY ( ) ; float nextY = distanceY + currentY ; boolean isInsideVertically = nextY >= minY && nextY <= maxY ; return isInsideVertically ? distanceY : 0 ; } | Returns the distance in the Y axes to perform the scroll taking into account the view boundary . |
6,404 | public boolean isValidGitRepository ( Path folder ) { if ( Files . exists ( folder ) && Files . isDirectory ( folder ) ) { if ( RepositoryCache . FileKey . isGitRepository ( folder . toFile ( ) , FS . DETECTED ) ) { return true ; } else { return false ; } } else { return false ; } } | Checks if given folder is a git repository |
6,405 | public Ref checkoutTag ( Git git , String tag ) { try { return git . checkout ( ) . setName ( "tags/" + tag ) . call ( ) ; } catch ( GitAPIException e ) { throw new IllegalStateException ( e ) ; } } | Checkout existing tag . |
6,406 | public boolean isLocalBranch ( final Git git , final String branch ) { try { final List < Ref > refs = git . branchList ( ) . call ( ) ; return refs . stream ( ) . anyMatch ( ref -> ref . getName ( ) . endsWith ( branch ) ) ; } catch ( GitAPIException e ) { throw new IllegalStateException ( e ) ; } } | Checks if given branch has been checkedout locally too . |
6,407 | public boolean isRemoteBranch ( final Git git , final String branch , final String remote ) { try { final List < Ref > refs = git . branchList ( ) . setListMode ( ListBranchCommand . ListMode . REMOTE ) . call ( ) ; final String remoteBranch = remote + "/" + branch ; return refs . stream ( ) . anyMatch ( ref -> ref . g... | Checks if given branch is remote . |
6,408 | public Ref checkoutBranch ( Git git , String branch ) { try { return git . checkout ( ) . setName ( branch ) . call ( ) ; } catch ( GitAPIException e ) { throw new IllegalStateException ( e ) ; } } | Checkout existing branch . |
6,409 | public Ref createBranchAndCheckout ( Git git , String branch ) { try { return git . checkout ( ) . setCreateBranch ( true ) . setName ( branch ) . setUpstreamMode ( CreateBranchCommand . SetupUpstreamMode . TRACK ) . call ( ) ; } catch ( GitAPIException e ) { throw new IllegalStateException ( e ) ; } } | Executes a checkout - b command using given branch . |
6,410 | public RevCommit addAndCommit ( Git git , String message ) { try { git . add ( ) . addFilepattern ( "." ) . call ( ) ; return git . commit ( ) . setMessage ( message ) . call ( ) ; } catch ( GitAPIException e ) { throw new IllegalStateException ( e ) ; } } | Add all files and commit them with given message . This is equivalent as doing git add . git commit - m message . |
6,411 | public Ref createTag ( Git git , String name ) { try { return git . tag ( ) . setName ( name ) . call ( ) ; } catch ( GitAPIException e ) { throw new IllegalStateException ( e ) ; } } | Creates a tag . |
6,412 | public Git cloneRepository ( String remoteUrl , Path localPath ) { try { return Git . cloneRepository ( ) . setURI ( remoteUrl ) . setDirectory ( localPath . toFile ( ) ) . call ( ) ; } catch ( GitAPIException e ) { throw new IllegalStateException ( e ) ; } } | Clones a public remote git repository . Caller is responsible of closing git repository . |
6,413 | public boolean hasAtLeastOneReference ( Repository repo ) { for ( Ref ref : repo . getAllRefs ( ) . values ( ) ) { if ( ref . getObjectId ( ) == null ) continue ; return true ; } return false ; } | Checks if a repo has been cloned correctly . |
6,414 | public List < Node > removeChildren ( final String name ) throws IllegalArgumentException { if ( name == null || name . trim ( ) . length ( ) == 0 ) { throw new IllegalArgumentException ( "Path must not be null or empty" ) ; } List < Node > found = get ( name ) ; for ( Node child : found ) { children . remove ( child )... | Remove all child nodes found at the given query . |
6,415 | public String getTextValueForPatternName ( final String name ) { Node n = this . getSingle ( name ) ; String text = n == null ? null : n . getText ( ) ; return text ; } | Get the text value of the element found at the given query name . If no element is found or no text exists return null ; |
6,416 | public List < String > getTextValuesForPatternName ( final String name ) { List < String > result = new ArrayList < String > ( ) ; List < Node > jars = this . get ( name ) ; for ( Node node : jars ) { String text = node . getText ( ) ; if ( text != null ) { result . add ( text ) ; } } return Collections . unmodifiableL... | Get the text values of all elements found at the given query name . If no elements are found or no text exists return an empty list ; |
6,417 | private Pattern [ ] validateAndMergePatternInput ( final Pattern pattern , final Pattern ... patterns ) { if ( pattern == null ) { throw new IllegalArgumentException ( "At least one pattern must not be specified" ) ; } final List < Pattern > merged = new ArrayList < Pattern > ( ) ; merged . add ( pattern ) ; for ( fina... | Validates that at least one pattern was specified merges all patterns together and returns the result |
6,418 | public static < T extends Descriptor > T create ( final Class < T > type ) throws IllegalArgumentException { return create ( type , null ) ; } | Creates a new Descriptor instance ; the predefined default descriptor name for this type will be used . |
6,419 | public void generateEnums ( ) throws JClassAlreadyExistsException , IOException { final JCodeModel cm = new JCodeModel ( ) ; for ( final MetadataEnum metadataEnum : metadata . getEnumList ( ) ) { final String fqnEnum = metadataEnum . getPackageApi ( ) + "." + getPascalizeCase ( metadataEnum . getName ( ) ) ; final JDef... | Generates all enumeration classes . |
6,420 | public boolean isEnum ( final String elementType ) { final String namespace = splitElementType ( elementType ) [ 0 ] ; final String localname = splitElementType ( elementType ) [ 1 ] ; boolean isEnum = false ; for ( final MetadataEnum metadataEnum : metadata . getEnumList ( ) ) { if ( metadataEnum . getName ( ) . equal... | Returns true if the given string argument represents a enumeration class . |
6,421 | public static Long getProfileLastModifiedCookie ( HttpServletRequest request ) { String profileLastModified = HttpUtils . getCookieValue ( PROFILE_LAST_MODIFIED_COOKIE_NAME , request ) ; if ( StringUtils . isNotEmpty ( profileLastModified ) ) { try { return new Long ( profileLastModified ) ; } catch ( NumberFormatExcep... | Returns the last modified timestamp cookie from the request . |
6,422 | public static Authentication getCurrentAuthentication ( ) { RequestContext context = RequestContext . getCurrent ( ) ; if ( context != null ) { return getAuthentication ( context . getRequest ( ) ) ; } else { return null ; } } | Returns the authentication attribute from the current request . |
6,423 | public static void setCurrentAuthentication ( Authentication authentication ) { RequestContext context = RequestContext . getCurrent ( ) ; if ( context != null ) { setAuthentication ( context . getRequest ( ) , authentication ) ; } } | Sets the authentication attribute in the current request . |
6,424 | public static void removeCurrentAuthentication ( ) { RequestContext context = RequestContext . getCurrent ( ) ; if ( context != null ) { removeAuthentication ( context . getRequest ( ) ) ; } } | Removes the authentication attribute from the current request . |
6,425 | public static Profile getCurrentProfile ( ) { RequestContext context = RequestContext . getCurrent ( ) ; if ( context != null ) { return getProfile ( context . getRequest ( ) ) ; } else { return null ; } } | Returns the profile from authentication attribute from the current request . |
6,426 | public static Profile getProfile ( HttpServletRequest request ) { Authentication auth = getAuthentication ( request ) ; if ( auth != null ) { return auth . getProfile ( ) ; } else { return null ; } } | Returns the profile from authentication attribute from the specified request . |
6,427 | public void setUrlRestrictions ( Map < String , String > restrictions ) { urlRestrictions = new LinkedHashMap < > ( ) ; ExpressionParser parser = new SpelExpressionParser ( ) ; for ( Map . Entry < String , String > entry : restrictions . entrySet ( ) ) { urlRestrictions . put ( entry . getKey ( ) , parser . parseExpres... | Sets the map of restrictions . Each key of the map is ANT - style path pattern used to match the URLs of incoming requests and each value is a Spring EL expression . |
6,428 | private void loadImage ( ) { List < Transformation > transformations = getTransformations ( ) ; boolean hasUrl = url != null ; boolean hasResourceId = resourceId != null ; boolean hasPlaceholder = placeholderId != null ; ListenerTarget listenerTarget = getLinearTarget ( listener ) ; if ( hasUrl ) { RequestCreator bitma... | Uses the configuration previously applied using this ImageLoader builder to download a resource asynchronously and notify the result to the listener . |
6,429 | private ListenerTarget getLinearTarget ( final Listener listener ) { ListenerTarget target = targets . get ( listener ) ; if ( target == null ) { target = new ListenerTarget ( listener ) ; targets . put ( listener , target ) ; } return target ; } | Given a listener passed as argument creates or returns a lazy instance of a Picasso Target . This implementation is needed because Picasso doesn t keep a strong reference to the target passed as parameter . Without this method Picasso looses the reference to the target and never notifies when the resource has been down... |
6,430 | private void delegate ( RequestDelegationService service , HttpServletRequest request , HttpServletResponse response , FilterChain filterChain ) { try { service . delegate ( request , response , filterChain ) ; } catch ( Exception e ) { throw new RequestDelegationException ( String . format ( "The request processing de... | Delegates given request and response to be processed by given service . |
6,431 | private boolean canDelegate ( RequestDelegationService delegate , HttpServletRequest request ) { try { return delegate . canDelegate ( request ) ; } catch ( Exception e ) { log . log ( Level . SEVERE , String . format ( "The delegation service can't check the delegability of the request: %s" , e . getCause ( ) ) , e . ... | Checks whether the given service can serve given request . |
6,432 | void awaitRequests ( ) { if ( ! isWaitingForEnriching ( ) ) { return ; } for ( int i = 0 ; i < NUMBER_OF_WAIT_LOOPS ; i ++ ) { try { Thread . sleep ( THREAD_SLEEP ) ; if ( ! isEnrichmentAdvertised ( ) ) { return ; } } catch ( InterruptedException e ) { throw new IllegalStateException ( e ) ; } } throw new SettingReques... | Await client activity causing requests in order to enrich requests |
6,433 | void awaitResponses ( ) { try { boolean finishedNicely = responseFinished . await ( WAIT_TIMEOUT_MILISECONDS , TimeUnit . MILLISECONDS ) ; if ( ! finishedNicely ) { throw new WarpSynchronizationException ( WarpContextStore . get ( ) ) ; } } catch ( InterruptedException e ) { } } | Await responses for requests or premature finishing |
6,434 | public void setDateTimeZone ( Object dtz ) throws JspTagException { if ( dtz == null || dtz instanceof String && ( ( String ) dtz ) . length ( ) == 0 ) { this . dateTimeZone = null ; } else if ( dtz instanceof DateTimeZone ) { this . dateTimeZone = ( DateTimeZone ) dtz ; } else { try { this . dateTimeZone = DateTimeZon... | Sets the zone attribute . |
6,435 | public void setLocale ( Object loc ) throws JspTagException { if ( loc == null || ( loc instanceof String && ( ( String ) loc ) . length ( ) == 0 ) ) { this . locale = null ; } else if ( loc instanceof Locale ) { this . locale = ( Locale ) loc ; } else { locale = Util . parseLocale ( ( String ) loc ) ; } } | Sets the style attribute . |
6,436 | protected boolean hasNoInvalidScope ( Attributes a ) { String scope = a . getValue ( SCOPE ) ; if ( ( scope != null ) && ! scope . equals ( PAGE_SCOPE ) && ! scope . equals ( REQUEST_SCOPE ) && ! scope . equals ( SESSION_SCOPE ) && ! scope . equals ( APPLICATION_SCOPE ) ) { return false ; } return true ; } | returns true if the scope attribute is valid |
6,437 | protected boolean hasDanglingScope ( Attributes a ) { return ( a . getValue ( SCOPE ) != null && a . getValue ( VAR ) == null ) ; } | returns true if the scope attribute is present without var |
6,438 | protected String getLocalPart ( String qname ) { int colon = qname . indexOf ( ":" ) ; return ( colon == - 1 ) ? qname : qname . substring ( colon + 1 ) ; } | retrieves the local part of a QName |
6,439 | private void executeGetOperation ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ClassNotFoundException { if ( request . getContentLength ( ) > 0 ) { response . setStatus ( HttpServletResponse . SC_NO_CONTENT ) ; ObjectInputStream input = new ObjectInputStream ( new BufferedInputStrea... | Container - to - Client command execution |
6,440 | private void executePutOperation ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ClassNotFoundException { if ( request . getContentLength ( ) > 0 ) { ObjectInputStream input = new ObjectInputStream ( new BufferedInputStream ( request . getInputStream ( ) ) ) ; CommandPayload payload =... | Client - to - Container event propagation |
6,441 | public FutureData < Dpu > dpu ( String historicsId ) { final FutureData < Dpu > future = new FutureData < Dpu > ( ) ; URI uri = newParams ( ) . put ( "historics_id" , historicsId ) . forURL ( config . newAPIEndpointURI ( DPU ) ) ; Request request = config . http ( ) . GET ( uri , new PageReader ( newRequestCallback ( f... | Retrieve the DPU usage of a historics job |
6,442 | private String computeRequestMethod ( Element e ) { for ( AnnotationMirror am : e . getAnnotationMirrors ( ) ) { final String typeString = am . getAnnotationType ( ) . toString ( ) ; if ( typeString . endsWith ( ".GET" ) ) { return "GET" ; } else if ( typeString . endsWith ( ".PUT" ) ) { return "PUT" ; } else if ( type... | Find the request method annotation the method was annotated with and return a string representing the request method . |
6,443 | private void generateOutput ( ) { final Filer filer = processingEnv . getFiler ( ) ; writeJsonToFile ( filer , "JSONClasses" , jsonClasses ) ; writeJsonToFile ( filer , "debugcrud" , debugMessages ) ; final List < ResourceMethod > resources = Lists . newArrayList ( ) ; for ( ResourceClass klass : resourceClasses . valu... | Dump the contents of our discoveries . |
6,444 | public void process ( TestDeployment testDeployment , Archive < ? > protocolArchive ) { final TestClass testClass = this . testClass . get ( ) ; final Archive < ? > applicationArchive = testDeployment . getApplicationArchive ( ) ; if ( WarpCommons . isWarpTest ( testClass . getJavaClass ( ) ) ) { if ( ! Validate . isAr... | Adds Warp archive to the protocol archive to make it available for WARs and EARs . |
6,445 | private void addWarpExtensionsDeployment ( WebArchive archive ) { final Collection < WarpDeploymentEnrichmentExtension > lifecycleExtensions = serviceLoader . get ( ) . all ( WarpDeploymentEnrichmentExtension . class ) ; for ( WarpDeploymentEnrichmentExtension extension : lifecycleExtensions ) { JavaArchive library = e... | Adds all Warp lifecycle extension packages to the archive |
6,446 | public static int getScope ( String scope ) { int ret = PageContext . PAGE_SCOPE ; if ( REQUEST . equalsIgnoreCase ( scope ) ) { ret = PageContext . REQUEST_SCOPE ; } else if ( SESSION . equalsIgnoreCase ( scope ) ) { ret = PageContext . SESSION_SCOPE ; } else if ( APPLICATION . equalsIgnoreCase ( scope ) ) { ret = Pag... | Converts the given string description of a scope to the corresponding PageContext constant . |
6,447 | private static Locale findFormattingMatch ( Locale pref , Locale [ ] avail ) { Locale match = null ; boolean langAndCountryMatch = false ; for ( int i = 0 ; i < avail . length ; i ++ ) { if ( pref . equals ( avail [ i ] ) ) { match = avail [ i ] ; break ; } else if ( ! "" . equals ( pref . getVariant ( ) ) && "" . equa... | Returns the best match between the given preferred locale and the given available locales . |
6,448 | public static LocalizationContext getLocalizationContext ( PageContext pc ) { LocalizationContext locCtxt = null ; Object obj = Config . find ( pc , Config . FMT_LOCALIZATION_CONTEXT ) ; if ( obj == null ) { return null ; } if ( obj instanceof LocalizationContext ) { locCtxt = ( LocalizationContext ) obj ; } else { loc... | Gets the default I18N localization context . |
6,449 | public RestRequestBuilder < B , R > addQueryParam ( String name , Collection < ? > values ) { if ( null != values ) { List < Object > allValues = getQueryParams ( name ) ; allValues . addAll ( values ) ; } return this ; } | Add a query parameter . If a null or empty collection is passed the param is ignored . |
6,450 | public RestRequestBuilder < B , R > addQueryParam ( String name , Object [ ] values ) { if ( null != values ) { List < Object > allValues = getQueryParams ( name ) ; for ( Object value : values ) { allValues . add ( value ) ; } } return this ; } | Add a query parameter . If a null or empty array is passed the param is ignored . |
6,451 | public static byte [ ] encodeInteger ( BigInteger bigInt ) { if ( bigInt == null ) { throw new NullPointerException ( "encodeInteger called with null parameter" ) ; } return encodeBase64 ( toIntegerBytes ( bigInt ) , false ) ; } | Encodes to a byte64 - encoded integer according to crypto standards such as W3C s XML - Signature |
6,452 | private String removeEnclosedCurlyBraces ( String str ) { final char curlyReplacement = 6 ; char [ ] chars = str . toCharArray ( ) ; int open = 0 ; for ( int i = 0 ; i < chars . length ; i ++ ) { if ( chars [ i ] == '{' ) { if ( open != 0 ) chars [ i ] = curlyReplacement ; open ++ ; } else if ( chars [ i ] == '}' ) { o... | Enclosed curly braces cannot be matched with a regex . Thus we remove them before applying the replaceAll method |
6,453 | public static WarpExecutionBuilder initiate ( Activity activity ) { WarpRuntime runtime = WarpRuntime . getInstance ( ) ; if ( runtime == null ) { throw new IllegalStateException ( "The Warp runtime isn't initialized. You need to make sure arquillian-warp-impl is on classpath and annotate a test class with @WarpTest in... | Takes client activity which should be performed in order to cause server request . |
6,454 | public int readInt ( ) throws IOException { int value = 0 ; value += ( read ( ) & 0xff ) << 0 ; value += ( read ( ) & 0xff ) << 8 ; value += ( read ( ) & 0xff ) << 16 ; value += ( read ( ) & 0xff ) << 24 ; return ( int ) value ; } | Read 32bit word as integer . |
6,455 | public int [ ] readIntArray ( int length ) throws IOException { int arr [ ] = new int [ length ] ; for ( int i = 0 ; i < length ; i ++ ) { arr [ i ] = readInt ( ) ; } return arr ; } | Read an array of 32bit words . |
6,456 | public byte [ ] readByteArray ( int length ) throws IOException { byte buf [ ] = new byte [ length ] ; for ( int i = 0 ; i < length ; i ++ ) { buf [ i ] = ( byte ) read ( ) ; } return buf ; } | Read an array of bytes . |
6,457 | public static void asUnchecked ( Throwable t , Class < ? extends RuntimeException > checkedExceptionWrapper ) { if ( t instanceof AssertionError ) { throw ( AssertionError ) t ; } else if ( t instanceof RuntimeException ) { throw ( RuntimeException ) t ; } else { RuntimeException exception ; try { exception = checkedEx... | Checks whether given throwable is unchecked and if not it will be wrapped as unchecked exception of given type |
6,458 | public static String getMessage ( String name , Object [ ] a ) throws MissingResourceException { String res = rb . getString ( name ) ; return MessageFormat . format ( res , a ) ; } | Retrieves a message with arbitrarily many arguments . |
6,459 | public static String getMessage ( String name , Object a1 , Object a2 , Object a3 , Object a4 ) throws MissingResourceException { return getMessage ( name , new Object [ ] { a1 , a2 , a3 , a4 } ) ; } | Retrieves a message with four arguments . |
6,460 | static Class < ? > [ ] getAncestors ( Class < ? > clazz ) { Set < Class < ? > > classes = new HashSet < Class < ? > > ( ) ; while ( clazz != null ) { classes . add ( clazz ) ; if ( clazz . getSuperclass ( ) != null ) { classes . add ( clazz . getSuperclass ( ) ) ; } classes . addAll ( Arrays . asList ( clazz . getInter... | Get all subclasses and interfaces in whole class hierarchy |
6,461 | private TypeSpec generateBuilder ( RestService restService ) { TypeSpec . Builder typeBuilder = TypeSpec . classBuilder ( restService . getBuilderSimpleClassName ( ) ) . addModifiers ( Modifier . PUBLIC , Modifier . FINAL ) . addJavadoc ( "Generated REST service builder for {@link $L}.\n" , restService . getTypeElement... | Generate the rest service builder |
6,462 | public void note ( Element e , String msg , Object ... args ) { messager . printMessage ( Diagnostic . Kind . NOTE , String . format ( msg , args ) , e ) ; } | Prints a note message |
6,463 | public void warn ( Element e , String msg , Object ... args ) { messager . printMessage ( Diagnostic . Kind . WARNING , String . format ( msg , args ) , e ) ; } | Prints a warning message |
6,464 | public void error ( Element e , String msg , Object ... args ) { messager . printMessage ( Diagnostic . Kind . ERROR , String . format ( msg , args ) , e ) ; } | Prints an error message |
6,465 | public FacebookPage addInstagramLinkedPage ( String pageid ) { ResourceParams parameterSet = newResourceParams ( ) ; parameterSet . set ( "id" , pageid ) ; parameterSet . set ( "type" , "instagram" ) ; return this ; } | Add a facebook page to be crawled for instagram content |
6,466 | public FacebookPage addInstagramUser ( String username ) { ResourceParams parameterSet = newResourceParams ( ) ; parameterSet . set ( "id" , username ) ; parameterSet . set ( "type" , "instagram_user" ) ; return this ; } | Add an instagram user to be crawled for content |
6,467 | private < T > T execute ( String url , Class < T > returnType , Object requestObject ) throws Exception { URLConnection connection = new URL ( url ) . openConnection ( ) ; if ( ! ( connection instanceof HttpURLConnection ) ) { throw new IllegalStateException ( "Not an http connection! " + connection ) ; } HttpURLConnec... | Executes the request to the remote url |
6,468 | private Grammar getEqualGrammar ( Grammar gr ) { for ( Grammar gx : this . grammars ) { if ( gr == gx ) { return gx ; } if ( isSameGrammarType ( gr , gx ) ) { if ( gr . getNumberOfEvents ( ) == gx . getNumberOfEvents ( ) ) { List < Grammar > handled = new ArrayList < Grammar > ( ) ; if ( isEqualGrammar ( gr , gx , hand... | ! = null ... found equal grammar |
6,469 | private synchronized void compile ( Token tok ) { if ( this . operations != null ) return ; this . numberOfClosures = 0 ; this . operations = this . compile ( tok , null , false ) ; } | Compiles a token tree into an operation flow . |
6,470 | protected SchemaInformedFirstStartTagGrammar translateSimpleTypeDefinitionToFSA ( XSSimpleTypeDefinition std ) throws EXIException { Characters chSchemaValid = new Characters ( getDatatype ( std ) ) ; SchemaInformedGrammar simpleContentEnd = SIMPLE_END_ELEMENT_RULE ; SchemaInformedElement simpleContent = new SchemaInfo... | protected SchemaInformedElement translateSimpleTypeDefinitionToFSA ( |
6,471 | private void init_jorbis ( ) { oggSyncState_ = new SyncState ( ) ; oggStreamState_ = new StreamState ( ) ; oggPage_ = new Page ( ) ; oggPacket_ = new Packet ( ) ; vorbisInfo = new Info ( ) ; vorbisComment = new Comment ( ) ; vorbisDspState = new DspState ( ) ; vorbisBlock = new Block ( vorbisDspState ) ; buffer = null ... | Initializes all the jOrbis and jOgg vars that are used for song playback . |
6,472 | private void outputSamples ( ) { int samples ; while ( ( samples = vorbisDspState . synthesis_pcmout ( _pcmf , _index ) ) > 0 ) { float [ ] [ ] pcmf = _pcmf [ 0 ] ; bout = ( samples < convsize ? samples : convsize ) ; for ( i = 0 ; i < vorbisInfo . channels ; i ++ ) { int pointer = i * 2 ; int mono = _index [ i ] ; for... | This routine was extracted so that when the output buffer fills up we can break out of the loop let the music channel drain then continue from where we were . |
6,473 | public int getBeginning ( int index ) { if ( this . beginpos == null ) throw new IllegalStateException ( "A result is not set." ) ; if ( index < 0 || this . nofgroups <= index ) throw new IllegalArgumentException ( "The parameter must be less than " + this . nofgroups + ": " + index ) ; return this . beginpos [ index ]... | Return a start position in the target text matched to specified regular expression group . |
6,474 | public int getEnd ( int index ) { if ( this . endpos == null ) throw new IllegalStateException ( "A result is not set." ) ; if ( index < 0 || this . nofgroups <= index ) throw new IllegalArgumentException ( "The parameter must be less than " + this . nofgroups + ": " + index ) ; return this . endpos [ index ] ; } | Return an end position in the target text matched to specified regular expression group . |
6,475 | public String getCapturedText ( int index ) { if ( this . beginpos == null ) throw new IllegalStateException ( "match() has never been called." ) ; if ( index < 0 || this . nofgroups <= index ) throw new IllegalArgumentException ( "The parameter must be less than " + this . nofgroups + ": " + index ) ; String ret ; int... | Return an substring of the target text matched to specified regular expression group . |
6,476 | protected void addRange ( int start , int end ) { this . icaseCache = null ; int r1 , r2 ; if ( start <= end ) { r1 = start ; r2 = end ; } else { r1 = end ; r2 = start ; } int pos = 0 ; if ( this . ranges == null ) { this . ranges = new int [ 2 ] ; this . ranges [ 0 ] = r1 ; this . ranges [ 1 ] = r2 ; this . setSorted ... | for RANGE or NRANGE |
6,477 | public AudioFileFormat getAudioFileFormat ( File file ) throws UnsupportedAudioFileException , IOException { LOG . log ( Level . FINE , "getAudioFileFormat(File file)" ) ; try ( InputStream inputStream = new BufferedInputStream ( new FileInputStream ( file ) ) ) { inputStream . mark ( MARK_LIMIT ) ; getAudioFileFormat ... | Return the AudioFileFormat from the given file . |
6,478 | public AudioFileFormat getAudioFileFormat ( URL url ) throws UnsupportedAudioFileException , IOException { LOG . log ( Level . FINE , "getAudioFileFormat(URL url)" ) ; InputStream inputStream = url . openStream ( ) ; try { return getAudioFileFormat ( inputStream ) ; } finally { if ( inputStream != null ) { inputStream ... | Return the AudioFileFormat from the given URL . |
6,479 | public AudioFileFormat getAudioFileFormat ( InputStream inputStream ) throws UnsupportedAudioFileException , IOException { LOG . log ( Level . FINE , "getAudioFileFormat(InputStream inputStream)" ) ; try { if ( ! inputStream . markSupported ( ) ) { inputStream = new BufferedInputStream ( inputStream ) ; } inputStream .... | Return the AudioFileFormat from the given InputStream . |
6,480 | public AudioFileFormat getAudioFileFormat ( InputStream inputStream , long medialength ) throws UnsupportedAudioFileException , IOException { return getAudioFileFormat ( inputStream , ( int ) medialength , AudioSystem . NOT_SPECIFIED ) ; } | Return the AudioFileFormat from the given InputStream and length in bytes . |
6,481 | public AudioInputStream getAudioInputStream ( File file ) throws UnsupportedAudioFileException , IOException { LOG . log ( Level . FINE , "getAudioInputStream(File file)" ) ; InputStream inputStream = new FileInputStream ( file ) ; try { return getAudioInputStream ( inputStream ) ; } catch ( UnsupportedAudioFileExcepti... | Return the AudioInputStream from the given File . |
6,482 | public AudioInputStream getAudioInputStream ( URL url ) throws UnsupportedAudioFileException , IOException { LOG . log ( Level . FINE , "getAudioInputStream(URL url)" ) ; InputStream inputStream = url . openStream ( ) ; try { return getAudioInputStream ( inputStream ) ; } catch ( UnsupportedAudioFileException | IOExcep... | Return the AudioInputStream from the given URL . |
6,483 | void decode_clear ( ) { os . clear ( ) ; vd . clear ( ) ; vb . clear ( ) ; decode_ready = false ; bittrack = 0.f ; samptrack = 0.f ; } | clear out the current logical bitstream decoder |
6,484 | int process_packet ( int readp ) { Page og = new Page ( ) ; while ( true ) { if ( decode_ready ) { Packet op = new Packet ( ) ; int result = os . packetout ( op ) ; long granulepos ; if ( result > 0 ) { granulepos = op . granulepos ; if ( vb . synthesis ( op ) == 0 ) { { int oldsamples = vd . synthesis_pcmout ( null , ... | 1 ) got a packet |
6,485 | int clear ( ) { vb . clear ( ) ; vd . clear ( ) ; os . clear ( ) ; if ( vi != null && links != 0 ) { for ( int i = 0 ; i < links ; i ++ ) { vi [ i ] . clear ( ) ; vc [ i ] . clear ( ) ; } vi = null ; vc = null ; } if ( dataoffsets != null ) { dataoffsets = null ; } if ( pcmlengths != null ) { pcmlengths = null ; } if (... | clear out the OggVorbis_File struct |
6,486 | public AudioInputStream getAudioInputStream ( AudioFormat targetFormat , AudioInputStream audioInputStream ) { if ( isConversionSupported ( targetFormat , audioInputStream . getFormat ( ) ) ) { return new DecodedVorbisAudioInputStream ( targetFormat , audioInputStream ) ; } else { throw new IllegalArgumentException ( "... | Returns converted AudioInputStream . |
6,487 | public static boolean matches ( AudioFormat format1 , AudioFormat format2 ) { return format1 . getEncoding ( ) . equals ( format2 . getEncoding ( ) ) && ( format2 . getSampleSizeInBits ( ) <= 8 || format1 . getSampleSizeInBits ( ) == AudioSystem . NOT_SPECIFIED || format2 . getSampleSizeInBits ( ) == AudioSystem . NOT_... | and a AudioFormat . Encoding . matches method . |
6,488 | private void setupWizard ( ) { setupComponents ( ) ; layoutComponents ( ) ; setMinimumSize ( defaultminimumSize ) ; Dimension screenSize = Toolkit . getDefaultToolkit ( ) . getScreenSize ( ) ; int xPosition = ( screenSize . width / 2 ) - ( defaultminimumSize . width / 2 ) ; int yPosition = ( screenSize . height / 2 ) -... | Sets up wizard upon construction . |
6,489 | private void setupComponents ( ) { cancelButton . addActionListener ( new ActionListener ( ) { public void actionPerformed ( ActionEvent e ) { dispose ( ) ; } } ) ; finishButton . addActionListener ( new ActionListener ( ) { public void actionPerformed ( ActionEvent e ) { JOptionPane . showMessageDialog ( getContentPan... | Sets up the components of the wizard with listeners and mnemonics . |
6,490 | private void layoutComponents ( ) { GridBagLayout layout = new GridBagLayout ( ) ; layout . rowWeights = new double [ ] { 1.0 , 0.0 , 0.0 } ; layout . columnWeights = new double [ ] { 1.0 , 0.0 , 0.0 , 0.0 , 0.0 } ; layout . rowHeights = new int [ ] { 0 , 0 , 0 } ; layout . columnWidths = new int [ ] { 0 , 0 , 0 , 0 , ... | Lays out the components in the wizards content pane . |
6,491 | public Grammars createXSDTypesOnlyGrammars ( ) throws EXIException { grammarBuilder . loadXSDTypesOnlyGrammars ( ) ; SchemaInformedGrammars g = grammarBuilder . toGrammars ( ) ; g . setBuiltInXMLSchemaTypesOnly ( true ) ; return g ; } | No user defined schema information is generated for processing the EXI body ; however the built - in XML schema types are available for use in the EXI body . |
6,492 | public AudioFormat . Encoding [ ] getTargetEncodings ( AudioFormat sourceFormat ) { if ( isAllowedSourceFormat ( sourceFormat ) ) { return getTargetEncodings ( ) ; } else { return EMPTY_ENCODING_ARRAY ; } } | This implementation assumes that the converter can convert from each of its source encodings to each of its target encodings . If this is not the case the converter has to override this method . |
6,493 | public AudioFormat [ ] getTargetFormats ( AudioFormat . Encoding targetEncoding , AudioFormat sourceFormat ) { if ( isConversionSupported ( targetEncoding , sourceFormat ) ) { return m_targetFormats . toArray ( EMPTY_FORMAT_ARRAY ) ; } else { return EMPTY_FORMAT_ARRAY ; } } | This implementation assumes that the converter can convert from each of its source formats to each of its target formats . If this is not the case the converter has to override this method . |
6,494 | final int getMinLength ( ) { switch ( this . type ) { case CONCAT : int sum = 0 ; for ( int i = 0 ; i < this . size ( ) ; i ++ ) sum += this . getChild ( i ) . getMinLength ( ) ; return sum ; case CONDITION : case UNION : if ( this . size ( ) == 0 ) return 0 ; int ret = this . getChild ( 0 ) . getMinLength ( ) ; for ( ... | How many characters are needed? |
6,495 | public boolean showNextPage ( AbstractWizardPage nextPage ) { if ( nextPage == null ) { updateButtons ( ) ; return false ; } if ( currentPage != null ) { pageHistory . push ( currentPage ) ; } setPage ( nextPage ) ; return true ; } | Sets the current page of this wizard to the specified page and adds the previous current page to the history . |
6,496 | int encode ( int a , Buffer b ) { b . write ( codelist [ a ] , c . lengthlist [ a ] ) ; return ( c . lengthlist [ a ] ) ; } | returns the number of bits |
6,497 | synchronized int decodevs_add ( float [ ] a , int offset , Buffer b , int n ) { int step = n / dim ; int entry ; int i , j , o ; if ( t . length < step ) { t = new int [ step ] ; } for ( i = 0 ; i < step ; i ++ ) { entry = decode ( b ) ; if ( entry == - 1 ) { return ( - 1 ) ; } t [ i ] = entry * dim ; } for ( i = 0 , o... | decodevs_add is synchronized for re - using t . |
6,498 | private int maptype1_quantvals ( ) { int vals = ( int ) ( Math . floor ( Math . pow ( entries , 1. / dim ) ) ) ; while ( true ) { int acc = 1 ; int acc1 = 1 ; for ( int i = 0 ; i < dim ; i ++ ) { acc *= vals ; acc1 *= vals + 1 ; } if ( acc <= entries && acc1 > entries ) { return ( vals ) ; } else { if ( acc > entries )... | thought of it . Therefore we opt on the side of caution |
6,499 | public void setBundleId ( String bundleId ) { if ( JawrRequestHandler . CLIENTSIDE_HANDLER_REQ_PATH . equals ( bundleId ) ) throw new IllegalArgumentException ( "The provided id [" + JawrRequestHandler . CLIENTSIDE_HANDLER_REQ_PATH + "] can't be used since it's the same as the clientside handler path. Please change thi... | Sets the bundle ID |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.