signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class GroovyScript2RestLoader { /** * Set attribute value . If value is null the attribute will be removed .
* @ param element The element to set attribute value
* @ param attr The attribute name
* @ param value The value of attribute */
protected void setAttributeSmart ( Element element , String attr , St... | if ( value == null ) { element . removeAttribute ( attr ) ; } else { element . setAttribute ( attr , value ) ; } |
public class RDBMEntityLockStore { /** * Delete all expired IEntityLocks from the underlying store .
* @ param lock IEntityLock */
public void deleteExpired ( IEntityLock lock ) throws LockingException { } } | deleteExpired ( new Date ( ) , lock . getEntityType ( ) , lock . getEntityKey ( ) ) ; |
public class FilterTargetData { /** * Match key condition
* @ param lookupKey Filter text
* @ return True if match , false otherwise */
public boolean keyMatch ( String lookupKey ) { } } | if ( key . isEmpty ( ) ) { return technicalName . contains ( lookupKey ) ; } else { return key . contains ( lookupKey ) ; } |
public class OkapiUI { /** * GEN - LAST : event _ txtXDimensionFocusLost */
private void txtWhitespaceWidthFocusLost ( java . awt . event . FocusEvent evt ) { } } | // GEN - FIRST : event _ txtWhitespaceWidthFocusLost
// TODO : the name ( and label ? ) of this text box no longer matches its purpose
if ( txtWhitespaceWidth . getText ( ) . matches ( "[0-9]+" ) ) { quietZoneVertical = Integer . parseInt ( txtWhitespaceWidth . getText ( ) ) ; encodeData ( ) ; } else { txtWhitespaceWid... |
public class DirectConnectGatewayAssociation { /** * The Amazon VPC prefixes to advertise to the Direct Connect gateway .
* @ return The Amazon VPC prefixes to advertise to the Direct Connect gateway . */
public java . util . List < RouteFilterPrefix > getAllowedPrefixesToDirectConnectGateway ( ) { } } | if ( allowedPrefixesToDirectConnectGateway == null ) { allowedPrefixesToDirectConnectGateway = new com . amazonaws . internal . SdkInternalList < RouteFilterPrefix > ( ) ; } return allowedPrefixesToDirectConnectGateway ; |
public class JcrResultSet { /** * { @ inheritDoc }
* This method , when cursor position is after the last row , will return < code > false < / code >
* @ see java . sql . ResultSet # next ( ) */
@ Override public boolean next ( ) throws SQLException { } } | notClosed ( ) ; if ( ! this . hasNext ( ) ) { this . row = null ; this . currentValue = null ; return false ; } this . row = rowIter . nextRow ( ) ; return true ; |
public class JavaSourceUtils { /** * 合并构造函数 */
public static ConstructorDeclaration mergeConstructor ( ConstructorDeclaration one , ConstructorDeclaration two ) { } } | if ( isAllNull ( one , two ) ) return null ; ConstructorDeclaration cd = null ; if ( isAllNotNull ( one , two ) ) { cd = new ConstructorDeclaration ( ) ; cd . setName ( one . getName ( ) ) ; cd . setComment ( mergeSelective ( one . getComment ( ) , two . getComment ( ) ) ) ; cd . setAnnotations ( mergeListNoDuplicate (... |
public class JClass { /** * Returns the class name . */
public String getSimpleName ( ) { } } | String name = getName ( ) ; int p = name . lastIndexOf ( '.' ) ; return name . substring ( p + 1 ) ; |
public class Table { /** * These key - value pairs define properties associated with the table .
* @ param parameters
* These key - value pairs define properties associated with the table .
* @ return Returns a reference to this object so that method calls can be chained together . */
public Table withParameters ... | setParameters ( parameters ) ; return this ; |
public class JmxValueConverterImpl { /** * Returns the value or the converted value if a conversion method is implemented .
* @ param value Value to convert .
* @ return the value or a converted value . */
@ Override public Object convert ( Object value ) { } } | if ( value instanceof Element ) { return parseXmlElement ( ( Element ) value ) ; } if ( value instanceof CompositeData ) { return toMap ( ( CompositeData ) value ) ; } return value ; |
public class ProcessContext { /** * Returns all attributes of the given activity . < br >
* If the given attribute has no attributes , the returned set contains
* no elements . The given activity has to be known by the context , i . e .
* be contained in the activity list .
* @ param activity Activity for which... | validateActivity ( activity ) ; if ( activityDataUsage . get ( activity ) == null ) { return new HashSet < > ( ) ; // No input data elements for this activity
} return Collections . unmodifiableSet ( activityDataUsage . get ( activity ) . keySet ( ) ) ; |
public class SingleColumnFilterFactory { /** * Creates the .
* @ param family
* the family
* @ param column
* the column
* @ param value
* the value
* @ return the filter */
public Filter create ( byte [ ] family , byte [ ] column , byte [ ] value ) { } } | return new SingleColumnValueFilter ( family , column , operator , comparatorFactory . apply ( value ) ) ; |
public class RunnersApi { /** * List jobs that are being processed or were processed by specified Runner .
* < pre > < code > GitLab Endpoint : GET / runners / : id / jobs < / code > < / pre >
* @ param runnerId The ID of a runner
* @ param itemsPerPage The number of Runner instances that will be fetched per page... | return ( getJobs ( runnerId , null , itemsPerPage ) ) ; |
public class StringUtils { /** * Returns true if given source string end with target string ignore case
* sensitive ; false otherwise .
* @ param source string to be tested .
* @ param target string to be tested .
* @ return true if given source string end with target string ignore case
* sensitive ; false ot... | if ( source . endsWith ( target ) ) { return true ; } if ( source . length ( ) < target . length ( ) ) { return false ; } return source . substring ( source . length ( ) - target . length ( ) ) . equalsIgnoreCase ( target ) ; |
public class MapUtils { /** * http : / / stackoverflow . com / a / 2581754/125617 */
public static < K , V extends Comparable < ? super V > > Map < K , V > sortByValue ( Map < K , V > map ) { } } | return sortByValue ( map , false ) ; |
public class Duration { /** * < p > Return the name of the XML Schema date / time type that this instance
* maps to . Type is computed based on fields that are set ,
* i . e . { @ link # isSet ( DatatypeConstants . Field field ) } = = < code > true < / code > . < / p >
* < table border = " 2 " rules = " all " cel... | boolean yearSet = isSet ( DatatypeConstants . YEARS ) ; boolean monthSet = isSet ( DatatypeConstants . MONTHS ) ; boolean daySet = isSet ( DatatypeConstants . DAYS ) ; boolean hourSet = isSet ( DatatypeConstants . HOURS ) ; boolean minuteSet = isSet ( DatatypeConstants . MINUTES ) ; boolean secondSet = isSet ( Datatype... |
public class CommerceOrderPersistenceImpl { /** * Returns the first commerce order in the ordered set where groupId = & # 63 ; and userId = & # 63 ; and orderStatus = & # 63 ; .
* @ param groupId the group ID
* @ param userId the user ID
* @ param orderStatus the order status
* @ param orderByComparator the com... | CommerceOrder commerceOrder = fetchByG_U_O_First ( groupId , userId , orderStatus , orderByComparator ) ; if ( commerceOrder != null ) { return commerceOrder ; } StringBundler msg = new StringBundler ( 8 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "groupId=" ) ; msg . append ( groupId ) ; msg . appen... |
public class VoltDbMessageFactory { /** * Overridden by subclasses to create message types unknown by voltcore
* @ param messageType
* @ return */
@ Override protected VoltMessage instantiate_local ( byte messageType ) { } } | // instantiate a new message instance according to the id
VoltMessage message = null ; switch ( messageType ) { case INITIATE_TASK_ID : message = new InitiateTaskMessage ( ) ; break ; case INITIATE_RESPONSE_ID : message = new InitiateResponseMessage ( ) ; break ; case FRAGMENT_TASK_ID : message = new FragmentTaskMessag... |
public class ApiUtil { public static Database change_db_obj ( final String host , final String port ) throws DevFailed { } } | return apiutilDAO . change_db_obj ( host , port ) ; |
public class RecurlyClient { /** * Get Subscription Addon Usages
* @ param subscriptionCode The recurly id of the { @ link Subscription }
* @ param addOnCode recurly id of { @ link AddOn }
* @ return { @ link Usages } for the specified subscription and addOn */
public Usages getSubscriptionUsages ( final String s... | return doGET ( Subscription . SUBSCRIPTION_RESOURCE + "/" + subscriptionCode + AddOn . ADDONS_RESOURCE + "/" + addOnCode + Usage . USAGE_RESOURCE , Usages . class , params ) ; |
public class DateUtils { /** * Warning : relies on default timezone ! */
public static String formatDateTime ( long ms ) { } } | return formatDateTime ( OffsetDateTime . ofInstant ( Instant . ofEpochMilli ( ms ) , ZoneId . systemDefault ( ) ) ) ; |
public class MachineInfo { /** * The main method .
* @ param args the arguments
* @ throws Exception the exception */
public static void main ( final String [ ] args ) throws Exception { } } | // System . out . println ( getSystemInfo ( ) . toString ( ) . replaceAll ( " , " ,
// JK . NEW _ LINE ) ) ;
System . out . println ( HardWare . MAC ) ; System . out . println ( getMacAddress ( ) ) ; |
public class WishlistItemUrl { /** * Get Resource Url for UpdateWishlistItemQuantity
* @ param quantity The number of cart items in the shopper ' s active cart .
* @ param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object . This paramete... | UrlFormatter formatter = new UrlFormatter ( "/api/commerce/wishlists/{wishlistId}/items/{wishlistItemId}/{quantity}?responseFields={responseFields}" ) ; formatter . formatUrl ( "quantity" , quantity ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "wishlistId" , wishlistId ) ; f... |
public class DiscriminationTreeIterators { /** * Iterator that traverses all leaves ( no inner nodes ) of a subtree of a given discrimination tree node .
* Additionally allows to specify a transformer that is applied to the leaf nodes
* @ param root
* the root node , from which traversal should start
* @ param ... | return Iterators . transform ( leafIterator ( root ) , transformer :: apply ) ; |
public class Command { /** * Extract a int array from a CORBA Any object .
* Remenber that the TANGO DevVarLong64Array type is mapped to the java int array
* type
* @ param in The CORBA Any object
* @ return The extracted int array
* @ exception DevFailed If the Any object does not contains a data of the
* ... | long [ ] data = null ; try { data = DevVarLong64ArrayHelper . extract ( in ) ; } catch ( BAD_OPERATION ex ) { throw_bad_type ( "DevVarLong64Array" ) ; } return data ; |
public class DatatypeConverter { /** * Read an int from an input stream .
* @ param is input stream
* @ return int value */
public static final int getInt ( InputStream is ) throws IOException { } } | byte [ ] data = new byte [ 4 ] ; is . read ( data ) ; return getInt ( data , 0 ) ; |
public class Binder { /** * Set attribute of this binder .
* Note use this method only on new resolver instance instead of shared instance
* @ param key the attribute key
* @ param value the attribute value
* @ return this binder instance */
public Binder < T > attribute ( String key , Object value ) { } } | if ( null == value ) { attributes . remove ( value ) ; } else { attributes . put ( key , value ) ; } return this ; |
public class MultipleCriteriaFilter { /** * filter current record per criteria passed in . Date filtering done prior to filter invocation
* any failure of a criteria results in a false return ( ie : don ' t accept record )
* @ param record RepositoryLogRecord to filter
* @ return true or false as to keeping this ... | if ( checkDate ) { if ( record . getMillis ( ) > endDate || startDate > record . getMillis ( ) ) return false ; } if ( levelFilter != null && ! levelFilter . accept ( record ) ) { return false ; } String message = ( record . getFormattedMessage ( ) != null ) ? record . getFormattedMessage ( ) : record . getRawMessage (... |
public class RiakIndexes { /** * Remove the named RiakIndex
* @ param name the { @ code RiakIndex . Name } representing the index to remove
* @ return the removed { @ code RiakIndex } ( typed accordingly ) if the index was present ,
* { @ code null } otherwise */
public < V , T extends RiakIndex < V > > T removeI... | RiakIndex < ? > removed = indexes . remove ( name . getFullname ( ) ) ; if ( removed != null ) { T index = name . wrap ( removed ) . createIndex ( ) ; return index ; } else { return null ; } |
public class WHERE { /** * < div color = ' red ' style = " font - size : 24px ; color : red " > < b > < i > < u > JCYPHER < / u > < / i > < / b > < / div >
* < div color = ' red ' style = " font - size : 18px ; color : red " > < i > matches a pattern expression against the graph . If the result is empty , returns fal... | Concatenator ret = P . existsPattern ( X ) ; ASTNode an = APIObjectAccess . getAstNode ( ret ) ; an . setClauseType ( ClauseType . WHERE ) ; return ret ; |
public class A_CmsEntryPoint { /** * Helper method for initializing the classes implementing { @ link I _ CmsHasInit } . < p >
* Calling this method more than once will have no effect . < p > */
private void initClasses ( ) { } } | if ( ! initializedClasses ) { I_CmsClassInitializer initializer = GWT . create ( I_CmsClassInitializer . class ) ; initializer . initClasses ( ) ; initializedClasses = true ; } |
public class Solo2 { /** * Waits for hint text to appear in an EditText
* @ param hintText text to wait for
* @ param timeout amount of time to wait */
public void waitForHintText ( String hintText , int timeout ) throws Exception { } } | int RETRY_PERIOD = 250 ; int retryNum = timeout / RETRY_PERIOD ; for ( int i = 0 ; i < retryNum ; i ++ ) { ArrayList < View > imageViews = getCustomViews ( "EditText" ) ; for ( View v : imageViews ) { if ( ( ( EditText ) v ) . getHint ( ) == null ) continue ; if ( ( ( EditText ) v ) . getHint ( ) . equals ( hintText ) ... |
public class MsgDestEncodingUtilsImpl { /** * initializePropertyMaps
* Initialize the Property Maps which must each contain an entry for every supported
* Destination Property which is to be encoded or set via this class . */
private static void initializePropertyMaps ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "initializePropertyMap" ) ; // Add all the supported properties to the PropertyMaps :
// PR , DM , and TL use the PhantomPropertyCoder as they are encoded / decoded
// separately rather than by using their PropertyCoder .
//... |
public class BufferedByteInputOutput { /** * Read a single byte .
* Blocks until data is available , or fail if buffer is closed . */
public int read ( ) throws IOException { } } | while ( true ) { lockR . lock ( ) ; try { if ( availableCount . get ( ) > 0 ) { // as long as there is available data
// serve it even if closed
int b = bytes [ readCursor ] & 0xFF ; incReadCursor ( 1 ) ; availableCount . decrementAndGet ( ) ; totalRead ++ ; return b ; } else if ( closed ) { // when no bytes are left a... |
public class CommerceWarehouseItemPersistenceImpl { /** * Removes the commerce warehouse item where commerceWarehouseId = & # 63 ; and CPInstanceUuid = & # 63 ; from the database .
* @ param commerceWarehouseId the commerce warehouse ID
* @ param CPInstanceUuid the cp instance uuid
* @ return the commerce warehou... | CommerceWarehouseItem commerceWarehouseItem = findByCWI_CPIU ( commerceWarehouseId , CPInstanceUuid ) ; return remove ( commerceWarehouseItem ) ; |
public class TwoDimensionalCounter { /** * Returns the counters with keys as the first key and count as the
* total count of the inner counter for that key
* @ return counter of type K1 */
public Counter < K1 > sumInnerCounter ( ) { } } | Counter < K1 > summed = new ClassicCounter < K1 > ( ) ; for ( K1 key : this . firstKeySet ( ) ) { summed . incrementCount ( key , this . getCounter ( key ) . totalCount ( ) ) ; } return summed ; |
public class NetworkWatchersInner { /** * Gets the current network topology by resource group .
* @ param resourceGroupName The name of the resource group .
* @ param networkWatcherName The name of the network watcher .
* @ param parameters Parameters that define the representation of topology .
* @ param servi... | return ServiceFuture . fromResponse ( getTopologyWithServiceResponseAsync ( resourceGroupName , networkWatcherName , parameters ) , serviceCallback ) ; |
public class JTB { /** * Gets the absolute path to the output directory for the visitor files .
* @ return The absolute path to the output directory for the visitor , only
* < code > null < / code > if neither { @ link # outputDirectory } nor
* { @ link # visitorDirectory } have been set . */
private File getEffe... | if ( this . visitorDirectory != null ) return this . visitorDirectory ; if ( this . outputDirectory != null ) return new File ( this . outputDirectory , getLastPackageName ( getEffectiveVisitorPackageName ( ) ) ) ; return null ; |
public class CommonCache { /** * { @ inheritDoc } */
@ Override public void cleanUpNullReferences ( ) { } } | List < K > keys = new LinkedList < > ( ) ; for ( Map . Entry < K , V > entry : map . entrySet ( ) ) { K key = entry . getKey ( ) ; V value = entry . getValue ( ) ; if ( null == value || ( value instanceof SoftReference && null == ( ( SoftReference ) value ) . get ( ) ) || ( value instanceof WeakReference && null == ( (... |
public class CurrencyHelper { /** * Try to parse a string value formatted by the { @ link NumberFormat } object
* returned from { @ link # getCurrencyFormat ( ECurrency ) } . E . g .
* < code > & euro ; 5,00 < / code >
* @ param eCurrency
* The currency it is about . If < code > null < / code > is provided
* ... | final PerCurrencySettings aPCS = getSettings ( eCurrency ) ; final DecimalFormat aCurrencyFormat = aPCS . getCurrencyFormat ( ) ; // Adopt the decimal separator
final String sRealTextValue ; // In Java 9 onwards , this the separators may be null ( e . g . for AED )
if ( aPCS . getDecimalSeparator ( ) != null && aPCS . ... |
public class ProjectStats { /** * Set the timestamp for this analysis run .
* @ param timestamp
* the time of the analysis run this ProjectStats represents , as
* previously reported by writeXML . */
public void setTimestamp ( String timestamp ) throws ParseException { } } | this . analysisTimestamp = new SimpleDateFormat ( TIMESTAMP_FORMAT , Locale . ENGLISH ) . parse ( timestamp ) ; |
public class MultiDraweeHolder { /** * Releases resources used to display the image .
* < p > The containing view must call this method from both { @ link View # onStartTemporaryDetach ( ) }
* and { @ link View # onDetachedFromWindow ( ) } . */
public void onDetach ( ) { } } | if ( ! mIsAttached ) { return ; } mIsAttached = false ; for ( int i = 0 ; i < mHolders . size ( ) ; ++ i ) { mHolders . get ( i ) . onDetach ( ) ; } |
public class FTPClient { /** * Sets remote server to passive server mode .
* @ return the address at which the server is listening . */
public HostPort setPassive ( ) throws IOException , ServerException { } } | Reply reply = null ; try { reply = controlChannel . execute ( ( controlChannel . isIPv6 ( ) ) ? Command . EPSV : Command . PASV ) ; } catch ( UnexpectedReplyCodeException urce ) { throw ServerException . embedUnexpectedReplyCodeException ( urce ) ; } catch ( FTPReplyParseException rpe ) { throw ServerException . embedF... |
public class Getter { /** * Return the property name for the specified getter { @ link Method method } .
* This method will not check if the method is an actual getter and will return the method name if not .
* @ param method The method .
* @ return The name , or the method name if method is not a typical getter ... | if ( ! is ( method ) ) { return method . getName ( ) ; } String name = method . getName ( ) ; if ( name . startsWith ( GET_PREFIX ) ) { return name . substring ( GET_PREFIX . length ( ) ) ; } else if ( name . startsWith ( IS_PREFIX ) ) { return name . substring ( IS_PREFIX . length ( ) ) ; } else if ( name . startsWith... |
public class StageStateMachine { /** * Add a listener for the final stage info . This notification is guaranteed to be fired only once .
* Listener is always notified asynchronously using a dedicated notification thread pool so , care should
* be taken to avoid leaking { @ code this } when adding a listener in a co... | AtomicBoolean done = new AtomicBoolean ( ) ; StateChangeListener < Optional < StageInfo > > fireOnceStateChangeListener = finalStageInfo -> { if ( finalStageInfo . isPresent ( ) && done . compareAndSet ( false , true ) ) { finalStatusListener . stateChanged ( finalStageInfo . get ( ) ) ; } } ; finalStageInfo . addState... |
public class Bean { /** * Programs the Bean with new firmware images .
* @ param bundle The firmware package holding A and B images to be sent to the Bean
* @ param listener OADListener to alert the client of OAD state */
public OADProfile . OADApproval programWithFirmware ( FirmwareBundle bundle , OADProfile . OAD... | return gattClient . getOADProfile ( ) . programWithFirmware ( bundle , listener ) ; |
public class MicroServiceTemplateSupport { /** * 获取非index的路径 */
private static String getRealDeptId ( String deptId ) { } } | int start = deptId . indexOf ( "[" ) ; String realKey = deptId ; if ( start > 0 ) { realKey = deptId . substring ( 0 , start ) ; } return realKey ; |
public class LegacyServersInitializerListener { /** * ( non - Javadoc )
* @ see javax . servlet . ServletContextListener # contextDestroyed ( javax . servlet .
* ServletContextEvent ) */
public final void contextDestroyed ( final ServletContextEvent sce ) { } } | // Stop the TciIpServer
if ( this . tcpIpServer != null ) { this . tcpIpServer . stop ( ) ; } // Stop the JmxServer
if ( this . jmxServer != null ) { this . jmxServer . stop ( ) ; } // Stop the SshServer
if ( this . sshServer != null ) { try { this . sshServer . stop ( ) ; } catch ( InterruptedException e ) { Launching... |
public class MtasCQLParserSentenceCondition { /** * Simplify .
* @ throws ParseException the parse exception */
public void simplify ( ) throws ParseException { } } | if ( ! simplified ) { if ( ! isBasic ( ) ) { for ( List < MtasCQLParserSentenceCondition > sequence : sequenceList ) { simplifySequence ( sequence ) ; } // flatten
if ( sequenceList . size ( ) > 1 ) { List < List < MtasCQLParserSentenceCondition > > newSequenceList = new ArrayList < List < MtasCQLParserSentenceConditio... |
public class Resty { /** * Register a login password for the realm returned by the authorization challenge .
* Use this method instead of authenticate in case the URL is not made available to the java . net . Authenticator class
* @ param realm the realm ( see rfc2617 , section 1.2)
* @ param aLogin
* @ param c... | rath . addRealm ( realm , aLogin , charArray ) ; |
public class ConnectionFactoryPooledImpl { /** * Closes all managed pools . */
public void releaseAllResources ( ) { } } | synchronized ( poolSynch ) { Collection pools = poolMap . values ( ) ; poolMap = new HashMap ( poolMap . size ( ) ) ; ObjectPool op = null ; for ( Iterator iterator = pools . iterator ( ) ; iterator . hasNext ( ) ; ) { try { op = ( ( ObjectPool ) iterator . next ( ) ) ; op . close ( ) ; } catch ( Exception e ) { log . ... |
public class AbstractDataBinder { /** * Removes a specific listener , which should not be notified about the events of the data
* binder , anymore .
* @ param listener
* The listener , which should be removed , as an instance of the type { @ link Listener } .
* The listener may not be null */
public final void ... | listeners . remove ( listener ) ; |
public class NeuralNetwork { /** * Propagates the errors back from a upper layer to the next lower layer .
* @ param upper the lower layer where errors are from .
* @ param lower the upper layer where errors are propagated back to . */
private void backpropagate ( Layer upper , Layer lower ) { } } | for ( int i = 0 ; i <= lower . units ; i ++ ) { double out = lower . output [ i ] ; double err = 0 ; for ( int j = 0 ; j < upper . units ; j ++ ) { err += upper . weight [ j ] [ i ] * upper . error [ j ] ; } lower . error [ i ] = out * ( 1.0 - out ) * err ; } |
public class UIInput { /** * < p > < span class = " changed _ modified _ 2_2 " > Convenience < / span > method to reset
* this component ' s value to the
* un - initialized state . This method does the following : < / p >
* < p class = " changed _ modified _ 2_2 " > Call { @ link UIOutput # setValue } . < / p >
... | super . resetValue ( ) ; this . setSubmittedValue ( null ) ; getStateHelper ( ) . remove ( PropertyKeys . localValueSet ) ; getStateHelper ( ) . remove ( PropertyKeys . valid ) ; |
public class AbstractPlane4F { /** * Rotate the plane with the given angle around the given axis .
* The rotation is done around the pivot point .
* @ param axis the rotation axis .
* @ param angle the rotation angle .
* @ param pivot the pivot point . */
public void rotate ( Vector3D axis , double angle , Poin... | Quaternion q = new Quaternion ( ) ; q . setAxisAngle ( axis , angle ) ; rotate ( q , pivot ) ; |
public class RequestedModuleNames { /** * Unfolds a folded module name list into a String array of unfolded names
* The returned list must be sorted the same way it was requested ordering
* modules in the same way as in the companion js extension to amd loader
* order provided in the folded module leaf
* @ para... | final String sourceMethod = "unfoldModules" ; // $ NON - NLS - 1 $
if ( isTraceLogging ) { log . entering ( RequestedModuleNames . class . getName ( ) , sourceMethod , new Object [ ] { modules , sparseArray } ) ; } Iterator < ? > it = modules . keys ( ) ; String [ ] prefixes = null ; if ( modules . containsKey ( PLUGIN... |
public class ProvFactory { /** * A factory method to create an instance of an end { @ link WasEndedBy }
* @ param id
* @ return an instance of { @ link WasEndedBy } */
public WasEndedBy newWasEndedBy ( QualifiedName id ) { } } | WasEndedBy res = of . createWasEndedBy ( ) ; res . setId ( id ) ; return res ; |
public class FileInfo { /** * < code > optional string ufsPath = 4 ; < / code > */
public com . google . protobuf . ByteString getUfsPathBytes ( ) { } } | java . lang . Object ref = ufsPath_ ; if ( ref instanceof java . lang . String ) { com . google . protobuf . ByteString b = com . google . protobuf . ByteString . copyFromUtf8 ( ( java . lang . String ) ref ) ; ufsPath_ = b ; return b ; } else { return ( com . google . protobuf . ByteString ) ref ; } |
public class AsteriskQueueImpl { /** * Gets an entry by its ( estimated ) position in the queue .
* @ param position the position , starting at 1.
* @ return the queue entry if exiting at this position , null otherwise . */
AsteriskQueueEntryImpl getEntry ( int position ) { } } | // positions in asterisk start at 1 , but list starts at 0
position -- ; AsteriskQueueEntryImpl foundEntry = null ; synchronized ( entries ) { try { foundEntry = entries . get ( position ) ; } catch ( IndexOutOfBoundsException e ) { // For consistency with the above method ,
// swallow . We might indeed request the 1st... |
public class QRDecompositionHouseholder_DDRB { /** * Multiplies the provided matrix by Q < sup > T < / sup > using householder reflectors . This is more
* efficient that computing Q then applying it to the matrix .
* Q = Q * ( I - & gamma ; W * Y ^ T ) < br >
* QR = A & ge ; R = Q ^ T * A = ( Q3 ^ T * ( Q2 ^ T * ... | int minDimen = Math . min ( dataA . numCols , dataA . numRows ) ; DSubmatrixD1 subB = new DSubmatrixD1 ( B ) ; W . col0 = W . row0 = 0 ; Y . row1 = W . row1 = dataA . numRows ; WTA . row0 = WTA . col0 = 0 ; // ( Q3 ^ T * ( Q2 ^ T * ( Q1 ^ t * A ) ) )
for ( int i = 0 ; i < minDimen ; i += blockLength ) { Y . col0 = i ; ... |
public class AdaptiveTableLayout { /** * Recycle view holder and remove view from layout .
* @ param holder view holder to recycle */
private void recycleViewHolder ( ViewHolder holder ) { } } | mRecycler . pushRecycledView ( holder ) ; removeView ( holder . getItemView ( ) ) ; mAdapter . onViewHolderRecycled ( holder ) ; |
public class SipPhone { /** * This method is the same as the basic nonblocking makeCall ( ) method except that it allows the
* caller to specify a message body and / or additional JAIN - SIP API message headers to add to or
* replace in the outbound INVITE message . Use of this method requires knowledge of the JAIN... | initErrorInfo ( ) ; SipCall call = this . createSipCall ( ) ; if ( call . initiateOutgoingCall ( null , to , viaNonProxyRoute , call , additionalHeaders , replaceHeaders , body ) == false ) { setReturnCode ( call . getReturnCode ( ) ) ; setErrorMessage ( call . getErrorMessage ( ) ) ; setException ( call . getException... |
public class DescribeSecretResult { /** * A list of all of the currently assigned < code > VersionStage < / code > staging labels and the < code > VersionId < / code >
* that each is attached to . Staging labels are used to keep track of the different versions during the rotation
* process .
* < note >
* A vers... | this . versionIdsToStages = versionIdsToStages ; |
public class SMILES { /** * method to generate canonical smiles for one single PolymerNotation
* @ param polymer
* PolymerNotation
* @ return smiles for the sinlge given PolymerNotation
* @ throws BuilderMoleculeException
* if the molecule can ' t be built
* @ throws HELM2HandledException
* if it contains... | AbstractMolecule molecule = BuilderMolecule . buildMoleculefromSinglePolymer ( polymer ) . getMolecule ( ) ; molecule = BuilderMolecule . mergeRgroups ( molecule ) ; return Chemistry . getInstance ( ) . getManipulator ( ) . canonicalize ( Chemistry . getInstance ( ) . getManipulator ( ) . convertMolecule ( molecule , A... |
public class syslog_snmp { /** * < pre >
* Use this operation to delete snmp syslog message details . .
* < / pre > */
public static syslog_snmp delete ( nitro_service client , syslog_snmp resource ) throws Exception { } } | resource . validate ( "delete" ) ; return ( ( syslog_snmp [ ] ) resource . delete_resource ( client ) ) [ 0 ] ; |
public class HBaseUtils { /** * Creates puts for HBase
* @ param record
* @ throws IOException */
@ Override public Put createPut ( Record record , String tableName , String famName , String quaName ) throws IOException { } } | HTable hTable = getTable ( tableName ) ; Put put = null ; if ( hTable != null ) { // Transforming data model record into an Avro record
AvroSerializer serializer = getSerializer ( ) ; final byte [ ] bytes = serializer . toBytes ( record ) ; // Resource ' s Key
put = new Put ( Bytes . toBytes ( record . getID ( ) . toSt... |
public class CollectionsHelper { /** * Creates a { @ link java . util . Set } with the given elements .
* @ param elements the elements .
* @ param < T > the element type .
* @ return a new { @ link java . util . Set } instance containing the given elements .
* @ throws NullPointerException if parameter element... | final Set < T > resultSet = new LinkedHashSet < T > ( ) ; addAll ( resultSet , elements ) ; return resultSet ; |
public class TableReader { /** * Read the optional row header and UUID .
* @ param stream input stream
* @ param map row map */
protected void readUUID ( StreamReader stream , Map < String , Object > map ) throws IOException { } } | int unknown0Size = stream . getMajorVersion ( ) > 5 ? 8 : 16 ; map . put ( "UNKNOWN0" , stream . readBytes ( unknown0Size ) ) ; map . put ( "UUID" , stream . readUUID ( ) ) ; |
public class PathMatchingResourcePatternResolver { /** * Find all class location resources with the given location via the ClassLoader .
* @ param location the absolute path within the classpath
* @ return the result as Resource array
* @ throws IOException in case of I / O errors
* @ see java . lang . ClassLoa... | String path = location ; if ( path . startsWith ( "/" ) ) { path = path . substring ( 1 ) ; } Enumeration < URL > resourceUrls = getClassLoader ( ) . getResources ( path ) ; Set < Resource > result = new LinkedHashSet < Resource > ( 16 ) ; while ( resourceUrls . hasMoreElements ( ) ) { URL url = resourceUrls . nextElem... |
public class CapabilityRegistry { /** * Registers a capability with the system . Any
* { @ link org . jboss . as . controller . capability . AbstractCapability # getRequirements ( ) requirements }
* associated with the capability will be recorded as requirements .
* @ param capability the capability . Cannot be {... | final CapabilityId capabilityId = new CapabilityId ( capability . getName ( ) , CapabilityScope . GLOBAL ) ; RegistrationPoint point = new RegistrationPoint ( registrationPoint , null ) ; CapabilityRegistration < ? > capabilityRegistration = new CapabilityRegistration < > ( capability , CapabilityScope . GLOBAL , point... |
public class CompatibleVersionsMap { /** * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setTargetVersions ( java . util . Collection ) } or { @ link # withTargetVersions ( java . util . Collection ) } if you want
* to override the existing values .
* @ par... | if ( this . targetVersions == null ) { setTargetVersions ( new java . util . ArrayList < String > ( targetVersions . length ) ) ; } for ( String ele : targetVersions ) { this . targetVersions . add ( ele ) ; } return this ; |
public class CssReader { /** * Returns the the next n characters in the stream without advancing the
* readers position .
* @ param n the number of characters to read
* @ return An array with guaranteed length n , with - 1 being the value for
* all elements at and after EOF .
* @ throws IOException */
int [ ]... | int [ ] buf = new int [ n ] ; Mark m = mark ( ) ; boolean seenEOF = false ; for ( int i = 0 ; i < buf . length ; i ++ ) { if ( ! seenEOF ) { buf [ i ] = next ( ) ; } else { buf [ i ] = - 1 ; } if ( buf [ i ] == - 1 ) { seenEOF = true ; } } if ( ! seenEOF ) { unread ( buf , m ) ; } else { List < Integer > ints = Lists .... |
public class InkView { /** * Clears the view */
public void clear ( ) { } } | // clean up existing bitmap
if ( bitmap != null ) { bitmap . recycle ( ) ; } // init bitmap cache
bitmap = Bitmap . createBitmap ( getWidth ( ) , getHeight ( ) , Bitmap . Config . ARGB_8888 ) ; canvas = new Canvas ( bitmap ) ; // notify listeners
for ( InkListener listener : listeners ) { listener . onInkClear ( ) ; } ... |
public class JKDateTimeUtil { /** * Addd days to current date .
* @ param numberOfDays the number of days
* @ return the date */
public static Date adddDaysToCurrentDate ( int numberOfDays ) { } } | Date date = new Date ( ) ; Calendar instance = Calendar . getInstance ( ) ; instance . setTime ( date ) ; instance . add ( Calendar . DATE , numberOfDays ) ; return instance . getTime ( ) ; |
public class AmazonAutoScalingClient { /** * Sets the health status of the specified instance .
* For more information , see < a href = " https : / / docs . aws . amazon . com / autoscaling / ec2 / userguide / healthcheck . html " > Health
* Checks for Auto Scaling Instances < / a > in the < i > Amazon EC2 Auto Sca... | request = beforeClientExecution ( request ) ; return executeSetInstanceHealth ( request ) ; |
public class CassandraDataHandlerBase { /** * Helper method to convert @ Entity to ThriftRow .
* @ param e
* the e
* @ param id
* the id
* @ param m
* the m
* @ param columnFamily
* the colmun family
* @ param columnTTLs
* TODO
* @ return the base data accessor . thrift row
* @ throws Exception ... | // timestamp to use in thrift column objects
long timestamp = generator . getTimestamp ( ) ; // Add super columns to thrift row
return onColumnOrSuperColumnThriftRow ( /* tr , */
m , e , id , timestamp , columnTTLs ) ; |
public class ModificationDate { /** * Finds the most recent modification date of all specified pages
* @ param pages multiple cq pages
* @ return the most recent date ( or null if none of the pages has a modification date ) */
public static @ Nullable Date mostRecent ( @ Nullable Page @ NotNull . . . pages ) { } } | Date [ ] dates = new Date [ pages . length ] ; for ( int i = 0 ; i < pages . length ; i ++ ) { dates [ i ] = get ( pages [ i ] ) ; } return mostRecent ( dates ) ; |
public class UserTypes { /** * Get all data types
* @ return All data types in a HashSet */
public HashSet < UserTypeVal > allDataTypes ( ) { } } | if ( allDataTypes == null ) { // Would be cleaner if we could call scala ' s apply method here , but it isn ' t part of a HashSet companion
// object - - instead it lives in GenericCompanion , and it ' s unclear now to get to it from Java .
allDataTypes = new HashSet < > ( ) ; allDataTypes = allDataTypes . $plus ( User... |
public class FilterBilinear { /** * Filter */
@ Override public ImageBuffer filter ( ImageBuffer source ) { } } | final int width = source . getWidth ( ) ; final int height = source . getHeight ( ) ; final int [ ] inPixels = new int [ width * height ] ; final int [ ] outPixels = new int [ width * height ] ; source . getRgb ( 0 , 0 , width , height , inPixels , 0 , width ) ; compute ( inPixels , outPixels , width , height , 1 ) ; c... |
public class MatrixVectorMult_DDRM { /** * An alternative implementation of { @ link # multAddTransA _ small } that performs well on large
* matrices . There is a relative performance hit when used on small matrices .
* @ param A A matrix that is m by n . Not modified .
* @ param B A vector that has length m . No... | if ( C . numCols != 1 ) { throw new MatrixDimensionException ( "C is not a column vector" ) ; } else if ( C . numRows != A . numCols ) { throw new MatrixDimensionException ( "C is not the expected length" ) ; } if ( B . numRows == 1 ) { if ( A . numRows != B . numCols ) { throw new MatrixDimensionException ( "A and B a... |
public class UploadMetadata { /** * Sets the storeSalesUploadCommonMetadata value for this UploadMetadata .
* @ param storeSalesUploadCommonMetadata */
public void setStoreSalesUploadCommonMetadata ( com . google . api . ads . adwords . axis . v201809 . rm . StoreSalesUploadCommonMetadata storeSalesUploadCommonMetada... | this . storeSalesUploadCommonMetadata = storeSalesUploadCommonMetadata ; |
public class CreateIpGroupRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateIpGroupRequest createIpGroupRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( createIpGroupRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createIpGroupRequest . getGroupName ( ) , GROUPNAME_BINDING ) ; protocolMarshaller . marshall ( createIpGroupRequest . getGroupDesc ( ) , GROUPDESC_BINDING ) ; prot... |
public class DescribeExpressionsResult { /** * The expressions configured for the domain .
* @ return The expressions configured for the domain . */
public java . util . List < ExpressionStatus > getExpressions ( ) { } } | if ( expressions == null ) { expressions = new com . amazonaws . internal . SdkInternalList < ExpressionStatus > ( ) ; } return expressions ; |
public class Digester { /** * 生成摘要
* @ param data { @ link InputStream } 数据流
* @ param bufferLength 缓存长度 , 不足1使用 { @ link IoUtil # DEFAULT _ BUFFER _ SIZE } 做为默认值
* @ return 摘要bytes
* @ throws IORuntimeException IO异常 */
public byte [ ] digest ( InputStream data , int bufferLength ) throws IORuntimeException { }... | if ( bufferLength < 1 ) { bufferLength = IoUtil . DEFAULT_BUFFER_SIZE ; } byte [ ] result ; try { if ( ArrayUtil . isEmpty ( this . salt ) ) { result = digestWithoutSalt ( data , bufferLength ) ; } else { result = digestWithSalt ( data , bufferLength ) ; } } catch ( IOException e ) { throw new IORuntimeException ( e ) ... |
public class NioServerDatagramChannelFactory { /** * mina . netty change - adding this to create child datagram channels */
public NioChildDatagramChannel newChildChannel ( Channel parent , final ChannelPipeline pipeline ) { } } | return new NioChildDatagramChannel ( parent , this , pipeline , childSink , workerPool . nextWorker ( ) , family ) ; |
public class LinuxTaskController { /** * this task . */
private String getDirectoryChosenForTask ( File directory , TaskControllerContext context ) { } } | String jobId = getJobId ( context ) ; String taskId = context . task . getTaskID ( ) . toString ( ) ; for ( String dir : mapredLocalDirs ) { File mapredDir = new File ( dir ) ; File taskDir = new File ( mapredDir , TaskTracker . getLocalTaskDir ( jobId , taskId , context . task . isTaskCleanupTask ( ) ) ) ; if ( direct... |
public class DescribeEventSubscriptionsResult { /** * A list of event subscriptions .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setEventSubscriptionsList ( java . util . Collection ) } or
* { @ link # withEventSubscriptionsList ( java . util . Collect... | if ( this . eventSubscriptionsList == null ) { setEventSubscriptionsList ( new java . util . ArrayList < EventSubscription > ( eventSubscriptionsList . length ) ) ; } for ( EventSubscription ele : eventSubscriptionsList ) { this . eventSubscriptionsList . add ( ele ) ; } return this ; |
public class Cluster { /** * The nodes in the cluster .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setClusterNodes ( java . util . Collection ) } or { @ link # withClusterNodes ( java . util . Collection ) } if you want to
* override the existing value... | if ( this . clusterNodes == null ) { setClusterNodes ( new com . amazonaws . internal . SdkInternalList < ClusterNode > ( clusterNodes . length ) ) ; } for ( ClusterNode ele : clusterNodes ) { this . clusterNodes . add ( ele ) ; } return this ; |
public class GetObjectAttributesRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetObjectAttributesRequest getObjectAttributesRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getObjectAttributesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getObjectAttributesRequest . getDirectoryArn ( ) , DIRECTORYARN_BINDING ) ; protocolMarshaller . marshall ( getObjectAttributesRequest . getObjectReference ( ... |
public class LookupManagerImpl { /** * { @ inheritDoc } */
@ Override public List < ServiceInstance > getAllInstances ( ) throws ServiceException { } } | ServiceInstanceUtils . validateManagerIsStarted ( isStarted ) ; List < ServiceInstance > instances = new ArrayList < ServiceInstance > ( ) ; List < ModelServiceInstance > allInstances = getLookupService ( ) . getAllInstances ( ) ; for ( ModelServiceInstance serviceInstance : allInstances ) { instances . add ( ServiceIn... |
public class RouteResult { /** * Extracts the param in { @ code pathParams } first , then falls back to the first matching
* param in { @ code queryParams } .
* @ return { @ code null } if there ' s no match */
public String param ( String name ) { } } | String pathValue = pathParams . get ( name ) ; return ( pathValue == null ) ? queryParam ( name ) : pathValue ; |
public class DescribeFindingsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeFindingsRequest describeFindingsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeFindingsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeFindingsRequest . getFindingArns ( ) , FINDINGARNS_BINDING ) ; protocolMarshaller . marshall ( describeFindingsRequest . getLocale ( ) , LOCALE_BINDING )... |
public class BaseClient { /** * 设置访问网络需要的socket代理
* @ param host 代理服务器地址
* @ param port 代理服务器端口 */
public void setSocketProxy ( String host , int port ) { } } | if ( config == null ) { config = new AipClientConfiguration ( ) ; } this . config . setProxy ( host , port , Proxy . Type . SOCKS ) ; |
public class ContainerDefImpl { /** * / * ( non - Javadoc )
* @ see org . jboss . arquillian . impl . configuration . api . ContainerDescription # property ( java . lang . String , java . lang . String ) */
@ Override public ContainerDef property ( String name , String value ) { } } | container . getOrCreate ( "configuration" ) . getOrCreate ( "property@name=" + name ) . text ( value ) ; return this ; |
public class ServiceModel { /** * Returns true if the context can still be configured . This is possible
* before any web components ( servlets / filters / listeners / error pages )
* are registered . TODO verify what happen once the web elements are
* registered and then unregistered . Can still be configured ? ... | return canBeConfigured ( httpContext , servletModels ) && canBeConfigured ( httpContext , filterModels . values ( ) ) && canBeConfigured ( httpContext , eventListenerModels . values ( ) ) && canBeConfigured ( httpContext , errorPageModels . values ( ) ) && canBeConfigured ( httpContext , loginConfigModels . values ( ) ... |
public class NoCacheDatabase { /** * Export a server into the tango db ( execute DbUnExportServer on DB device )
* @ param serverName
* The server name
* @ throws DevFailed */
@ Override public void unexportServer ( final String serverName ) throws DevFailed { } } | final DeviceData argin = new DeviceData ( ) ; argin . insert ( serverName ) ; database . command_inout ( "DbUnExportServer" , argin ) ; |
public class GVRCameraRig { /** * Map a four - component { @ code float } vector to { @ code key } .
* @ param key
* Key to map the vector to .
* @ param x
* ' X ' component of vector .
* @ param y
* ' Y ' component of vector .
* @ param z
* ' Z ' component of vector .
* @ param w
* ' W ' component ... | checkStringNotNullOrEmpty ( "key" , key ) ; NativeCameraRig . setVec4 ( getNative ( ) , key , x , y , z , w ) ; |
public class DependencyBundlingAnalyzer { /** * Counts the number of times the character is present in the string .
* @ param string the string to count the characters in
* @ param c the character to count
* @ return the number of times the character is present in the string */
private int countChar ( String stri... | int count = 0 ; final int max = string . length ( ) ; for ( int i = 0 ; i < max ; i ++ ) { if ( c == string . charAt ( i ) ) { count ++ ; } } return count ; |
public class IOSCollator { /** * Sets strength field , but is otherwise unused . */
@ Override public void setStrength ( int value ) { } } | if ( value < Collator . PRIMARY || value > Collator . IDENTICAL ) { throw new IllegalArgumentException ( ) ; } strength = value ; |
public class JarEntry { /** * Validates the jar . */
public void validate ( ) throws ConfigException { } } | loadManifest ( ) ; if ( _manifest != null ) validateManifest ( _jarPath . getContainer ( ) . getURL ( ) , _manifest ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.