signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class SynchronizedCache { /** * 检测缓存长度是否越界 */ private boolean checkOverFlow ( ) { } }
// 检查长度是否越界 if ( config . getMaxHeapSize ( ) > 0 && info . getSize ( ) >= config . getMaxHeapSize ( ) ) { return true ; } // 检查占用空间是否越界 if ( config . getMaxMemorySize ( ) > 0 && info . getMemorySize ( ) >= config . getMaxMemorySize ( ) ) { return true ; } return false ;
public class ApplicationWrapper { /** * < p class = " changed _ added _ 2_0 " > The default behavior of this method * is to call { @ link Application # publishEvent ( javax . faces . context . FacesContext , Class , Object ) } * on the wrapped { @ link Application } object . < / p > */ @ Override public void publis...
getWrapped ( ) . publishEvent ( context , systemEventClass , source ) ;
public class ApiOvhTelephony { /** * Get all available SIP domains by country * REST : POST / telephony / setDefaultSipDomain * @ param domain [ required ] SIP domain to set * @ param type [ required ] Product type * @ param country [ required ] Country */ public void setDefaultSipDomain_POST ( OvhNumberCountry...
String qPath = "/telephony/setDefaultSipDomain" ; StringBuilder sb = path ( qPath ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "country" , country ) ; addBody ( o , "domain" , domain ) ; addBody ( o , "type" , type ) ; exec ( qPath , "POST" , sb . toString ( ) , o ) ;
public class Train { /** * Compute log li gradient . * @ param lambda the lambda * @ param gradLogLi the grad log li * @ param numIter the num iter * @ param fout the fout * @ return the double */ public double computeLogLiGradient ( double [ ] lambda , double [ ] gradLogLi , int numIter , PrintWriter fout ) ...
double logLi = 0.0 ; int ii , i ; // , j , k ; for ( i = 0 ; i < numFeatures ; i ++ ) { gradLogLi [ i ] = - 1 * lambda [ i ] / model . option . sigmaSquare ; logLi -= ( lambda [ i ] * lambda [ i ] ) / ( 2 * model . option . sigmaSquare ) ; } // go through all training data examples / observations for ( ii = 0 ; ii < mo...
public class GetInstance { /** * This method exists for compatibility with JCE only . It will be removed * once JCE has been changed to use the replacement method . * @ deprecated use getServices ( List < ServiceId > ) instead */ @ Deprecated public static List < Service > getServices ( String type , List < String ...
ProviderList list = Providers . getProviderList ( ) ; return list . getServices ( type , algorithms ) ;
public class DefaultCollectionService { /** * ~ Methods * * * * * */ @ Override public void submitMetric ( PrincipalUser submitter , Metric metric ) { } }
submitMetrics ( submitter , Arrays . asList ( new Metric [ ] { metric } ) ) ;
public class Util { /** * Generate a pattern for obtaining the strict superclasses of a concept . * Uses BIND which Requires SPARQL 1.1 * @ param origin the URL of the class we want to find superclasses for * @ param matchVariable the model reference variable * @ param bindingVar the name of the variable we wil...
StringBuffer query = new StringBuffer ( ) ; query . append ( Util . generateSuperclassPattern ( origin , matchVariable ) + NL ) ; query . append ( "FILTER NOT EXISTS { " + Util . generateSubclassPattern ( origin , matchVariable ) + "}" + NL ) ; // Bind a variable for inspection query . append ( "BIND (true as ?" + bind...
public class ServletAddHeaderTask { /** * { @ inheritDoc } */ public void perform ( TaskRequest req , TaskResponse res ) { } }
HttpServletResponse sres = ( HttpServletResponse ) response . evaluate ( req , res ) ; String headerName = ( String ) header_name . evaluate ( req , res ) ; String headerValue = ( String ) header_value . evaluate ( req , res ) ; // Send the header sres . addHeader ( headerName , headerValue ) ;
public class SensorIoHandler { /** * Passes the Throwable to the IOAdapter . */ @ Override public void exceptionCaught ( IoSession session , Throwable cause ) throws Exception { } }
log . error ( "Unhandled exception caught in session {}: {}" , session , cause ) ; this . sensorIoAdapter . exceptionCaught ( session , cause ) ;
public class StringColumn { /** * Add all the strings in the list to this column * @ param stringValues a list of values */ public StringColumn addAll ( List < String > stringValues ) { } }
for ( String stringValue : stringValues ) { append ( stringValue ) ; } return this ;
public class AbstractFXMLApplication { /** * { @ inheritDoc } * @ return { @ inheritDoc } * @ throws CouldNotPerformException { @ inheritDoc } */ @ Override protected Scene loadScene ( ) throws CouldNotPerformException { } }
try { // setup scene Scene scene ; try { scene = new Scene ( FXMLProcessor . loadFxmlPane ( FXMLProcessor . loadDefaultFXML ( controllerClass ) , getClass ( ) ) ) ; } catch ( final Exception ex ) { throw new CouldNotPerformException ( "Could not load fxml description!" , ex ) ; } try { scene . getStylesheets ( ) . add ...
public class AbstractManagedType { /** * Check for valid . * @ param paramName * the param name * @ param attribute * the attribute */ private void checkForValid ( String paramName , Attribute < ? super X , ? > attribute ) { } }
if ( attribute == null ) { throw new IllegalArgumentException ( "attribute of the given name and type is not present in the managed type, for name:" + paramName ) ; }
public class DeepLearningTask2 { /** * Finish up the work after all nodes have reduced their models via the above reduce ( ) method . * All we do is average the models and add to the global training sample counter . * After this returns , model _ info ( ) can be queried for the updated model . */ @ Override protect...
assert ( _res . model_info ( ) . get_params ( ) . _replicate_training_data ) ; super . postGlobal ( ) ; // model averaging ( DeepLearningTask only computed the per - node models , each on all the data ) _res . model_info ( ) . div ( _res . _chunk_node_count ) ; _res . model_info ( ) . add_processed_global ( _res . mode...
public class MaxCore { /** * Run all the tests contained in < code > request < / code > . * This variant should be used if { @ code core } has attached listeners that this * run should notify . * @ param request the request describing tests * @ param core a JUnitCore to delegate to . * @ return a { @ link Res...
core . addListener ( history . listener ( ) ) ; return core . run ( sortRequest ( request ) . getRunner ( ) ) ;
public class ArrayUtil { /** * Mean double . * @ param op the op * @ return the double */ public static double mean ( @ javax . annotation . Nonnull final double [ ] op ) { } }
return com . simiacryptus . util . ArrayUtil . sum ( op ) / op . length ;
public class RegisteredServiceJwtTicketCipherExecutor { /** * Gets signing key . * @ param registeredService the registered service * @ return the signing key */ public Optional < String > getSigningKey ( final RegisteredService registeredService ) { } }
val property = getSigningKeyRegisteredServiceProperty ( ) ; if ( property . isAssignedTo ( registeredService ) ) { val signingKey = property . getPropertyValue ( registeredService ) . getValue ( ) ; return Optional . of ( signingKey ) ; } return Optional . empty ( ) ;
public class GCPARCImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setYCENT ( Integer newYCENT ) { } }
Integer oldYCENT = ycent ; ycent = newYCENT ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . GCPARC__YCENT , oldYCENT , ycent ) ) ;
public class S3RequestEndpointResolver { /** * Converts the current endpoint set for this client into virtual addressing style , by placing * the name of the specified bucket before the S3 service endpoint . * @ param bucketName The name of the bucket to use in the virtual addressing style of the returned URI . *...
try { return new URI ( String . format ( "%s://%s.%s" , endpoint . getScheme ( ) , bucketName , endpoint . getAuthority ( ) ) ) ; } catch ( URISyntaxException e ) { throw new IllegalArgumentException ( "Invalid bucket name: " + bucketName , e ) ; }
public class RequestQueue { /** * Create network dispatchers ( and corresponding threads ) up to the pool size . */ private void setUpNetworkDispatchers ( ) { } }
if ( networkDispatcherFactory == null ) { networkDispatcherFactory = new NetworkDispatcher . NetworkDispatcherFactory ( networkQueue , network , cache , delivery ) ; } for ( int i = 0 ; i < networkDispatchers . length ; i ++ ) { networkDispatchers [ i ] = networkDispatcherFactory . create ( ) ; networkDispatchers [ i ]...
public class MechanizeAgent { /** * / * ( non - Javadoc ) * @ see com . gistlabs . mechanize . Mechanize # post ( java . lang . String , java . util . Map ) */ @ Override public < T extends Resource > T post ( final String uri , final Map < String , String > params ) throws UnsupportedEncodingException { } }
return post ( uri , new Parameters ( unsafeCast ( params ) ) ) ;
public class YearResultsPartitioner { /** * / * ( non - Javadoc ) * @ see org . archive . wayback . resultspartitioner . ResultsPartitioner # rangeToTitle ( java . util . Calendar , java . util . Calendar ) */ protected String rangeToTitle ( Calendar start , Calendar end , WaybackRequest wbRequest ) { } }
return wbRequest . getFormatter ( ) . format ( "ResultPartitions.year" , start . getTime ( ) ) ;
public class LogTemplates { /** * Produces a concrete log template which logs messages into a SLF4J Logger . * @ param loggerName Logger name * @ param levelName Level name ( info , debug , warn , etc . ) * @ param markerName Marker name * @ return Logger */ public static < C > SLF4JLogTemplate < C > toSLF4J ( ...
if ( "debug" . equalsIgnoreCase ( levelName ) ) { return new SLF4JLogTemplate . Debug < > ( loggerName , markerName ) ; } else if ( "info" . equalsIgnoreCase ( levelName ) ) { return new SLF4JLogTemplate . Info < > ( loggerName , markerName ) ; } else if ( "warn" . equalsIgnoreCase ( levelName ) ) { return new SLF4JLog...
public class ExpressionUtil { /** * Return true / false whether an expression contains any aggregate expression * @ param expr * @ return true is expression contains an aggregate subexpression */ public static boolean containsAggregateExpression ( AbstractExpression expr ) { } }
AbstractExpression . SubexprFinderPredicate pred = new AbstractExpression . SubexprFinderPredicate ( ) { @ Override public boolean matches ( AbstractExpression expr ) { return expr . getExpressionType ( ) . isAggregateExpression ( ) ; } } ; return expr . hasAnySubexpressionWithPredicate ( pred ) ;
public class NumbersConverter { /** * Convert a string to a number of given type . If given string can ' t be stored into required type silent rounding is * applied . If given string is empty return 0 since it is considered as an optional numeric input . * @ throws BugError if value type is not supported . */ @ Ove...
if ( "null" . equals ( string ) ) { return null ; } Number number = string . isEmpty ( ) ? 0 : parseNumber ( string ) ; // hopefully int and double are most used numeric types and test them first if ( Types . equalsAny ( valueType , int . class , Integer . class ) ) { return ( T ) ( Integer ) number . intValue ( ) ; } ...
public class CatalogMap { /** * Create a new instance of a CatalogType as a child of this map with a * given name . Note : this just makes a catalog command and calls * catalog . execute ( . . ) . * @ param name The name of the new instance to create , the thing to add * @ return The newly created CatalogType i...
try { if ( m_items == null ) { m_items = new TreeMap < String , T > ( ) ; } String mapKey = name . toUpperCase ( ) ; if ( m_items . containsKey ( mapKey ) ) { throw new CatalogException ( "Catalog item '" + mapKey + "' already exists for " + m_parent ) ; } T x = m_cls . newInstance ( ) ; x . setBaseValues ( this , name...
public class ConfigurationModule { /** * Gets a combined configuration list with the default added last so that * { @ code filePaths } will override { @ code defaultFilePath } . */ private List < ConfigurationHelper . ConfigurationInfo < String > > getFilePathConfigurationListWithDefault ( @ Nullable List < String > ...
List < ConfigurationHelper . ConfigurationInfo < String > > defaultConfigList = ConfigurationHelper . newList ( true , defaultFilePath ) ; List < ConfigurationHelper . ConfigurationInfo < String > > filePathConfigList = ConfigurationHelper . newList ( filePaths , true ) ; if ( defaultConfigList != null ) { if ( filePat...
public class ExceptionUtils { /** * < p > stackTrace . < / p > * @ param t a { @ link java . lang . Throwable } object . * @ param separator a { @ link java . lang . String } object . * @ return a { @ link java . lang . String } object . */ public static String stackTrace ( Throwable t , String separator ) { } }
return stackTrace ( t , separator , FULL ) ;
public class JSParser { /** * Variant : : = " { " TypeDecl ( " | " TypeDecl ) * " } " */ final public JSVariant Variant ( Map refs ) throws ParseException { } }
JSVariant ans = new JSVariant ( ) ; JSType mem ; jj_consume_token ( 5 ) ; mem = TypeDecl ( refs ) ; ans . addCase ( mem ) ; label_2 : while ( true ) { switch ( ( jj_ntk == - 1 ) ? jj_ntk ( ) : jj_ntk ) { case 6 : ; break ; default : jj_la1 [ 3 ] = jj_gen ; break label_2 ; } jj_consume_token ( 6 ) ; mem = TypeDecl ( ref...
public class CustomizedScalingMetricSpecification { /** * The dimensions of the metric . * Conditional : If you published your metric with dimensions , you must specify the same dimensions in your * customized scaling metric specification . * < b > NOTE : < / b > This method appends the values to the existing lis...
if ( this . dimensions == null ) { setDimensions ( new java . util . ArrayList < MetricDimension > ( dimensions . length ) ) ; } for ( MetricDimension ele : dimensions ) { this . dimensions . add ( ele ) ; } return this ;
public class RoutesInner { /** * Gets all routes in a route table . * @ param resourceGroupName The name of the resource group . * @ param routeTableName The name of the route table . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; R...
return listWithServiceResponseAsync ( resourceGroupName , routeTableName ) . map ( new Func1 < ServiceResponse < Page < RouteInner > > , Page < RouteInner > > ( ) { @ Override public Page < RouteInner > call ( ServiceResponse < Page < RouteInner > > response ) { return response . body ( ) ; } } ) ;
public class MinimumEnlargementInsert { /** * Chooses the best path of the specified subtree for insertion of the given * object . * @ param tree the tree to insert into * @ param object the entry to search * @ param subtree the subtree to be tested for insertion * @ return the path of the appropriate subtree...
N node = tree . getNode ( subtree . getEntry ( ) ) ; // leaf if ( node . isLeaf ( ) ) { return subtree ; } // Initialize from first : int bestIdx = 0 ; E bestEntry = node . getEntry ( 0 ) ; double bestDistance = tree . distance ( object . getRoutingObjectID ( ) , bestEntry . getRoutingObjectID ( ) ) ; // Iterate over r...
public class PersonGenerator { /** * Will generate the given number of random people * @ param num the number of people to generate * @ return a list of the generated people */ public List < Person > nextPeople ( int num ) { } }
List < Person > names = new ArrayList < Person > ( num ) ; for ( int i = 0 ; i < num ; i ++ ) { names . add ( nextPerson ( ) ) ; } return names ;
public class ProjectApi { /** * Updates a push rule for the specified project . * < pre > < code > PUT / projects / : id / push _ rule / : push _ rule _ id < / code > < / pre > * The following properties on the PushRules instance are utilized when updating the push rule : * < code > * denyDeleteTag ( optional )...
GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "deny_delete_tag" , pushRule . getDenyDeleteTag ( ) ) . withParam ( "member_check" , pushRule . getMemberCheck ( ) ) . withParam ( "prevent_secrets" , pushRule . getPreventSecrets ( ) ) . withParam ( "commit_message_regex" , pushRule . getCommitMessageRegex (...
public class DiGraphIterator { /** * Creates a stream . * @ param < T > * @ param root * @ param edges * @ return */ public static < T > Stream < T > stream ( T root , Function < ? super T , ? extends Stream < T > > edges ) { } }
return StreamSupport . stream ( spliterator ( root , edges ) , false ) ;
public class BProgram { /** * Blocks until an external event is added . Then , if that event is not the * " stop daemon mode " one , returns the event . Otherwise , returns * { @ code null } . * @ return The event , or { @ code null } in case the daemon mode is turned off * during the wait . * @ throws Interr...
BEvent next = recentlyEnqueuedExternalEvents . take ( ) ; if ( next == NO_MORE_WAIT_EXTERNAL ) { waitForExternalEvents = false ; return null ; } else { return next ; }
public class Controller { /** * TODO not correctly formulated doc */ protected < T > T parseBody ( Class < T > clazz ) throws ParsableException , MediaTypeException { } }
String contentType = context . requestContentType ( ) ; // if the content type header was not provided , we throw if ( contentType == null || contentType . isEmpty ( ) ) { throw new MediaTypeException ( "Missing media type header" ) ; } // extract the actual content type in case charset is also a part of the string con...
public class SPUIComponentProvider { /** * Layout of tabs in detail tabsheet . * @ return VerticalLayout */ public static VerticalLayout getDetailTabLayout ( ) { } }
final VerticalLayout layout = new VerticalLayout ( ) ; layout . setSpacing ( true ) ; layout . setMargin ( true ) ; layout . setImmediate ( true ) ; return layout ;
public class SourceToHTMLConverter { /** * Add a line from source to the HTML file that is generated . * @ param pre the content tree to which the line will be added . * @ param line the string to format . * @ param currentLineNo the current number . */ private void addLine ( Content pre , String line , int curre...
if ( line != null ) { Content anchor = HtmlTree . A ( configuration . htmlVersion , "line." + Integer . toString ( currentLineNo ) , new StringContent ( utils . replaceTabs ( line ) ) ) ; pre . addContent ( anchor ) ; pre . addContent ( NEW_LINE ) ; }
public class HttpRequest { public Principal getUserPrincipal ( ) { } }
if ( _userPrincipal == __NO_USER ) return null ; if ( _userPrincipal == __NOT_CHECKED ) { _userPrincipal = __NO_USER ; // Try a lazy authentication HttpContext context = getHttpResponse ( ) . getHttpContext ( ) ; if ( context != null ) { Authenticator auth = context . getAuthenticator ( ) ; UserRealm realm = context . ...
public class XsdEmitter { /** * If simple type has conditions attached to it , emit enumeration facets . * @ param xsdDataItem COBOL data item decorated with XSD attributes * @ param restriction the current set of constraints */ protected void addEnumerationFacets ( final XsdDataItem xsdDataItem , final XmlSchemaSi...
if ( getConfig ( ) . mapConditionsToFacets ( ) ) { boolean hasValueThru = false ; for ( XsdDataItem child : xsdDataItem . getChildren ( ) ) { if ( child . getDataEntryType ( ) == DataEntryType . CONDITION ) { for ( String conditionValue : child . getConditionLiterals ( ) ) { restriction . getFacets ( ) . add ( createEn...
public class CmsXmlContentEditor { /** * Writes the xml content to the vfs and re - initializes the member variables . < p > * @ throws CmsException if writing the file fails */ private void writeContent ( ) throws CmsException { } }
String decodedContent = m_content . toString ( ) ; try { m_file . setContents ( decodedContent . getBytes ( getFileEncoding ( ) ) ) ; } catch ( UnsupportedEncodingException e ) { throw new CmsException ( Messages . get ( ) . container ( Messages . ERR_INVALID_CONTENT_ENC_1 , getParamResource ( ) ) , e ) ; } // the file...
public class SystemInputJsonWriter { /** * Writes the given system test definition the form of a JSON document . */ public void write ( SystemInputDef systemInput ) { } }
JsonWriterFactory writerFactory = Json . createWriterFactory ( MapBuilder . of ( PRETTY_PRINTING , true ) . build ( ) ) ; JsonWriter jsonWriter = writerFactory . createWriter ( getWriter ( ) ) ; jsonWriter . write ( SystemInputJson . toJson ( systemInput ) ) ;
public class RoundedMoney { /** * ( non - Javadoc ) * @ see MonetaryAmount # multiply ( Number ) */ @ Override public RoundedMoney multiply ( Number multiplicand ) { } }
BigDecimal bd = MoneyUtils . getBigDecimal ( multiplicand ) ; if ( isOne ( bd ) ) { return this ; } MathContext mc = monetaryContext . get ( MathContext . class ) ; if ( mc == null ) { mc = MathContext . DECIMAL64 ; } BigDecimal dec = number . multiply ( bd , mc ) ; return new RoundedMoney ( dec , currency , rounding )...
public class PHPDriverHelper { /** * < p > Getter for the field < code > phpExec < / code > . < / p > * @ param exec a { @ link java . lang . String } object . * @ return a { @ link java . lang . String } object . * @ throws java . io . IOException if any . */ public String getPhpExec ( String exec ) throws IOExc...
if ( phpExec != null ) { return phpExec ; } initPhpExec ( exec ) ; return phpExec ;
public class NetworkWatchersInner { /** * Initiate troubleshooting on a specified resource . * @ param resourceGroupName The name of the resource group . * @ param networkWatcherName The name of the network watcher resource . * @ param parameters Parameters that define the resource to troubleshoot . * @ throws ...
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( networkWatcherName == null ) { throw new IllegalArgumentException ( "Parameter networkWatcherName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ...
public class QueryUpdateOnSubscribe { /** * Cancels a running PreparedStatement , closing it and the current * Connection but only if auto commit mode . */ private void close ( State state ) { } }
// ensure close happens once only to avoid race conditions if ( state . closed . compareAndSet ( false , true ) ) { Util . closeQuietly ( state . ps ) ; if ( isCommit ( ) || isRollback ( ) ) Util . closeQuietly ( state . con ) ; else Util . closeQuietlyIfAutoCommit ( state . con ) ; }
public class DCacheBase { /** * Increase cache size in bytes to the total count * @ param size * The size to be increased */ public void increaseCacheSizeInBytes ( long size , String msg ) { } }
if ( this . memoryCacheSizeInMBEnabled ) { this . currentMemoryCacheSizeInBytes += size ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "increaseCacheSizeInBytes() cacheName=" + cacheName + " " + msg + " size=" + size + " currentMemoryCacheSizeInBytes=" + this . currentMemoryCacheSizeInBytes ) ; } }
public class PasswordUtils { public static final String replacePossiblePassword ( boolean password , Object o ) { } }
if ( password ) return replaceNonNullObject ( o ) ; else if ( o == null ) return null ; else return o . toString ( ) ;
public class ESTemplate { /** * 根据解析出的语法结构确定sql语句是否是velocity模板 * 如果不是则重置sqlinfo的istpl属性 , 相关的缓存就可以使用sqlname来作为key * 同时避免每次都对token进行拼接 , 提升系统性能 */ private void rechecksqlistpl ( ) { } }
if ( data != null ) { Node [ ] childrens = ( ( SimpleNode ) data ) . getChildren ( ) ; if ( childrens != null && childrens . length > 0 ) { boolean switchcase = true ; for ( Node node : childrens ) { if ( ! ( node instanceof ASTText ) ) { switchcase = false ; break ; } } if ( switchcase ) { this . esInfo . setTpl ( fal...
public class GHRequest { /** * For possible values see AlgorithmOptions . * */ public GHRequest setAlgorithm ( String algo ) { } }
if ( algo != null ) this . algo = Helper . camelCaseToUnderScore ( algo ) ; return this ;
public class PostOffice { /** * Create a new EditText Dialog ' Mail ' Delivery to display * - This creates a dialog with 2 buttons and an EditText field for * the content and retrieves text input from your user * @ param ctx the application context * @ param title the dialog title * @ param hint the EditText ...
// Create the delivery Delivery . Builder builder = newMail ( ctx ) . setTitle ( title ) . setStyle ( new EditTextStyle . Builder ( ctx ) . setHint ( hint ) . setInputType ( inputType ) . setOnTextAcceptedListener ( listener ) . build ( ) ) ; // Return the delivery return builder . build ( ) ;
public class LayoutUtils { /** * Moves the elements contained in " band " in the Y axis " yOffset " * @ param yOffset * @ param band */ public static void moveBandsElemnts ( int yOffset , JRDesignBand band ) { } }
if ( band == null ) return ; for ( JRChild jrChild : band . getChildren ( ) ) { JRDesignElement elem = ( JRDesignElement ) jrChild ; elem . setY ( elem . getY ( ) + yOffset ) ; }
public class Flowable { /** * Returns a Flowable that correlates two Publishers when they overlap in time and groups the results . * There are no guarantees in what order the items get combined when multiple * items from one or both source Publishers overlap . * < img width = " 640 " height = " 380 " src = " http...
ObjectHelper . requireNonNull ( other , "other is null" ) ; ObjectHelper . requireNonNull ( leftEnd , "leftEnd is null" ) ; ObjectHelper . requireNonNull ( rightEnd , "rightEnd is null" ) ; ObjectHelper . requireNonNull ( resultSelector , "resultSelector is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableGrou...
public class TargetsApi { /** * Get recently used targets * Get recently used targets for the current agent . * @ param limit The number of results to return . The default value is 50 . ( optional ) * @ return TargetsResponse * @ throws ApiException If fail to call the API , e . g . server error or cannot deser...
ApiResponse < TargetsResponse > resp = getRecentTargetsWithHttpInfo ( limit ) ; return resp . getData ( ) ;
public class CharBuffer { /** * clear the content of the buffer */ public void clear ( ) { } }
if ( size ( ) == 0 ) return ; buffer = new char [ buffer . length ] ; root . next = null ; pos = 0 ; length = 0 ; curr = root ;
public class Viterbi { /** * Divide . * @ param cols the cols * @ param val the val */ public void divide ( PairDblInt [ ] cols , double val ) { } }
for ( int i = 0 ; i < numLabels ; i ++ ) { cols [ i ] . first /= val ; }
public class SnackBar { /** * Set the text that the ActionButton is to display . * @ param id If 0 , then the ActionButton will be hidden . * @ return This SnackBar for chaining methods . */ public SnackBar actionText ( int id ) { } }
if ( id == 0 ) return actionText ( null ) ; return actionText ( getContext ( ) . getResources ( ) . getString ( id ) ) ;
public class NetUtils { /** * Returns an address in a normalized format for Akka . * When an IPv6 address is specified , it normalizes the IPv6 address to avoid * complications with the exact URL match policy of Akka . * @ param host The hostname , IPv4 or IPv6 address * @ return host which will be normalized i...
// Return loopback interface address if host is null // This represents the behavior of { @ code InetAddress . getByName } and RFC 3330 if ( host == null ) { host = InetAddress . getLoopbackAddress ( ) . getHostAddress ( ) ; } else { host = host . trim ( ) . toLowerCase ( ) ; } // normalize and valid address if ( IPAdd...
public class DI { /** * delegator */ public static < T > Class < ? extends T > resolveImplementingClass ( final Class < T > interf ) { } }
return ImplementingClassResolver . resolve ( interf ) ;
public class ThaiSolarCalendar { /** * / * [ deutsch ] * < p > Entspricht { @ code at ( PlainTime . of ( hour , minute ) ) } . < / p > * @ param hour hour of day in range ( 0-24) * @ param minute minute of hour in range ( 0-59) * @ return general timestamp as composition of this date and given time * @ throws...
return this . at ( PlainTime . of ( hour , minute ) ) ;
public class Functions { /** * Increases the saturation of the given color by N percent . * @ param generator the surrounding generator * @ param input the function call to evaluate * @ return the result of the evaluation */ public static Expression saturate ( Generator generator , FunctionCall input ) { } }
Color color = input . getExpectedColorParam ( 0 ) ; int increase = input . getExpectedIntParam ( 1 ) ; return changeSaturation ( color , increase ) ;
public class CreateDirectConnectGatewayAssociationRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateDirectConnectGatewayAssociationRequest createDirectConnectGatewayAssociationRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createDirectConnectGatewayAssociationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createDirectConnectGatewayAssociationRequest . getDirectConnectGatewayId ( ) , DIRECTCONNECTGATEWAYID_BINDING ) ; protocolMarshaller . marsh...
public class Mode { /** * Adds a set of element actions to be performed in this mode * for elements in a specified namespace . * @ param ns The namespace pattern . * @ param wildcard The wildcard character . * @ param actions The set of element actions . * @ return true if successfully added , that is the nam...
NamespaceSpecification nss = new NamespaceSpecification ( ns , wildcard ) ; if ( nssElementMap . get ( nss ) != null ) return false ; for ( Enumeration e = nssElementMap . keys ( ) ; e . hasMoreElements ( ) ; ) { NamespaceSpecification nssI = ( NamespaceSpecification ) e . nextElement ( ) ; if ( nss . compete ( nssI ) ...
public class Input { /** * Fire an event indicating that a control has been pressed * @ param index The index of the control pressed * @ param controllerIndex The index of the controller on which the control was pressed */ private void fireControlPress ( int index , int controllerIndex ) { } }
consumed = false ; for ( int i = 0 ; i < controllerListeners . size ( ) ; i ++ ) { ControllerListener listener = ( ControllerListener ) controllerListeners . get ( i ) ; if ( listener . isAcceptingInput ( ) ) { switch ( index ) { case LEFT : listener . controllerLeftPressed ( controllerIndex ) ; break ; case RIGHT : li...
public class Sherdog { /** * Gets an organization via it ' s sherdog page HTML , in case you want to have your own way of getting teh HTML content * @ param html The web page HTML * @ return an Organization * @ throws IOException if connecting to sherdog fails * @ throws ParseException if the page structure has...
return new OrganizationParser ( zoneId ) . parseFromHtml ( html ) ;
public class IpCamDeviceRegistry { /** * Is device registered ? * @ param ipcam the IP camera device * @ return True if device is registsred , false otherwise */ public static boolean isRegistered ( IpCamDevice ipcam ) { } }
if ( ipcam == null ) { throw new IllegalArgumentException ( "IP camera device cannot be null" ) ; } Iterator < IpCamDevice > di = DEVICES . iterator ( ) ; while ( di . hasNext ( ) ) { if ( di . next ( ) . getName ( ) . equals ( ipcam . getName ( ) ) ) { return true ; } } return false ;
public class AbstractServletModule { /** * Constructs an init parameter map for the * { @ link Cas20ProxyReceivingTicketValidationFilter } filter . * @ return the init parameter map . */ protected Map < String , String > getCasValidationFilterInitParams ( ) { } }
Map < String , String > params = new HashMap < > ( ) ; CasEurekaClinicalProperties properties = this . servletModuleSupport . getApplicationProperties ( ) ; params . put ( "casServerUrlPrefix" , properties . getCasUrl ( ) ) ; params . put ( "serverName" , properties . getProxyCallbackServer ( ) ) ; params . put ( "prox...
public class InternalSARLParser { /** * InternalSARL . g : 15966:1 : ruleXFunctionTypeRef returns [ EObject current = null ] : ( ( otherlv _ 0 = ' ( ' ( ( ( lv _ paramTypes _ 1_0 = ruleJvmTypeReference ) ) ( otherlv _ 2 = ' , ' ( ( lv _ paramTypes _ 3_0 = ruleJvmTypeReference ) ) ) * ) ? otherlv _ 4 = ' ) ' ) ? otherlv...
EObject current = null ; Token otherlv_0 = null ; Token otherlv_2 = null ; Token otherlv_4 = null ; Token otherlv_5 = null ; EObject lv_paramTypes_1_0 = null ; EObject lv_paramTypes_3_0 = null ; EObject lv_returnType_6_0 = null ; enterRule ( ) ; try { // InternalSARL . g : 15972:2 : ( ( ( otherlv _ 0 = ' ( ' ( ( ( lv _...
public class RandomAccessFile { /** * Returns the length of this file in bytes . * @ return the file ' s length in bytes . * @ throws IOException * if this file is closed or some other I / O error occurs . */ public long length ( ) throws IOException { } }
try { return Libcore . os . fstat ( fd ) . st_size ; } catch ( ErrnoException errnoException ) { throw errnoException . rethrowAsIOException ( ) ; }
public class Parser { /** * * * * * * Definition Lists * * * * * */ public Rule DefinitionList ( ) { } }
return NodeSequence ( // test for successful definition list match before actually building it to reduce backtracking TestNot ( Spacechar ( ) ) , Test ( OneOrMore ( TestNot ( BlankLine ( ) ) , TestNot ( DefListBullet ( ) ) , OneOrMore ( NotNewline ( ) , ANY ) , Newline ( ) ) , ZeroOrMore ( BlankLine ( ) ) , DefListBull...
public class WSRdbManagedConnectionImpl { /** * Used by the container to change the association of an application - level * connection handle with a ManagedConneciton instance . The container should * find the right ManagedConnection instance and call the associateConnection * method . * The resource adapter is...
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "associateConnection" , connection ) ; WSJdbcConnection connHandle = ( WSJdbcConnection ) connection ; // JDBC Handles do not support reassociation during a transaction because of th...
public class PGPUtils { /** * Performs decryption of a given stream using a PGP private key . * @ param encryptedStream stream providing the encrypted data * @ param targetStream stream to receive the decrypted data * @ param privateKeyStream stream providing the encoded PGP private key * @ param password passp...
BcKeyFingerprintCalculator calculator = new BcKeyFingerprintCalculator ( ) ; PGPObjectFactory factory = new PGPObjectFactory ( PGPUtil . getDecoderStream ( encryptedStream ) , calculator ) ; PGPEncryptedDataList dataList ; Object object = factory . nextObject ( ) ; if ( object instanceof PGPEncryptedDataList ) { dataLi...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcBuildingElementPart ( ) { } }
if ( ifcBuildingElementPartEClass == null ) { ifcBuildingElementPartEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 59 ) ; } return ifcBuildingElementPartEClass ;
public class VisLmlSyntax { /** * Extra common attributes : */ @ Override protected void registerBuildingAttributes ( ) { } }
super . registerBuildingAttributes ( ) ; // DragPaneLmlActorBuilder : addBuildingAttributeProcessor ( new GroupTypeLmlAttribute ( ) , "type" ) ; // VisWindowLmlActorBuilder : addBuildingAttributeProcessor ( new ShowWindowBorderLmlAttribute ( ) , "showBorder" , "showWindowBorder" ) ; // MenuItemLmlActorBuilder : addBuil...
public class Array { /** * { @ link Arrays # binarySearch ( Object [ ] , Object , Comparator ) } * @ param a * @ param key * @ param cmp * @ return */ static < T > int binarySearch ( final T [ ] a , final T key , final Comparator < ? super T > cmp ) { } }
if ( N . isNullOrEmpty ( a ) ) { return N . INDEX_NOT_FOUND ; } return Arrays . binarySearch ( a , key , cmp == null ? Comparators . NATURAL_ORDER : cmp ) ;
public class UpdateDatastoreRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateDatastoreRequest updateDatastoreRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateDatastoreRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateDatastoreRequest . getDatastoreName ( ) , DATASTORENAME_BINDING ) ; protocolMarshaller . marshall ( updateDatastoreRequest . getRetentionPeriod ( ) , RETENT...
public class BaseNeo4jDialect { /** * A regular embedded is an element that it is embedded but it is not a key or a collection . * @ param keyColumnNames the column names representing the identifier of the entity * @ param column the column we want to check * @ return { @ code true } if the column represent an at...
return isPartOfEmbedded ( column ) && ! ArrayHelper . contains ( keyColumnNames , column ) ;
public class route { /** * Use this API to fetch all the route resources that are configured on netscaler . */ public static route [ ] get ( nitro_service service , options option ) throws Exception { } }
route obj = new route ( ) ; route [ ] response = ( route [ ] ) obj . get_resources ( service , option ) ; return response ;
public class WorkspaceApi { /** * Activates the voice channel using the provided resources . If the channel is successfully activated , * Workspace sends additional information about the state of active resources ( DNs , channels ) via events . The * resources you provide are associated with the agent for the durat...
try { String msg = "Activating channels with agentId [" + agentId + "] " ; ActivatechannelsData data = new ActivatechannelsData ( ) ; data . setAgentId ( agentId ) ; if ( placeName != null ) { data . setPlaceName ( placeName ) ; msg += "place [" + placeName + "]" ; } else { data . setDn ( dn ) ; msg += "dn [" + dn + "]...
public class AbstractHBaseUtils { /** * Creates an HBase configuration object . * @ param properties the configuration properties */ public void createConfiguration ( final Properties properties ) { } }
setHbcfg ( HBaseConfiguration . create ( ) ) ; getHbcfg ( ) . set ( HBASE_ZOOKEEPER_QUORUM , properties . getProperty ( HBASE_ZOOKEEPER_QUORUM , "hlt-services4" ) ) ; getHbcfg ( ) . set ( HBASE_ZOOKEEPER_CLIENT_PORT , properties . getProperty ( HBASE_ZOOKEEPER_CLIENT_PORT , "2181" ) ) ; getHbcfg ( ) . set ( HADOOP_FS_D...
public class CmsSitemapController { /** * Ensure the uniqueness of a given URL - name within the children of the given parent site - map entry . < p > * @ param parent the parent entry * @ param newName the proposed name * @ param callback the callback to execute */ public void ensureUniqueName ( CmsClientSitemap...
ensureUniqueName ( parent . getSitePath ( ) , newName , callback ) ;
public class RealmTableImpl { /** * ( non - Javadoc ) * @ see org . jdiameter . client . api . controller . IRealmTable # removeRealmApplicationId ( java . lang . String , org . jdiameter . api . ApplicationId ) */ @ Override public Realm removeRealmApplicationId ( String realmName , ApplicationId appId ) { } }
RealmSet set = this . realmNameToRealmSet . get ( realmName ) ; if ( set != null ) { Realm r = set . getRealm ( appId ) ; set . removeRealm ( appId ) ; if ( set . size ( ) == 0 && ! realmName . equals ( this . localRealmName ) ) { this . realmNameToRealmSet . remove ( realmName ) ; this . allRealmsSet . remove ( realmN...
public class AesCtr { /** * See < a href = * " http : / / csrc . nist . gov / publications / nistpubs / 800-38D / SP - 800-38D . pdf " > * NIST Special Publication 800-38D . < / a > for the definition of J0 , the * " pre - counter block " . * Reference : < a href = * " https : / / github . com / bcgit / bc - ...
final int blockSize = getBlockSizeInBytes ( ) ; byte [ ] J0 = new byte [ blockSize ] ; System . arraycopy ( nonce , 0 , J0 , 0 , nonce . length ) ; J0 [ blockSize - 1 ] = 0x01 ; return incrementBlocks ( J0 , 1 ) ;
public class FineUploader5Validation { /** * Specify file valid file extensions here to restrict uploads to specific * types . * @ param sAllowedExtension * The allowed extension to be added . E . g . ( " jpeg " , " jpg " , " gif " ) * @ return this for chaining */ @ Nonnull public FineUploader5Validation addAl...
ValueEnforcer . notEmpty ( sAllowedExtension , "AllowedExtension" ) ; m_aValidationAllowedExtensions . add ( sAllowedExtension ) ; return this ;
public class Bytes { /** * Converts a byte array to an int value . * @ param bytes byte array * @ param offset offset into array * @ param length length of int ( has to be { @ link # SIZEOF _ INT } ) * @ return the int value * @ throws IllegalArgumentException if length is not { @ link # SIZEOF _ INT } or *...
if ( length != SIZEOF_INT || offset + length > bytes . length ) { throw explainWrongLengthOrOffset ( bytes , offset , length , SIZEOF_INT ) ; } int n = 0 ; for ( int i = offset ; i < ( offset + length ) ; i ++ ) { n <<= 8 ; n ^= bytes [ i ] & 0xFF ; } return n ;
public class Dater { /** * Returns a new Dater instance with the given date and date style * @ param date * @ return */ public static Dater of ( String date , DateStyle dateStyle ) { } }
return from ( date ) . with ( dateStyle ) ;
public class NetworkSecurityGroupsInner { /** * Gets the specified network security group . * @ param resourceGroupName The name of the resource group . * @ param networkSecurityGroupName The name of the network security group . * @ param serviceCallback the async ServiceCallback to handle successful and failed r...
return ServiceFuture . fromResponse ( getByResourceGroupWithServiceResponseAsync ( resourceGroupName , networkSecurityGroupName ) , serviceCallback ) ;
public class ParserDDL { /** * Responsible for handling tail of ALTER COLUMN . . . RENAME . . . */ private void processAlterColumnRename ( Table table , ColumnSchema column ) { } }
checkIsSimpleName ( ) ; if ( table . findColumn ( token . tokenString ) > - 1 ) { throw Error . error ( ErrorCode . X_42504 , token . tokenString ) ; } database . schemaManager . checkColumnIsReferenced ( table . getName ( ) , column . getName ( ) ) ; session . commit ( false ) ; table . renameColumn ( column , token ....
public class Tags { /** * Return a stream of the contained tags . * @ return a tags stream */ public Stream < Tag > stream ( ) { } }
return StreamSupport . stream ( Spliterators . spliteratorUnknownSize ( iterator ( ) , Spliterator . ORDERED | Spliterator . DISTINCT | Spliterator . NONNULL | Spliterator . SORTED ) , false ) ;
public class MethodParameter { /** * Enables converters to get the value type from the " value " expression . * @ param name DOCUMENT _ ME * @ return DOCUMENT _ ME */ @ Override public ValueExpression getValueExpression ( final String name ) { } }
if ( "value" . equals ( name ) ) { // get type from parent component // MethodSignatureTagHandler stores all parameters to the parent component final UIComponent parent = getParent ( ) ; final Map < String , Object > parentAttribtues = parent . getAttributes ( ) ; final Class < ? > [ ] parameterTypes = ( Class < ? > [ ...
public class BasicColorPicker { /** * Updates picker ui from current color */ protected void updateValuesFromCurrentColor ( ) { } }
int [ ] hsv = ColorUtils . RGBtoHSV ( color ) ; int ch = hsv [ 0 ] ; int cs = hsv [ 1 ] ; int cv = hsv [ 2 ] ; verticalBar . setValue ( ch ) ; palette . setValue ( cs , cv ) ;
public class CmsSitemapController { /** * Moves the given sitemap entry with all its descendants to the new position . < p > * @ param entry the sitemap entry to move * @ param toPath the destination path * @ param position the new position between its siblings */ public void move ( CmsClientSitemapEntry entry , ...
// check for valid data if ( ! isValidEntryAndPath ( entry , toPath ) ) { // invalid data , do nothing CmsDebugLog . getInstance ( ) . printLine ( "invalid data, doing nothing" ) ; return ; } // check for relevance if ( isChangedPosition ( entry , toPath , position ) ) { // only register real changes CmsSitemapChange c...
public class Assert { /** * Asserts that a cookies with the provided name has a value equal to the * expected value . This information will be logged and recorded , with a * screenshot for traceability and added debugging support . * @ param cookieName the name of the cookie * @ param expectedCookieValue the ex...
assertEquals ( "Cookie Value Mismatch" , expectedCookieValue , checkCookieEquals ( cookieName , expectedCookieValue , 0 , 0 ) ) ;
public class FYShuffle { /** * Randomly shuffle a char array * @ param charArray array of char to shuffle . */ public static void shuffle ( char [ ] charArray ) { } }
int swapPlace = - 1 ; for ( int i = 0 ; i < charArray . length ; i ++ ) { swapPlace = ( int ) ( Math . random ( ) * ( charArray . length - 1 ) ) ; XORSwap . swap ( charArray , i , swapPlace ) ; }
public class RemoteUIAElement { /** * TODO freynaud fix that server side . */ @ Override public boolean isDisplayed ( ) { } }
WebDriverLikeRequest request = buildRequest ( WebDriverLikeCommand . DISPLAYED ) ; return ( Boolean ) commandExecutor . execute ( request ) ;
public class MessageDetailScreen { /** * Add all the screen listeners . */ public void addListeners ( ) { } }
super . addListeners ( ) ; ( ( MessageDetail ) this . getMainRecord ( ) ) . addPropertyListeners ( ) ; this . getMainRecord ( ) . addListener ( new MessageDetailDefTransHandler ( null ) ) ; String strManualTransportID = Integer . toString ( ( ( ReferenceField ) this . getMainRecord ( ) . getField ( MessageDetail . MESS...
public class AppGameContainer { /** * Start running the game * @ throws SlickException Indicates a failure to initialise the system */ public void start ( ) throws SlickException { } }
try { setup ( ) ; getDelta ( ) ; while ( running ( ) ) { gameLoop ( ) ; } } finally { destroy ( ) ; } if ( forceExit ) { System . exit ( 0 ) ; }
public class BNFHeadersImpl { /** * Read the next byte [ ] from the input stream instance . * @ param input * @ return byte [ ] - - value read , or null if length marker indicates no byte [ ] * @ throws IOException */ protected byte [ ] readByteArray ( ObjectInput input ) throws IOException { } }
int len = input . readInt ( ) ; if ( - 1 == len ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "read byte[] found -1 length marker" ) ; } return null ; } byte [ ] value = new byte [ len ] ; input . readFully ( value ) ; return value ;
public class EurekaClinicalClient { /** * Submits a form and gets back a JSON object . Adds appropriate Accepts and * Content Type headers . * @ param < T > the type of object that is expected in the response . * @ param path the API to call . * @ param formParams the form parameters to send . * @ param cls t...
return doPost ( path , formParams , cls , null ) ;
public class AbstractEntry { /** * Writes the index entry into the provided buffer at the current position . */ public void index ( final ByteBuffer index , final int position ) { } }
index . putInt ( tag ) . putInt ( getType ( ) ) . putInt ( position ) . putInt ( count ) ;