signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Distribution { /** * Creates a Good - Turing smoothed Distribution from the given counter .
* @ return a new Good - Turing smoothed Distribution . */
public static < E > Distribution < E > goodTuringSmoothedCounter ( Counter < E > counter , int numberOfKeys ) { } } | // gather count - counts
int [ ] countCounts = getCountCounts ( counter ) ; // if count - counts are unreliable , we shouldn ' t be using G - T
// revert to laplace
for ( int i = 1 ; i <= 10 ; i ++ ) { if ( countCounts [ i ] < 3 ) { return laplaceSmoothedDistribution ( counter , numberOfKeys , 0.5 ) ; } } double observ... |
public class SchemaVersionOne { /** * / * ( non - Javadoc )
* @ see net . agkn . hll . serialization . ISchemaVersion # writeMetadata ( byte [ ] , IHLLMetadata ) */
@ Override public void writeMetadata ( final byte [ ] bytes , final IHLLMetadata metadata ) { } } | final HLLType type = metadata . HLLType ( ) ; final int typeOrdinal = getOrdinal ( type ) ; final int explicitCutoffValue ; if ( metadata . explicitOff ( ) ) { explicitCutoffValue = EXPLICIT_OFF ; } else if ( metadata . explicitAuto ( ) ) { explicitCutoffValue = EXPLICIT_AUTO ; } else { explicitCutoffValue = metadata .... |
public class MessageBirdClient { /** * Function to view recording by call id , leg id and recording id
* @ param callID Voice call ID
* @ param legId Leg ID
* @ param recordingId Recording ID
* @ return Recording
* @ throws NotFoundException not found with callId and legId
* @ throws UnauthorizedException i... | if ( callID == null ) { throw new IllegalArgumentException ( "Voice call ID must be specified." ) ; } if ( legId == null ) { throw new IllegalArgumentException ( "Leg ID must be specified." ) ; } if ( recordingId == null ) { throw new IllegalArgumentException ( "Recording ID must be specified." ) ; } String url = Strin... |
public class MongoDBQueryDescriptorBuilder { /** * parse JSON
* @ param json
* @ return
* @ see < a href = " http : / / stackoverflow . com / questions / 34436952 / json - parse - equivalent - in - mongo - driver - 3 - x - for - java " > JSON . parse equivalent < / a > */
private static Object parseAsObject ( Str... | if ( StringHelper . isNullOrEmptyString ( json ) ) { return null ; } Document object = Document . parse ( "{ 'json': " + json + "}" ) ; return object . get ( "json" ) ; |
public class DescribeChapCredentialsResult { /** * An array of < a > ChapInfo < / a > objects that represent CHAP credentials . Each object in the array contains CHAP
* credential information for one target - initiator pair . If no CHAP credentials are set , an empty array is returned .
* CHAP credential informatio... | if ( this . chapCredentials == null ) { setChapCredentials ( new com . amazonaws . internal . SdkInternalList < ChapInfo > ( chapCredentials . length ) ) ; } for ( ChapInfo ele : chapCredentials ) { this . chapCredentials . add ( ele ) ; } return this ; |
public class KeyUtil { /** * 生成私钥 , 仅用于非对称加密 < br >
* 算法见 : https : / / docs . oracle . com / javase / 7 / docs / technotes / guides / security / StandardNames . html # KeyFactory
* @ param algorithm 算法
* @ param keySpec { @ link KeySpec }
* @ return 私钥 { @ link PrivateKey }
* @ since 3.1.1 */
public static P... | if ( null == keySpec ) { return null ; } algorithm = getAlgorithmAfterWith ( algorithm ) ; try { return getKeyFactory ( algorithm ) . generatePrivate ( keySpec ) ; } catch ( Exception e ) { throw new CryptoException ( e ) ; } |
public class PropertyCollectorUtil { /** * Method to convert an object to its type
* For example when ArrayOfManagedObject is passed in
* return a ManagedObject [ ]
* @ param dynaPropVal
* @ return */
public static Object convertProperty ( Object dynaPropVal ) { } } | Object propertyValue = null ; if ( dynaPropVal == null ) { throw new IllegalArgumentException ( "Unable to convertProperty on null object." ) ; } Class < ? > propClass = dynaPropVal . getClass ( ) ; String propName = propClass . getName ( ) ; // Check the dynamic propery for ArrayOfXXX object
if ( propName . contains (... |
public class ColumnFamilyRecordReader { /** * not necessarily on Cassandra machines , too . This should be adequate for single - DC clusters , at least . */
private String getLocation ( ) { } } | Collection < InetAddress > localAddresses = FBUtilities . getAllLocalAddresses ( ) ; for ( InetAddress address : localAddresses ) { for ( String location : split . getLocations ( ) ) { InetAddress locationAddress = null ; try { locationAddress = InetAddress . getByName ( location ) ; } catch ( UnknownHostException e ) ... |
public class appfwwsdl { /** * Use this API to fetch all the appfwwsdl resources that are configured on netscaler . */
public static appfwwsdl get ( nitro_service service ) throws Exception { } } | appfwwsdl obj = new appfwwsdl ( ) ; appfwwsdl [ ] response = ( appfwwsdl [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ; |
public class ConfigUniqueNameGenerator { /** * 解析唯一标识UniqueName得到接口名
* @ param uniqueName 服务唯一标识
* @ return 接口名 */
public static String getInterfaceName ( String uniqueName ) { } } | if ( StringUtils . isEmpty ( uniqueName ) ) { return uniqueName ; } int index = uniqueName . indexOf ( ':' ) ; return index < 0 ? uniqueName : uniqueName . substring ( 0 , index ) ; |
public class TCBeginMessageImpl { /** * ( non - Javadoc )
* @ see org . restcomm . protocols . ss7 . tcap . asn . Encodable # decode ( org . mobicents . protocols . asn . AsnInputStream ) */
public void decode ( AsnInputStream ais ) throws ParseException { } } | try { AsnInputStream localAis = ais . readSequenceStream ( ) ; int tag = localAis . readTag ( ) ; if ( tag != _TAG_OTX || localAis . getTagClass ( ) != Tag . CLASS_APPLICATION ) throw new ParseException ( PAbortCauseType . IncorrectTxPortion , null , "Error decoding TC-Begin: Expected OriginatingTransactionId, found ta... |
public class PartitionContainer { Indexes getIndexes ( String name ) { } } | Indexes ixs = indexes . get ( name ) ; if ( ixs == null ) { MapServiceContext mapServiceContext = mapService . getMapServiceContext ( ) ; MapContainer mapContainer = mapServiceContext . getMapContainer ( name ) ; if ( mapContainer . isGlobalIndexEnabled ( ) ) { throw new IllegalStateException ( "Can't use a partitioned... |
public class WaitStrategies { /** * Returns a strategy that sleeps a random amount of time before retrying .
* @ param maximumTime the maximum time to sleep
* @ param timeUnit the unit of the maximum time
* @ return a wait strategy with a random wait time
* @ throws IllegalStateException if the maximum sleep ti... | Preconditions . checkNotNull ( timeUnit , "The time unit may not be null" ) ; return new RandomWaitStrategy ( 0L , timeUnit . toMillis ( maximumTime ) ) ; |
public class AmazonTranscribeClient { /** * Deletes a previously submitted transcription job along with any other generated results such as the
* transcription , models , and so on .
* @ param deleteTranscriptionJobRequest
* @ return Result of the DeleteTranscriptionJob operation returned by the service .
* @ t... | request = beforeClientExecution ( request ) ; return executeDeleteTranscriptionJob ( request ) ; |
public class CLIConnectionFactory { /** * Convenience method to call { @ link # authorization } with the HTTP basic authentication .
* Cf . { @ code BasicHeaderApiTokenAuthenticator } . */
public CLIConnectionFactory basicAuth ( String userInfo ) { } } | return authorization ( "Basic " + new String ( Base64 . encodeBase64 ( ( userInfo ) . getBytes ( ) ) ) ) ; |
public class TEEJBInvocationInfo { /** * This is called by the EJB container server code to write a
* EJB method call postinvoke exceptions record to the trace log , if enabled . */
public static void tracePostInvokeException ( EJSDeployedSupport s , EJSWrapperBase wrapper , Throwable t ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { StringBuffer sbuf = new StringBuffer ( ) ; sbuf . append ( MthdPostInvokeException_Type_Str ) . append ( DataDelimiter ) . append ( MthdPostInvokeException_Type ) . append ( DataDelimiter ) ; writeDeployedSupportInfo ( s , sbuf , wrapper , t )... |
public class IOUtils { /** * See { @ link hudson . FilePath # isAbsolute ( String ) } .
* @ param path String representing < code > Platform Specific < / code > ( unlike FilePath , which may get Platform agnostic paths ) , may not be null
* @ return true if String represents absolute path on this platform , false o... | Pattern DRIVE_PATTERN = Pattern . compile ( "[A-Za-z]:[\\\\/].*" ) ; return path . startsWith ( "/" ) || DRIVE_PATTERN . matcher ( path ) . matches ( ) ; |
public class JusFragment { /** * TODO : Rename and change types and number of parameters */
public static JusFragment newInstance ( ) { } } | JusFragment fragment = new JusFragment ( ) ; Bundle args = new Bundle ( ) ; fragment . setArguments ( args ) ; return fragment ; |
public class RankableObjectWithFields { /** * Note : We do not defensively copy the wrapped object and any accompanying
* fields . We do guarantee , however , do return a defensive ( shallow ) copy of
* the List object that is wrapping any accompanying fields .
* @ return */
@ Override public Rankable copy ( ) { ... | List < Object > shallowCopyOfFields = ImmutableList . copyOf ( getFields ( ) ) ; return new RankableObjectWithFields ( getObject ( ) , getCount ( ) , shallowCopyOfFields ) ; |
public class FeatureDescription { /** * Returns the feature name */
public String getName ( ) { } } | FeatureDescriptor fd = getFeatureDescriptor ( ) ; if ( fd == null ) { return null ; } return fd . getName ( ) ; |
public class policyexpression { /** * Use this API to add policyexpression . */
public static base_response add ( nitro_service client , policyexpression resource ) throws Exception { } } | policyexpression addresource = new policyexpression ( ) ; addresource . name = resource . name ; addresource . value = resource . value ; addresource . description = resource . description ; addresource . comment = resource . comment ; addresource . clientsecuritymessage = resource . clientsecuritymessage ; return addr... |
public class FluentValidator { /** * 在待验证对象数组 < tt > t < / tt > 上 , 使用 < tt > v < / tt > 验证器进行验证
* 注 : 当数组为空时 , 则会跳过
* @ param t 待验证对象数组
* @ param v 验证器
* @ return FluentValidator */
public < T > FluentValidator onEach ( T [ ] t , final Validator < T > v ) { } } | Preconditions . checkNotNull ( v , "Validator should not be NULL" ) ; if ( ArrayUtil . isEmpty ( t ) ) { lastAddCount = 0 ; return this ; } return onEach ( Arrays . asList ( t ) , v ) ; |
public class MessageProcessInfo { /** * SetupMessageHeaderFromCode Method . */
public boolean setupMessageHeaderFromCode ( Message trxMessage , String strMessageCode , String strVersion ) { } } | TrxMessageHeader trxMessageHeader = ( TrxMessageHeader ) ( ( BaseMessage ) trxMessage ) . getMessageHeader ( ) ; if ( ( trxMessageHeader == null ) && ( strMessageCode == null ) ) return false ; if ( trxMessageHeader == null ) { trxMessageHeader = new TrxMessageHeader ( null , null ) ; ( ( BaseMessage ) trxMessage ) . s... |
public class Application { /** * Cause an the argument < code > resolver < / code > to be added to the resolver chain as specified in section 5.5.1 of
* the JavaServer Faces Specification .
* It is not possible to remove an < code > ELResolver < / code > registered with this method , once it has been registered .
... | // The following concrete methods were added for JSF 1.2 . They supply default
// implementations that throw UnsupportedOperationException .
// This allows old Application implementations to still work .
Application application = getMyfacesApplicationInstance ( ) ; if ( application != null ) { application . addELResolv... |
public class CopyDataHandler { /** * Do the physical move operation .
* @ param bDisplayOption If true , display the change .
* @ param iMoveMode The type of move being done ( init / read / screen ) .
* @ return The error code ( or NORMAL _ RETURN if okay ) . */
public int moveSourceToDest ( boolean bDisplayOptio... | if ( m_objValue instanceof String ) return m_fldDest . setString ( ( String ) m_objValue , bDisplayOption , iMoveMode ) ; else return m_fldDest . setData ( m_objValue , bDisplayOption , iMoveMode ) ; |
public class XmlMapper { /** * Java Collection - > Xml without encoding , 特别支持Root Element是Collection的情形 . */
public static String toXml ( Collection < ? > root , String rootName , Class clazz ) { } } | return toXml ( root , rootName , clazz , null ) ; |
public class GetConfigResponse { /** * Returns the map of line number to line value for a given category .
* @ param categoryNumber a valid category number from getCategories .
* @ return the map of category numbers to names .
* @ see org . asteriskjava . manager . response . GetConfigResponse # getCategories */
... | if ( lines == null ) { lines = new TreeMap < > ( ) ; } Map < String , Object > responseMap = super . getAttributes ( ) ; for ( Entry < String , Object > response : responseMap . entrySet ( ) ) { String key = response . getKey ( ) ; if ( key . toLowerCase ( Locale . US ) . contains ( "line" ) ) { String [ ] keyParts = k... |
public class VpnTunnelClient { /** * Returns the specified VpnTunnel resource . Gets a list of available VPN tunnels by making a
* list ( ) request .
* < p > Sample code :
* < pre > < code >
* try ( VpnTunnelClient vpnTunnelClient = VpnTunnelClient . create ( ) ) {
* ProjectRegionVpnTunnelName vpnTunnel = Pro... | GetVpnTunnelHttpRequest request = GetVpnTunnelHttpRequest . newBuilder ( ) . setVpnTunnel ( vpnTunnel == null ? null : vpnTunnel . toString ( ) ) . build ( ) ; return getVpnTunnel ( request ) ; |
public class ClientDObjectMgr { /** * Called when the client is cleaned up due to having disconnected from the server . */
public void cleanup ( ) { } } | // tell any pending object subscribers that they ' re not getting their bits
for ( PendingRequest < ? > req : _penders . values ( ) ) { for ( Subscriber < ? > sub : req . targets ) { sub . requestFailed ( req . oid , new ObjectAccessException ( "Client connection closed" ) ) ; } } _penders . clear ( ) ; _flusher . canc... |
public class Orbitals { /** * Set a coefficient matrix */
public void setCoefficients ( Matrix C ) { } } | if ( count_basis == C . rows ) { this . C = C ; count_orbitals = C . columns ; } |
public class FunctionSQL { /** * End of VoltDB extension */
public static FunctionSQL newSQLFunction ( String token , CompileContext context ) { } } | int id = regularFuncMap . get ( token , - 1 ) ; if ( id == - 1 ) { id = valueFuncMap . get ( token , - 1 ) ; } if ( id == - 1 ) { return null ; } FunctionSQL function = new FunctionSQL ( id ) ; if ( id == FUNC_VALUE ) { if ( context . currentDomain == null ) { return null ; } function . dataType = context . currentDoma... |
public class ActionableHelper { /** * Deletes a FilePath file on exit .
* @ param filePath The FilePath to delete on exit .
* @ throws IOException In case of a missing file . */
public static void deleteFilePathOnExit ( FilePath filePath ) throws IOException , InterruptedException { } } | filePath . act ( new MasterToSlaveFileCallable < Void > ( ) { public Void invoke ( File file , VirtualChannel virtualChannel ) throws IOException , InterruptedException { file . deleteOnExit ( ) ; return null ; } } ) ; |
public class UriUtils { /** * Returns a string that has been encoded for use in a URL .
* @ param s The string to encode .
* @ return The given string encoded for use in a URL . */
public static String urlNonFormEncode ( final String s ) { } } | if ( StringUtils . isBlank ( s ) ) { LOG . warn ( "Could not encode blank string" ) ; throw new IllegalArgumentException ( "Blank string" ) ; } try { // We use the HttpClient encoder because the java URLEncoder
// class uses form encoding .
return URIUtil . encodeQuery ( s , "UTF-8" ) ; } catch ( final URIException e )... |
public class ParseErrors { /** * A helper method for formatting javacc ParseExceptions .
* @ param errorToken The piece of text that we were unable to parse .
* @ param expectedTokens The set of formatted tokens that we were expecting next . */
private static String formatParseExceptionDetails ( String errorToken ,... | // quotes / normalize the expected tokens before rendering , just in case after normalization some
// can be deduplicated .
ImmutableSet . Builder < String > normalizedTokensBuilder = ImmutableSet . builder ( ) ; for ( String t : expectedTokens ) { normalizedTokensBuilder . add ( maybeQuoteForParseError ( t ) ) ; } exp... |
public class DockerAgentUtils { /** * Execute push docker image on agent
* @ param launcher
* @ param log
* @ param imageTag
* @ param username
* @ param password
* @ param host @ return
* @ throws IOException
* @ throws InterruptedException */
public static boolean pushImage ( Launcher launcher , final... | return launcher . getChannel ( ) . call ( new MasterToSlaveCallable < Boolean , IOException > ( ) { public Boolean call ( ) throws IOException { String message = "Pushing image: " + imageTag ; if ( StringUtils . isNotEmpty ( host ) ) { message += " using docker daemon host: " + host ; } log . info ( message ) ; DockerU... |
public class DBTransaction { /** * Add an update that will delete the row with the given row key from the given store .
* @ param storeName Name of store from which to delete an object row .
* @ param rowKey Row key in string form . */
public void deleteRow ( String storeName , String rowKey ) { } } | m_rowDeletes . add ( new RowDelete ( storeName , rowKey ) ) ; |
public class XATransactionWrapper { /** * Inform the resource manager to roll back work done on behalf of a transaction branch
* @ param xid - A global transaction identifier
* @ throws XAException - An error has occurred */
@ Override public void rollback ( Xid xid ) throws XAException { } } | final boolean isTracingEnabled = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTracingEnabled && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "rollback" ) ; if ( getMcWrapper ( ) . isMCAborted ( ) ) { Tr . exit ( tc , "Connection was aborted. Exiting rollback." ) ; return ; } this . hasRollbackOccured = true ... |
public class EEValidationUtils { /** * Does additional validation on the WebServiceRef annotation . Note that some validation has already been done at this point by WebServiceRefProcessor .
* If we are injecting into a Service type , we check that the value ( ) attribute is compatible with the type .
* If we are in... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "validateWebServiceRef" , new Object [ ] { wsRef , declaringClass , Util . identity ( annotated ) } ) ; } Class < ? > ipClass = getInjectedClass ( annotated ) ; /* * note : Thorough WebService validation is performed later , ... |
public class GetWorkerReportPOptions { /** * < code > repeated . alluxio . grpc . block . WorkerInfoField fieldRanges = 2 ; < / code > */
public alluxio . grpc . WorkerInfoField getFieldRanges ( int index ) { } } | return fieldRanges_converter_ . convert ( fieldRanges_ . get ( index ) ) ; |
public class GetResourcesRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetResourcesRequest getResourcesRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getResourcesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getResourcesRequest . getRestApiId ( ) , RESTAPIID_BINDING ) ; protocolMarshaller . marshall ( getResourcesRequest . getPosition ( ) , POSITION_BINDING ) ; protocolM... |
public class DnDManager { /** * Find the rectangular area that is visible in screen coordinates
* for the given component . */
protected Rectangle getRectOnScreen ( JComponent comp ) { } } | Rectangle r = comp . getVisibleRect ( ) ; Point p = comp . getLocationOnScreen ( ) ; r . translate ( p . x , p . y ) ; return r ; |
public class QNMinimizer { /** * computes d = a + b * c */
private static double [ ] plusAndConstMult ( double [ ] a , double [ ] b , double c , double [ ] d ) { } } | for ( int i = 0 ; i < a . length ; i ++ ) { d [ i ] = a [ i ] + c * b [ i ] ; } return d ; |
public class Authorizations { /** * Checks if this Account implies the given permission strings and returns a boolean array indicating which
* permissions are implied .
* This is an overloaded method for the corresponding type - safe { @ link Permission Permission } variant .
* Please see the class - level JavaDo... | boolean [ ] rights = new boolean [ permissions . length ] ; for ( int i = 0 ; i < permissions . length ; i ++ ) { Permission permission = new Permission ( permissions [ i ] ) ; rights [ i ] = isPermitted ( permission ) ; } return rights ; |
public class Profiler { /** * Starts a profiling section .
* @ param section The name of the section */
public synchronized void startSection ( String section ) { } } | section = section . toLowerCase ( ) ; if ( this . startTime . containsKey ( section ) ) throw new IllegalArgumentException ( "Section \"" + section + "\" had already been started!" ) ; this . startTime . put ( section , System . nanoTime ( ) ) ; this . trace . push ( section ) ; |
public class BaseDependencyCheckMojo { /** * Returns the output name .
* @ return the output name */
@ Override public String getOutputName ( ) { } } | if ( "HTML" . equalsIgnoreCase ( this . format ) || "ALL" . equalsIgnoreCase ( this . format ) ) { return "dependency-check-report" ; } else if ( "XML" . equalsIgnoreCase ( this . format ) ) { return "dependency-check-report.xml" ; } else if ( "JUNIT" . equalsIgnoreCase ( this . format ) ) { return "dependency-check-ju... |
public class ExpectedConditions { /** * An expectation for checking if the given element is selected .
* @ param element WebElement to be selected
* @ param selected boolean state of the selection state of the element
* @ return true once the element ' s selection stated is that of selected */
public static Expec... | return new ExpectedCondition < Boolean > ( ) { @ Override public Boolean apply ( WebDriver driver ) { return element . isSelected ( ) == selected ; } @ Override public String toString ( ) { return String . format ( "element (%s) to %sbe selected" , element , ( selected ? "" : "not " ) ) ; } } ; |
public class PredicateOptimisations { /** * Removes duplicate occurrences of same predicate in a conjunction or disjunction . Also detects and removes
* tautology and contradiction . The following translation rules are applied :
* < ul >
* < li > X | | X = > X < / li >
* < li > X & & X = > X < / li >
* < li >... | for ( int i = 0 ; i < children . size ( ) ; i ++ ) { BooleanExpr ci = children . get ( i ) ; if ( ci instanceof BooleanOperatorExpr || ci instanceof FullTextBoostExpr || ci instanceof FullTextOccurExpr ) { // we may encounter non - predicate expressions , just ignore them
continue ; } boolean isCiNegated = ci instanceo... |
public class BufferingBeanBuilder { /** * Gets the buffered value associated with the specified property name .
* @ param metaProperty the meta - property , not null
* @ return the current value in the builder , null if not found or value is null */
@ Override @ SuppressWarnings ( "unchecked" ) public < P > P get (... | return ( P ) getBuffer ( ) . get ( metaProperty ) ; |
public class GetData { /** * Get Current day ( + / - number of days / months / years )
* @ param days days
* @ param months months
* @ param years years
* @ param format format
* @ return data */
public static String getDate ( int days , int months , int years , String format ) { } } | return getDate ( days , months , years , format , Locale . ENGLISH ) ; |
public class InternalPureXbaseLexer { /** * $ ANTLR start " T _ _ 61" */
public final void mT__61 ( ) throws RecognitionException { } } | try { int _type = T__61 ; int _channel = DEFAULT_TOKEN_CHANNEL ; // InternalPureXbase . g : 59:7 : ( ' [ ' )
// InternalPureXbase . g : 59:9 : ' [ '
{ match ( '[' ) ; } state . type = _type ; state . channel = _channel ; } finally { } |
public class TcpTransporter { /** * - - - DISCONNECT - - - */
protected void disconnect ( ) { } } | // Stop broadcaster
if ( locator != null ) { locator . disconnect ( ) ; locator = null ; } // Stop gossiper ' s timer
if ( gossiperTimer != null ) { gossiperTimer . cancel ( false ) ; gossiperTimer = null ; } // Close socket reader
if ( reader != null ) { reader . disconnect ( ) ; reader = null ; } // Close socket writ... |
public class Handler { /** * handleMessage message handles loop for org . hyperledger . fabric . java . shim side of chaincode / validator stream . */
public synchronized void handleMessage ( ChaincodeMessage message ) throws Exception { } } | if ( message . getType ( ) == ChaincodeMessage . Type . KEEPALIVE ) { logger . debug ( String . format ( "[%s] Recieved KEEPALIVE message, do nothing" , shortID ( message ) ) ) ; // Received a keep alive message , we don ' t do anything with it for now
// and it does not touch the state machine
return ; } logger . debu... |
public class Transform1D { /** * Translate .
* @ param thePath the path to follow .
* @ param direction is the direction to follow on the path if the path contains only one segment .
* @ param curvilineCoord the curviline translation .
* @ param shiftCoord the shifting translation . */
public void translate ( L... | this . path = thePath == null || thePath . isEmpty ( ) ? null : new ArrayList < > ( thePath ) ; this . firstSegmentDirection = detectFirstSegmentDirection ( direction ) ; this . curvilineTranslation += curvilineCoord ; this . shiftTranslation += shiftCoord ; this . isIdentity = null ; |
public class ListStringRecordReader { /** * Called once at initialization .
* @ param split the split that defines the range of records to read
* @ throws IOException
* @ throws InterruptedException */
@ Override public void initialize ( InputSplit split ) throws IOException , InterruptedException { } } | if ( split instanceof ListStringSplit ) { ListStringSplit listStringSplit = ( ListStringSplit ) split ; delimitedData = listStringSplit . getData ( ) ; dataIter = delimitedData . iterator ( ) ; } else { throw new IllegalArgumentException ( "Illegal type of input split " + split . getClass ( ) . getName ( ) ) ; } |
public class ConfigServiceFactory { /** * Setup the factory beans */
public synchronized void setUp ( ) { } } | if ( initialized ) return ; String className = null ; // Load
Map < Object , Object > properties = settings . getProperties ( ) ; String key = null ; Object serviceObject = null ; for ( Map . Entry < Object , Object > entry : properties . entrySet ( ) ) { key = String . valueOf ( entry . getKey ( ) ) ; if ( key . start... |
public class ArrayCounter { /** * Returns an int [ ] array of length segments containing the distribution
* count of the elements in unsorted int [ ] array with values between min
* and max ( range ) . Values outside the min - max range are ignored < p >
* A usage example is determining the count of people of eac... | int [ ] counts = new int [ segments ] ; long interval = calcInterval ( segments , start , limit ) ; int index = 0 ; int element = 0 ; if ( interval <= 0 ) { return counts ; } for ( int i = 0 ; i < elements ; i ++ ) { element = array [ i ] ; if ( element < start || element >= limit ) { continue ; } index = ( int ) ( ( e... |
public class InstanceAdminClient { /** * Deletes an instance .
* < p > Immediately upon completion of the request :
* < p > & # 42 ; Billing ceases for all of the instance ' s reserved resources .
* < p > Soon afterward :
* < p > & # 42 ; The instance and & # 42 ; all of its databases & # 42 ; immediately and i... | DeleteInstanceRequest request = DeleteInstanceRequest . newBuilder ( ) . setName ( name == null ? null : name . toString ( ) ) . build ( ) ; deleteInstance ( request ) ; |
public class XARMojo { /** * Add all the XML elements under the & lt ; info & gt ; element ( name , description , license , author , version and whether
* it ' s a backup pack or not ) .
* @ param infoElement the info element to which to add to */
private void addInfoElements ( Element infoElement ) { } } | Element el = new DOMElement ( "name" ) ; el . addText ( this . project . getName ( ) ) ; infoElement . add ( el ) ; el = new DOMElement ( "description" ) ; String description = this . project . getDescription ( ) ; if ( description == null ) { el . addText ( "" ) ; } else { el . addText ( description ) ; } infoElement ... |
public class S3ALowLevelOutputStream { /** * Creates a new temp file to write to . */
private void initNewFile ( ) throws IOException { } } | mFile = new File ( PathUtils . concatPath ( CommonUtils . getTmpDir ( mTmpDirs ) , UUID . randomUUID ( ) ) ) ; if ( mHash != null ) { mLocalOutputStream = new BufferedOutputStream ( new DigestOutputStream ( new FileOutputStream ( mFile ) , mHash ) ) ; } else { mLocalOutputStream = new BufferedOutputStream ( new FileOut... |
public class WicketUrlExtensions { /** * Gets the base url .
* @ param pageClass
* the page class
* @ param parameters
* the parameters
* @ return the base url */
public static Url getBaseUrl ( final Class < ? extends Page > pageClass , final PageParameters parameters ) { } } | return RequestCycle . get ( ) . mapUrlFor ( pageClass , parameters ) ; |
public class AbstractWriteHandler { /** * Abort the write process due to error .
* @ param error the error */
private void abort ( Error error ) { } } | try { if ( mContext == null || mContext . getError ( ) != null || mContext . isDoneUnsafe ( ) ) { // Note , we may reach here via events due to network errors bubbling up before
// mContext is initialized , or stream error after the request is finished .
return ; } mContext . setError ( error ) ; cleanupRequest ( mCont... |
public class SagaMessageStream { /** * { @ inheritDoc } */
@ Override public void add ( @ Nonnull final Object message , @ Nullable final Map < String , Object > headers ) { } } | checkNotNull ( message , "Message to handle must not be null." ) ; addMessage ( message , toTypedHeaders ( headers ) ) ; |
public class MavenUtil { /** * parse snapshot exe name from maven - metadata . xml */
static String parseSnapshotExeName ( File mdFile ) throws IOException { } } | String exeName = null ; try { String clsStr = Protoc . getPlatformClassifier ( ) ; DocumentBuilder xmlBuilder = DocumentBuilderFactory . newInstance ( ) . newDocumentBuilder ( ) ; Document xmlDoc = xmlBuilder . parse ( mdFile ) ; NodeList versions = xmlDoc . getElementsByTagName ( "snapshotVersion" ) ; for ( int i = 0 ... |
public class DwgPolyline2D { /** * Read a Polyline2D in the DWG format Version 15
* @ param data Array of unsigned bytes obtained from the DWG binary file
* @ param offset The current bit offset where the value begins
* @ throws Exception If an unexpected bit value is found in the DWG file . Occurs
* when we ar... | // System . out . println ( " readDwgPolyline2D executing . . . " ) ;
int bitPos = offset ; bitPos = readObjectHeaderV15 ( data , bitPos ) ; Vector v = DwgUtil . getBitShort ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; int flags = ( ( Integer ) v . get ( 1 ) ) . intValue ( ) ; this . flag... |
public class IMatrix { /** * Transpose a matrix */
public IMatrix transpose ( ) { } } | IMatrix result = new IMatrix ( rows , columns ) ; transpose ( result ) ; return result ; |
public class JSType { /** * Looks up a property on this type , but without properly replacing any templates in the result .
* < p > Subclasses can override this if they need more complicated logic for property lookup than
* just autoboxing to an object .
* < p > This is only for use by { @ code findPropertyType (... | ObjectType autoboxObjType = ObjectType . cast ( autoboxesTo ( ) ) ; if ( autoboxObjType != null ) { return autoboxObjType . findPropertyType ( propertyName ) ; } return null ; |
public class StringUtils { /** * < p > Find the latest index of any of a set of potential substrings . < / p >
* < p > A { @ code null } CharSequence will return { @ code - 1 } .
* A { @ code null } search array will return { @ code - 1 } .
* A { @ code null } or zero length search array entry will be ignored ,
... | if ( str == null || searchStrs == null ) { return INDEX_NOT_FOUND ; } int ret = INDEX_NOT_FOUND ; int tmp = 0 ; for ( final CharSequence search : searchStrs ) { if ( search == null ) { continue ; } tmp = CharSequenceUtils . lastIndexOf ( str , search , str . length ( ) ) ; if ( tmp > ret ) { ret = tmp ; } } return ret ... |
public class Multiplexing { /** * Flattens passed iterators of E to an iterator of E . E . g :
* < code >
* chain ( [ 1,2 ] , [ 3,4 ] ) - > [ 1,2,3,4]
* < / code >
* @ param < E > the iterator element type
* @ param < I > the iterator type
* @ param iterators the array of iterators to be flattened
* @ ret... | return new ChainIterator < > ( ArrayIterator . of ( iterators ) ) ; |
public class PageShellInterceptor { /** * Renders the content after the backing component .
* @ param writer the writer to write to . */
protected void afterPaint ( final PrintWriter writer ) { } } | PageShell pageShell = Factory . newInstance ( PageShell . class ) ; pageShell . writeFooter ( writer ) ; pageShell . closeDoc ( writer ) ; |
public class IdentityPatchContext { /** * Create a patch element for the rollback patch .
* @ param entry the entry
* @ return the new patch element */
protected static PatchElement createRollbackElement ( final PatchEntry entry ) { } } | final PatchElement patchElement = entry . element ; final String patchId ; final Patch . PatchType patchType = patchElement . getProvider ( ) . getPatchType ( ) ; if ( patchType == Patch . PatchType . CUMULATIVE ) { patchId = entry . getCumulativePatchID ( ) ; } else { patchId = patchElement . getId ( ) ; } return crea... |
public class DataReader { /** * Load patches which override values in the CLDR data . Use this to restore
* certain cases to our preferred form . */
private void loadPatches ( ) throws IOException { } } | List < Path > paths = Utils . listResources ( PATCHES ) ; for ( Path path : paths ) { String fileName = path . getFileName ( ) . toString ( ) ; if ( fileName . endsWith ( ".json" ) ) { JsonObject root = load ( path ) ; patches . put ( fileName , root ) ; } } |
public class GeneralStorable { /** * Returns the key belonging to the given field as read - only ByteBuffer
* @ param field
* the name of the field
* @ return the requested value
* @ throws IOException */
public ByteBuffer getKey ( String field ) throws IOException { } } | int hash = Arrays . hashCode ( field . getBytes ( ) ) ; return getKey ( structure . keyHash2Index . get ( hash ) ) ; |
public class ProxyBranchImpl { /** * https : / / code . google . com / p / sipservlets / issues / detail ? id = 238 */
public void removeTransaction ( String branch ) { } } | synchronized ( this . ongoingTransactions ) { TransactionRequest remove = null ; for ( TransactionRequest tr : this . ongoingTransactions ) { if ( tr . branchId . equals ( branch ) ) { remove = tr ; break ; } } if ( remove != null ) { boolean removed = this . ongoingTransactions . remove ( remove ) ; if ( logger . isDe... |
public class ParosTableHistory { /** * Deletes from the database all the history records whose ID is in the list { @ code ids } , in batches of given
* { @ code batchSize } .
* @ param ids a { @ code List } containing all the IDs of the history records to be deleted
* @ param batchSize the maximum size of records... | try { if ( ids == null ) { throw new IllegalArgumentException ( "Parameter ids must not be null." ) ; } if ( batchSize <= 0 ) { throw new IllegalArgumentException ( "Parameter batchSize must be greater than zero." ) ; } int count = 0 ; for ( Integer id : ids ) { psDelete . setInt ( 1 , id ) ; psDelete . addBatch ( ) ; ... |
public class Block { /** * Splits this block ' s lines , creating a new child block having ' line ' as it ' s
* lineTail .
* @ param aLine
* The line to split from .
* @ return The newly created Block . */
public Block split ( final Line aLine ) { } } | final Block aBlock = new Block ( ) ; aBlock . m_aLines = m_aLines ; aBlock . m_aLineTail = aLine ; m_aLines = aLine . m_aNext ; aLine . m_aNext = null ; if ( m_aLines == null ) m_aLineTail = null ; else m_aLines . m_aPrevious = null ; if ( m_aBlocks == null ) m_aBlocks = m_aBlockTail = aBlock ; else { m_aBlockTail . m_... |
public class AbstractDns { protected Object createCacheEntry ( String host , String [ ] ips ) { } } | try { long expiration = System . currentTimeMillis ( ) + EXPIRATION ; // 10年失效
InetAddress [ ] addresses = new InetAddress [ ips . length ] ; for ( int i = 0 ; i < addresses . length ; i ++ ) { // addresses [ i ] = InetAddress . getByAddress ( host , toBytes ( ips [ i ] ) ) ;
addresses [ i ] = InetAddress . getByAddres... |
public class CommitMarkerCodec { /** * since we can recover without any consequence */
public int readMarker ( SequenceFile . Reader reader ) throws IOException { } } | if ( valueBytes == null ) { valueBytes = reader . createValueBytes ( ) ; } rawKey . reset ( ) ; rawValue . reset ( ) ; // valueBytes need not be reset since nextRaw call does it ( and it is a private method )
int status = reader . nextRaw ( rawKey , valueBytes ) ; // if we reach EOF , return - 1
if ( status == - 1 ) { ... |
public class CommerceRegionPersistenceImpl { /** * Removes the commerce region with the primary key from the database . Also notifies the appropriate model listeners .
* @ param primaryKey the primary key of the commerce region
* @ return the commerce region that was removed
* @ throws NoSuchRegionException if a ... | Session session = null ; try { session = openSession ( ) ; CommerceRegion commerceRegion = ( CommerceRegion ) session . get ( CommerceRegionImpl . class , primaryKey ) ; if ( commerceRegion == null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } throw new NoSuch... |
public class SymbolTable { /** * Gets all symbols associated with the given type . For union types , this may be multiple symbols .
* For instance types , this will return the constructor of that instance . */
public List < Symbol > getAllSymbolsForType ( JSType type ) { } } | if ( type == null ) { return ImmutableList . of ( ) ; } UnionType unionType = type . toMaybeUnionType ( ) ; if ( unionType != null ) { List < Symbol > result = new ArrayList < > ( 2 ) ; for ( JSType alt : unionType . getAlternates ( ) ) { // Our type system never has nested unions .
Symbol altSym = getSymbolForTypeHelp... |
public class DetourCommon { /** * / @ see dtOverlapQuantBounds */
public static boolean overlapBounds ( float [ ] amin , float [ ] amax , float [ ] bmin , float [ ] bmax ) { } } | boolean overlap = true ; overlap = ( amin [ 0 ] > bmax [ 0 ] || amax [ 0 ] < bmin [ 0 ] ) ? false : overlap ; overlap = ( amin [ 1 ] > bmax [ 1 ] || amax [ 1 ] < bmin [ 1 ] ) ? false : overlap ; overlap = ( amin [ 2 ] > bmax [ 2 ] || amax [ 2 ] < bmin [ 2 ] ) ? false : overlap ; return overlap ; |
public class OstrovskyInitialMeans { /** * Initialize the weight list .
* @ param weights Weight list
* @ param ids IDs
* @ param relation Data relation
* @ param first First ID
* @ param second Second ID
* @ param distQ Distance query
* @ return Weight sum
* @ param < T > Object type */
protected stati... | double weightsum = 0. ; for ( DBIDIter it = ids . iter ( ) ; it . valid ( ) ; it . advance ( ) ) { // distance will usually already be squared
T v = relation . get ( it ) ; double weight = Math . min ( distQ . distance ( first , v ) , distQ . distance ( second , v ) ) ; weights . putDouble ( it , weight ) ; weightsum +... |
public class BAMInputFormat { /** * Only include reads that overlap the given intervals . Unplaced unmapped reads are not
* included .
* @ param conf the Hadoop configuration to set properties on
* @ param intervals the intervals to filter by
* @ param < T > the { @ link Locatable } type */
public static < T ex... | setTraversalParameters ( conf , intervals , false ) ; |
public class DoubleHistogram { /** * Add the contents of another histogram to this one , while correcting the incoming data for coordinated omission .
* To compensate for the loss of sampled values when a recorded value is larger than the expected
* interval between value samples , the values added will include an ... | final DoubleHistogram toHistogram = this ; for ( HistogramIterationValue v : fromHistogram . integerValuesHistogram . recordedValues ( ) ) { toHistogram . recordValueWithCountAndExpectedInterval ( v . getValueIteratedTo ( ) * integerToDoubleValueConversionRatio , v . getCountAtValueIteratedTo ( ) , expectedIntervalBetw... |
public class TaskUpdateOptions { /** * Set a timestamp indicating the last modified time of the resource known to the client . The operation will be performed only if the resource on the service has not been modified since the specified time .
* @ param ifUnmodifiedSince the ifUnmodifiedSince value to set
* @ retur... | if ( ifUnmodifiedSince == null ) { this . ifUnmodifiedSince = null ; } else { this . ifUnmodifiedSince = new DateTimeRfc1123 ( ifUnmodifiedSince ) ; } return this ; |
public class JDBCDatabaseMetaData { /** * # ifdef JAVA6 */
public ResultSet getSchemas ( String catalog , String schemaPattern ) throws SQLException { } } | StringBuffer select = toQueryPrefix ( "SYSTEM_SCHEMAS" ) . append ( and ( "TABLE_CATALOG" , "=" , catalog ) ) . append ( and ( "TABLE_SCHEM" , "LIKE" , schemaPattern ) ) ; // By default , query already returns result in contract order
return execute ( select . toString ( ) ) ; |
public class WorkAloneRedisManager { /** * get value from redis
* @ param key key
* @ return value */
@ Override public byte [ ] get ( byte [ ] key ) { } } | if ( key == null ) { return null ; } byte [ ] value = null ; Jedis jedis = getJedis ( ) ; try { value = jedis . get ( key ) ; } finally { jedis . close ( ) ; } return value ; |
public class Signatures { /** * Selects the best equally - matching methods for the given arguments .
* @ param methods
* @ param args
* @ return methods */
public static Method [ ] candidateMethods ( Method [ ] methods , Object [ ] args ) { } } | return candidateMethods ( methods , collectArgTypes ( args ) ) ; |
public class CSSWriter { /** * Create the CSS without a specific charset .
* @ param aCSS
* The CSS object to be converted to text . May not be < code > null < / code >
* @ return The text representation of the CSS .
* @ see # writeCSS ( CascadingStyleSheet , Writer ) */
@ Nonnull public String getCSSAsString (... | final NonBlockingStringWriter aSW = new NonBlockingStringWriter ( ) ; try { writeCSS ( aCSS , aSW ) ; } catch ( final IOException ex ) { // Should never occur since NonBlockingStringWriter does not throw such an
// exception
throw new IllegalStateException ( "Totally unexpected" , ex ) ; } return aSW . getAsString ( ) ... |
public class KerasSequentialModel { /** * Build a MultiLayerNetwork from this Keras Sequential model configuration and import weights .
* @ return MultiLayerNetwork */
public MultiLayerNetwork getMultiLayerNetwork ( boolean importWeights ) throws InvalidKerasConfigurationException , UnsupportedKerasConfigurationExcep... | MultiLayerNetwork model = new MultiLayerNetwork ( getMultiLayerConfiguration ( ) ) ; model . init ( ) ; if ( importWeights ) model = ( MultiLayerNetwork ) KerasModelUtils . copyWeightsToModel ( model , this . layers ) ; return model ; |
public class JsMessageVisitor { /** * Appends the message parts in a JS message value extracted from the given
* text node .
* @ param builder the JS message builder to append parts to
* @ param node the node with string literal that contains the message text
* @ throws MalformedException if { @ code value } co... | String value = extractStringFromStringExprNode ( node ) ; while ( true ) { int phBegin = value . indexOf ( PH_JS_PREFIX ) ; if ( phBegin < 0 ) { // Just a string literal
builder . appendStringPart ( value ) ; return ; } else { if ( phBegin > 0 ) { // A string literal followed by a placeholder
builder . appendStringPart... |
public class SiteSwitcherHandlerInterceptor { /** * Creates a site switcher that redirects to a custom domain for normal site requests that either
* originate from a mobile device or indicate a mobile site preference .
* Uses a { @ link CookieSitePreferenceRepository } that saves a cookie that is shared between the... | return new SiteSwitcherHandlerInterceptor ( StandardSiteSwitcherHandlerFactory . standard ( normalServerName , mobileServerName , cookieDomain , tabletIsMobile ) ) ; |
public class ConciseSet { /** * Performs the given operation over the bit - sets
* @ param other { @ link ConciseSet } instance that represents the right
* operand
* @ param operator operator
* @ return the result of the operation */
private ConciseSet performOperation ( ConciseSet other , Operator operator ) {... | // non - empty arguments
if ( this . isEmpty ( ) || other . isEmpty ( ) ) { return operator . combineEmptySets ( this , other ) ; } // if the two operands are disjoint , the operation is faster
ConciseSet res = operator . combineDisjointSets ( this , other ) ; if ( res != null ) { return res ; } // Allocate a sufficien... |
public class DBaseFileWriter { /** * Write a string inside the current < var > stream < / var > .
* Each character of the string will be written as bytes .
* No terminal null character is written . The
* string area will be filled with the given byte .
* @ param str is the string to write
* @ param size if th... | assert this . language != null ; // Be sure that the encoding will be the right one
int strSize = 0 ; if ( str != null ) { final Charset encodingCharset = this . language . getChatset ( ) ; if ( encodingCharset == null ) { throw new IOException ( Locale . getString ( "UNKNOWN_CHARSET" ) ) ; // $ NON - NLS - 1 $
} final... |
public class Translation { /** * Translates { @ code Order . Direction } to Google App Engine Datastore
* { @ code SortDirection } .
* @ param direction Acid House { @ code Order . Direction } .
* @ return Google App Engine Datastore { @ code SortDirection } translated
* from Acid House { @ code Order . Directi... | if ( direction == Order . Direction . ASC ) { return SortDirection . ASCENDING ; } else if ( direction == Order . Direction . DESC ) { return SortDirection . DESCENDING ; } else { throw new UnsupportedOperationException ( "Direction [" + direction + "] is not supported by Google App Engine Datastore" ) ; } |
public class CDDB { /** * Fetches and returns the list of categories supported by the server .
* @ throws IOException if a problem occurs chatting to the server .
* @ throws CDDBException if the server responds with an error . */
public String [ ] lscat ( ) throws IOException , CDDBException { } } | // sanity check
if ( _sock == null ) { throw new CDDBException ( 500 , "Not connected" ) ; } // make the request
Response rsp = request ( "cddb lscat" ) ; // anything other than an OK response earns an exception
if ( rsp . code != 210 ) { throw new CDDBException ( rsp . code , rsp . message ) ; } ArrayList < String > l... |
public class SubtitleChatOverlay { /** * Figure out how many of the first history elements fit in our bounds such that we can set the
* bounds on the scrollbar correctly such that the scrolling to the smallest value just barely
* puts the first element onscreen . */
protected void figureHistoryOffset ( Graphics2D g... | if ( ! isLaidOut ( ) ) { return ; } int hei = _subtitleYSpacing ; int hsize = _history . size ( ) ; for ( int ii = 0 ; ii < hsize ; ii ++ ) { ChatGlyph rec = getHistorySubtitle ( ii , gfx ) ; Rectangle r = rec . getBounds ( ) ; hei += r . height ; // oop , we passed it , it was the last one
if ( hei >= _subtitleHeight ... |
public class Main { /** * / * public static void main ( String [ ] arg ) {
* String tuneAsString = " X : 0 \ nT : A simple scale exercise \ nM : 4/4 \ nK : D \ n ( CD EF | G ) A Bc | de fg - | gf ed | cB A ( G | FE DC ) \ n " ;
* Tune tune = new TuneParser ( ) . parse ( tuneAsString ) ;
* JScoreComponent scoreUI ... | try { boolean chr = arg . length > 0 && arg [ 0 ] . equals ( "--chromatic" ) ; String rn = chr ? CHROMATIC_RECOURCE_NAME : DEMO_RESOURCE_NAME ; Reader isr = new InputStreamReader ( Main . class . getResourceAsStream ( rn ) , "UTF-8" ) ; TuneBook tb = new TuneBookParser ( ) . parse ( isr ) ; Tune tune = tb . getTune ( c... |
public class KeyUtils { /** * Gets the key string .
* @ param server
* @ param query the query
* @ param result the result
* @ param typeNames the type names
* @ param rootPrefix the root prefix
* @ return the key string */
public static String getKeyString ( Server server , Query query , Result result , Li... | StringBuilder sb = new StringBuilder ( ) ; addRootPrefix ( rootPrefix , sb ) ; addAlias ( server , sb ) ; addSeparator ( sb ) ; addMBeanIdentifier ( query , result , sb ) ; addSeparator ( sb ) ; addTypeName ( query , result , typeNames , sb ) ; addKeyString ( query , result , sb ) ; return sb . toString ( ) ; |
public class DataEncoder { /** * Encodes the given optional String into a variable amount of bytes . The
* amount written can be determined by calling
* calculateEncodedStringLength .
* Strings are encoded in a fashion similar to UTF - 8 , in that ASCII
* characters are written in one byte . This encoding is mo... | if ( value == null ) { dst [ dstOffset ] = NULL_BYTE_HIGH ; return 1 ; } final int originalOffset = dstOffset ; int valueLength = value . length ( ) ; // Write the value length first , in a variable amount of bytes .
dstOffset += encodeUnsignedVarInt ( valueLength , dst , dstOffset ) ; for ( int i = 0 ; i < valueLength... |
public class APSPSolver { /** * TP creation */
private int tpCreate ( ) { } } | logger . finest ( "Creating 1 TP" ) ; int i = 2 ; boolean found = false ; while ( i < MAX_TPS && ! found ) { if ( ! tPoints [ i ] . isUsed ( ) ) { tPoints [ i ] . setUsed ( true ) ; found = true ; // reusing a timepoint , check !
// System . out . println ( " REUSING TP " + i + " and with Origin - > " + i + " is " + tP... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.