signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class Postfach { /** * Liefert die einzelnen Attribute eines Postfaches als Map .
* @ return Attribute als Map */
@ Override public Map < String , Object > toMap ( ) { } }
|
Map < String , Object > map = new HashMap < > ( ) ; map . put ( "plz" , getPLZ ( ) ) ; map . put ( "ortsname" , getOrtsname ( ) ) ; if ( nummer != null ) { map . put ( "nummer" , nummer ) ; } return map ;
|
public class BuildTasksInner { /** * Creates a build task for a container registry with the specified parameters .
* @ param resourceGroupName The name of the resource group to which the container registry belongs .
* @ param registryName The name of the container registry .
* @ param buildTaskName The name of the container registry build task .
* @ param buildTaskCreateParameters The parameters for creating a build task .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < BuildTaskInner > beginCreateAsync ( String resourceGroupName , String registryName , String buildTaskName , BuildTaskInner buildTaskCreateParameters , final ServiceCallback < BuildTaskInner > serviceCallback ) { } }
|
return ServiceFuture . fromResponse ( beginCreateWithServiceResponseAsync ( resourceGroupName , registryName , buildTaskName , buildTaskCreateParameters ) , serviceCallback ) ;
|
public class LNGBooleanVector { /** * Grows the vector to a new size and initializes the new elements with a given value .
* @ param size the new size
* @ param pad the value for new elements */
public void growTo ( int size , boolean pad ) { } }
|
if ( this . size >= size ) return ; this . ensure ( size ) ; for ( int i = this . size ; i < size ; i ++ ) this . elements [ i ] = pad ; this . size = size ;
|
public class MessageBuilder { /** * Creates a DISCONNECTED message .
* @ param serverId the ID of the disconnected peer .
* @ return a protobuf message . */
public static Message buildDisconnected ( String serverId ) { } }
|
Disconnected dis = Disconnected . newBuilder ( ) . setServerId ( serverId ) . build ( ) ; return Message . newBuilder ( ) . setType ( MessageType . DISCONNECTED ) . setDisconnected ( dis ) . build ( ) ;
|
public class DefaultProcessExecutor { /** * This function parsers the command and converts to a command array .
* @ param configurationHolder
* The configuration holder used when invoking the process
* @ param command
* The command to parse
* @ return The parsed command as an array */
protected List < String > parseCommand ( ConfigurationHolder configurationHolder , String command ) { } }
|
// init list
List < String > commandList = new LinkedList < String > ( ) ; StringBuilder buffer = new StringBuilder ( command ) ; String part = null ; int quoteIndex = - 1 ; int spaceIndex = - 1 ; int length = - 1 ; do { quoteIndex = buffer . indexOf ( "\"" ) ; spaceIndex = buffer . indexOf ( " " ) ; if ( quoteIndex == - 1 ) { if ( spaceIndex == - 1 ) { buffer = this . addAllBuffer ( commandList , buffer ) ; } else { buffer = this . addPart ( commandList , buffer , spaceIndex , true ) ; } } else if ( spaceIndex == - 1 ) { if ( quoteIndex == - 1 ) { buffer = this . addAllBuffer ( commandList , buffer ) ; } else if ( quoteIndex == 0 ) { quoteIndex = buffer . indexOf ( "\"" , 1 ) ; if ( quoteIndex == - 1 ) { throw new FaxException ( "Unable to parse command: " + command ) ; } buffer = this . addPart ( commandList , buffer , quoteIndex , false ) ; } else { throw new FaxException ( "Unable to parse command: " + command ) ; } } else if ( quoteIndex < spaceIndex ) { if ( quoteIndex == 0 ) { quoteIndex = buffer . indexOf ( "\"" , 1 ) ; if ( quoteIndex == - 1 ) { throw new FaxException ( "Unable to parse command: " + command ) ; } buffer = this . addPart ( commandList , buffer , quoteIndex , false ) ; } else { buffer = this . addPart ( commandList , buffer , spaceIndex , true ) ; } } else // spaceIndex < quoteIndex
{ buffer = this . addPart ( commandList , buffer , spaceIndex , true ) ; } length = buffer . length ( ) ; if ( length > 0 ) { part = buffer . toString ( ) ; part = part . trim ( ) ; buffer . delete ( 0 , length ) ; buffer . append ( part ) ; length = buffer . length ( ) ; } } while ( length > 0 ) ; return commandList ;
|
public class QueryExpression { /** * Sets the scope to SESSION for the QueryExpression object that creates
* the table */
void setReturningResultSet ( ) { } }
|
if ( unionCorresponding ) { persistenceScope = TableBase . SCOPE_SESSION ; columnMode = TableBase . COLUMNS_UNREFERENCED ; return ; } leftQueryExpression . setReturningResultSet ( ) ;
|
public class Step { /** * Save value in memory using default target key ( Page key + field ) .
* @ param field
* is name of the field to retrieve .
* @ param page
* is target page .
* @ throws TechnicalException
* is thrown if you have a technical error ( format , configuration , datas , . . . ) in NoraUi .
* Exception with { @ value com . github . noraui . utils . Messages # FAIL _ MESSAGE _ UNABLE _ TO _ FIND _ ELEMENT } message ( with screenshot , with exception ) or with
* { @ value com . github . noraui . utils . Messages # FAIL _ MESSAGE _ UNABLE _ TO _ RETRIEVE _ VALUE } message
* ( with screenshot , with exception )
* @ throws FailureException
* if the scenario encounters a functional error */
protected void saveElementValue ( String field , Page page ) throws TechnicalException , FailureException { } }
|
logger . debug ( "saveValueInStep: {} in {}." , field , page . getApplication ( ) ) ; saveElementValue ( field , page . getPageKey ( ) + field , page ) ;
|
public class ExtendedData { /** * Retrieves a long value from the extended data .
* @ param type Type identifier
* @ return long value */
public long getLong ( Integer type ) { } }
|
long result = 0 ; byte [ ] item = m_map . get ( type ) ; if ( item != null ) { result = MPPUtility . getLong6 ( item , 0 ) ; } return ( result ) ;
|
public class RaftPartition { /** * Deletes the partition .
* @ return future to be completed once the partition has been deleted */
public CompletableFuture < Void > delete ( ) { } }
|
return server . stop ( ) . thenCompose ( v -> client . stop ( ) ) . thenRun ( ( ) -> { if ( server != null ) { server . delete ( ) ; } } ) ;
|
public class Maps { /** * Grabs the first value from a tree map ( Navigable map ) . */
public static < K , V > V first ( NavigableMap < K , V > map ) { } }
|
return map . firstEntry ( ) . getValue ( ) ;
|
public class JsHttpRequest { /** * [ ] or [ { name : . . . , value : . . . } , { name : . . . , value : . . . } ] */
public @ Nullable Scriptable jsFunction_headers ( String name ) { } }
|
Context cx = Context . getCurrentContext ( ) ; Header [ ] hs = req . getHeaders ( name ) ; Scriptable result = RHINO . newArray ( cx , getParentScope ( ) ) ; int i = 0 ; for ( Header h : hs ) { Scriptable jsh = makeJsHeader ( cx , h ) ; RHINO . putProperty ( result , i ++ , jsh ) ; } return result ;
|
public class AttributesManager { /** * Sets session attributes , replacing any existing attributes already present in the session . An exception is thrown
* if this method is called while processing an out of session request . Use this method when bulk replacing attributes
* is desired .
* @ param sessionAttributes session attributes to set
* @ throws IllegalStateException if attempting to retrieve session attributes from an out of session request */
public void setSessionAttributes ( Map < String , Object > sessionAttributes ) { } }
|
if ( requestEnvelope . getSession ( ) == null ) { throw new IllegalStateException ( "Attempting to set session attributes for out of session request" ) ; } this . sessionAttributes = sessionAttributes ;
|
public class RepositoryPersistor { /** * Read metadata by populating an instance of the target class
* using SAXParser . */
private Object readMetadataFromXML ( InputSource source , Class target ) throws MalformedURLException , ParserConfigurationException , SAXException , IOException { } }
|
// TODO : make this configurable
boolean validate = false ; // get a xml reader instance :
SAXParserFactory factory = SAXParserFactory . newInstance ( ) ; log . info ( "RepositoryPersistor using SAXParserFactory : " + factory . getClass ( ) . getName ( ) ) ; if ( validate ) { factory . setValidating ( true ) ; } SAXParser p = factory . newSAXParser ( ) ; XMLReader reader = p . getXMLReader ( ) ; if ( validate ) { reader . setErrorHandler ( new OJBErrorHandler ( ) ) ; } Object result ; if ( DescriptorRepository . class . equals ( target ) ) { // create an empty repository :
DescriptorRepository repository = new DescriptorRepository ( ) ; // create handler for building the repository structure
ContentHandler handler = new RepositoryXmlHandler ( repository ) ; // tell parser to use our handler :
reader . setContentHandler ( handler ) ; reader . parse ( source ) ; result = repository ; } else if ( ConnectionRepository . class . equals ( target ) ) { // create an empty repository :
ConnectionRepository repository = new ConnectionRepository ( ) ; // create handler for building the repository structure
ContentHandler handler = new ConnectionDescriptorXmlHandler ( repository ) ; // tell parser to use our handler :
reader . setContentHandler ( handler ) ; reader . parse ( source ) ; // LoggerFactory . getBootLogger ( ) . info ( " loading XML took " + ( stop - start ) + " msecs " ) ;
result = repository ; } else throw new MetadataException ( "Could not build a repository instance for '" + target + "', using source " + source ) ; return result ;
|
public class SystemParameter { /** * < pre >
* Define the URL query parameter name to use for the parameter . It is case
* sensitive .
* < / pre >
* < code > string url _ query _ parameter = 3 ; < / code > */
public java . lang . String getUrlQueryParameter ( ) { } }
|
java . lang . Object ref = urlQueryParameter_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; urlQueryParameter_ = s ; return s ; }
|
public class KeyVaultClientBaseImpl { /** * Creates or updates a new SAS definition for the specified storage account . This operation requires the storage / setsas permission .
* @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net .
* @ param storageAccountName The name of the storage account .
* @ param sasDefinitionName The name of the SAS definition .
* @ param templateUri The SAS definition token template signed with an arbitrary key . Tokens created according to the SAS definition will have the same properties as the template .
* @ param sasType The type of SAS token the SAS definition will create . Possible values include : ' account ' , ' service '
* @ param validityPeriod The validity period of SAS tokens created according to the SAS definition .
* @ param sasDefinitionAttributes The attributes of the SAS definition .
* @ param tags Application specific metadata in the form of key - value pairs .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < SasDefinitionBundle > setSasDefinitionAsync ( String vaultBaseUrl , String storageAccountName , String sasDefinitionName , String templateUri , SasTokenType sasType , String validityPeriod , SasDefinitionAttributes sasDefinitionAttributes , Map < String , String > tags , final ServiceCallback < SasDefinitionBundle > serviceCallback ) { } }
|
return ServiceFuture . fromResponse ( setSasDefinitionWithServiceResponseAsync ( vaultBaseUrl , storageAccountName , sasDefinitionName , templateUri , sasType , validityPeriod , sasDefinitionAttributes , tags ) , serviceCallback ) ;
|
public class Condition { /** * < p > Sample : < code > $ ( " # mydiv " ) . shouldHave ( attribute ( " fileId " , " 12345 " ) ) ; < / code > < / p >
* @ param attributeName name of attribute
* @ param expectedAttributeValue expected value of attribute */
public static Condition attribute ( final String attributeName , final String expectedAttributeValue ) { } }
|
return new Condition ( "attribute" ) { @ Override public boolean apply ( Driver driver , WebElement element ) { return expectedAttributeValue . equals ( getAttributeValue ( element , attributeName ) ) ; } @ Override public String toString ( ) { return name + " " + attributeName + '=' + expectedAttributeValue ; } } ;
|
public class DescribeUploadBufferRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeUploadBufferRequest describeUploadBufferRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( describeUploadBufferRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeUploadBufferRequest . getGatewayARN ( ) , GATEWAYARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class AmBaseSpout { /** * Continually called method by Storm that gets next message . < br >
* < br >
* When spout is running , this method is endlessly called . */
@ Override public void nextTuple ( ) { } }
|
if ( this . reloadConfig && this . watcher != null ) { Map < String , Object > reloadedConfig = null ; try { reloadedConfig = this . watcher . readIfUpdated ( ) ; } catch ( IOException ex ) { String logFormat = "Config file reload failed. Skip reload config." ; logger . warn ( logFormat , ex ) ; } if ( reloadedConfig != null ) { onUpdate ( reloadedConfig ) ; } } onNextTuple ( ) ;
|
public class WebFluxLinkBuilder { /** * Returns a { @ link UriComponentsBuilder } obtained from the { @ link ServerWebExchange } .
* @ param exchange */
private static UriComponentsBuilder getBuilder ( @ Nullable ServerWebExchange exchange ) { } }
|
return exchange == null ? UriComponentsBuilder . fromPath ( "/" ) : UriComponentsBuilder . fromHttpRequest ( exchange . getRequest ( ) ) ;
|
public class DerInputStream { /** * Get a Generalized encoded time value from the input stream . */
public Date getGeneralizedTime ( ) throws IOException { } }
|
if ( buffer . read ( ) != DerValue . tag_GeneralizedTime ) throw new IOException ( "DER input, GeneralizedTime tag invalid " ) ; return buffer . getGeneralizedTime ( getLength ( buffer ) ) ;
|
public class DescribeLifecycleHooksRequest { /** * The names of one or more lifecycle hooks . If you omit this parameter , all lifecycle hooks are described .
* @ return The names of one or more lifecycle hooks . If you omit this parameter , all lifecycle hooks are described . */
public java . util . List < String > getLifecycleHookNames ( ) { } }
|
if ( lifecycleHookNames == null ) { lifecycleHookNames = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return lifecycleHookNames ;
|
public class IterateExample { public static void main ( String [ ] args ) throws Exception { } }
|
// Checking input parameters
final ParameterTool params = ParameterTool . fromArgs ( args ) ; // set up input for the stream of integer pairs
// obtain execution environment and set setBufferTimeout to 1 to enable
// continuous flushing of the output buffers ( lowest latency )
StreamExecutionEnvironment env = StreamExecutionEnvironment . getExecutionEnvironment ( ) . setBufferTimeout ( 1 ) ; // make parameters available in the web interface
env . getConfig ( ) . setGlobalJobParameters ( params ) ; // create input stream of integer pairs
DataStream < Tuple2 < Integer , Integer > > inputStream ; if ( params . has ( "input" ) ) { inputStream = env . readTextFile ( params . get ( "input" ) ) . map ( new FibonacciInputMap ( ) ) ; } else { System . out . println ( "Executing Iterate example with default input data set." ) ; System . out . println ( "Use --input to specify file input." ) ; inputStream = env . addSource ( new RandomFibonacciSource ( ) ) ; } // create an iterative data stream from the input with 5 second timeout
IterativeStream < Tuple5 < Integer , Integer , Integer , Integer , Integer > > it = inputStream . map ( new InputMap ( ) ) . iterate ( 5000 ) ; // apply the step function to get the next Fibonacci number
// increment the counter and split the output with the output selector
SplitStream < Tuple5 < Integer , Integer , Integer , Integer , Integer > > step = it . map ( new Step ( ) ) . split ( new MySelector ( ) ) ; // close the iteration by selecting the tuples that were directed to the
// ' iterate ' channel in the output selector
it . closeWith ( step . select ( "iterate" ) ) ; // to produce the final output select the tuples directed to the
// ' output ' channel then get the input pairs that have the greatest iteration counter
// on a 1 second sliding window
DataStream < Tuple2 < Tuple2 < Integer , Integer > , Integer > > numbers = step . select ( "output" ) . map ( new OutputMap ( ) ) ; // emit results
if ( params . has ( "output" ) ) { numbers . writeAsText ( params . get ( "output" ) ) ; } else { System . out . println ( "Printing result to stdout. Use --output to specify output path." ) ; numbers . print ( ) ; } // execute the program
env . execute ( "Streaming Iteration Example" ) ;
|
public class NormalizeUtils { /** * It normalizes a { @ code value } in a range [ { @ code a } , { @ code b } ] given a { @ code min } and { @ code max } value .
* The equation used here were based on the following links :
* < ul >
* < li > { @ link https : / / stats . stackexchange . com / a / 281165 } < / li >
* < li > { @ link https : / / stats . stackexchange . com / a / 178629 } < / li >
* < li > { @ link https : / / en . wikipedia . org / wiki / Normalization _ ( statistics ) } < / li >
* < li > { @ link https : / / en . wikipedia . org / wiki / Feature _ scaling } < / li >
* < / ul >
* @ param value value number to be normalized
* @ param minRangeValue the minimum value for the range
* @ param maxRangeValue the maximum value for the range
* @ param min minimum value that { @ code value } can take on
* @ param max maximum value that { @ code value } can take on
* @ return the normalized number */
public static double normalize ( double value , double minRangeValue , double maxRangeValue , double min , double max ) { } }
|
if ( max == min ) { throw new JMetalException ( "The max minus min should not be zero" ) ; } return minRangeValue + ( ( ( value - min ) * ( maxRangeValue - minRangeValue ) ) / ( max - min ) ) ;
|
public class MenuParser { /** * Get rid of the extra HTML code .
* @ param strText
* @ return */
public static String stripTopLevelTag ( String strText , String strTag ) { } }
|
int iStart = MenuParser . getFirstNonWhitespace ( strText ) ; int iEnd = MenuParser . getLastNonWhitespace ( strText ) ; if ( ( iStart != - 1 ) && ( iEnd != - 1 ) ) { String strStartTag = Utility . startTag ( strTag ) ; String strEndTag = Utility . endTag ( strTag ) ; if ( strText . substring ( iStart , iStart + strStartTag . length ( ) ) . equalsIgnoreCase ( strStartTag ) ) if ( strText . substring ( iEnd - strEndTag . length ( ) + 1 , iEnd + 1 ) . equalsIgnoreCase ( strEndTag ) ) strText = strText . substring ( iStart + strStartTag . length ( ) , iEnd - strEndTag . length ( ) + 1 ) ; } return strText ;
|
public class DefaultGeometryIndexControllerFactory { @ Override public MapController create ( GeometryEditService editService , GeometryIndex index ) throws GeometryIndexNotFoundException { } }
|
if ( index == null ) { return null ; } switch ( editService . getIndexService ( ) . getType ( index ) ) { case TYPE_VERTEX : return createVertexController ( editService , index ) ; case TYPE_EDGE : return createEdgeController ( editService , index ) ; default : return null ; }
|
public class GeometryRendererImpl { /** * Renders a line from the last inserted point to the current mouse position , indicating what the new situation
* would look like if a vertex where to be inserted at the mouse location . */
public void onTentativeMove ( GeometryEditTentativeMoveEvent event ) { } }
|
try { Coordinate [ ] vertices = editService . getIndexService ( ) . getSiblingVertices ( editService . getGeometry ( ) , editService . getInsertIndex ( ) ) ; String geometryType = editService . getIndexService ( ) . getGeometryType ( editService . getGeometry ( ) , editService . getInsertIndex ( ) ) ; if ( vertices != null && ( Geometry . LINE_STRING . equals ( geometryType ) || Geometry . LINEAR_RING . equals ( geometryType ) ) ) { Coordinate temp1 = event . getOrigin ( ) ; Coordinate temp2 = event . getCurrentPosition ( ) ; Coordinate c1 = mapPresenter . getViewPort ( ) . getTransformationService ( ) . transform ( temp1 , RenderSpace . WORLD , RenderSpace . SCREEN ) ; Coordinate c2 = mapPresenter . getViewPort ( ) . getTransformationService ( ) . transform ( temp2 , RenderSpace . WORLD , RenderSpace . SCREEN ) ; tentativeMoveLine . setStep ( 0 , new MoveTo ( false , c1 . getX ( ) , c1 . getY ( ) ) ) ; tentativeMoveLine . setStep ( 1 , new LineTo ( false , c2 . getX ( ) , c2 . getY ( ) ) ) ; } else if ( vertices != null && Geometry . LINEAR_RING . equals ( geometryType ) ) { // Draw the second line ( as an option . . . )
} } catch ( GeometryIndexNotFoundException e ) { throw new IllegalStateException ( e ) ; }
|
public class DataSessionReader { /** * Retrieve the previous page from the Twilio API .
* @ param page current page
* @ param client TwilioRestClient with which to make the request
* @ return Previous Page */
@ Override public Page < DataSession > previousPage ( final Page < DataSession > page , final TwilioRestClient client ) { } }
|
Request request = new Request ( HttpMethod . GET , page . getPreviousPageUrl ( Domains . WIRELESS . toString ( ) , client . getRegion ( ) ) ) ; return pageForRequest ( client , request ) ;
|
public class AbcGrammar { /** * xcom - indent : : = " indent " 1 * WSP xcom - number xcom - unit */
Rule XcomIndent ( ) { } }
|
return Sequence ( String ( "indent" ) , OneOrMore ( WSP ( ) ) . suppressNode ( ) , XcomNumber ( ) , XcomUnit ( ) ) . label ( XcomIndent ) ;
|
public class PlanAssembler { /** * Turn sequential scan to index scan for group by if possible */
private AbstractPlanNode indexAccessForGroupByExprs ( SeqScanPlanNode root , IndexGroupByInfo gbInfo ) { } }
|
if ( ! root . isPersistentTableScan ( ) ) { // subquery and common tables are not handled
return root ; } String fromTableAlias = root . getTargetTableAlias ( ) ; assert ( fromTableAlias != null ) ; List < ParsedColInfo > groupBys = m_parsedSelect . groupByColumns ( ) ; Table targetTable = m_catalogDb . getTables ( ) . get ( root . getTargetTableName ( ) ) ; assert ( targetTable != null ) ; CatalogMap < Index > allIndexes = targetTable . getIndexes ( ) ; List < Integer > maxCoveredGroupByColumns = new ArrayList < > ( ) ; ArrayList < AbstractExpression > maxCoveredBindings = null ; Index pickedUpIndex = null ; boolean foundAllGroupByCoveredIndex = false ; for ( Index index : allIndexes ) { if ( ! IndexType . isScannable ( index . getType ( ) ) ) { continue ; } if ( ! index . getPredicatejson ( ) . isEmpty ( ) ) { // do not try to look at Partial / Sparse index
continue ; } ArrayList < AbstractExpression > bindings = new ArrayList < > ( ) ; List < Integer > coveredGroupByColumns = calculateGroupbyColumnsCovered ( index , fromTableAlias , bindings ) ; if ( coveredGroupByColumns . size ( ) > maxCoveredGroupByColumns . size ( ) ) { maxCoveredGroupByColumns = coveredGroupByColumns ; pickedUpIndex = index ; maxCoveredBindings = bindings ; if ( maxCoveredGroupByColumns . size ( ) == groupBys . size ( ) ) { foundAllGroupByCoveredIndex = true ; break ; } } } if ( pickedUpIndex == null ) { return root ; } IndexScanPlanNode indexScanNode = new IndexScanPlanNode ( root , null , pickedUpIndex , SortDirectionType . INVALID ) ; indexScanNode . setForGroupingOnly ( ) ; indexScanNode . setBindings ( maxCoveredBindings ) ; gbInfo . m_coveredGroupByColumns = maxCoveredGroupByColumns ; gbInfo . m_canBeFullySerialized = foundAllGroupByCoveredIndex ; return indexScanNode ;
|
public class DynamicTokenBucket { /** * Request tokens . Like { @ link # getPermitsAndDelay ( long , long , long ) } but block until the wait time passes . */
public long getPermits ( long requestedPermits , long minPermits , long timeoutMillis ) { } }
|
PermitsAndDelay permitsAndDelay = getPermitsAndDelay ( requestedPermits , minPermits , timeoutMillis ) ; if ( permitsAndDelay . delay > 0 ) { try { Thread . sleep ( permitsAndDelay . delay ) ; } catch ( InterruptedException ie ) { return 0 ; } } return permitsAndDelay . permits ;
|
public class CleaneLingSolver { /** * Performs resolution on two given clauses and a pivot literal .
* @ param c the first clause
* @ param pivot the pivot literal
* @ param d the second clause */
private void doResolve ( final CLClause c , final int pivot , final CLClause d ) { } }
|
assert ! c . dumped ( ) && ! c . satisfied ( ) ; assert ! d . dumped ( ) && ! d . satisfied ( ) ; assert this . addedlits . empty ( ) ; this . stats . steps ++ ; for ( int i = 0 ; i < c . lits ( ) . size ( ) ; i ++ ) { final int lit = c . lits ( ) . get ( i ) ; if ( lit != pivot ) { this . addedlits . push ( lit ) ; } } this . stats . steps ++ ; for ( int i = 0 ; i < d . lits ( ) . size ( ) ; i ++ ) { final int lit = d . lits ( ) . get ( i ) ; if ( lit != - pivot ) { this . addedlits . push ( lit ) ; } } if ( ! trivialClause ( ) ) { newPushConnectClause ( ) ; } this . addedlits . clear ( ) ;
|
public class ListFiles { /** * / * ( non - Javadoc ) */
File printHeader ( File directory ) { } }
|
System . out . printf ( "Listing contents for directory [%s]...%n%n" , directory . getAbsolutePath ( ) ) ; return directory ;
|
public class BosClient { /** * Copies a source object to a new destination in Bos .
* @ param request The request object containing all the options for copying an Bos object .
* @ return A CopyObjectResponse object containing the information returned by Bos for the newly created object . */
public CopyObjectResponse copyObject ( CopyObjectRequest request ) { } }
|
checkNotNull ( request , "request should not be null." ) ; assertStringNotNullOrEmpty ( request . getSourceKey ( ) , "object key should not be null or empty" ) ; InternalRequest internalRequest = this . createRequest ( request , HttpMethodName . PUT ) ; String copySourceHeader = "/" + request . getSourceBucketName ( ) + "/" + request . getSourceKey ( ) ; copySourceHeader = HttpUtils . normalizePath ( copySourceHeader ) ; internalRequest . addHeader ( Headers . BCE_COPY_SOURCE , copySourceHeader ) ; if ( request . getETag ( ) != null ) { internalRequest . addHeader ( Headers . BCE_COPY_SOURCE_IF_MATCH , "\"" + request . getETag ( ) + "\"" ) ; } if ( request . getNoneMatchETagConstraint ( ) != null ) { internalRequest . addHeader ( Headers . BCE_COPY_SOURCE_IF_NONE_MATCH , "\"" + request . getNoneMatchETagConstraint ( ) + "\"" ) ; } if ( request . getUnmodifiedSinceConstraint ( ) != null ) { internalRequest . addHeader ( Headers . BCE_COPY_SOURCE_IF_UNMODIFIED_SINCE , request . getUnmodifiedSinceConstraint ( ) ) ; } if ( request . getModifiedSinceConstraint ( ) != null ) { internalRequest . addHeader ( Headers . BCE_COPY_SOURCE_IF_MODIFIED_SINCE , request . getModifiedSinceConstraint ( ) ) ; } if ( request . getStorageClass ( ) != null ) { internalRequest . addHeader ( Headers . BCE_STORAGE_CLASS , request . getStorageClass ( ) ) ; } ObjectMetadata newObjectMetadata = request . getNewObjectMetadata ( ) ; if ( newObjectMetadata != null ) { internalRequest . addHeader ( Headers . BCE_COPY_METADATA_DIRECTIVE , "replace" ) ; populateRequestMetadata ( internalRequest , newObjectMetadata ) ; } else { internalRequest . addHeader ( Headers . BCE_COPY_METADATA_DIRECTIVE , "copy" ) ; } this . setZeroContentLength ( internalRequest ) ; CopyObjectResponseWithExceptionInfo intermidiateRes = this . invokeHttpClient ( internalRequest , CopyObjectResponseWithExceptionInfo . class ) ; // handle exception
if ( intermidiateRes . getETag ( ) == null && intermidiateRes . getLastModified ( ) == null ) { if ( intermidiateRes . getMessage ( ) != null ) { BceServiceException bse = new BceServiceException ( intermidiateRes . getMessage ( ) ) ; bse . setErrorCode ( intermidiateRes . getCode ( ) ) ; bse . setRequestId ( intermidiateRes . getRequestId ( ) ) ; if ( bse . getErrorCode ( ) == "InternalError" ) { bse . setErrorType ( ErrorType . Service ) ; } else { bse . setErrorType ( ErrorType . Client ) ; } bse . setStatusCode ( HttpStatus . SC_INTERNAL_SERVER_ERROR ) ; throw bse ; } } return ( CopyObjectResponse ) intermidiateRes ;
|
public class RestService { /** * { @ inheritDoc } */
@ Override public synchronized void start ( StartContext startContext ) throws StartException { } }
|
RestServerConfigurationBuilder builder = new RestServerConfigurationBuilder ( ) ; builder . name ( serverName ) . extendedHeaders ( extendedHeaders ) . ignoredCaches ( ignoredCaches ) . contextPath ( contextPath ) . maxContentLength ( maxContentLength ) . compressionLevel ( compressionLevel ) ; EncryptableServiceHelper . fillSecurityConfiguration ( this , builder . ssl ( ) ) ; String protocolName = getProtocolName ( ) ; ROOT_LOGGER . endpointStarting ( serverName ) ; try { SocketBinding socketBinding = getSocketBinding ( ) . getOptionalValue ( ) ; if ( socketBinding == null ) { builder . startTransport ( false ) ; ROOT_LOGGER . startingServerWithoutTransport ( "REST" ) ; } else { InetSocketAddress socketAddress = socketBinding . getSocketAddress ( ) ; builder . host ( socketAddress . getAddress ( ) . getHostAddress ( ) ) ; builder . port ( socketAddress . getPort ( ) ) ; } int mgmtHttpPort = getSocketBindingManagementPlain ( ) . getValue ( ) . getAbsolutePort ( ) ; int mgmtHttpsPort = getSocketBindingManagementSecured ( ) . getValue ( ) . getAbsolutePort ( ) ; builder . corsAllowForLocalhost ( "http" , mgmtHttpPort ) ; builder . corsAllowForLocalhost ( "https" , mgmtHttpsPort ) ; builder . corsAllowForLocalhost ( "http" , CROSS_ORIGIN_CONSOLE_PORT ) ; builder . corsAllowForLocalhost ( "https" , CROSS_ORIGIN_CONSOLE_PORT ) ; builder . addAll ( corsConfigList ) ; Authenticator authenticator ; switch ( authMethod ) { case BASIC : { SecurityRealm authenticationRealm = authenticationSecurityRealm . getOptionalValue ( ) ; SecurityDomain restSecurityDomain = new BasicRestSecurityDomain ( authenticationRealm ) ; authenticator = new BasicAuthenticator ( restSecurityDomain , authenticationRealm . getName ( ) ) ; break ; } case CLIENT_CERT : { if ( ! EncryptableServiceHelper . isSecurityEnabled ( this ) ) { throw ROOT_LOGGER . cannotUseCertificateAuthenticationWithoutEncryption ( ) ; } authenticator = new ClientCertAuthenticator ( ) ; break ; } case NONE : { authenticator = new VoidAuthenticator ( ) ; break ; } default : throw ROOT_LOGGER . restAuthMethodUnsupported ( authMethod . toString ( ) ) ; } restServer = new RestServer ( ) ; restServer . setAuthenticator ( authenticator ) ; } catch ( Exception e ) { throw ROOT_LOGGER . restContextCreationFailed ( e ) ; } try { restServer . start ( builder . build ( ) , cacheManagerInjector . getValue ( ) ) ; ROOT_LOGGER . httpEndpointStarted ( protocolName , restServer . getHost ( ) + ":" + restServer . getPort ( ) , contextPath ) ; } catch ( Exception e ) { throw ROOT_LOGGER . restContextStartFailed ( e ) ; }
|
public class BigQueryDataMarshallerByType { /** * Asserts that a field annotated as { @ link BigQueryFieldMode # REPEATED } is not left null . */
private void assertFieldValue ( Field field , Object fieldValue ) { } }
|
if ( fieldValue == null && isFieldRequired ( field ) ) { throw new IllegalArgumentException ( "Non-nullable field " + field . getName ( ) + ". This field is either annotated as REQUIRED or is a primitive type." ) ; }
|
public class BatchWorker { /** * Schedule task in thread pool .
* If pool reject task - task will execute immediately in current thread .
* If pool is shutdown - task will not run , but finalizer will executed .
* @ param name Task name for debug
* @ param task Task runnable
* @ param finalizer Finalizer to execute like ' try - final ' block */
private void executeInPool ( @ NotNull String name , @ NotNull Runnable task , @ Nullable Runnable finalizer , boolean pooled ) { } }
|
if ( pool . isShutdown ( ) ) { log . warn ( "Thread pool is shutdown" ) ; if ( finalizer != null ) { finalizer . run ( ) ; } return ; } if ( ! pooled ) { log . debug ( "Begin: " + name ) ; try { task . run ( ) ; } catch ( Throwable e ) { log . error ( "Execute exception: " + e ) ; if ( finalizer != null ) { finalizer . run ( ) ; } throw e ; } finally { if ( finalizer != null ) { finalizer . run ( ) ; } log . debug ( "End: " + name ) ; } return ; } try { pool . execute ( new Runnable ( ) { @ Override public void run ( ) { executeInPool ( name , task , finalizer , false ) ; } @ Override public String toString ( ) { return name ; } } ) ; } catch ( RejectedExecutionException e ) { if ( pool . isShutdown ( ) ) { log . warn ( "Thread pool is shutdown" ) ; } else { executeInPool ( name , task , finalizer , false ) ; } } catch ( Throwable e ) { log . error ( "Execute in pool exception: " + e ) ; if ( finalizer != null ) { finalizer . run ( ) ; } throw e ; }
|
public class AmazonChimeClient { /** * Retrieves details for the specified phone number order , such as order creation timestamp , phone numbers in E . 164
* format , product type , and order status .
* @ param getPhoneNumberOrderRequest
* @ return Result of the GetPhoneNumberOrder operation returned by the service .
* @ throws UnauthorizedClientException
* The client is not currently authorized to make the request .
* @ throws NotFoundException
* One or more of the resources in the request does not exist in the system .
* @ throws ForbiddenException
* The client is permanently forbidden from making the request . For example , when a user tries to create an
* account from an unsupported region .
* @ throws BadRequestException
* The input parameters don ' t match the service ' s restrictions .
* @ throws ThrottledClientException
* The client exceeded its request rate limit .
* @ throws ServiceUnavailableException
* The service is currently unavailable .
* @ throws ServiceFailureException
* The service encountered an unexpected error .
* @ sample AmazonChime . GetPhoneNumberOrder
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / chime - 2018-05-01 / GetPhoneNumberOrder " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public GetPhoneNumberOrderResult getPhoneNumberOrder ( GetPhoneNumberOrderRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeGetPhoneNumberOrder ( request ) ;
|
public class PidfileIterator { /** * { @ inheritDoc } */
public String next ( ) { } }
|
if ( ! hasNext ( ) ) { throw new NoSuchElementException ( ) ; } String result = nextLine ; nextLine = null ; fillNextLine ( ) ; return result ;
|
public class ExpiringResourceClaim { /** * Claim a resource .
* @ param zooKeeperConnection ZooKeeper connection to use .
* @ param poolSize Size of the resource pool .
* @ param znode Root znode of the ZooKeeper resource - pool .
* @ param timeout Delay in milliseconds before the claim expires .
* @ return A resource claim . */
public static ResourceClaim claimExpiring ( ZooKeeperConnection zooKeeperConnection , int poolSize , String znode , Long timeout ) throws IOException { } }
|
long timeoutNonNull = timeout == null ? DEFAULT_TIMEOUT : timeout ; logger . debug ( "Preparing expiring resource-claim; will release it in {}ms." , timeout ) ; return new ExpiringResourceClaim ( zooKeeperConnection , poolSize , znode , timeoutNonNull ) ;
|
public class JwkDefinitionSource { /** * Returns the JWK definition matching the provided keyId ( & quot ; kid & quot ; ) .
* If the JWK definition is not available in the internal cache then { @ link # loadJwkDefinitions ( URL ) }
* will be called ( to re - load the cache ) and then followed - up with a second attempt to locate the JWK definition .
* @ param keyId the Key ID ( & quot ; kid & quot ; )
* @ return the matching { @ link JwkDefinition } or null if not found */
JwkDefinitionHolder getDefinitionLoadIfNecessary ( String keyId ) { } }
|
JwkDefinitionHolder result = this . getDefinition ( keyId ) ; if ( result != null ) { return result ; } synchronized ( this . jwkDefinitions ) { result = this . getDefinition ( keyId ) ; if ( result != null ) { return result ; } this . jwkDefinitions . clear ( ) ; for ( URL jwkSetUrl : jwkSetUrls ) { this . jwkDefinitions . putAll ( loadJwkDefinitions ( jwkSetUrl ) ) ; } return this . getDefinition ( keyId ) ; }
|
public class WordVectorSerializer { /** * This method saves ParagraphVectors model into compressed zip file
* @ param file */
public static void writeParagraphVectors ( ParagraphVectors vectors , File file ) { } }
|
try ( FileOutputStream fos = new FileOutputStream ( file ) ; BufferedOutputStream stream = new BufferedOutputStream ( fos ) ) { writeParagraphVectors ( vectors , stream ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
|
public class ConciseSet { /** * { @ inheritDoc } */
@ Override public void complement ( ) { } }
|
modCount ++ ; if ( isEmpty ( ) ) { return ; } if ( last == ConciseSetUtils . MIN_ALLOWED_SET_BIT ) { clear ( ) ; return ; } // update size
if ( size >= 0 ) { size = last - size + 1 ; } // complement each word
for ( int i = 0 ; i <= lastWordIndex ; i ++ ) { int w = words [ i ] ; if ( isLiteral ( w ) ) // negate the bits and set the most significant bit to 1
{ words [ i ] = ConciseSetUtils . ALL_ZEROS_LITERAL | ~ w ; } else // switch the sequence type
{ words [ i ] ^= ConciseSetUtils . SEQUENCE_BIT ; } } // do not complement after the last element
if ( isLiteral ( words [ lastWordIndex ] ) ) { clearBitsAfterInLastWord ( maxLiteralLengthModulus ( last ) ) ; } // remove trailing zeros
trimZeros ( ) ; if ( isEmpty ( ) ) { return ; } // calculate the maximal element
last = 0 ; int w = 0 ; for ( int i = 0 ; i <= lastWordIndex ; i ++ ) { w = words [ i ] ; if ( isLiteral ( w ) ) { last += ConciseSetUtils . MAX_LITERAL_LENGTH ; } else { last += maxLiteralLengthMultiplication ( getSequenceCount ( w ) + 1 ) ; } } // manage the last word ( that must be a literal or a sequence of 1 ' s )
if ( isLiteral ( w ) ) { last -= Integer . numberOfLeadingZeros ( getLiteralBits ( w ) ) ; } else { last -- ; }
|
public class Util { /** * Checks whether the given java element is a Java class file .
* @ param elt
* The resource to check .
* @ return < code > true < / code > if the given resource is a class file ,
* < code > false < / code > otherwise . */
public static boolean isClassFile ( IJavaElement elt ) { } }
|
if ( elt == null ) { return false ; } return elt instanceof IClassFile || elt instanceof ICompilationUnit ;
|
public class KrakenImpl { /** * Query implementation for multiple result with the parsed query . */
private void findStreamLocal ( QueryKraken query , Object [ ] args , ResultStream < Cursor > result ) { } }
|
try { TableKraken table = query . table ( ) ; TableKelp tableKelp = table . getTableKelp ( ) ; RowCursor cursor = tableKelp . cursor ( ) ; query . fillKey ( cursor , args ) ; query . findStream ( result , args ) ; } catch ( Exception e ) { result . fail ( e ) ; }
|
public class HttpUtils { /** * Close the response .
* @ param response the response to close */
public static void close ( final HttpResponse response ) { } }
|
if ( response instanceof CloseableHttpResponse ) { val closeableHttpResponse = ( CloseableHttpResponse ) response ; try { closeableHttpResponse . close ( ) ; } catch ( final IOException e ) { LOGGER . error ( e . getMessage ( ) , e ) ; } }
|
public class AmazonEC2Client { /** * Describes Reserved Instance offerings that are available for purchase . With Reserved Instances , you purchase the
* right to launch instances for a period of time . During that time period , you do not receive insufficient capacity
* errors , and you pay a lower usage rate than the rate charged for On - Demand instances for the actual time used .
* If you have listed your own Reserved Instances for sale in the Reserved Instance Marketplace , they will be
* excluded from these results . This is to ensure that you do not purchase your own Reserved Instances .
* For more information , see < a
* href = " https : / / docs . aws . amazon . com / AWSEC2 / latest / UserGuide / ri - market - general . html " > Reserved Instance
* Marketplace < / a > in the < i > Amazon Elastic Compute Cloud User Guide < / i > .
* @ param describeReservedInstancesOfferingsRequest
* Contains the parameters for DescribeReservedInstancesOfferings .
* @ return Result of the DescribeReservedInstancesOfferings operation returned by the service .
* @ sample AmazonEC2 . DescribeReservedInstancesOfferings
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ec2-2016-11-15 / DescribeReservedInstancesOfferings "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public DescribeReservedInstancesOfferingsResult describeReservedInstancesOfferings ( DescribeReservedInstancesOfferingsRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeDescribeReservedInstancesOfferings ( request ) ;
|
public class CmsRequestUtil { /** * Appends a request parameter to the given URL . < p >
* This method takes care about the adding the parameter as an additional
* parameter ( appending < code > & param = value < / code > ) or as the first parameter
* ( appending < code > ? param = value < / code > ) . < p >
* @ param url the URL where to append the parameter to
* @ param paramName the paramter name to append
* @ param paramValue the parameter value to append
* @ return the URL with the given parameter appended */
public static String appendParameter ( String url , String paramName , String paramValue ) { } }
|
if ( CmsStringUtil . isEmpty ( url ) ) { return null ; } int pos = url . indexOf ( URL_DELIMITER ) ; StringBuffer result = new StringBuffer ( 256 ) ; result . append ( url ) ; if ( pos >= 0 ) { // url already has parameters
result . append ( PARAMETER_DELIMITER ) ; } else { // url does not have parameters
result . append ( URL_DELIMITER ) ; } result . append ( paramName ) ; result . append ( PARAMETER_ASSIGNMENT ) ; result . append ( paramValue ) ; return result . toString ( ) ;
|
public class AddAdCustomizer { /** * Runs the example .
* @ param adWordsServices the services factory .
* @ param session the session .
* @ param adGroupIds IDs of the ad groups for which ad customizers will be created .
* @ param feedName the name of the ad customizer feed to create .
* @ throws ApiException if the API request failed with one or more service errors .
* @ throws RemoteException if the API request failed due to other errors . */
public static void runExample ( AdWordsServicesInterface adWordsServices , AdWordsSession session , List < Long > adGroupIds , String feedName ) throws RemoteException { } }
|
// Create a customizer feed . One feed per account can be used for all ads .
AdCustomizerFeed adCustomizerFeed = createCustomizerFeed ( adWordsServices , session , feedName ) ; // Add feed items containing the values we ' d like to place in ads .
createCustomizerFeedItems ( adWordsServices , session , adGroupIds , adCustomizerFeed ) ; // All set ! We can now create ads with customizations .
createAdsWithCustomizations ( adWordsServices , session , adGroupIds , feedName ) ;
|
public class CausticUtil { /** * Gets the { @ link java . io . InputStream } ' s data as a { @ link java . nio . ByteBuffer } . The image data reading is done according to the { @ link com . flowpowered . caustic . api . gl . Texture . Format } . The image size is
* stored in the passed { @ link Rectangle } instance . The returned buffer is flipped an ready for reading .
* @ param source The image input stream to extract the data from
* @ param format The format of the image data
* @ param size The rectangle to store the size in
* @ return The flipped buffer containing the decoded image data */
public static ByteBuffer getImageData ( InputStream source , Format format , Rectangle size ) { } }
|
try { final BufferedImage image = ImageIO . read ( source ) ; size . setSize ( image . getWidth ( ) , image . getHeight ( ) ) ; return getImageData ( image , format ) ; } catch ( IOException ex ) { throw new IllegalStateException ( "Unreadable texture image data" , ex ) ; }
|
public class EditPlaylistEntry { /** * This method is called from within the constructor to
* initialize the form . */
private void initialize ( ) { } }
|
java . awt . GridBagConstraints gridBagConstraints ; getContentPane ( ) . setLayout ( new java . awt . GridBagLayout ( ) ) ; jLabel1 = new javax . swing . JLabel ( ) ; jLabel1 . setText ( "Old:" ) ; jLabel1 . setFont ( Helpers . getDialogFont ( ) ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . anchor = GridBagConstraints . WEST ; gridBagConstraints . gridx = 0 ; gridBagConstraints . gridy = 0 ; gridBagConstraints . fill = java . awt . GridBagConstraints . NONE ; gridBagConstraints . insets = new java . awt . Insets ( 5 , 5 , 5 , 5 ) ; getContentPane ( ) . add ( jLabel1 , gridBagConstraints ) ; textField1 = new javax . swing . JTextField ( ) ; textField1 . setFont ( Helpers . getDialogFont ( ) ) ; textField1 . setEditable ( false ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . anchor = GridBagConstraints . WEST ; gridBagConstraints . gridx = 1 ; gridBagConstraints . gridy = 0 ; gridBagConstraints . gridwidth = 2 ; gridBagConstraints . weightx = 1.0 ; gridBagConstraints . weighty = 1.0 ; gridBagConstraints . fill = java . awt . GridBagConstraints . HORIZONTAL ; gridBagConstraints . insets = new java . awt . Insets ( 5 , 5 , 5 , 5 ) ; getContentPane ( ) . add ( textField1 , gridBagConstraints ) ; jLabel2 = new javax . swing . JLabel ( ) ; jLabel2 . setText ( "New:" ) ; jLabel2 . setFont ( Helpers . getDialogFont ( ) ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . anchor = GridBagConstraints . WEST ; gridBagConstraints . gridx = 0 ; gridBagConstraints . gridy = 1 ; gridBagConstraints . fill = java . awt . GridBagConstraints . NONE ; gridBagConstraints . insets = new java . awt . Insets ( 5 , 5 , 5 , 5 ) ; getContentPane ( ) . add ( jLabel2 , gridBagConstraints ) ; textField2 = new javax . swing . JTextField ( ) ; textField2 . setFont ( Helpers . getDialogFont ( ) ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . anchor = GridBagConstraints . WEST ; gridBagConstraints . gridx = 1 ; gridBagConstraints . gridy = 1 ; gridBagConstraints . weightx = 1.0 ; gridBagConstraints . weighty = 1.0 ; gridBagConstraints . fill = java . awt . GridBagConstraints . HORIZONTAL ; gridBagConstraints . insets = new java . awt . Insets ( 5 , 5 , 5 , 5 ) ; getContentPane ( ) . add ( textField2 , gridBagConstraints ) ; searchButton = new javax . swing . JButton ( ) ; searchButton . setMnemonic ( 's' ) ; searchButton . setText ( "..." ) ; searchButton . setToolTipText ( "Search" ) ; searchButton . setFont ( Helpers . getDialogFont ( ) ) ; searchButton . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { doSearch ( ) ; } } ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . anchor = GridBagConstraints . WEST ; gridBagConstraints . gridx = 2 ; gridBagConstraints . gridy = 1 ; gridBagConstraints . fill = java . awt . GridBagConstraints . NONE ; gridBagConstraints . insets = new java . awt . Insets ( 5 , 5 , 5 , 5 ) ; getContentPane ( ) . add ( searchButton , gridBagConstraints ) ; jPanel1 = new javax . swing . JPanel ( ) ; openButton = new javax . swing . JButton ( ) ; openButton . setMnemonic ( 'O' ) ; openButton . setText ( "OK" ) ; openButton . setFont ( Helpers . getDialogFont ( ) ) ; openButton . setToolTipText ( "OK" ) ; openButton . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { doOpen ( ) ; } } ) ; jPanel1 . add ( openButton ) ; cancelButton = new javax . swing . JButton ( ) ; cancelButton . setMnemonic ( 'C' ) ; cancelButton . setText ( "Cancel" ) ; cancelButton . setToolTipText ( "Cancel" ) ; cancelButton . setFont ( Helpers . getDialogFont ( ) ) ; cancelButton . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { doCancel ( ) ; } } ) ; jPanel1 . add ( cancelButton ) ; gridBagConstraints = new java . awt . GridBagConstraints ( ) ; gridBagConstraints . anchor = GridBagConstraints . CENTER ; gridBagConstraints . gridx = 0 ; gridBagConstraints . gridy = 2 ; gridBagConstraints . gridwidth = 3 ; gridBagConstraints . weightx = 1.0 ; gridBagConstraints . weighty = 1.0 ; gridBagConstraints . fill = java . awt . GridBagConstraints . HORIZONTAL ; gridBagConstraints . insets = new java . awt . Insets ( 5 , 5 , 5 , 5 ) ; getContentPane ( ) . add ( jPanel1 , gridBagConstraints ) ; setDefaultCloseOperation ( javax . swing . WindowConstants . DISPOSE_ON_CLOSE ) ; addWindowListener ( new java . awt . event . WindowAdapter ( ) { @ Override public void windowClosing ( java . awt . event . WindowEvent e ) { doClose ( ) ; } } ) ; setName ( "Edit Playlist entry" ) ; setTitle ( "Edit Playlist entry" ) ; setResizable ( true ) ; pack ( ) ; setLocation ( Helpers . getFrameCenteredLocation ( this , getParent ( ) ) ) ;
|
public class TerminalEmulatorDeviceConfiguration { /** * Copies the current configuration . The new object has the given value .
* @ param cursorBlinking Should the terminal text cursor blink ?
* @ return A copy of the current configuration with the changed value . */
public TerminalEmulatorDeviceConfiguration withCursorBlinking ( boolean cursorBlinking ) { } }
|
if ( this . cursorBlinking == cursorBlinking ) { return this ; } else { return new TerminalEmulatorDeviceConfiguration ( this . lineBufferScrollbackSize , this . blinkLengthInMilliSeconds , this . cursorStyle , this . cursorColor , cursorBlinking , this . clipboardAvailable ) ; }
|
public class DateGroovyMethods { /** * Increment a Calendar by one day .
* @ param self a Calendar
* @ return a new Calendar set to the next day
* @ since 1.8.7 */
public static Calendar next ( Calendar self ) { } }
|
Calendar result = ( Calendar ) self . clone ( ) ; result . add ( Calendar . DAY_OF_YEAR , 1 ) ; return result ;
|
public class TaskDefinitionMarshaller { /** * Marshall the given parameter object . */
public void marshall ( TaskDefinition taskDefinition , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( taskDefinition == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( taskDefinition . getTaskDefinitionArn ( ) , TASKDEFINITIONARN_BINDING ) ; protocolMarshaller . marshall ( taskDefinition . getContainerDefinitions ( ) , CONTAINERDEFINITIONS_BINDING ) ; protocolMarshaller . marshall ( taskDefinition . getFamily ( ) , FAMILY_BINDING ) ; protocolMarshaller . marshall ( taskDefinition . getTaskRoleArn ( ) , TASKROLEARN_BINDING ) ; protocolMarshaller . marshall ( taskDefinition . getExecutionRoleArn ( ) , EXECUTIONROLEARN_BINDING ) ; protocolMarshaller . marshall ( taskDefinition . getNetworkMode ( ) , NETWORKMODE_BINDING ) ; protocolMarshaller . marshall ( taskDefinition . getRevision ( ) , REVISION_BINDING ) ; protocolMarshaller . marshall ( taskDefinition . getVolumes ( ) , VOLUMES_BINDING ) ; protocolMarshaller . marshall ( taskDefinition . getStatus ( ) , STATUS_BINDING ) ; protocolMarshaller . marshall ( taskDefinition . getRequiresAttributes ( ) , REQUIRESATTRIBUTES_BINDING ) ; protocolMarshaller . marshall ( taskDefinition . getPlacementConstraints ( ) , PLACEMENTCONSTRAINTS_BINDING ) ; protocolMarshaller . marshall ( taskDefinition . getCompatibilities ( ) , COMPATIBILITIES_BINDING ) ; protocolMarshaller . marshall ( taskDefinition . getRequiresCompatibilities ( ) , REQUIRESCOMPATIBILITIES_BINDING ) ; protocolMarshaller . marshall ( taskDefinition . getCpu ( ) , CPU_BINDING ) ; protocolMarshaller . marshall ( taskDefinition . getMemory ( ) , MEMORY_BINDING ) ; protocolMarshaller . marshall ( taskDefinition . getPidMode ( ) , PIDMODE_BINDING ) ; protocolMarshaller . marshall ( taskDefinition . getIpcMode ( ) , IPCMODE_BINDING ) ; protocolMarshaller . marshall ( taskDefinition . getProxyConfiguration ( ) , PROXYCONFIGURATION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class CmsSystemConfiguration { /** * Adds the event manager class . < p >
* @ param clazz the class name of event manager class to instantiate and add */
public void addEventManager ( String clazz ) { } }
|
try { m_eventManager = ( CmsEventManager ) Class . forName ( clazz ) . newInstance ( ) ; if ( CmsLog . INIT . isInfoEnabled ( ) ) { CmsLog . INIT . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . INIT_EVENTMANAGER_CLASS_SUCCESS_1 , m_eventManager ) ) ; } } catch ( Throwable t ) { LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . INIT_EVENTMANAGER_CLASS_INVALID_1 , clazz ) , t ) ; return ; }
|
public class DataExpressionHandler { /** * This method returns the data value associated with the requested data
* source and key . .
* @ param trace The trace
* @ param node The node
* @ param direction The direction
* @ param headers The optional headers
* @ param values The values
* @ return The required data value */
protected Object getDataValue ( Trace trace , Node node , Direction direction , Map < String , ? > headers , Object [ ] values ) { } }
|
if ( source == DataSource . Content ) { return values [ index ] ; } else if ( source == DataSource . Header ) { return headers . get ( key ) ; } return null ;
|
public class AtlasRegistry { /** * Stop the scheduler reporting Atlas data . */
public void stop ( ) { } }
|
if ( scheduler != null ) { scheduler . shutdown ( ) ; scheduler = null ; logger . info ( "stopped collecting metrics every {}ms reporting to {}" , step , uri ) ; } else { logger . warn ( "registry stopped, but was never started" ) ; }
|
public class Product { /** * Sets the productType value for this Product .
* @ param productType * The type of { @ code Product } . This will always be { @ link ProductType # DFP }
* for programmatic
* guaranteed products .
* < span class = " constraint ReadOnly " > This attribute is
* read - only when : < ul > < li > using programmatic guaranteed , using sales
* management . < / li > < li > not using programmatic , using sales management . < / li > < / ul > < / span > */
public void setProductType ( com . google . api . ads . admanager . axis . v201902 . ProductType productType ) { } }
|
this . productType = productType ;
|
public class CPSpecificationOptionLocalServiceUtil { /** * Returns the cp specification option matching the UUID and group .
* @ param uuid the cp specification option ' s UUID
* @ param groupId the primary key of the group
* @ return the matching cp specification option , or < code > null < / code > if a matching cp specification option could not be found */
public static com . liferay . commerce . product . model . CPSpecificationOption fetchCPSpecificationOptionByUuidAndGroupId ( String uuid , long groupId ) { } }
|
return getService ( ) . fetchCPSpecificationOptionByUuidAndGroupId ( uuid , groupId ) ;
|
public class ListApplicationSnapshotsResult { /** * A collection of objects containing information about the application snapshots .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setSnapshotSummaries ( java . util . Collection ) } or { @ link # withSnapshotSummaries ( java . util . Collection ) } if
* you want to override the existing values .
* @ param snapshotSummaries
* A collection of objects containing information about the application snapshots .
* @ return Returns a reference to this object so that method calls can be chained together . */
public ListApplicationSnapshotsResult withSnapshotSummaries ( SnapshotDetails ... snapshotSummaries ) { } }
|
if ( this . snapshotSummaries == null ) { setSnapshotSummaries ( new java . util . ArrayList < SnapshotDetails > ( snapshotSummaries . length ) ) ; } for ( SnapshotDetails ele : snapshotSummaries ) { this . snapshotSummaries . add ( ele ) ; } return this ;
|
public class ReflectionUtils { /** * 通过反射 , 获得Class定义中声明的父类的泛型参数的类型 .
* 如无法找到 , 返回Object . class .
* 如public UserDao extends HibernateDao < User , Long >
* @ param clazz clazz The class to introspect
* @ param index the Index of the generic ddeclaration , start from 0.
* @ return the index generic declaration , or Object . class if cannot be determined */
@ SuppressWarnings ( "rawtypes" ) public static Class getSuperClassGenricType ( final Class < ? > clazz , final int index ) { } }
|
Type genType = clazz . getGenericSuperclass ( ) ; if ( ! ( genType instanceof ParameterizedType ) ) { /* * By Hilbert Wang @ 2015-3-8
* logger . info ( clazz . getSimpleName ( ) + " ' s superclass not ParameterizedType " ) ; */
return Object . class ; } Type [ ] params = ( ( ParameterizedType ) genType ) . getActualTypeArguments ( ) ; if ( index >= params . length || index < 0 ) { logger . warn ( "Index: " + index + ", Size of " + clazz . getSimpleName ( ) + "'s Parameterized Type: " + params . length ) ; return Object . class ; } if ( ! ( params [ index ] instanceof Class ) ) { logger . warn ( clazz . getSimpleName ( ) + " not set the actual class on superclass generic parameter" ) ; return Object . class ; } return ( Class ) params [ index ] ;
|
public class Mail { /** * Add a header to the email .
* @ param key the header ' s key .
* @ param value the header ' s value . */
public void addHeader ( String key , String value ) { } }
|
this . headers = addToMap ( key , value , this . headers ) ;
|
public class XData { /** * stores a datanode in a xdata file using the given marshallers . For all classes other
* than these a special marshaller is required to map the class ' data to a data node
* deSerializedObject :
* < ul >
* < li > Boolean < / li >
* < li > Long < / li >
* < li > Integer < / li >
* < li > String < / li >
* < li > Float < / li >
* < li > Double < / li >
* < li > Byte < / li >
* < li > Short < / li >
* < li > Character < / li >
* < li > DataNode < / li >
* < li > List & lt ; ? & gt ; < / li >
* < / ul >
* Also take a look at { @ link com . moebiusgames . xdata . marshaller } . There are a bunch of
* standard marshallers that ARE INCLUDED by default . So you don ' t need to add them here
* to work .
* @ param node
* @ param file
* @ param addChecksum if this is true then a sha - 256 checksum is added at the end of this xdata stream
* @ param ignoreMissingMarshallers if this is set to true then classes that can ' t be marshalled are
* silently replaced with null values
* @ param progressListener
* @ param marshallers
* @ throws IOException */
public static void store ( DataNode node , File file , boolean addChecksum , boolean ignoreMissingMarshallers , ProgressListener progressListener , AbstractDataMarshaller < ? > ... marshallers ) throws IOException { } }
|
store ( node , new FileOutputStream ( file ) , addChecksum , ignoreMissingMarshallers , progressListener , marshallers ) ;
|
public class PoolImplThreadSafe { /** * F96377 */
private int drainToSize ( int minPooled , int maxDiscard ) { } }
|
// Stop draining if we have reached the maximum drain amount .
// This slows the drain process , allowing for the pool to become
// active before becoming fully drained ( to minimum level ) .
int numDiscarded = 0 ; Object o = null ; while ( numDiscarded < maxDiscard ) { o = buffer . popWithLimit ( minPooled ) ; if ( o != null ) { ++ numDiscarded ; if ( discardStrategy != null ) { discardStrategy . discard ( o ) ; } } else break ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "drainToSize: numDiscarded=" + numDiscarded + ", inactive=" + ivInactiveNoDrainCount + ", " + this ) ; if ( beanPerf != null ) { // Update PMI data
beanPerf . poolDrained ( buffer . size ( ) , numDiscarded ) ; } return numDiscarded ;
|
public class AWSGlueClient { /** * Starts an existing trigger . See < a href = " http : / / docs . aws . amazon . com / glue / latest / dg / trigger - job . html " > Triggering
* Jobs < / a > for information about how different types of trigger are started .
* @ param startTriggerRequest
* @ return Result of the StartTrigger operation returned by the service .
* @ throws InvalidInputException
* The input provided was not valid .
* @ throws InternalServiceException
* An internal service error occurred .
* @ throws EntityNotFoundException
* A specified entity does not exist
* @ throws OperationTimeoutException
* The operation timed out .
* @ throws ResourceNumberLimitExceededException
* A resource numerical limit was exceeded .
* @ throws ConcurrentRunsExceededException
* Too many jobs are being run concurrently .
* @ sample AWSGlue . StartTrigger
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / glue - 2017-03-31 / StartTrigger " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public StartTriggerResult startTrigger ( StartTriggerRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeStartTrigger ( request ) ;
|
public class CPCImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eSet ( int featureID , Object newValue ) { } }
|
switch ( featureID ) { case AfplibPackage . CPC__DEF_CHAR_ID : setDefCharID ( ( String ) newValue ) ; return ; case AfplibPackage . CPC__PRT_FLAGS : setPrtFlags ( ( Integer ) newValue ) ; return ; case AfplibPackage . CPC__CPIRG_LEN : setCPIRGLen ( ( Integer ) newValue ) ; return ; case AfplibPackage . CPC__VS_CHAR_SN : setVSCharSN ( ( Integer ) newValue ) ; return ; case AfplibPackage . CPC__VS_CHAR : setVSChar ( ( Integer ) newValue ) ; return ; case AfplibPackage . CPC__VS_FLAGS : setVSFlags ( ( Integer ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
|
public class StringUtils { /** * Get mininum of three values .
* @ param a number a
* @ param b number b
* @ param c number c
* @ return the minimum */
private static int minimum ( int a , int b , int c ) { } }
|
int minValue ; minValue = a ; if ( b < minValue ) { minValue = b ; } if ( c < minValue ) { minValue = c ; } return minValue ;
|
public class HttpRequest { /** * 将请求参数转换成String , 字符串格式为 : bean1 = { } & amp ; id = 13 & amp ; name = xxx < br >
* 不会返回null , 没有参数返回空字符串
* @ param prefix 拼接前缀 , 如果无参数 , 返回的字符串不会含有拼接前缀
* @ return String */
public String getParametersToString ( String prefix ) { } }
|
final StringBuilder sb = new StringBuilder ( ) ; getParameters ( ) . forEach ( ( k , v ) -> { if ( sb . length ( ) > 0 ) sb . append ( '&' ) ; try { sb . append ( k ) . append ( '=' ) . append ( URLEncoder . encode ( v , "UTF-8" ) ) ; } catch ( IOException ex ) { throw new RuntimeException ( ex ) ; } } ) ; return ( sb . length ( ) > 0 && prefix != null ) ? ( prefix + sb ) : sb . toString ( ) ;
|
public class MultiUserChat { /** * Grants ownership privileges to other users . Room owners may grant ownership privileges .
* Some room implementations will not allow to grant ownership privileges to other users .
* An owner is allowed to change defining room features as well as perform all administrative
* functions .
* @ param jids the collection of bare XMPP user IDs of the users to grant ownership .
* @ throws XMPPErrorException if an error occurs granting ownership privileges to a user .
* @ throws NoResponseException if there was no response from the server .
* @ throws NotConnectedException
* @ throws InterruptedException */
public void grantOwnership ( Collection < ? extends Jid > jids ) throws XMPPErrorException , NoResponseException , NotConnectedException , InterruptedException { } }
|
changeAffiliationByAdmin ( jids , MUCAffiliation . owner ) ;
|
public class Java { /** * Create the source file for a given class
* @ param clazz is the class description
* @ throws java . io . IOException */
public static synchronized void createSource ( Java . _ClassBody clazz ) throws IOException { } }
|
if ( baseDir == null ) { throw new IOException ( "Base directory for output not set, use 'setBaseDirectory'" ) ; } String pkg = clazz . getPackage ( ) ; if ( pkg == null ) { pkg = "" ; // throw new IOException ( " Class package cannot be null " ) ;
} pkg = pkg . replace ( '.' , '/' ) ; File path = new File ( baseDir , pkg ) ; path . mkdirs ( ) ; try ( PrintWriter fp = new PrintWriter ( new FileWriter ( new File ( path , clazz . getName ( ) + ".java" ) ) ) ) { clazz . emit ( 0 , fp ) ; }
|
public class PullFilter { /** * < p > Generate a string representation of this { @ code Filter } object
* that is consistent for a given name and parameter set . < / p >
* < p > The string is not intended for use in URLs as it ' s not
* escaped . < / p >
* < p > Filter parameters are sorted by key so that the generated
* String are the same for different calls . This is important
* because the String can therefore be part of the replication ID . < / p >
* @ return query string like representation of the filter
* @ see PullStrategy # getReplicationId ( ) */
public String toQueryString ( ) { } }
|
if ( this . parameters == null ) { return String . format ( "filter=%s" , this . name ) ; } else { List < String > queries = new ArrayList < String > ( ) ; for ( Map . Entry < String , String > parameter : this . parameters . entrySet ( ) ) { queries . add ( String . format ( "%s=%s" , parameter . getKey ( ) , parameter . getValue ( ) ) ) ; } Collections . sort ( queries ) ; queries . add ( 0 , String . format ( "filter=%s" , this . name ) ) ; return Misc . join ( "&" , queries ) ; }
|
public class OptionsDoclet { /** * Get the result of inserting the options documentation into the docfile .
* @ return the docfile , but with the command - line argument documentation updated
* @ throws Exception if there is trouble reading files */
@ RequiresNonNull ( "docFile" ) private String newDocFileText ( ) throws Exception { } }
|
StringJoiner b = new StringJoiner ( lineSep ) ; BufferedReader doc = Files . newBufferedReader ( docFile . toPath ( ) , UTF_8 ) ; String docline ; boolean replacing = false ; boolean replacedOnce = false ; String prefix = null ; while ( ( docline = doc . readLine ( ) ) != null ) { if ( replacing ) { if ( docline . trim ( ) . equals ( endDelim ) ) { replacing = false ; } else { continue ; } } b . add ( docline ) ; if ( ! replacedOnce && docline . trim ( ) . equals ( startDelim ) ) { if ( formatJavadoc ) { int starIndex = docline . indexOf ( '*' ) ; b . add ( docline . substring ( 0 , starIndex + 1 ) ) ; String jdoc = optionsToJavadoc ( starIndex , 100 ) ; b . add ( jdoc ) ; if ( jdoc . endsWith ( "</ul>" ) ) { b . add ( docline . substring ( 0 , starIndex + 1 ) ) ; } } else { b . add ( optionsToHtml ( 0 ) ) ; } replacedOnce = true ; replacing = true ; } } doc . close ( ) ; return b . toString ( ) ;
|
public class GroupService { /** * Power on groups of servers
* @ param groups groups references list
* @ return OperationFuture wrapper for Server list */
public OperationFuture < List < Server > > powerOn ( Group ... groups ) { } }
|
return serverService ( ) . powerOn ( getServerSearchCriteria ( groups ) ) ;
|
public class ServiceInstanceQueryHelper { /** * Filter the ModelServiceInstance list against the ServiceInstanceQuery .
* @ param query
* the ServiceInstanceQuery matchers .
* @ param list
* the ModelServiceInstance list .
* @ return
* the matched ModelServiceInstance list . */
public static List < ModelServiceInstance > filter ( ServiceInstanceQuery query , List < ModelServiceInstance > list ) { } }
|
List < ModelServiceInstance > instances = new ArrayList < ModelServiceInstance > ( ) ; for ( ModelServiceInstance instance : list ) { boolean passed = true ; for ( QueryCriterion criterion : query . getCriteria ( ) ) { if ( criterion . isMatch ( instance . getMetadata ( ) ) == false ) { passed = false ; break ; } } if ( passed ) { instances . add ( instance ) ; } } return instances ;
|
public class RegistriesInner { /** * Get the upload location for the user to be able to upload the source .
* @ param resourceGroupName The name of the resource group to which the container registry belongs .
* @ param registryName The name of the container registry .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the SourceUploadDefinitionInner object if successful . */
public SourceUploadDefinitionInner getBuildSourceUploadUrl ( String resourceGroupName , String registryName ) { } }
|
return getBuildSourceUploadUrlWithServiceResponseAsync ( resourceGroupName , registryName ) . toBlocking ( ) . single ( ) . body ( ) ;
|
public class MtasFetchData { /** * Gets the url .
* @ param prefix the prefix
* @ param postfix the postfix
* @ return the url
* @ throws MtasParserException the mtas parser exception */
public Reader getUrl ( String prefix , String postfix ) throws MtasParserException { } }
|
String url = getString ( ) ; if ( ( url != null ) && ! url . equals ( "" ) ) { if ( prefix != null ) { url = prefix + url ; } if ( postfix != null ) { url = url + postfix ; } if ( url . startsWith ( "http://" ) || url . startsWith ( "https://" ) ) { BufferedReader in = null ; try { URLConnection connection = new URL ( url ) . openConnection ( ) ; connection . setRequestProperty ( "Accept-Encoding" , "gzip" ) ; connection . setReadTimeout ( 10000 ) ; if ( connection . getHeaderField ( "Content-Encoding" ) != null && connection . getHeaderField ( "Content-Encoding" ) . equals ( "gzip" ) ) { in = new BufferedReader ( new InputStreamReader ( new GZIPInputStream ( connection . getInputStream ( ) ) , StandardCharsets . UTF_8 ) ) ; } else { in = new BufferedReader ( new InputStreamReader ( connection . getInputStream ( ) , StandardCharsets . UTF_8 ) ) ; } return in ; } catch ( IOException ex ) { log . debug ( ex ) ; throw new MtasParserException ( "couldn't get " + url ) ; } } else { throw new MtasParserException ( "no valid url: " + url ) ; } } else { throw new MtasParserException ( "no valid url: " + url ) ; }
|
public class A_CmsEditUserGroupRoleDialog { /** * Init method . < p > */
protected void init ( ) { } }
|
setHeightUndefined ( ) ; removeExistingTable ( getLeftTableLayout ( ) ) ; removeExistingTable ( getRightTableLayout ( ) ) ; final CmsAvailableRoleOrPrincipalTable table = new CmsAvailableRoleOrPrincipalTable ( this ) ; if ( getAvailableItemsIndexedContainer ( "caption" , "icon" ) . size ( ) > 0 ) { getRightTableLayout ( ) . addComponent ( new FixedHeightPanel ( table , ITEM_HEIGHT ) , 0 ) ; } else { getRightTableLayout ( ) . addComponent ( new FixedHeightPanel ( CmsVaadinUtils . getInfoLayout ( getEmptyMessage ( ) ) , ITEM_HEIGHT ) ) ; } if ( getItemsOfUserIndexedContainer ( "prop1" , "prop2" , "prop3" ) . size ( ) > 0 ) { getLeftTableLayout ( ) . addComponent ( new FixedHeightPanel ( new CmsCurrentRoleOrPrincipalTable ( this , m_cms , m_principal ) , ITEM_HEIGHT ) , 0 ) ; } else { getLeftTableLayout ( ) . addComponent ( new FixedHeightPanel ( CmsVaadinUtils . getInfoLayout ( getEmptyMessage ( ) ) , ITEM_HEIGHT ) ) ; } TextField siteTableFilter = new TextField ( ) ; siteTableFilter . setIcon ( FontOpenCms . FILTER ) ; siteTableFilter . setInputPrompt ( Messages . get ( ) . getBundle ( UI . getCurrent ( ) . getLocale ( ) ) . key ( Messages . GUI_EXPLORER_FILTER_0 ) ) ; siteTableFilter . addStyleName ( ValoTheme . TEXTFIELD_INLINE_ICON ) ; siteTableFilter . setWidth ( "200px" ) ; siteTableFilter . addTextChangeListener ( new TextChangeListener ( ) { private static final long serialVersionUID = 1L ; public void textChange ( TextChangeEvent event ) { table . filterTable ( event . getText ( ) ) ; } } ) ; if ( getParentLayout ( ) . getComponent ( 0 ) instanceof TextField ) { getParentLayout ( ) . removeComponent ( getParentLayout ( ) . getComponent ( 1 ) ) ; getParentLayout ( ) . removeComponent ( getParentLayout ( ) . getComponent ( 0 ) ) ; } HorizontalLayout caps = new HorizontalLayout ( ) ; caps . setSpacing ( true ) ; caps . setWidth ( "100%" ) ; caps . setHeight ( "30px" ) ; caps . addComponent ( new Label ( getCurrentTableCaption ( ) ) ) ; caps . addComponent ( new Label ( getAddCaptionText ( ) ) ) ; getParentLayout ( ) . addComponent ( caps , 0 ) ; getParentLayout ( ) . addComponent ( siteTableFilter , 0 ) ; getParentLayout ( ) . setComponentAlignment ( siteTableFilter , com . vaadin . ui . Alignment . TOP_RIGHT ) ; getParentLayout ( ) . setExpandRatio ( getParentLayout ( ) . getComponent ( 2 ) , 1 ) ;
|
public class PolicyStatesInner { /** * Summarizes policy states for the resource group level policy assignment .
* @ param subscriptionId Microsoft Azure subscription ID .
* @ param resourceGroupName Resource group name .
* @ param policyAssignmentName Policy assignment name .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the SummarizeResultsInner object */
public Observable < SummarizeResultsInner > summarizeForResourceGroupLevelPolicyAssignmentAsync ( String subscriptionId , String resourceGroupName , String policyAssignmentName ) { } }
|
return summarizeForResourceGroupLevelPolicyAssignmentWithServiceResponseAsync ( subscriptionId , resourceGroupName , policyAssignmentName ) . map ( new Func1 < ServiceResponse < SummarizeResultsInner > , SummarizeResultsInner > ( ) { @ Override public SummarizeResultsInner call ( ServiceResponse < SummarizeResultsInner > response ) { return response . body ( ) ; } } ) ;
|
public class PartitionBuilder { /** * Return the intersect of two disjoint partition . The returned disjoint partition has items that : - Each interval
* item is a subset of only an interval I1 \ in p1 and a subset of only an interval I2 \ in p2.
* @ param p1
* @ param p2
* @ return */
public static < T extends Comparable < T > > Partition < T > intersect ( Partition < T > p1 , Partition < T > p2 ) throws MIDDException { } }
|
if ( p1 . size ( ) == 0 || p2 . size ( ) == 0 ) { return new Partition < T > ( ) ; } List < Interval < T > > tempIntervals = combine ( p1 , p2 ) ; Interval < T > newInterval = null ; Interval < T > superOfNewIntervalP1 = null ; Interval < T > superOfNewIntervalP2 = null ; // combine adjacent intervals which belong to the same type
List < Interval < T > > outputPartition = new ArrayList < Interval < T > > ( ) ; for ( int i = 0 ; i < tempIntervals . size ( ) ; i ++ ) { Interval < T > tempInterval = tempIntervals . get ( i ) ; Interval < T > superOfTempIntervalP1 = p1 . getSuperInterval ( tempInterval ) ; Interval < T > superOfTempIntervalP2 = p2 . getSuperInterval ( tempInterval ) ; // if it belongs to at most one partition , ignore !
if ( superOfTempIntervalP1 == null || superOfTempIntervalP2 == null ) { continue ; } if ( newInterval == null ) { newInterval = tempInterval ; superOfNewIntervalP1 = superOfTempIntervalP1 ; superOfNewIntervalP2 = superOfTempIntervalP2 ; continue ; } if ( superOfNewIntervalP1 == superOfTempIntervalP1 && superOfNewIntervalP2 == superOfTempIntervalP2 ) { newInterval . includeBound ( tempInterval ) ; } else { outputPartition . add ( newInterval ) ; newInterval = tempInterval ; superOfNewIntervalP1 = superOfTempIntervalP1 ; superOfNewIntervalP2 = superOfTempIntervalP2 ; } } if ( newInterval != null ) { outputPartition . add ( newInterval ) ; } return new Partition < T > ( outputPartition ) ;
|
public class ListAppsResult { /** * A list of application summaries .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setApps ( java . util . Collection ) } or { @ link # withApps ( java . util . Collection ) } if you want to override the
* existing values .
* @ param apps
* A list of application summaries .
* @ return Returns a reference to this object so that method calls can be chained together . */
public ListAppsResult withApps ( AppSummary ... apps ) { } }
|
if ( this . apps == null ) { setApps ( new java . util . ArrayList < AppSummary > ( apps . length ) ) ; } for ( AppSummary ele : apps ) { this . apps . add ( ele ) ; } return this ;
|
public class AmazonCognitoIdentityClient { /** * Gets details about a particular identity pool , including the pool name , ID description , creation date , and
* current number of users .
* You must use AWS Developer credentials to call this API .
* @ param describeIdentityPoolRequest
* Input to the DescribeIdentityPool action .
* @ return Result of the DescribeIdentityPool operation returned by the service .
* @ throws InvalidParameterException
* Thrown for missing or bad input parameter ( s ) .
* @ throws ResourceNotFoundException
* Thrown when the requested resource ( for example , a dataset or record ) does not exist .
* @ throws NotAuthorizedException
* Thrown when a user is not authorized to access the requested resource .
* @ throws TooManyRequestsException
* Thrown when a request is throttled .
* @ throws InternalErrorException
* Thrown when the service encounters an error during processing the request .
* @ sample AmazonCognitoIdentity . DescribeIdentityPool
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / cognito - identity - 2014-06-30 / DescribeIdentityPool "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public DescribeIdentityPoolResult describeIdentityPool ( DescribeIdentityPoolRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeDescribeIdentityPool ( request ) ;
|
public class InstanceFailoverGroupsInner { /** * Fails over from the current primary managed instance to this managed instance .
* @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal .
* @ param locationName The name of the region where the resource is located .
* @ param failoverGroupName The name of the failover group .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < InstanceFailoverGroupInner > failoverAsync ( String resourceGroupName , String locationName , String failoverGroupName , final ServiceCallback < InstanceFailoverGroupInner > serviceCallback ) { } }
|
return ServiceFuture . fromResponse ( failoverWithServiceResponseAsync ( resourceGroupName , locationName , failoverGroupName ) , serviceCallback ) ;
|
public class IIntQueue { /** * append a int from the tail
* @ param data
* @ return boolean */
public boolean enQueue ( int data ) { } }
|
Entry o = new Entry ( data , tail . prev , tail ) ; tail . prev . next = o ; tail . prev = o ; // set the size
size ++ ; return true ;
|
public class Tags { /** * Return a new { @ code Tags } instance by merging this collection and the specified key / value pair .
* @ param key the tag key to add
* @ param value the tag value to add
* @ return a new { @ code Tags } instance */
public Tags and ( String key , String value ) { } }
|
return and ( Tag . of ( key , value ) ) ;
|
public class SoapClientActionBuilder { /** * Generic response builder for expecting response messages on client .
* @ return */
public SoapClientResponseActionBuilder receive ( ) { } }
|
SoapClientResponseActionBuilder soapClientResponseActionBuilder ; if ( soapClient != null ) { soapClientResponseActionBuilder = new SoapClientResponseActionBuilder ( action , soapClient ) ; } else { soapClientResponseActionBuilder = new SoapClientResponseActionBuilder ( action , soapClientUri ) ; } soapClientResponseActionBuilder . withApplicationContext ( applicationContext ) ; return soapClientResponseActionBuilder ;
|
public class CmsSingleTreeLocaleHandler { /** * Reads the locale from the first path element . < p >
* @ param sitePath the site path with the locale prefix
* @ return the locale or < code > null < / code > if no matching locale was found */
public static Locale getLocaleFromPath ( String sitePath ) { } }
|
Locale result = null ; if ( sitePath . indexOf ( "/" ) == 0 ) { sitePath = sitePath . substring ( 1 ) ; } if ( sitePath . length ( ) > 1 ) { String localePrefix ; if ( ! sitePath . contains ( "/" ) ) { // this may be the case for paths pointing to the root folder of a site
// check for parameters
int separator = - 1 ; int param = sitePath . indexOf ( "?" ) ; int hash = sitePath . indexOf ( "#" ) ; if ( param >= 0 ) { if ( hash != 0 ) { separator = param < hash ? param : hash ; } else { separator = param ; } } else { separator = hash ; } if ( separator >= 0 ) { localePrefix = sitePath . substring ( 0 , separator ) ; } else { localePrefix = sitePath ; } } else { localePrefix = sitePath . substring ( 0 , sitePath . indexOf ( "/" ) ) ; } Locale locale = CmsLocaleManager . getLocale ( localePrefix ) ; if ( localePrefix . equals ( locale . toString ( ) ) && OpenCms . getLocaleManager ( ) . getAvailableLocales ( ) . contains ( locale ) ) { result = locale ; } } return result ;
|
public class Element { /** * ( non - Javadoc )
* @ see
* qc . automation . framework . widget . IElement # waitForAttributeNotEqualTo ( java
* . lang . String , java . lang . String , java . lang . Long ) */
public void waitForAttributeNotEqualTo ( final String attributeName , final String attributeValue , long timeout ) throws WidgetTimeoutException { } }
|
waitForCommand ( new ITimerCallback ( ) { @ Override public boolean execute ( ) throws WidgetException { String val = getAttribute ( attributeName ) ; if ( val == null && attributeName == null ) return true ; if ( val == null || attributeName == null ) return false ; if ( ! val . equals ( attributeValue ) ) return true ; return false ; } @ Override public String toString ( ) { return "Waiting for attribute, " + ( ( attributeName == null ) ? "" : attributeName ) + ", to not equal: " + ( ( attributeValue == null ) ? "" : attributeValue ) + " - for the element with the locator: " + locator ; } } , timeout ) ;
|
public class StandardAtomGenerator { /** * Position the hydrogen label relative to the element label .
* @ param position relative position where the hydrogen is placed
* @ param element the outline of the element label
* @ param hydrogen the outline of the hydrogen
* @ return positioned hydrogen label */
TextOutline positionHydrogenLabel ( HydrogenPosition position , TextOutline element , TextOutline hydrogen ) { } }
|
final Rectangle2D elementBounds = element . getBounds ( ) ; final Rectangle2D hydrogenBounds = hydrogen . getBounds ( ) ; switch ( position ) { case Above : return hydrogen . translate ( 0 , ( elementBounds . getMinY ( ) - padding ) - hydrogenBounds . getMaxY ( ) ) ; case Right : return hydrogen . translate ( ( elementBounds . getMaxX ( ) + padding ) - hydrogenBounds . getMinX ( ) , 0 ) ; case Below : return hydrogen . translate ( 0 , ( elementBounds . getMaxY ( ) + padding ) - hydrogenBounds . getMinY ( ) ) ; case Left : return hydrogen . translate ( ( elementBounds . getMinX ( ) - padding ) - hydrogenBounds . getMaxX ( ) , 0 ) ; } return hydrogen ; // never reached
|
public class HodViewServiceImpl { /** * Format the document ' s content for display in a browser */
private InputStream formatRawContent ( final Document document ) throws IOException { } }
|
final String body = "<h1>" + escapeAndAddLineBreaks ( resolveTitle ( document ) ) + "</h1>" + "<p>" + escapeAndAddLineBreaks ( document . getContent ( ) ) + "</p>" ; return IOUtils . toInputStream ( body , StandardCharsets . UTF_8 ) ;
|
public class Logger { /** * Logs a message and stack trace if DEBUG logging is enabled
* or a formatted message and exception description if INFO logging is enabled .
* @ param cause an exception to print stack trace of if DEBUG logging is enabled
* @ param message a message */
public final void infoDebug ( final Throwable cause , final String message ) { } }
|
logDebug ( Level . INFO , cause , message ) ;
|
public class Dialog { /** * Set the text of positive action button .
* @ param action
* @ return The Dialog for chaining methods . */
public Dialog positiveAction ( CharSequence action ) { } }
|
mPositiveAction . setText ( action ) ; mPositiveAction . setVisibility ( TextUtils . isEmpty ( action ) ? View . GONE : View . VISIBLE ) ; return this ;
|
public class druidGParser { /** * druidG . g : 377:1 : complexHaving returns [ Having having ] : ( ( s = simpleHaving ) | ( a = simpleHaving WS o = ( AND | OR ) WS b = complexHaving ) ) ; */
public final Having complexHaving ( ) throws RecognitionException { } }
|
Having having = null ; Token o = null ; Having s = null ; Having a = null ; Having b = null ; try { // druidG . g : 378:2 : ( ( s = simpleHaving ) | ( a = simpleHaving WS o = ( AND | OR ) WS b = complexHaving ) )
int alt182 = 2 ; alt182 = dfa182 . predict ( input ) ; switch ( alt182 ) { case 1 : // druidG . g : 378:4 : ( s = simpleHaving )
{ // druidG . g : 378:4 : ( s = simpleHaving )
// druidG . g : 378:5 : s = simpleHaving
{ pushFollow ( FOLLOW_simpleHaving_in_complexHaving2695 ) ; s = simpleHaving ( ) ; state . _fsp -- ; } having = s ; } break ; case 2 : // druidG . g : 379:4 : ( a = simpleHaving WS o = ( AND | OR ) WS b = complexHaving )
{ // druidG . g : 379:4 : ( a = simpleHaving WS o = ( AND | OR ) WS b = complexHaving )
// druidG . g : 379:5 : a = simpleHaving WS o = ( AND | OR ) WS b = complexHaving
{ pushFollow ( FOLLOW_simpleHaving_in_complexHaving2706 ) ; a = simpleHaving ( ) ; state . _fsp -- ; match ( input , WS , FOLLOW_WS_in_complexHaving2708 ) ; o = input . LT ( 1 ) ; if ( input . LA ( 1 ) == AND || input . LA ( 1 ) == OR ) { input . consume ( ) ; state . errorRecovery = false ; } else { MismatchedSetException mse = new MismatchedSetException ( null , input ) ; throw mse ; } match ( input , WS , FOLLOW_WS_in_complexHaving2718 ) ; pushFollow ( FOLLOW_complexHaving_in_complexHaving2722 ) ; b = complexHaving ( ) ; state . _fsp -- ; } having = new Having ( ( o != null ? o . getText ( ) : null ) . toLowerCase ( ) ) ; having . havingSpecs = Arrays . asList ( a , b ) ; } break ; } } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; } finally { // do for sure before leaving
} return having ;
|
public class VpnGatewaysInner { /** * Lists all the VpnGateways in a subscription .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; VpnGatewayInner & gt ; object */
public Observable < Page < VpnGatewayInner > > listNextAsync ( final String nextPageLink ) { } }
|
return listNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < VpnGatewayInner > > , Page < VpnGatewayInner > > ( ) { @ Override public Page < VpnGatewayInner > call ( ServiceResponse < Page < VpnGatewayInner > > response ) { return response . body ( ) ; } } ) ;
|
public class RecoveryHelper { /** * Moves a copied path into a persistent location managed by gobblin - distcp . This method is used when an already
* copied file cannot be successfully published . In future runs , instead of re - copying the file , distcp will use the
* persisted file .
* @ param state { @ link State } containing job information .
* @ param file { @ link org . apache . gobblin . data . management . copy . CopyEntity } from which input { @ link Path } originated .
* @ param path { @ link Path } to persist .
* @ return true if persist was successful .
* @ throws IOException */
public boolean persistFile ( State state , CopyableFile file , Path path ) throws IOException { } }
|
if ( ! this . persistDir . isPresent ( ) ) { return false ; } String guid = computeGuid ( state , file ) ; Path guidPath = new Path ( this . persistDir . get ( ) , guid ) ; if ( ! this . fs . exists ( guidPath ) ) { this . fs . mkdirs ( guidPath , new FsPermission ( FsAction . ALL , FsAction . READ , FsAction . NONE ) ) ; } Path targetPath = new Path ( guidPath , shortenPathName ( file . getOrigin ( ) . getPath ( ) , 250 - guid . length ( ) ) ) ; log . info ( String . format ( "Persisting file %s with guid %s to location %s." , path , guid , targetPath ) ) ; if ( this . fs . rename ( path , targetPath ) ) { this . fs . setTimes ( targetPath , System . currentTimeMillis ( ) , - 1 ) ; return true ; } return false ;
|
public class Domain { /** * Convenience method to return a Domain
* @ param client the client .
* @ param id the domain id .
* @ return the domain object .
* @ throws ParseException Error parsing data
* @ throws Exception error */
public static Domain get ( final BandwidthClient client , final String id ) throws ParseException , Exception { } }
|
assert ( client != null ) ; final String domainsUri = client . getUserResourceInstanceUri ( BandwidthConstants . DOMAINS_URI_PATH , id ) ; final JSONObject jsonObject = toJSONObject ( client . get ( domainsUri , null ) ) ; return new Domain ( client , jsonObject ) ;
|
public class GetIntentResult { /** * An array of sample utterances configured for the intent .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setSampleUtterances ( java . util . Collection ) } or { @ link # withSampleUtterances ( java . util . Collection ) } if you
* want to override the existing values .
* @ param sampleUtterances
* An array of sample utterances configured for the intent .
* @ return Returns a reference to this object so that method calls can be chained together . */
public GetIntentResult withSampleUtterances ( String ... sampleUtterances ) { } }
|
if ( this . sampleUtterances == null ) { setSampleUtterances ( new java . util . ArrayList < String > ( sampleUtterances . length ) ) ; } for ( String ele : sampleUtterances ) { this . sampleUtterances . add ( ele ) ; } return this ;
|
public class AnnotationInfo { /** * Populates an @ RiakUsermeta annotated domain object with the User metadata .
* @ param < T >
* @ param userMetadata
* @ param obj */
public < T > void setUsermetaData ( RiakUserMetadata userMetadata , T obj ) { } }
|
Field mapField = null ; for ( UsermetaField uf : usermetaFields ) { switch ( uf . getFieldType ( ) ) { case STRING : if ( userMetadata . containsKey ( uf . getUsermetaDataKey ( ) ) ) { setFieldValue ( uf . getField ( ) , obj , userMetadata . get ( uf . getUsermetaDataKey ( ) ) ) ; userMetadata . remove ( uf . getUsermetaDataKey ( ) ) ; } break ; case MAP : mapField = uf . getField ( ) ; break ; default : break ; } } Method mapSetter = null ; for ( UsermetaMethod um : usermetaMethods ) { switch ( um . getMethodType ( ) ) { case STRING_SETTER : if ( userMetadata . containsKey ( um . getUsermetaDataKey ( ) ) ) { setMethodValue ( um . getMethod ( ) , obj , userMetadata . get ( um . getUsermetaDataKey ( ) ) ) ; userMetadata . remove ( um . getUsermetaDataKey ( ) ) ; } break ; case MAP_SETTER : mapSetter = um . getMethod ( ) ; break ; default : break ; } } if ( mapSetter != null || mapField != null ) { Map < String , String > mapCopy = new HashMap < > ( userMetadata . size ( ) ) ; for ( Map . Entry < BinaryValue , BinaryValue > entry : userMetadata . getUserMetadata ( ) ) { mapCopy . put ( entry . getKey ( ) . toString ( ) , entry . getValue ( ) . toString ( ) ) ; } if ( mapSetter != null ) { setMethodValue ( mapSetter , obj , mapCopy ) ; } if ( mapField != null ) { setFieldValue ( mapField , obj , mapCopy ) ; } }
|
public class Util { /** * Formats the given exception in a multiline error message with all causes .
* @ param e
* Exception for format as error message
* @ return Returns an error string */
public static String formatException ( final Exception e ) { } }
|
final StringBuilder sb = new StringBuilder ( ) ; Throwable t = e ; while ( t != null ) { sb . append ( t . getMessage ( ) ) . append ( "\n" ) ; t = t . getCause ( ) ; } return sb . toString ( ) ;
|
public class BaseActions { /** * < p > Returns the input text matched by the rule immediately preceding the action expression that is currently
* being evaluated . If the matched input text is empty the given default string is returned .
* This call can only be used in actions that are part of a Sequence rule and are not at first
* position in this Sequence . < / p >
* @ param defaultString the default string to return if the matched input text is empty
* @ return the input text matched by the immediately preceding subrule or the default string */
public String matchOrDefault ( String defaultString ) { } }
|
check ( ) ; String match = context . getMatch ( ) ; return match . length ( ) == 0 ? defaultString : match ;
|
public class Section { /** * getter for textObjects - gets the text objects ( figure , table , boxed text etc . ) that are associated with a particular section
* @ generated
* @ return value of the feature */
public FSArray getTextObjects ( ) { } }
|
if ( Section_Type . featOkTst && ( ( Section_Type ) jcasType ) . casFeat_textObjects == null ) jcasType . jcas . throwFeatMissing ( "textObjects" , "de.julielab.jules.types.Section" ) ; return ( FSArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Section_Type ) jcasType ) . casFeatCode_textObjects ) ) ) ;
|
public class BidiLine { /** * Compute the runs array from the levels array .
* After getRuns ( ) returns true , runCount is guaranteed to be > 0
* and the runs are reordered .
* Odd - level runs have visualStart on their visual right edge and
* they progress visually to the left .
* If option OPTION _ INSERT _ MARKS is set , insertRemove will contain the
* sum of appropriate LRM / RLM _ BEFORE / AFTER flags .
* If option OPTION _ REMOVE _ CONTROLS is set , insertRemove will contain the
* negative number of BiDi control characters within this run . */
static void getRuns ( Bidi bidi ) { } }
|
/* * This method returns immediately if the runs are already set . This
* includes the case of length = = 0 ( handled in setPara ) . . */
if ( bidi . runCount >= 0 ) { return ; } if ( bidi . direction != Bidi . MIXED ) { /* simple , single - run case - this covers length = = 0 */
/* bidi . paraLevel is ok even for contextual multiple paragraphs */
getSingleRun ( bidi , bidi . paraLevel ) ; } else /* Bidi . MIXED , length > 0 */
{ /* mixed directionality */
int length = bidi . length , limit ; byte [ ] levels = bidi . levels ; int i , runCount ; byte level = - 1 ; /* initialize with no valid level */
/* * If there are WS characters at the end of the line
* and the run preceding them has a level different from
* paraLevel , then they will form their own run at paraLevel ( L1 ) .
* Count them separately .
* We need some special treatment for this in order to not
* modify the levels array which a line Bidi object shares
* with its paragraph parent and its other line siblings .
* In other words , for the trailing WS , it may be
* levels [ ] ! = paraLevel but we have to treat it like it were so . */
limit = bidi . trailingWSStart ; /* count the runs , there is at least one non - WS run , and limit > 0 */
runCount = 0 ; for ( i = 0 ; i < limit ; ++ i ) { /* increment runCount at the start of each run */
if ( levels [ i ] != level ) { ++ runCount ; level = levels [ i ] ; } } /* * We don ' t need to see if the last run can be merged with a trailing
* WS run because setTrailingWSStart ( ) would have done that . */
if ( runCount == 1 && limit == length ) { /* There is only one non - WS run and no trailing WS - run . */
getSingleRun ( bidi , levels [ 0 ] ) ; } else /* runCount > 1 | | limit < length */
{ /* allocate and set the runs */
BidiRun [ ] runs ; int runIndex , start ; byte minLevel = Bidi . MAX_EXPLICIT_LEVEL + 1 ; byte maxLevel = 0 ; /* now , count a ( non - mergeable ) WS run */
if ( limit < length ) { ++ runCount ; } /* runCount > 1 */
bidi . getRunsMemory ( runCount ) ; runs = bidi . runsMemory ; /* set the runs */
/* FOOD FOR THOUGHT : this could be optimized , e . g . :
* 464 - > 444 , 484 - > 444 , 575 - > 555 , 595 - > 555
* However , that would take longer . Check also how it would
* interact with BiDi control removal and inserting Marks . */
runIndex = 0 ; /* search for the run limits and initialize visualLimit values with the run lengths */
i = 0 ; do { /* prepare this run */
start = i ; level = levels [ i ] ; if ( level < minLevel ) { minLevel = level ; } if ( level > maxLevel ) { maxLevel = level ; } /* look for the run limit */
while ( ++ i < limit && levels [ i ] == level ) { } /* i is another run limit */
runs [ runIndex ] = new BidiRun ( start , i - start , level ) ; ++ runIndex ; } while ( i < limit ) ; if ( limit < length ) { /* there is a separate WS run */
runs [ runIndex ] = new BidiRun ( limit , length - limit , bidi . paraLevel ) ; /* For the trailing WS run , bidi . paraLevel is ok even
if contextual multiple paragraphs . */
if ( bidi . paraLevel < minLevel ) { minLevel = bidi . paraLevel ; } } /* set the object fields */
bidi . runs = runs ; bidi . runCount = runCount ; reorderLine ( bidi , minLevel , maxLevel ) ; /* now add the direction flags and adjust the visualLimit ' s to be just that */
/* this loop will also handle the trailing WS run */
limit = 0 ; for ( i = 0 ; i < runCount ; ++ i ) { runs [ i ] . level = levels [ runs [ i ] . start ] ; limit = ( runs [ i ] . limit += limit ) ; } /* Set the embedding level for the trailing WS run . */
/* For a RTL paragraph , it will be the * first * run in visual order . */
/* For the trailing WS run , bidi . paraLevel is ok even if
contextual multiple paragraphs . */
if ( runIndex < runCount ) { int trailingRun = ( ( bidi . paraLevel & 1 ) != 0 ) ? 0 : runIndex ; runs [ trailingRun ] . level = bidi . paraLevel ; } } } /* handle insert LRM / RLM BEFORE / AFTER run */
if ( bidi . insertPoints . size > 0 ) { Bidi . Point point ; int runIndex , ip ; for ( ip = 0 ; ip < bidi . insertPoints . size ; ip ++ ) { point = bidi . insertPoints . points [ ip ] ; runIndex = getRunFromLogicalIndex ( bidi , point . pos ) ; bidi . runs [ runIndex ] . insertRemove |= point . flag ; } } /* handle remove BiDi control characters */
if ( bidi . controlCount > 0 ) { int runIndex , ic ; char c ; for ( ic = 0 ; ic < bidi . length ; ic ++ ) { c = bidi . text [ ic ] ; if ( Bidi . IsBidiControlChar ( c ) ) { runIndex = getRunFromLogicalIndex ( bidi , ic ) ; bidi . runs [ runIndex ] . insertRemove -- ; } } }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.