signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class InternalXbaseWithAnnotationsParser { /** * $ ANTLR start synpred51 _ InternalXbaseWithAnnotations */ public final void synpred51_InternalXbaseWithAnnotations_fragment ( ) throws RecognitionException { } }
// InternalXbaseWithAnnotations . g : 2686:2 : ( ( ( ruleXForLoopExpression ) ) ) // InternalXbaseWithAnnotations . g : 2686:2 : ( ( ruleXForLoopExpression ) ) { // InternalXbaseWithAnnotations . g : 2686:2 : ( ( ruleXForLoopExpression ) ) // InternalXbaseWithAnnotations . g : 2687:3 : ( ruleXForLoopExpression ) { if ( state . backtracking == 0 ) { before ( grammarAccess . getXPrimaryExpressionAccess ( ) . getXForLoopExpressionParserRuleCall_7 ( ) ) ; } // InternalXbaseWithAnnotations . g : 2688:3 : ( ruleXForLoopExpression ) // InternalXbaseWithAnnotations . g : 2688:4 : ruleXForLoopExpression { pushFollow ( FOLLOW_2 ) ; ruleXForLoopExpression ( ) ; state . _fsp -- ; if ( state . failed ) return ; } } }
public class JerseyClient { @ Override public List < com . enioka . jqm . api . Deliverable > getJobDeliverables ( int idJob ) { } }
try { return target . path ( "ji/" + idJob + "/files" ) . request ( ) . get ( new GenericType < List < Deliverable > > ( ) { } ) ; } catch ( BadRequestException e ) { throw new JqmInvalidRequestException ( e . getResponse ( ) . readEntity ( String . class ) , e ) ; } catch ( Exception e ) { throw new JqmClientException ( e ) ; }
public class DataSource { /** * Execute query . * @ param callInfo Call info . * @ param takeSnapshot Indicates that a snapshot should be taken . * @ return Result of query . */ final DataSet executeQuery ( CallInfo callInfo , boolean takeSnapshot ) { } }
DataSet data = new DataSet ( this ) ; return db . access ( callInfo , ( ) -> { try ( WrappedStatement ws = db . compile ( getSQLForQuery ( ) ) ) { proceedWithQuery ( ws . getStatement ( ) , data ) ; if ( takeSnapshot ) { setSnapshot ( data ) ; db . logSnapshot ( callInfo , data ) ; } else { db . logQuery ( callInfo , data ) ; } } return data ; } ) ;
public class BDDFactory { /** * Recursive build procedure for the BDD . * @ param formula the formula * @ return the BDD index */ private int buildRec ( final Formula formula ) { } }
switch ( formula . type ( ) ) { case FALSE : return BDDKernel . BDD_FALSE ; case TRUE : return BDDKernel . BDD_TRUE ; case LITERAL : final Literal lit = ( Literal ) formula ; Integer idx = this . var2idx . get ( lit . variable ( ) ) ; if ( idx == null ) { idx = this . var2idx . size ( ) ; this . var2idx . put ( lit . variable ( ) , idx ) ; this . idx2var . put ( idx , lit . variable ( ) ) ; } return lit . phase ( ) ? this . kernel . ithVar ( idx ) : this . kernel . nithVar ( idx ) ; case NOT : final Not not = ( Not ) formula ; return this . kernel . addRef ( this . kernel . not ( buildRec ( not . operand ( ) ) ) ) ; case IMPL : final Implication impl = ( Implication ) formula ; return this . kernel . addRef ( this . kernel . implication ( buildRec ( impl . left ( ) ) , buildRec ( impl . right ( ) ) ) ) ; case EQUIV : final Equivalence equiv = ( Equivalence ) formula ; return this . kernel . addRef ( this . kernel . equivalence ( buildRec ( equiv . left ( ) ) , buildRec ( equiv . right ( ) ) ) ) ; case AND : case OR : final Iterator < Formula > it = formula . iterator ( ) ; int res = buildRec ( it . next ( ) ) ; while ( it . hasNext ( ) ) res = formula . type ( ) == AND ? this . kernel . addRef ( this . kernel . and ( res , buildRec ( it . next ( ) ) ) ) : this . kernel . addRef ( this . kernel . or ( res , buildRec ( it . next ( ) ) ) ) ; return res ; case PBC : return buildRec ( formula . nnf ( ) ) ; default : throw new IllegalArgumentException ( "Unsupported operator for BDD generation: " + formula . type ( ) ) ; }
public class ListAccessKeysResult { /** * A list of objects containing metadata about the access keys . * @ return A list of objects containing metadata about the access keys . */ public java . util . List < AccessKeyMetadata > getAccessKeyMetadata ( ) { } }
if ( accessKeyMetadata == null ) { accessKeyMetadata = new com . amazonaws . internal . SdkInternalList < AccessKeyMetadata > ( ) ; } return accessKeyMetadata ;
public class JobHistory { /** * Log a raw record type with keys and values . This is method is generally not used directly . * @ param recordType type of log event * @ param key key * @ param value value */ public static void log ( PrintWriter out , RecordTypes recordType , Keys key , String value ) { } }
value = escapeString ( value ) ; out . println ( recordType . name ( ) + DELIMITER + key + "=\"" + value + "\"" + DELIMITER + LINE_DELIMITER_CHAR ) ;
public class Launcher { /** * Program entry point . See class documentation for the supported features . * @ param args * command line arguments */ public static void main ( final String ... args ) { } }
// Configure command line options final Options options = new Options ( ) ; options . addOption ( "c" , "config" , true , "use service configuration file / classpath " + "resource (default '" + DEFAULT_CONFIG + "')" ) ; options . addOption ( "v" , "version" , false , "display version and copyright information, then exit" ) ; options . addOption ( "h" , "help" , false , "display usage information, then exit" ) ; // Initialize exit status int status = EX_OK ; try { // Parse command line and handle different commands final CommandLine cmd = new GnuParser ( ) . parse ( options , args ) ; if ( cmd . hasOption ( "v" ) ) { // Show version and copyright ( http : / / www . gnu . org / prep / standards / standards . html ) System . out . println ( String . format ( "%s (FBK KnowledgeStore) %s\njava %s bit (%s) %s\n%s" , PROGRAM_EXECUTABLE , PROGRAM_VERSION , System . getProperty ( "sun.arch.data.model" ) , System . getProperty ( "java.vendor" ) , System . getProperty ( "java.version" ) , PROGRAM_DISCLAIMER ) ) ; } else if ( cmd . hasOption ( "h" ) ) { // Show usage ( done later ) and terminate status = EX_USAGE ; } else { // Run the service . Retrieve the configuration final String configLocation = cmd . getOptionValue ( 'c' , DEFAULT_CONFIG ) ; // Differentiate between normal run , commons - daemon start , commons - daemon stop if ( cmd . getArgList ( ) . contains ( "__start" ) ) { start ( configLocation ) ; // commons - daemon start } else if ( cmd . getArgList ( ) . contains ( "__stop" ) ) { stop ( ) ; // commons - deamon stop } else { run ( configLocation ) ; // normal execution } } } catch ( final ParseException ex ) { // Display error message and then usage on syntax error System . err . println ( "SYNTAX ERROR: " + ex . getMessage ( ) ) ; status = EX_USAGE ; } catch ( final ServiceConfigurationError ex ) { // Display error message and stack trace and terminate on configuration error System . err . println ( "INVALID CONFIGURATION: " + ex . getMessage ( ) ) ; Throwables . getRootCause ( ex ) . printStackTrace ( ) ; status = EX_CONFIG ; } catch ( final Throwable ex ) { // Display error message and stack trace on generic error System . err . print ( "EXECUTION FAILED: " ) ; ex . printStackTrace ( ) ; status = ex instanceof IOException ? EX_IOERR : EX_UNAVAILABLE ; } // Display usage information if necessary if ( status == EX_USAGE ) { final PrintWriter out = new PrintWriter ( System . out ) ; final HelpFormatter formatter = new HelpFormatter ( ) ; formatter . printUsage ( out , WIDTH , PROGRAM_EXECUTABLE , options ) ; if ( PROGRAM_DESCRIPTION != null ) { formatter . printWrapped ( out , WIDTH , "\n" + PROGRAM_DESCRIPTION . trim ( ) ) ; } out . println ( "\nOptions" ) ; formatter . printOptions ( out , WIDTH , options , 2 , 2 ) ; out . flush ( ) ; } // Display exit status for convenience if ( status != EX_OK ) { System . err . println ( "[exit status: " + status + "]" ) ; } else { System . out . println ( "[exit status: " + status + "]" ) ; } // Flush STDIN and STDOUT before exiting ( we noted truncated outputs otherwise ) System . out . flush ( ) ; System . err . flush ( ) ; // Force exiting ( in case there are threads still running ) System . exit ( status ) ;
public class TrainingSpecificationMarshaller { /** * Marshall the given parameter object . */ public void marshall ( TrainingSpecification trainingSpecification , ProtocolMarshaller protocolMarshaller ) { } }
if ( trainingSpecification == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( trainingSpecification . getTrainingImage ( ) , TRAININGIMAGE_BINDING ) ; protocolMarshaller . marshall ( trainingSpecification . getTrainingImageDigest ( ) , TRAININGIMAGEDIGEST_BINDING ) ; protocolMarshaller . marshall ( trainingSpecification . getSupportedHyperParameters ( ) , SUPPORTEDHYPERPARAMETERS_BINDING ) ; protocolMarshaller . marshall ( trainingSpecification . getSupportedTrainingInstanceTypes ( ) , SUPPORTEDTRAININGINSTANCETYPES_BINDING ) ; protocolMarshaller . marshall ( trainingSpecification . getSupportsDistributedTraining ( ) , SUPPORTSDISTRIBUTEDTRAINING_BINDING ) ; protocolMarshaller . marshall ( trainingSpecification . getMetricDefinitions ( ) , METRICDEFINITIONS_BINDING ) ; protocolMarshaller . marshall ( trainingSpecification . getTrainingChannels ( ) , TRAININGCHANNELS_BINDING ) ; protocolMarshaller . marshall ( trainingSpecification . getSupportedTuningJobObjectiveMetrics ( ) , SUPPORTEDTUNINGJOBOBJECTIVEMETRICS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class BiFunctionBuilder { /** * One of ways of creating builder . In most cases ( considering all _ functional _ builders ) it requires to provide generic parameters ( in most cases redundantly ) */ @ Nonnull public static < T1 , T2 , R > BiFunctionBuilder < T1 , T2 , R > biFunction ( ) { } }
return new BiFunctionBuilder ( ) ;
public class CertificatesInner { /** * Update a certificate . * @ param resourceGroupName Name of an Azure Resource group . * @ param automationAccountName The name of the automation account . * @ param certificateName The parameters supplied to the update certificate operation . * @ param parameters The parameters supplied to the update certificate operation . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < CertificateInner > updateAsync ( String resourceGroupName , String automationAccountName , String certificateName , CertificateUpdateParameters parameters , final ServiceCallback < CertificateInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( updateWithServiceResponseAsync ( resourceGroupName , automationAccountName , certificateName , parameters ) , serviceCallback ) ;
public class Solve { /** * Solves the linear equation A * X = B for symmetric A . */ public static DoubleMatrix solveSymmetric ( DoubleMatrix A , DoubleMatrix B ) { } }
A . assertSquare ( ) ; DoubleMatrix X = B . dup ( ) ; int [ ] ipiv = new int [ B . rows ] ; SimpleBlas . sysv ( 'U' , A . dup ( ) , ipiv , X ) ; return X ;
public class AFPOptimizer { /** * optimize the alignment by dynamic programming */ public static void optimizeAln ( FatCatParameters params , AFPChain afpChain , Atom [ ] ca1 , Atom [ ] ca2 ) throws StructureException { } }
int minLen = afpChain . getMinLen ( ) ; int fragLen = params . getFragLen ( ) ; long optStart = System . currentTimeMillis ( ) ; int i , a , k , p1 , p2 , bk , b1 , b2 , e1 , e2 , a1 , a2 ; int iniLen ; int [ ] [ ] iniSet = new int [ 2 ] [ minLen ] ; int maxi = 100 ; int [ ] [ ] [ ] optAln = afpChain . getOptAln ( ) ; int [ ] optLen = afpChain . getOptLen ( ) ; int maxTra = params . getMaxTra ( ) ; double [ ] optRmsd = afpChain . getOptRmsd ( ) ; int blockNum = afpChain . getBlockNum ( ) ; if ( optAln == null ) { optAln = new int [ maxTra + 1 ] [ 2 ] [ minLen ] ; optLen = new int [ maxTra + 1 ] ; afpChain . setOptLen ( optLen ) ; optRmsd = new double [ maxTra + 1 ] ; afpChain . setOptRmsd ( optRmsd ) ; } List < AFP > afpSet = afpChain . getAfpSet ( ) ; int optLength = afpChain . getOptLength ( ) ; int [ ] afpChainList = afpChain . getAfpChainList ( ) ; int [ ] block2Afp = afpChain . getBlock2Afp ( ) ; int [ ] blockSize = afpChain . getBlockSize ( ) ; if ( debug ) System . out . println ( "AFPOptimizer got blockNum: " + blockNum ) ; // optimize each alignment defined by a block b1 = b2 = e1 = e2 = optLength = 0 ; for ( bk = 0 ; bk < blockNum ; bk ++ ) { // initial aligned position iniLen = 0 ; if ( bk > 0 ) { b1 = e1 ; b2 = e2 ; } if ( bk < blockNum - 1 ) { a1 = afpChainList [ block2Afp [ bk ] + blockSize [ bk ] - 1 ] ; // the last AFP in current block a2 = afpChainList [ block2Afp [ bk + 1 ] ] ; // the first AFP in next block e1 = ( afpSet . get ( a1 ) . getP1 ( ) + fragLen + afpSet . get ( a2 ) . getP1 ( ) ) / 2 ; e2 = ( afpSet . get ( a1 ) . getP2 ( ) + fragLen + afpSet . get ( a2 ) . getP2 ( ) ) / 2 ; } // use the middle point of the current and next AFPs . old ( starting point of next AFP ) else { e1 = ca1 . length ; e2 = ca2 . length ; } for ( i = block2Afp [ bk ] ; i < block2Afp [ bk ] + blockSize [ bk ] ; i ++ ) { a = afpChainList [ i ] ; p1 = afpSet . get ( a ) . getP1 ( ) ; p2 = afpSet . get ( a ) . getP2 ( ) ; for ( k = 0 ; k < afpSet . get ( a ) . getFragLen ( ) ; k ++ ) { iniSet [ 0 ] [ iniLen ] = p1 + k - b1 ; // note - b1 iniSet [ 1 ] [ iniLen ] = p2 + k - b2 ; // note - b2 iniLen ++ ; } } // optimize the align by dynamic programming & constraint the optimization region if ( debug ) { System . err . println ( String . format ( "optimize block %d (%d afp), region %d-%d(len %d), %d-%d(len %d)\n" , bk , blockSize [ bk ] , b1 , e1 , e1 - b1 , b2 , e2 , e2 - b2 ) ) ; System . err . println ( " initial alignment Length: " + iniLen ) ; } StructureAlignmentOptimizer opt = new StructureAlignmentOptimizer ( b1 , e1 , ca1 , b2 , e2 , ca2 , iniLen , iniSet ) ; opt . runOptimization ( maxi ) ; optRmsd [ bk ] = opt . optimizeResult ( optLen , bk , optAln [ bk ] ) ; // System . out . println ( optRmsd [ bk ] ) ; // SALNOPT * opt = new SALNOPT ( e1 - b1 , & pro1 - > caCod [ 3 * b1 ] , e2 - b2 , & pro2 - > caCod [ 3 * b2 ] , iniLen , iniSet , maxi ) ; // optRmsd [ bk ] = opt - > OptimizeResult ( & optLen [ bk ] , optAln [ bk ] ) ; if ( debug ) System . out . println ( String . format ( " optimized len=%d, rmsd %f\n" , optLen [ bk ] , optRmsd [ bk ] ) ) ; for ( i = 0 ; i < optLen [ bk ] ; i ++ ) { optAln [ bk ] [ 0 ] [ i ] += b1 ; // restore the position optAln [ bk ] [ 1 ] [ i ] += b2 ; // restore the position } optLength += optLen [ bk ] ; } long optEnd = System . currentTimeMillis ( ) ; if ( debug ) System . out . println ( "complete AlignOpt " + ( optEnd - optStart ) + "\n" ) ; if ( optLength < minLen ) { int [ ] [ ] [ ] optAln_trim = new int [ maxTra + 1 ] [ 2 ] [ optLength ] ; for ( i = 0 ; i < maxTra + 1 ; i ++ ) { System . arraycopy ( optAln [ i ] [ 0 ] , 0 , optAln_trim [ i ] [ 0 ] , 0 , optLength ) ; System . arraycopy ( optAln [ i ] [ 1 ] , 0 , optAln_trim [ i ] [ 1 ] , 0 , optLength ) ; } afpChain . setOptAln ( optAln_trim ) ; } else { afpChain . setOptAln ( optAln ) ; } afpChain . setBlockNum ( blockNum ) ; afpChain . setOptLength ( optLength ) ; afpChain . setAfpChainList ( afpChainList ) ; afpChain . setBlock2Afp ( block2Afp ) ; afpChain . setBlockSize ( blockSize ) ;
public class BigtableBufferedMutator { /** * Create a { @ link RetriesExhaustedWithDetailsException } if there were any async exceptions and * send it to the { @ link org . apache . hadoop . hbase . client . BufferedMutator . ExceptionListener } . */ private RetriesExhaustedWithDetailsException getExceptions ( ) throws RetriesExhaustedWithDetailsException { } }
if ( ! hasExceptions . get ( ) ) { return null ; } ArrayList < MutationException > mutationExceptions = null ; synchronized ( globalExceptions ) { hasExceptions . set ( false ) ; if ( globalExceptions . isEmpty ( ) ) { return null ; } mutationExceptions = new ArrayList < > ( globalExceptions ) ; globalExceptions . clear ( ) ; } List < Throwable > problems = new ArrayList < > ( mutationExceptions . size ( ) ) ; ArrayList < String > hostnames = new ArrayList < > ( mutationExceptions . size ( ) ) ; List < Row > failedMutations = new ArrayList < > ( mutationExceptions . size ( ) ) ; if ( ! mutationExceptions . isEmpty ( ) ) { LOG . warn ( "Exception occurred in BufferedMutator" , mutationExceptions . get ( 0 ) . throwable ) ; } for ( MutationException mutationException : mutationExceptions ) { problems . add ( mutationException . throwable ) ; failedMutations . add ( mutationException . mutation ) ; hostnames . add ( host ) ; LOG . debug ( "Exception occurred in BufferedMutator" , mutationException . throwable ) ; } return new RetriesExhaustedWithDetailsException ( problems , failedMutations , hostnames ) ;
public class PropPatchCommand { /** * List of properties to remove . * @ param request request body * @ return list of properties to remove . */ public List < HierarchicalProperty > removeList ( HierarchicalProperty request ) { } }
HierarchicalProperty remove = request . getChild ( new QName ( "DAV:" , "remove" ) ) ; HierarchicalProperty prop = remove . getChild ( new QName ( "DAV:" , "prop" ) ) ; List < HierarchicalProperty > removeList = prop . getChildren ( ) ; return removeList ;
public class ComputationGraph { /** * Evaluate the network ( classification performance - single output ComputationGraphs only ) * @ param iterator Iterator to evaluate on * @ return Evaluation object ; results of evaluation on all examples in the data set */ public < T extends Evaluation > T evaluate ( MultiDataSetIterator iterator ) { } }
return evaluate ( iterator , ( List < String > ) null ) ;
public class ValueMapImpl { /** * Build the map if requested to , it does this lazily . */ private final void buildIfNeededMap ( ) { } }
if ( map == null ) { map = new HashMap < > ( items . length ) ; for ( Entry < String , Value > miv : items ) { if ( miv == null ) { break ; } map . put ( miv . getKey ( ) , miv . getValue ( ) ) ; } }
public class ProtobufIDLProxy { /** * Creates the single . * @ param reader the reader * @ param debug the debug * @ return the IDL proxy object * @ throws IOException Signals that an I / O exception has occurred . */ public static IDLProxyObject createSingle ( Reader reader , boolean debug ) throws IOException { } }
return createSingle ( reader , debug , null ) ;
public class ExpressRouteCrossConnectionsInner { /** * Retrieves all the ExpressRouteCrossConnections in a subscription . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; ExpressRouteCrossConnectionInner & gt ; object */ public Observable < Page < ExpressRouteCrossConnectionInner > > listNextAsync ( final String nextPageLink ) { } }
return listNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < ExpressRouteCrossConnectionInner > > , Page < ExpressRouteCrossConnectionInner > > ( ) { @ Override public Page < ExpressRouteCrossConnectionInner > call ( ServiceResponse < Page < ExpressRouteCrossConnectionInner > > response ) { return response . body ( ) ; } } ) ;
public class SamplingTargetDocumentMarshaller { /** * Marshall the given parameter object . */ public void marshall ( SamplingTargetDocument samplingTargetDocument , ProtocolMarshaller protocolMarshaller ) { } }
if ( samplingTargetDocument == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( samplingTargetDocument . getRuleName ( ) , RULENAME_BINDING ) ; protocolMarshaller . marshall ( samplingTargetDocument . getFixedRate ( ) , FIXEDRATE_BINDING ) ; protocolMarshaller . marshall ( samplingTargetDocument . getReservoirQuota ( ) , RESERVOIRQUOTA_BINDING ) ; protocolMarshaller . marshall ( samplingTargetDocument . getReservoirQuotaTTL ( ) , RESERVOIRQUOTATTL_BINDING ) ; protocolMarshaller . marshall ( samplingTargetDocument . getInterval ( ) , INTERVAL_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class DepsAnalyzer { /** * Recursively analyze the class dependences */ private void transitiveDeps ( int depth ) throws IOException { } }
Stream < Location > deps = archives . stream ( ) . flatMap ( Archive :: getDependencies ) ; Deque < Location > unresolved = deps . collect ( Collectors . toCollection ( LinkedList :: new ) ) ; ConcurrentLinkedDeque < Location > deque = new ConcurrentLinkedDeque < > ( ) ; do { Location target ; while ( ( target = unresolved . poll ( ) ) != null ) { if ( finder . isParsed ( target ) ) continue ; Archive archive = configuration . findClass ( target ) . orElse ( null ) ; if ( archive != null ) { archives . add ( archive ) ; String name = target . getName ( ) ; Set < Location > targets = apiOnly ? finder . parseExportedAPIs ( archive , name ) : finder . parse ( archive , name ) ; // build unresolved dependencies targets . stream ( ) . filter ( t -> ! finder . isParsed ( t ) ) . forEach ( deque :: add ) ; } } unresolved = deque ; deque = new ConcurrentLinkedDeque < > ( ) ; } while ( ! unresolved . isEmpty ( ) && depth -- > 0 ) ;
public class HarrisFast { /** * 拉普拉斯高斯差分 , Laplace of Gaussian , 涉及到卷积操作 , 计算开销很大 * @ param sigma */ private void computeDerivatives ( double sigma ) { } }
this . Lx2 = new float [ width ] [ height ] ; this . Ly2 = new float [ width ] [ height ] ; this . Lxy = new float [ width ] [ height ] ; float [ ] [ ] [ ] grad = new float [ width ] [ height ] [ ] ; for ( int y = 0 ; y < height ; y ++ ) for ( int x = 0 ; x < width ; x ++ ) grad [ x ] [ y ] = sobel ( x , y ) ; int radius = ( int ) ( 2 * sigma ) ; int window = 1 + 2 * radius ; float [ ] [ ] gaussian = new float [ window ] [ window ] ; for ( int j = - radius ; j <= radius ; j ++ ) for ( int i = - radius ; i <= radius ; i ++ ) gaussian [ i + radius ] [ j + radius ] = ( float ) gaussian ( i , j , sigma ) ; for ( int y = 0 ; y < height ; y ++ ) { for ( int x = 0 ; x < width ; x ++ ) { for ( int dy = - radius ; dy <= radius ; dy ++ ) { for ( int dx = - radius ; dx <= radius ; dx ++ ) { int xk = x + dx ; int yk = y + dy ; if ( xk < 0 || xk >= width ) continue ; if ( yk < 0 || yk >= height ) continue ; double gw = gaussian [ dx + radius ] [ dy + radius ] ; this . Lx2 [ x ] [ y ] += gw * grad [ xk ] [ yk ] [ 0 ] * grad [ xk ] [ yk ] [ 0 ] ; this . Ly2 [ x ] [ y ] += gw * grad [ xk ] [ yk ] [ 1 ] * grad [ xk ] [ yk ] [ 1 ] ; this . Lxy [ x ] [ y ] += gw * grad [ xk ] [ yk ] [ 0 ] * grad [ xk ] [ yk ] [ 1 ] ; } } } }
public class JaxInfo { /** * Build up JAXB Information ( recursively ) * @ param cls * @ param rootNns * @ return * @ throws SecurityException * @ throws NoSuchFieldException * @ throws ClassNotFoundException * @ throws ParseException */ public static JaxInfo build ( Class < ? > cls , String ... rootNns ) throws SecurityException , NoSuchFieldException , ClassNotFoundException , ParseException { } }
String defaultNS ; if ( rootNns . length > 0 && rootNns [ 0 ] != null ) { defaultNS = rootNns [ 0 ] ; } else { Package pkg = cls . getPackage ( ) ; XmlSchema xs = pkg . getAnnotation ( XmlSchema . class ) ; defaultNS = xs == null ? "" : xs . namespace ( ) ; } String name ; if ( rootNns . length > 1 ) { name = rootNns [ 1 ] ; } else { XmlRootElement xre = cls . getAnnotation ( XmlRootElement . class ) ; if ( xre != null ) { name = xre . name ( ) ; } else { XmlType xt = cls . getAnnotation ( XmlType . class ) ; if ( xt != null ) { name = xt . name ( ) ; } else { throw new ParseException ( "Need a JAXB Object with XmlRootElement, or stipulate in parms" ) ; } } } return new JaxInfo ( name , defaultNS , cls , buildFields ( cls , defaultNS ) , false , false , false , false ) ;
public class GeneratedMessage { /** * Internal helper which returns a mutable map . */ private Map < FieldDescriptor , Object > getAllFieldsMutable ( ) { } }
final TreeMap < FieldDescriptor , Object > result = new TreeMap < FieldDescriptor , Object > ( ) ; final Descriptor descriptor = internalGetFieldAccessorTable ( ) . descriptor ; for ( final FieldDescriptor field : descriptor . getFields ( ) ) { if ( field . isRepeated ( ) ) { final List < ? > value = ( List < ? > ) getField ( field ) ; if ( ! value . isEmpty ( ) ) { result . put ( field , value ) ; } } else { if ( hasField ( field ) ) { result . put ( field , getField ( field ) ) ; } } } return result ;
public class hqlParser { /** * hql . g : 224:1 : insertablePropertySpec : OPEN primaryExpression ( COMMA primaryExpression ) * CLOSE - > ^ ( RANGE [ \ " column - spec \ " ] ( primaryExpression ) * ) ; */ public final hqlParser . insertablePropertySpec_return insertablePropertySpec ( ) throws RecognitionException { } }
hqlParser . insertablePropertySpec_return retval = new hqlParser . insertablePropertySpec_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; Token OPEN33 = null ; Token COMMA35 = null ; Token CLOSE37 = null ; ParserRuleReturnScope primaryExpression34 = null ; ParserRuleReturnScope primaryExpression36 = null ; CommonTree OPEN33_tree = null ; CommonTree COMMA35_tree = null ; CommonTree CLOSE37_tree = null ; RewriteRuleTokenStream stream_OPEN = new RewriteRuleTokenStream ( adaptor , "token OPEN" ) ; RewriteRuleTokenStream stream_CLOSE = new RewriteRuleTokenStream ( adaptor , "token CLOSE" ) ; RewriteRuleTokenStream stream_COMMA = new RewriteRuleTokenStream ( adaptor , "token COMMA" ) ; RewriteRuleSubtreeStream stream_primaryExpression = new RewriteRuleSubtreeStream ( adaptor , "rule primaryExpression" ) ; try { // hql . g : 225:2 : ( OPEN primaryExpression ( COMMA primaryExpression ) * CLOSE - > ^ ( RANGE [ \ " column - spec \ " ] ( primaryExpression ) * ) ) // hql . g : 225:4 : OPEN primaryExpression ( COMMA primaryExpression ) * CLOSE { OPEN33 = ( Token ) match ( input , OPEN , FOLLOW_OPEN_in_insertablePropertySpec865 ) ; stream_OPEN . add ( OPEN33 ) ; pushFollow ( FOLLOW_primaryExpression_in_insertablePropertySpec867 ) ; primaryExpression34 = primaryExpression ( ) ; state . _fsp -- ; stream_primaryExpression . add ( primaryExpression34 . getTree ( ) ) ; // hql . g : 225:27 : ( COMMA primaryExpression ) * loop8 : while ( true ) { int alt8 = 2 ; int LA8_0 = input . LA ( 1 ) ; if ( ( LA8_0 == COMMA ) ) { alt8 = 1 ; } switch ( alt8 ) { case 1 : // hql . g : 225:29 : COMMA primaryExpression { COMMA35 = ( Token ) match ( input , COMMA , FOLLOW_COMMA_in_insertablePropertySpec871 ) ; stream_COMMA . add ( COMMA35 ) ; pushFollow ( FOLLOW_primaryExpression_in_insertablePropertySpec873 ) ; primaryExpression36 = primaryExpression ( ) ; state . _fsp -- ; stream_primaryExpression . add ( primaryExpression36 . getTree ( ) ) ; } break ; default : break loop8 ; } } CLOSE37 = ( Token ) match ( input , CLOSE , FOLLOW_CLOSE_in_insertablePropertySpec878 ) ; stream_CLOSE . add ( CLOSE37 ) ; // AST REWRITE // elements : primaryExpression // token labels : // rule labels : retval // token list labels : // rule list labels : // wildcard labels : retval . tree = root_0 ; RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream ( adaptor , "rule retval" , retval != null ? retval . getTree ( ) : null ) ; root_0 = ( CommonTree ) adaptor . nil ( ) ; // 226:3 : - > ^ ( RANGE [ \ " column - spec \ " ] ( primaryExpression ) * ) { // hql . g : 226:6 : ^ ( RANGE [ \ " column - spec \ " ] ( primaryExpression ) * ) { CommonTree root_1 = ( CommonTree ) adaptor . nil ( ) ; root_1 = ( CommonTree ) adaptor . becomeRoot ( adaptor . create ( RANGE , "column-spec" ) , root_1 ) ; // hql . g : 226:29 : ( primaryExpression ) * while ( stream_primaryExpression . hasNext ( ) ) { adaptor . addChild ( root_1 , stream_primaryExpression . nextTree ( ) ) ; } stream_primaryExpression . reset ( ) ; adaptor . addChild ( root_0 , root_1 ) ; } } retval . tree = root_0 ; } retval . stop = input . LT ( - 1 ) ; retval . tree = ( CommonTree ) adaptor . rulePostProcessing ( root_0 ) ; adaptor . setTokenBoundaries ( retval . tree , retval . start , retval . stop ) ; } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; retval . tree = ( CommonTree ) adaptor . errorNode ( input , retval . start , input . LT ( - 1 ) , re ) ; } finally { // do for sure before leaving } return retval ;
public class AbstractColumnFamilyOutputFormat { /** * Connects to the given server : port and returns a client based on the given socket that points to the configured * keyspace , and is logged in with the configured credentials . * @ param host fully qualified host name to connect to * @ param port RPC port of the server * @ param conf a job configuration * @ return a cassandra client * @ throws Exception set of thrown exceptions may be implementation defined , * depending on the used transport factory */ public static Cassandra . Client createAuthenticatedClient ( String host , int port , Configuration conf ) throws Exception { } }
logger . debug ( "Creating authenticated client for CF output format" ) ; TTransport transport = ConfigHelper . getClientTransportFactory ( conf ) . openTransport ( host , port ) ; TProtocol binaryProtocol = new TBinaryProtocol ( transport , true , true ) ; Cassandra . Client client = new Cassandra . Client ( binaryProtocol ) ; client . set_keyspace ( ConfigHelper . getOutputKeyspace ( conf ) ) ; String user = ConfigHelper . getOutputKeyspaceUserName ( conf ) ; String password = ConfigHelper . getOutputKeyspacePassword ( conf ) ; if ( ( user != null ) && ( password != null ) ) login ( user , password , client ) ; logger . debug ( "Authenticated client for CF output format created successfully" ) ; return client ;
public class Automounter { /** * Add handle to owner , to be auto closed . * @ param owner the handle owner * @ param handle the handle * @ return add result */ public static boolean addHandle ( VirtualFile owner , Closeable handle ) { } }
RegistryEntry entry = getEntry ( owner ) ; return entry . handles . add ( handle ) ;
public class CmsUploadButton { /** * Formats a given bytes value ( file size ) . < p > * @ param filesize the file size to format * @ return the formated file size in KB */ public static String formatBytes ( long filesize ) { } }
double kByte = Math . ceil ( filesize / KILOBYTE ) ; String formated = NumberFormat . getDecimalFormat ( ) . format ( new Double ( kByte ) ) ; return formated + " KB" ;
public class SPX { /** * / * [ deutsch ] * < p > Implementierungsmethode des Interface { @ link Externalizable } . < / p > * @ param in input stream * @ throws IOException in case of I / O - problems * @ throws ClassNotFoundException if class - loading fails */ @ Override public void readExternal ( ObjectInput in ) throws IOException , ClassNotFoundException { } }
int header = in . readByte ( ) ; switch ( header ) { case FIXED_DAY_PATTERN_TYPE : this . obj = readFixedDayPattern ( in ) ; break ; case DAY_OF_WEEK_IN_MONTH_PATTERN_TYPE : this . obj = readDayOfWeekInMonthPattern ( in ) ; break ; case LAST_WEEKDAY_PATTERN_TYPE : this . obj = readLastDayOfWeekPattern ( in ) ; break ; case RULE_BASED_TRANSITION_MODEL_TYPE : this . obj = readRuleBasedTransitionModel ( in ) ; break ; case ARRAY_TRANSITION_MODEL_TYPE : this . obj = readArrayTransitionModel ( in ) ; break ; case COMPOSITE_TRANSITION_MODEL_TYPE : this . obj = readCompositeTransitionModel ( in ) ; break ; default : throw new StreamCorruptedException ( "Unknown serialized type." ) ; }
public class ImageStatistics { /** * Returns the sum of all the pixels in the image . * @ param img Input image . Not modified . */ public static float sum ( InterleavedF32 img ) { } }
if ( BoofConcurrency . USE_CONCURRENT ) { return ImplImageStatistics_MT . sum ( img ) ; } else { return ImplImageStatistics . sum ( img ) ; }
public class NetworkInterfacesInner { /** * Updates a network interface tags . * @ param resourceGroupName The name of the resource group . * @ param networkInterfaceName The name of the network interface . * @ param tags Resource tags . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable for the request */ public Observable < NetworkInterfaceInner > updateTagsAsync ( String resourceGroupName , String networkInterfaceName , Map < String , String > tags ) { } }
return updateTagsWithServiceResponseAsync ( resourceGroupName , networkInterfaceName , tags ) . map ( new Func1 < ServiceResponse < NetworkInterfaceInner > , NetworkInterfaceInner > ( ) { @ Override public NetworkInterfaceInner call ( ServiceResponse < NetworkInterfaceInner > response ) { return response . body ( ) ; } } ) ;
public class Environment { /** * Starts a OS level process . * @ param exec The commandline arguments , including the process to be started . * @ return The Process instance . * @ throws IOException if an underlying I / O exception occurs . */ private static Process startProcess ( String [ ] exec ) throws IOException { } }
Process process = Runtime . getRuntime ( ) . exec ( exec ) ; return process ;
public class EncryptionProtectorsInner { /** * Gets a list of server encryption protectors . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; EncryptionProtectorInner & gt ; object */ public Observable < Page < EncryptionProtectorInner > > listByServerAsync ( final String resourceGroupName , final String serverName ) { } }
return listByServerWithServiceResponseAsync ( resourceGroupName , serverName ) . map ( new Func1 < ServiceResponse < Page < EncryptionProtectorInner > > , Page < EncryptionProtectorInner > > ( ) { @ Override public Page < EncryptionProtectorInner > call ( ServiceResponse < Page < EncryptionProtectorInner > > response ) { return response . body ( ) ; } } ) ;
public class KNXnetIPTunnel { /** * / * ( non - Javadoc ) * @ see tuwien . auto . calimero . knxnetip . ConnectionImpl # handleService * ( tuwien . auto . calimero . knxnetip . servicetype . KNXnetIPHeader , byte [ ] , int ) */ void handleService ( KNXnetIPHeader h , byte [ ] data , int offset ) throws KNXFormatException , IOException { } }
final int svc = h . getServiceType ( ) ; if ( svc == KNXnetIPHeader . TUNNELING_REQ ) { ServiceRequest req ; try { req = PacketHelper . getServiceRequest ( h , data , offset ) ; } catch ( final KNXFormatException e ) { // check if at least the connection header of the service request // is correct and try to get its values req = PacketHelper . getEmptyServiceRequest ( h , data , offset ) ; final byte [ ] junk = new byte [ h . getTotalLength ( ) - h . getStructLength ( ) - 4 ] ; System . arraycopy ( data , offset + 4 , junk , 0 , junk . length ) ; logger . warn ( "received tunneling request with unknown cEMI part " + DataUnitBuilder . toHex ( junk , " " ) , e ) ; } if ( req . getChannelID ( ) != getChannelID ( ) ) { logger . warn ( "received wrong request channel-ID " + req . getChannelID ( ) + ", expected " + getChannelID ( ) + " - ignored" ) ; return ; } final short seq = req . getSequenceNumber ( ) ; if ( seq == getSeqNoRcv ( ) || seq + 1 == getSeqNoRcv ( ) ) { final short status = h . getVersion ( ) == KNXNETIP_VERSION_10 ? ErrorCodes . NO_ERROR : ErrorCodes . VERSION_NOT_SUPPORTED ; final byte [ ] buf = PacketHelper . toPacket ( new ServiceAck ( KNXnetIPHeader . TUNNELING_ACK , getChannelID ( ) , seq , status ) ) ; final DatagramPacket p = new DatagramPacket ( buf , buf . length , dataEP . getAddress ( ) , dataEP . getPort ( ) ) ; socket . send ( p ) ; if ( status == ErrorCodes . VERSION_NOT_SUPPORTED ) { close ( ConnectionCloseEvent . INTERNAL , "protocol version changed" , LogLevel . ERROR , null ) ; return ; } } else logger . warn ( "tunneling request invalid receive-sequence " + seq + ", expected " + getSeqNoRcv ( ) ) ; if ( seq == getSeqNoRcv ( ) ) { incSeqNoRcv ( ) ; final CEMI cemi = req . getCEMI ( ) ; // leave if we are working with an empty ( broken ) service request if ( cemi == null ) return ; if ( cemi . getMessageCode ( ) == CEMILData . MC_LDATA_IND || cemi . getMessageCode ( ) == CEMIBusMon . MC_BUSMON_IND ) fireFrameReceived ( cemi ) ; else if ( cemi . getMessageCode ( ) == CEMILData . MC_LDATA_CON ) { // invariant : notify listener before return from blocking send fireFrameReceived ( cemi ) ; setStateNotify ( OK ) ; } else if ( cemi . getMessageCode ( ) == CEMILData . MC_LDATA_REQ ) logger . warn ( "received L-Data request - ignored" ) ; } } else logger . warn ( "received unknown frame (service type 0x" + Integer . toHexString ( svc ) + ") - ignored" ) ;
public class ProgressWheel { /** * Set the properties of the paints we ' re using to * draw the progress wheel */ private void setupPaints ( ) { } }
barPaint . setColor ( barColor ) ; barPaint . setAntiAlias ( true ) ; barPaint . setStyle ( Style . STROKE ) ; barPaint . setStrokeWidth ( barWidth ) ; rimPaint . setColor ( rimColor ) ; rimPaint . setAntiAlias ( true ) ; rimPaint . setStyle ( Style . STROKE ) ; rimPaint . setStrokeWidth ( rimWidth ) ;
public class BaseDestinationHandler { /** * Recover a BaseDestinationHandler retrieved from the MessageStore . * @ param processor * @ param durableSubscriptionsTable * @ throws Exception */ protected void reconstitute ( MessageProcessor processor , HashMap < String , Object > durableSubscriptionsTable , int startMode ) throws SIResourceException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "reconstitute" , new Object [ ] { processor , durableSubscriptionsTable , Integer . valueOf ( startMode ) } ) ; super . reconstitute ( processor ) ; // Links are ' BaseDestinationHandlers ' but have no destination - like addressibility . if ( ! isLink ( ) ) { _name = getDefinition ( ) . getName ( ) ; _destinationAddr = SIMPUtils . createJsDestinationAddress ( _name , null , getBus ( ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Reconstituting " + ( isPubSub ( ) ? "pubsub" : "ptp" ) + " BaseDestinationHandler " + getName ( ) ) ; String name = getName ( ) ; if ( ( name . startsWith ( SIMPConstants . TEMPORARY_QUEUE_DESTINATION_PREFIX ) || name . startsWith ( SIMPConstants . TEMPORARY_PUBSUB_DESTINATION_PREFIX ) ) ) { _isTemporary = true ; _isSystem = false ; } else { _isTemporary = false ; _isSystem = name . startsWith ( SIMPConstants . SYSTEM_DESTINATION_PREFIX ) ; } /* * Any kind of failure while retrieving data from the message store ( whether * problems with the MS itself or with the data retrieved ) means this * destination should be marked as corrupt . The only time an exception * should be thrown back up to the DM is when the corruption of the * destination is fatal to starting the ME ( such as a corrupt system * destination , currently ) . */ try { // Create appropriate state objects createRealizationAndState ( messageProcessor ) ; // Restore GD ProtocolItemStream before creating InputHandler _protoRealization . getRemoteSupport ( ) . reconstituteGD ( ) ; // Reconstitute message ItemStreams if ( isPubSub ( ) ) { // Indicate that the destinationHandler has not yet been reconciled _reconciled = false ; createControlAdapter ( ) ; // Check if we are running in an ND environment . If not we can skip // some performance intensive WLM work _singleServer = messageProcessor . isSingleServer ( ) ; _pubSubRealization . reconstitute ( startMode , durableSubscriptionsTable ) ; } else { initializeNonPersistent ( processor , durableSubscriptionsTable , null ) ; // Indicate that the destinationHandler has not yet been reconciled _reconciled = false ; _ptoPRealization . reconstitute ( startMode , definition , isToBeDeleted ( ) , isSystem ( ) ) ; } // Reconstitute GD target streams _protoRealization . reconstituteGDTargetStreams ( ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.BaseDestinationHandler.reconstitute" , "1:945:1.700.3.45" , this ) ; SibTr . exception ( tc , e ) ; // At the moment , any exception we get while reconstituting means that we // want to mark the destination as corrupt . _isCorruptOrIndoubt = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "reconstitute" , e ) ; throw new SIResourceException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Reconstituted " + ( isPubSub ( ) ? "pubsub" : "ptp" ) + " BaseDestinationHandler " + getName ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "reconstitute" ) ;
public class Initiator { /** * Creates a new session to a target with the given Internet address and port . The target has the name * < code > targetName < / code > . * @ param targetAddress The Internet address and Port of the target . * @ param targetName Name of the target , to which a connection should be created . * @ throws Exception if any error occurs . */ public final void createSession ( final InetSocketAddress targetAddress , final String targetName ) { } }
final Session session = factory . getSession ( configuration , targetName , targetAddress ) ; sessions . put ( session . getTargetName ( ) , session ) ; LOGGER . info ( "Created the session with iSCSI Target '" + targetName + "' at " + targetAddress . getHostName ( ) + " on port " + targetAddress . getPort ( ) + "." ) ;
public class WalletApi { /** * Get corporation wallet journal Retrieve the given corporation & # 39 ; s * wallet journal for the given division going 30 days back - - - This route * is cached for up to 3600 seconds - - - Requires one of the following EVE * corporation role ( s ) : Accountant , Junior _ Accountant SSO Scope : * esi - wallet . read _ corporation _ wallets . v1 * @ param corporationId * An EVE corporation ID ( required ) * @ param division * Wallet key of the division to fetch journals from ( required ) * @ param datasource * The server name you would like data from ( optional , default to * tranquility ) * @ param ifNoneMatch * ETag from a previous request . A 304 will be returned if this * matches the current ETag ( optional ) * @ param page * Which page of results to return ( optional , default to 1) * @ param token * Access token to use if unable to set a header ( optional ) * @ return ApiResponse & lt ; List & lt ; CorporationWalletJournalResponse & gt ; & gt ; * @ throws ApiException * If fail to call the API , e . g . server error or cannot * deserialize the response body */ public ApiResponse < List < CorporationWalletJournalResponse > > getCorporationsCorporationIdWalletsDivisionJournalWithHttpInfo ( Integer corporationId , Integer division , String datasource , String ifNoneMatch , Integer page , String token ) throws ApiException { } }
com . squareup . okhttp . Call call = getCorporationsCorporationIdWalletsDivisionJournalValidateBeforeCall ( corporationId , division , datasource , ifNoneMatch , page , token , null ) ; Type localVarReturnType = new TypeToken < List < CorporationWalletJournalResponse > > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class ReceiveMessageBuilder { /** * Adds ignore path expression for message element . * @ param path * @ return */ public T ignore ( String path ) { } }
if ( messageType . equalsIgnoreCase ( MessageType . XML . name ( ) ) || messageType . equalsIgnoreCase ( MessageType . XHTML . name ( ) ) ) { xmlMessageValidationContext . getIgnoreExpressions ( ) . add ( path ) ; } else if ( messageType . equalsIgnoreCase ( MessageType . JSON . name ( ) ) ) { jsonMessageValidationContext . getIgnoreExpressions ( ) . add ( path ) ; } return self ;
public class PlaceRegistry { /** * Creates a place manager using the supplied config , injects dependencies into and registers * the supplied list of delegates , runs the supplied pre - startup hook and finally returns it . */ protected PlaceManager createPlace ( PlaceConfig config , List < PlaceManagerDelegate > delegates , PreStartupHook hook ) throws InstantiationException , InvocationException { } }
PlaceManager pmgr = null ; try { // create a place manager using the class supplied in the place config pmgr = createPlaceManager ( config ) ; // if we have delegates , inject their dependencies and add them if ( delegates != null ) { for ( PlaceManagerDelegate delegate : delegates ) { _injector . injectMembers ( delegate ) ; pmgr . addDelegate ( delegate ) ; } } // let the pmgr know about us and its configuration pmgr . init ( this , _invmgr , _omgr , selectLocator ( config ) , config ) ; } catch ( Exception e ) { log . warning ( e ) ; throw new InstantiationException ( "Error creating PlaceManager for " + config ) ; } // let the manager abort the whole process if it fails any permissions checks String errmsg = pmgr . checkPermissions ( ) ; if ( errmsg != null ) { // give the place manager a chance to clean up after its early initialization process pmgr . permissionsFailed ( ) ; throw new InvocationException ( errmsg ) ; } // and create and register the place object PlaceObject plobj = pmgr . createPlaceObject ( ) ; _omgr . registerObject ( plobj ) ; // stick the manager into our table _pmgrs . put ( plobj . getOid ( ) , pmgr ) ; // start the place manager up with the newly created place object try { if ( hook != null ) { hook . invoke ( pmgr ) ; } pmgr . startup ( plobj ) ; } catch ( Exception e ) { log . warning ( "Error starting place manager" , "obj" , plobj , "pmgr" , pmgr , e ) ; } return pmgr ;
public class JsonReader { /** * Parse the number represented by the supplied ( unquoted ) JSON field value . * @ param value the string representation of the value * @ return the number , or null if the value could not be parsed */ public static Number parseNumber ( String value ) { } }
// Try to parse as a number . . . char c = value . charAt ( 0 ) ; if ( ( c >= '0' && c <= '9' ) || c == '.' || c == '-' || c == '+' ) { // It ' s definitely a number . . . if ( c == '0' && value . length ( ) > 2 ) { // it might be a hex number that starts with ' 0x ' char two = value . charAt ( 1 ) ; if ( two == 'x' || two == 'X' ) { try { // Parse the remainder of the hex number . . . return Integer . parseInt ( value . substring ( 2 ) , 16 ) ; } catch ( NumberFormatException e ) { // Ignore and continue . . . } } } // Try parsing as a double . . . try { if ( ( value . indexOf ( '.' ) > - 1 ) || ( value . indexOf ( 'E' ) > - 1 ) || ( value . indexOf ( 'e' ) > - 1 ) ) { return Double . parseDouble ( value ) ; } Long longObj = new Long ( value ) ; long longValue = longObj . longValue ( ) ; int intValue = longObj . intValue ( ) ; if ( longValue == intValue ) { // Then it ' s just an integer . . . return new Integer ( intValue ) ; } return longObj ; } catch ( NumberFormatException e ) { // ignore . . . } } return null ;
public class StartDeliveryStreamEncryptionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( StartDeliveryStreamEncryptionRequest startDeliveryStreamEncryptionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( startDeliveryStreamEncryptionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( startDeliveryStreamEncryptionRequest . getDeliveryStreamName ( ) , DELIVERYSTREAMNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ListUtil { /** * finds a value inside a list , ignore case , ignore empty items * @ param list list to search * @ param value value to find * @ param delimiter delimiter of the list * @ return position in list or 0 */ public static int listFindNoCaseIgnoreEmpty ( String list , String value , String delimiter ) { } }
if ( delimiter . length ( ) == 1 ) return listFindNoCaseIgnoreEmpty ( list , value , delimiter . charAt ( 0 ) ) ; if ( list == null ) return - 1 ; int len = list . length ( ) ; if ( len == 0 ) return - 1 ; int last = 0 ; int count = 0 ; char [ ] del = delimiter . toCharArray ( ) ; char c ; for ( int i = 0 ; i < len ; i ++ ) { c = list . charAt ( i ) ; for ( int y = 0 ; y < del . length ; y ++ ) { if ( c == del [ y ] ) { if ( last < i ) { if ( list . substring ( last , i ) . equalsIgnoreCase ( value ) ) return count ; count ++ ; } last = i + 1 ; break ; } } } if ( last < len ) { if ( list . substring ( last ) . equalsIgnoreCase ( value ) ) return count ; } return - 1 ;
public class LimitedServletInputStream { /** * Implement length limitation on top of the < code > readLine < / code > method of * the wrapped < code > ServletInputStream < / code > . * @ param b an array of bytes into which data is read . * @ param off an integer specifying the character at which * this method begins reading . * @ param len an integer specifying the maximum number of * bytes to read . * @ return an integer specifying the actual number of bytes * read , or - 1 if the end of the stream is reached . * @ exception IOException if an I / O error occurs . */ public int readLine ( byte b [ ] , int off , int len ) throws IOException { } }
int result , left = totalExpected - totalRead ; if ( left <= 0 ) { return - 1 ; } else { result = ( ( ServletInputStream ) in ) . readLine ( b , off , Math . min ( left , len ) ) ; } if ( result > 0 ) { totalRead += result ; } return result ;
public class TypeUtility { /** * Merge type name with suffix . * @ param typeName * the type name * @ param typeNameSuffix * the type name suffix * @ return the class name */ public static ClassName mergeTypeNameWithSuffix ( TypeName typeName , String typeNameSuffix ) { } }
ClassName className = className ( typeName . toString ( ) ) ; return classNameWithSuffix ( className . packageName ( ) , className . simpleName ( ) , typeNameSuffix ) ;
public class Dialogs { /** * Dialog with title " Error " , provided text and exception stacktrace available after pressing ' Details ' button . */ public static DetailsDialog showErrorDialog ( Stage stage , String text , Throwable exception ) { } }
if ( exception == null ) return showErrorDialog ( stage , text , ( String ) null ) ; else return showErrorDialog ( stage , text , getStackTrace ( exception ) ) ;
public class QueryParametersLazyList { /** * Performs cleanup of all resources used by this lazy query output list implementation : { @ link Statement } and { @ link ResultSet } */ public void close ( ) { } }
while ( getCurrentResultSet ( ) != null ) { try { closeResultSet ( getCurrentResultSet ( ) ) ; setCurrentResultSet ( getNextResultSet ( ) ) ; } catch ( SQLException ex ) { // considering that all ResultSets are closed setCurrentResultSet ( null ) ; } } MjdbcUtils . closeQuietly ( stmt ) ;
public class ModelsImpl { /** * Delete an entity role . * @ param appId The application ID . * @ param versionId The version ID . * @ param entityId The entity ID . * @ param roleId The entity role Id . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws ErrorResponseException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the OperationStatus object if successful . */ public OperationStatus deleteRegexEntityRole ( UUID appId , String versionId , UUID entityId , UUID roleId ) { } }
return deleteRegexEntityRoleWithServiceResponseAsync ( appId , versionId , entityId , roleId ) . toBlocking ( ) . single ( ) . body ( ) ;
public class Question { /** * 获取topN候选答案 * @ param topN * @ return topN候选答案 */ public List < CandidateAnswer > getTopNCandidateAnswer ( int topN ) { } }
List < CandidateAnswer > topNcandidateAnswers = new ArrayList < > ( ) ; List < CandidateAnswer > allCandidateAnswers = getAllCandidateAnswer ( ) ; if ( topN > allCandidateAnswers . size ( ) ) { topN = allCandidateAnswers . size ( ) ; } for ( int i = 0 ; i < topN ; i ++ ) { topNcandidateAnswers . add ( allCandidateAnswers . get ( i ) ) ; } return topNcandidateAnswers ;
public class LazyNode { /** * protected void moveInto ( StringBuilder buf , char [ ] source , StringBuilder dirtyBuf ) { * if ( endIndex > - 1 & & type ! = OBJECT & & type ! = ARRAY ) { * int newIndex = buf . length ( ) ; * buf . append ( getStringValue ( source , dirtyBuf ) ) ; * startIndex = newIndex ; * endIndex = buf . length ( ) ; * dirty = true ; * LazyNode pointer = child ; * while ( pointer ! = null ) { * pointer . moveInto ( buf , source , dirtyBuf ) ; * pointer = pointer . next ; */ protected boolean isDirty ( ) { } }
if ( dirty ) { return true ; } if ( child == null ) { return false ; } LazyNode pointer = child ; while ( pointer != null ) { if ( pointer . isDirty ( ) ) return true ; pointer = pointer . next ; } return false ;
public class OAuthClient { /** * Execute queued callbacks once valid OAuth * credentials are acquired . */ protected void executeQueuedCallbacks ( ) { } }
if ( VERBOSE ) Log . i ( TAG , String . format ( "Executing %d queued callbacks" , mCallbackQueue . size ( ) ) ) ; for ( OAuthCallback cb : mCallbackQueue ) { cb . onSuccess ( getRequestFactoryFromCachedCredentials ( ) ) ; }
public class RunCommandParameters { /** * Currently , we support including only one RunCommandTarget block , which specifies either an array of InstanceIds * or a tag . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setRunCommandTargets ( java . util . Collection ) } or { @ link # withRunCommandTargets ( java . util . Collection ) } if * you want to override the existing values . * @ param runCommandTargets * Currently , we support including only one RunCommandTarget block , which specifies either an array of * InstanceIds or a tag . * @ return Returns a reference to this object so that method calls can be chained together . */ public RunCommandParameters withRunCommandTargets ( RunCommandTarget ... runCommandTargets ) { } }
if ( this . runCommandTargets == null ) { setRunCommandTargets ( new java . util . ArrayList < RunCommandTarget > ( runCommandTargets . length ) ) ; } for ( RunCommandTarget ele : runCommandTargets ) { this . runCommandTargets . add ( ele ) ; } return this ;
public class NotificationHubsInner { /** * test send a push notification . * @ param resourceGroupName The name of the resource group . * @ param namespaceName The namespace name . * @ param notificationHubName The notification hub name . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < DebugSendResponseInner > debugSendAsync ( String resourceGroupName , String namespaceName , String notificationHubName , final ServiceCallback < DebugSendResponseInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( debugSendWithServiceResponseAsync ( resourceGroupName , namespaceName , notificationHubName ) , serviceCallback ) ;
public class hqlLexer { /** * $ ANTLR start " BXOR " */ public final void mBXOR ( ) throws RecognitionException { } }
try { int _type = BXOR ; int _channel = DEFAULT_TOKEN_CHANNEL ; // hql . g : 743:6 : ( ' ^ ' ) // hql . g : 743:8 : ' ^ ' { match ( '^' ) ; if ( state . failed ) return ; } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving }
public class LocalSubscriptionControl { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . admin . Controllable # getName ( ) */ public String getName ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getName" ) ; String name = consumerDispatcher . getConsumerDispatcherState ( ) . getSubscriberID ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getName" , name ) ; return name ;
public class TreeVectorizer { /** * Vectorizes the passed in sentences * @ param sentences the sentences to convert to trees * @ return a list of trees pre converted with CNF and * binarized and word vectors at the leaves of the trees * @ throws Exception */ public List < Tree > getTrees ( String sentences ) throws Exception { } }
List < Tree > ret = new ArrayList < > ( ) ; List < Tree > baseTrees = parser . getTrees ( sentences ) ; for ( Tree t : baseTrees ) { Tree binarized = treeTransformer . transform ( t ) ; binarized = cnfTransformer . transform ( binarized ) ; ret . add ( binarized ) ; } return ret ;
public class BundleImportExtender { /** * < p > startUp . < / p > * @ param bundleContext a { @ link org . osgi . framework . BundleContext } object . * @ since 3.0.5 */ @ Activate public void startUp ( BundleContext bundleContext ) { } }
extendedBundleContext = new ExtendedBundle . ExtendedBundleContext ( bundleContext ) ; bundleContext . addBundleListener ( this ) ;
public class LBiObjBoolPredicateBuilder { /** * One of ways of creating builder . This might be the only way ( considering all _ functional _ builders ) that might be utilize to specify generic params only once . */ @ Nonnull public static < T1 , T2 > LBiObjBoolPredicateBuilder < T1 , T2 > biObjBoolPredicate ( Consumer < LBiObjBoolPredicate < T1 , T2 > > consumer ) { } }
return new LBiObjBoolPredicateBuilder ( consumer ) ;
public class GlobalConfiguration { /** * Returns the value associated with the given key as an integer . * @ param key * the key pointing to the associated value * @ param defaultValue * the default value which is returned in case there is no value associated with the given key * @ return the ( default ) value associated with the given key */ private int getIntegerInternal ( final String key , final int defaultValue ) { } }
int retVal = defaultValue ; try { synchronized ( this . confData ) { if ( this . confData . containsKey ( key ) ) { retVal = Integer . parseInt ( this . confData . get ( key ) ) ; } } } catch ( NumberFormatException e ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( StringUtils . stringifyException ( e ) ) ; } } return retVal ;
public class TreeWitnessRewriter { /** * Check if query cq1 is contained in cq2 , syntactically . That is , if the * head of cq1 and cq2 are equal according to toString ( ) . equals and each * atom in cq2 is also in the body of cq1 ( also by means of toString ( ) . equals ( ) . */ private static boolean isContainedIn ( CQIE cq1 , CQIE cq2 ) { } }
if ( ! cq2 . getHead ( ) . equals ( cq1 . getHead ( ) ) ) return false ; for ( Function atom : cq2 . getBody ( ) ) if ( ! cq1 . getBody ( ) . contains ( atom ) ) return false ; return true ;
public class Smb2NegotiateRequest { /** * { @ inheritDoc } * @ see jcifs . internal . CommonServerMessageBlockRequest # size ( ) */ @ Override public int size ( ) { } }
int size = Smb2Constants . SMB2_HEADER_LENGTH + 36 + size8 ( 2 * this . dialects . length , 4 ) ; if ( this . negotiateContexts != null ) { for ( NegotiateContextRequest ncr : this . negotiateContexts ) { size += 8 + size8 ( ncr . size ( ) ) ; } } return size8 ( size ) ;
public class AnnotationOptionValueSource { /** * Returns a converter instance for the given annotation . * @ param annotation the annotation * @ return a converter instance or { @ code null } if the given annotation is no option annotation */ private < A extends Annotation > AnnotationConverter < A > getConverter ( Annotation annotation ) { } }
MappingOption mappingOption = annotation . annotationType ( ) . getAnnotation ( MappingOption . class ) ; if ( mappingOption == null ) { return null ; } // wrong type would be a programming error of the annotation developer @ SuppressWarnings ( "unchecked" ) Class < ? extends AnnotationConverter < A > > converterClass = ( Class < ? extends AnnotationConverter < A > > ) mappingOption . value ( ) ; try { return converterClass . newInstance ( ) ; } catch ( Exception e ) { throw log . cannotConvertAnnotation ( converterClass , e ) ; }
public class PartitionBalance { /** * Go through all nodes and determine how many partition Ids each node * hosts . * @ param cluster * @ return map of nodeId to number of primary partitions hosted on node . */ private Map < Integer , Integer > getNodeIdToPrimaryCount ( Cluster cluster ) { } }
Map < Integer , Integer > nodeIdToPrimaryCount = Maps . newHashMap ( ) ; for ( Node node : cluster . getNodes ( ) ) { nodeIdToPrimaryCount . put ( node . getId ( ) , node . getPartitionIds ( ) . size ( ) ) ; } return nodeIdToPrimaryCount ;
public class FastDeserializer { /** * Read an object from its byte array representation . This is a shortcut * utility method useful when only a single object needs to be deserialized . * @ return The byte array representation for < code > object < / code > . */ public final static < T extends FastSerializable > T deserialize ( final byte [ ] data , final Class < T > expectedType ) throws IOException { } }
final FastDeserializer in = new FastDeserializer ( data ) ; return in . readObject ( expectedType ) ;
public class MicrochipPotentiometerBase { /** * Enables or disables wiper - lock . See chapter 5.3. * @ param enabled wiper - lock for the poti ' s channel has to be enabled * @ throws IOException Thrown if communication fails or device returned a malformed result */ @ Override public void setWiperLock ( final boolean enabled ) throws IOException { } }
controller . setWiperLock ( DeviceControllerChannel . valueOf ( channel ) , enabled ) ;
public class GenericsUtils { /** * It is important to keep possible outer class generics , because they may be used in type declarations . * NOTE : It may be not all generics of owner type , but only visible owner generics . * < pre > { @ code class Outer < T , K > { * / / outer generic T hidden * class Inner < T > { } * } } < / pre > * In order to recover possibly missed outer generics use { @ code extractTypeGenerics ( type , resultedMap ) } * ( may be required for proper owner type to string printing with all generics ) . * @ param type type * @ param generics all type ' s context generics ( self + outer class ) * @ return owner class generics if type is inner class or empty map if not */ public static Map < String , Type > extractOwnerGenerics ( final Class < ? > type , final Map < String , Type > generics ) { } }
final boolean hasOwnerGenerics = type . isMemberClass ( ) && type . getTypeParameters ( ) . length != generics . size ( ) ; if ( ! hasOwnerGenerics ) { return Collections . emptyMap ( ) ; } final LinkedHashMap < String , Type > res = new LinkedHashMap < String , Type > ( generics ) ; // owner generics are all generics not mentioned in signature for ( TypeVariable var : type . getTypeParameters ( ) ) { res . remove ( var . getName ( ) ) ; } return res ;
public class BindingXmlLoader { /** * Helper used to construct a document builder * @ param errors A list for holding any errors that take place * @ return JAXP { @ link DocumentBuilder } * @ throws ParserConfigurationException If the parser cannot be initialised */ private static DocumentBuilder constructDocumentBuilder ( List < SAXParseException > errors ) throws ParserConfigurationException { } }
DocumentBuilderFactory documentBuilderFactory = constructDocumentBuilderFactory ( ) ; DocumentBuilder docBuilder = documentBuilderFactory . newDocumentBuilder ( ) ; docBuilder . setEntityResolver ( new BindingXmlEntityResolver ( ) ) ; docBuilder . setErrorHandler ( new BindingXmlErrorHandler ( errors ) ) ; return docBuilder ;
public class MariaDbStatement { /** * Execute statements . depending on option , queries mays be rewritten : * < p > those queries will be rewritten if possible to INSERT INTO . . . VALUES ( . . . ) ; INSERT INTO . . . * VALUES ( . . . ) ; < / p > * < p > if option rewriteBatchedStatements is set to true , rewritten to INSERT INTO . . . VALUES ( . . . ) , * @ return an array of update counts containing one element for each command in the batch . The * elements of the array are ordered according to the order in which send were added to the * batch . * @ throws SQLException if a database access error occurs , this method is called on a closed * < code > Statement < / code > or the driver does not support batch statements . * Throws { @ link BatchUpdateException } ( a subclass of * < code > SQLException < / code > ) if one of the send sent to the database fails * to execute properly or attempts to return a result set . * @ see # addBatch * @ see DatabaseMetaData # supportsBatchUpdates * @ since 1.3 */ public int [ ] executeBatch ( ) throws SQLException { } }
checkClose ( ) ; int size ; if ( batchQueries == null || ( size = batchQueries . size ( ) ) == 0 ) { return new int [ 0 ] ; } lock . lock ( ) ; try { internalBatchExecution ( size ) ; return results . getCmdInformation ( ) . getUpdateCounts ( ) ; } catch ( SQLException initialSqlEx ) { throw executeBatchExceptionEpilogue ( initialSqlEx , size ) ; } finally { executeBatchEpilogue ( ) ; lock . unlock ( ) ; }
public class ESJDBC { /** * 补充额外的字段和值 * @ param fieldName * @ param dateFormat * @ param value * @ return */ public ESJDBC addFieldValue ( String fieldName , String dateFormat , Object value , String locale , String timeZone ) { } }
this . importBuilder . addFieldValue ( fieldName , dateFormat , value , locale , timeZone ) ; return this ;
public class Settings { /** * Sets the base Facebook domain to use when making Web requests . This defaults to " facebook . com " , but may * be overridden to , e . g . , " beta . facebook . com " to direct requests at a different domain . This method should * never be called from production code . * @ param facebookDomain the base domain to use instead of " facebook . com " */ public static void setFacebookDomain ( String facebookDomain ) { } }
if ( ! BuildConfig . DEBUG ) { Log . w ( TAG , "WARNING: Calling setFacebookDomain from non-DEBUG code." ) ; } Settings . facebookDomain = facebookDomain ;
public class DepictionGenerator { /** * Internal - makes a map of the highlights for reaction mapping . * @ param reactants reaction reactants * @ param products reaction products * @ return the highlight map */ private Map < IChemObject , Color > makeHighlightAtomMap ( List < IAtomContainer > reactants , List < IAtomContainer > products ) { } }
Map < IChemObject , Color > colorMap = new HashMap < > ( ) ; Map < Integer , Color > mapToColor = new HashMap < > ( ) ; int colorIdx = - 1 ; for ( IAtomContainer mol : reactants ) { int prevPalletIdx = colorIdx ; for ( IAtom atom : mol . atoms ( ) ) { int mapidx = accessAtomMap ( atom ) ; if ( mapidx > 0 ) { if ( prevPalletIdx == colorIdx ) { colorIdx ++ ; // select next color if ( colorIdx >= atomMapColors . length ) throw new IllegalArgumentException ( "Not enough colors to highlight atom mapping, please provide mode" ) ; } Color color = atomMapColors [ colorIdx ] ; colorMap . put ( atom , color ) ; mapToColor . put ( mapidx , color ) ; } } if ( colorIdx > prevPalletIdx ) { for ( IBond bond : mol . bonds ( ) ) { IAtom a1 = bond . getBegin ( ) ; IAtom a2 = bond . getEnd ( ) ; Color c1 = colorMap . get ( a1 ) ; Color c2 = colorMap . get ( a2 ) ; if ( c1 != null && c1 == c2 ) colorMap . put ( bond , c1 ) ; } } } for ( IAtomContainer mol : products ) { for ( IAtom atom : mol . atoms ( ) ) { int mapidx = accessAtomMap ( atom ) ; if ( mapidx > 0 ) { colorMap . put ( atom , mapToColor . get ( mapidx ) ) ; } } for ( IBond bond : mol . bonds ( ) ) { IAtom a1 = bond . getBegin ( ) ; IAtom a2 = bond . getEnd ( ) ; Color c1 = colorMap . get ( a1 ) ; Color c2 = colorMap . get ( a2 ) ; if ( c1 != null && c1 == c2 ) colorMap . put ( bond , c1 ) ; } } return colorMap ;
public class TimeSeries { /** * Pushes a new data point . * Exponential moving average is calculated , and the { @ link # history } is updated . * This method needs to be called periodically and regularly , and it represents * the raw data stream . */ public void update ( float newData ) { } }
float data = history [ 0 ] * decay + newData * ( 1 - decay ) ; float [ ] r = new float [ Math . min ( history . length + 1 , historySize ) ] ; System . arraycopy ( history , 0 , r , 1 , Math . min ( history . length , r . length - 1 ) ) ; r [ 0 ] = data ; history = r ;
public class Source { /** * / * pp */ void init ( Preprocessor pp ) { } }
setListener ( pp . getListener ( ) ) ; this . werror = pp . getWarnings ( ) . contains ( Warning . ERROR ) ;
public class QuickSelect { /** * Compute the median of an array efficiently using the QuickSelect method . * On an odd length , it will return the lower element . * Note : the array is < b > modified < / b > by this . * @ param < T > object type * @ param data Data to process * @ param comparator Comparator to use * @ param begin Begin of valid values * @ param end End of valid values ( exclusive ! ) * @ return Median value */ public static < T > T median ( List < ? extends T > data , Comparator < ? super T > comparator , int begin , int end ) { } }
final int length = end - begin ; assert ( length > 0 ) ; // Integer division is " floor " since we are non - negative . final int left = begin + ( ( length - 1 ) >> 1 ) ; quickSelect ( data , comparator , begin , end , left ) ; return data . get ( left ) ;
public class SMPPSession { /** * / * ( non - Javadoc ) * @ see org . jsmpp . session . ClientSession # queryShortMessage ( java . lang . String , org . jsmpp . bean . TypeOfNumber , org . jsmpp . bean . NumberingPlanIndicator , java . lang . String ) */ public QuerySmResult queryShortMessage ( String messageId , TypeOfNumber sourceAddrTon , NumberingPlanIndicator sourceAddrNpi , String sourceAddr ) throws PDUException , ResponseTimeoutException , InvalidResponseException , NegativeResponseException , IOException { } }
ensureTransmittable ( "queryShortMessage" ) ; QuerySmCommandTask task = new QuerySmCommandTask ( pduSender ( ) , messageId , sourceAddrTon , sourceAddrNpi , sourceAddr ) ; QuerySmResp resp = ( QuerySmResp ) executeSendCommand ( task , getTransactionTimer ( ) ) ; if ( resp . getMessageId ( ) . equals ( messageId ) ) { return new QuerySmResult ( resp . getFinalDate ( ) , resp . getMessageState ( ) , resp . getErrorCode ( ) ) ; } else { // message id requested not same as the returned throw new InvalidResponseException ( "Requested message_id doesn't match with the result" ) ; }
public class ResolverServiceImpl { /** * { @ inheritDoc } */ @ Override public List < KamNode > resolveNodes ( Kam kam , List < Node > nodes ) throws ResolverServiceException { } }
final List < KamNode > resolvedKamNodes = sizedArrayList ( nodes . size ( ) ) ; final Equivalencer eq = getEquivalencer ( ) ; Map < String , String > nsmap = namespaces ( kam ) ; for ( final Node node : nodes ) { if ( node == null || node . getLabel ( ) == null ) { throw new InvalidArgument ( "Node is invalid." ) ; } String bel = node . getLabel ( ) ; try { resolvedKamNodes . add ( convert ( kam . getKamInfo ( ) , resolver . resolve ( kam , kAMStore , bel , nsmap , eq ) ) ) ; } catch ( ResolverException e ) { String fmt = "Failed to resolve BEL node %s." ; throw new ResolverServiceException ( format ( fmt , bel ) , e ) ; } } return resolvedKamNodes ;
public class ClusteringSetupTab { /** * < / editor - fold > / / GEN - END : initComponents */ private void buttonImportSettingsActionPerformed ( java . awt . event . ActionEvent evt ) { } }
// GEN - FIRST : event _ buttonImportSettingsActionPerformed BaseFileChooser fileChooser = new BaseFileChooser ( ) ; fileChooser . setAcceptAllFileFilterUsed ( true ) ; fileChooser . addChoosableFileFilter ( new FileExtensionFilter ( "txt" ) ) ; if ( lastfile != null ) fileChooser . setSelectedFile ( new File ( lastfile ) ) ; if ( fileChooser . showOpenDialog ( this . buttonImportSettings ) == BaseFileChooser . APPROVE_OPTION ) { lastfile = fileChooser . getSelectedFile ( ) . getPath ( ) ; loadOptionsFromFile ( fileChooser . getSelectedFile ( ) . getPath ( ) ) ; }
public class BaseSession { /** * Get the screen query . * @ return The screen record ( or null if none ) . */ public Record getScreenRecord ( ) { } }
Record record = super . getScreenRecord ( ) ; if ( record == null ) if ( m_sessionObjectParent != null ) record = ( ( BaseSession ) m_sessionObjectParent ) . getScreenRecord ( ) ; // Look thru the parent window now return record ;
public class AjaxPollingWButtonExample { /** * { @ inheritDoc } */ @ Override protected void preparePaintComponent ( final Request request ) { } }
super . preparePaintComponent ( request ) ; if ( Cache . getCache ( ) . get ( DATA_KEY ) != null ) { poller . disablePoll ( ) ; }
public class TraversalPlanner { /** * Create a plan using Edmonds ' algorithm with greedy approach to execute a single conjunction * @ param query the conjunction query to find a traversal plan * @ return a semi - optimal traversal plan to execute the given conjunction */ private static List < Fragment > planForConjunction ( ConjunctionQuery query , TransactionOLTP tx ) { } }
// a query plan is an ordered list of fragments final List < Fragment > plan = new ArrayList < > ( ) ; // flatten all the possible fragments from the conjunction query ( these become edges in the query graph ) final Set < Fragment > allFragments = query . getEquivalentFragmentSets ( ) . stream ( ) . flatMap ( EquivalentFragmentSet :: stream ) . collect ( Collectors . toSet ( ) ) ; // if role players ' types are known , we can infer the types of the relation , adding label & isa fragments Set < Fragment > inferredFragments = inferRelationTypes ( tx , allFragments ) ; allFragments . addAll ( inferredFragments ) ; // convert fragments into nodes - some fragments create virtual middle nodes to ensure the Janus edge is traversed ImmutableMap < NodeId , Node > queryGraphNodes = buildNodesWithDependencies ( allFragments ) ; // it ' s possible that some ( or all ) fragments are disconnected , e . g . $ x isa person ; $ y isa dog ; Collection < Set < Fragment > > connectedFragmentSets = getConnectedFragmentSets ( allFragments ) ; // build a query plan for each query subgraph separately for ( Set < Fragment > connectedFragments : connectedFragmentSets ) { // one of two cases - either we have a connected graph > 1 node , which is used to compute a MST , OR exactly 1 node Arborescence < Node > subgraphArborescence = computeArborescence ( connectedFragments , queryGraphNodes , tx ) ; if ( subgraphArborescence != null ) { // collect the mapping from directed edge back to fragments - - inverse operation of creating virtual middle nodes Map < Node , Map < Node , Fragment > > middleNodeFragmentMapping = virtualMiddleNodeToFragmentMapping ( connectedFragments , queryGraphNodes ) ; List < Fragment > subplan = GreedyTreeTraversal . greedyTraversal ( subgraphArborescence , queryGraphNodes , middleNodeFragmentMapping ) ; plan . addAll ( subplan ) ; } else { // find and include all the nodes not touched in the MST in the plan Set < Node > unhandledNodes = connectedFragments . stream ( ) . flatMap ( fragment -> fragment . getNodes ( ) . stream ( ) ) . map ( node -> queryGraphNodes . get ( node . getNodeId ( ) ) ) . collect ( Collectors . toSet ( ) ) ; if ( unhandledNodes . size ( ) != 1 ) { throw GraknServerException . create ( "Query planner exception - expected one unhandled node, found " + unhandledNodes . size ( ) ) ; } plan . addAll ( nodeToPlanFragments ( Iterators . getOnlyElement ( unhandledNodes . iterator ( ) ) , queryGraphNodes , false ) ) ; } } // this shouldn ' t be necessary , but we keep it just in case of an edge case that we haven ' t thought of List < Fragment > remainingFragments = fragmentsForUnvisitedNodes ( queryGraphNodes , queryGraphNodes . values ( ) ) ; if ( remainingFragments . size ( ) > 0 ) { LOG . warn ( "Expected all fragments to be handled, but found these: " + remainingFragments ) ; plan . addAll ( remainingFragments ) ; } LOG . trace ( "Greedy Plan = {}" , plan ) ; return plan ;
public class GrpcBlockingStream { /** * Cancels the stream . */ public void cancel ( ) { } }
if ( isOpen ( ) ) { LOG . debug ( "Cancelling stream ({})" , mDescription ) ; mCanceled = true ; mRequestObserver . cancel ( "Request is cancelled by user." , null ) ; }
public class AutoValueOrOneOfProcessor { /** * Implements the semantics of { @ code AutoValue . CopyAnnotations } ; see its javadoc . */ private ImmutableList < String > copyAnnotations ( Element autoValueType , Element typeOrMethod , Set < String > excludedAnnotations ) { } }
ImmutableList < AnnotationMirror > annotationsToCopy = annotationsToCopy ( autoValueType , typeOrMethod , excludedAnnotations ) ; return annotationStrings ( annotationsToCopy ) ;
public class Node { /** * Gets the JsDoc comment string attached to this node . * @ return the comment string or { @ code null } if no JsDoc is attached to * this node */ public String getJsDoc ( ) { } }
Comment comment = getJsDocNode ( ) ; if ( comment != null ) { return comment . getValue ( ) ; } return null ;
public class MessageDialog { /** * Shortcut for quickly displaying a message box * @ param textGUI The GUI to display the message box on * @ param title Title of the message box * @ param text Main message of the message box * @ param buttons Buttons that the user can confirm the message box with * @ return Which button the user selected */ public static MessageDialogButton showMessageDialog ( WindowBasedTextGUI textGUI , String title , String text , MessageDialogButton ... buttons ) { } }
MessageDialogBuilder builder = new MessageDialogBuilder ( ) . setTitle ( title ) . setText ( text ) ; if ( buttons . length == 0 ) { builder . addButton ( MessageDialogButton . OK ) ; } for ( MessageDialogButton button : buttons ) { builder . addButton ( button ) ; } return builder . build ( ) . showDialog ( textGUI ) ;
public class CSP2SourceList { /** * Add the provided nonce value . The { @ value # HASH _ PREFIX } and * { @ link # HASH _ SUFFIX } are added automatically . The byte array is automatically * Bas64 encoded ! * @ param eMDAlgo * The message digest algorithm used . May only * { @ link EMessageDigestAlgorithm # SHA _ 256 } , * { @ link EMessageDigestAlgorithm # SHA _ 384 } or * { @ link EMessageDigestAlgorithm # SHA _ 512 } . May not be < code > null < / code > . * @ param aHashValue * The plain hash digest value . May not be < code > null < / code > . * @ return this for chaining */ @ Nonnull public CSP2SourceList addHash ( @ Nonnull final EMessageDigestAlgorithm eMDAlgo , @ Nonnull @ Nonempty final byte [ ] aHashValue ) { } }
ValueEnforcer . notEmpty ( aHashValue , "HashValue" ) ; return addHash ( eMDAlgo , Base64 . safeEncodeBytes ( aHashValue ) ) ;
public class Start { /** * Init the doclet invoker . * The doclet class may be given explicitly , or via the - doclet option in * argv . * If the doclet class is not given explicitly , it will be loaded from * the file manager ' s DOCLET _ PATH location , if available , or via the * - doclet path option in argv . * @ param docletClass The doclet class . May be null . * @ param fileManager The file manager used to get the class loader to load * the doclet class if required . May be null . * @ param argv Args containing - doclet and - docletpath , in case they are required . */ private void setDocletInvoker ( Class < ? > docletClass , JavaFileManager fileManager , String [ ] argv ) { } }
boolean exportInternalAPI = false ; String docletClassName = null ; String docletPath = null ; // Parse doclet specifying arguments for ( int i = 0 ; i < argv . length ; i ++ ) { String arg = argv [ i ] ; if ( arg . equals ( ToolOption . DOCLET . opt ) ) { oneArg ( argv , i ++ ) ; if ( docletClassName != null ) { usageError ( "main.more_than_one_doclet_specified_0_and_1" , docletClassName , argv [ i ] ) ; } docletClassName = argv [ i ] ; } else if ( arg . equals ( ToolOption . DOCLETPATH . opt ) ) { oneArg ( argv , i ++ ) ; if ( docletPath == null ) { docletPath = argv [ i ] ; } else { docletPath += File . pathSeparator + argv [ i ] ; } } else if ( arg . equals ( "-XDaccessInternalAPI" ) ) { exportInternalAPI = true ; } } if ( docletClass != null ) { // TODO , check no - doclet , - docletpath docletInvoker = new DocletInvoker ( messager , docletClass , apiMode , exportInternalAPI ) ; } else { if ( docletClassName == null ) { docletClassName = defaultDocletClassName ; } // attempt to find doclet docletInvoker = new DocletInvoker ( messager , fileManager , docletClassName , docletPath , docletParentClassLoader , apiMode , exportInternalAPI ) ; }
public class OutboundResourceadapterTypeImpl { /** * If not already created , a new < code > connection - definition < / code > element will be created and returned . * Otherwise , the first existing < code > connection - definition < / code > element will be returned . * @ return the instance defined for the element < code > connection - definition < / code > */ public ConnectionDefinitionType < OutboundResourceadapterType < T > > getOrCreateConnectionDefinition ( ) { } }
List < Node > nodeList = childNode . get ( "connection-definition" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new ConnectionDefinitionTypeImpl < OutboundResourceadapterType < T > > ( this , "connection-definition" , childNode , nodeList . get ( 0 ) ) ; } return createConnectionDefinition ( ) ;
public class JmsJMSContextImpl { /** * ( non - Javadoc ) * @ see javax . jms . JMSContext # getMetaData ( ) */ @ Override public ConnectionMetaData getMetaData ( ) throws JMSRuntimeException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getMetaData" ) ; ConnectionMetaData connectionMetaData = null ; try { connectionMetaData = jmsConnection . getMetaData ( ) ; } catch ( JMSException jmse ) { throw ( JMSRuntimeException ) JmsErrorUtils . getJMS2Exception ( jmse , JMSRuntimeException . class ) ; } finally { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getMetaData" , new Object [ ] { connectionMetaData } ) ; } return connectionMetaData ;
public class BlueCasUtil { /** * Whether this document should be kept for analysis , based on : * < ul > * < li > language = = en < / li > * < li > OOV < 0.4 ( see { @ link TooMuchOOVFilterAnnotator } ) < / li > * < li > Enough tokens per page ( see { @ link TooFewTokensFilterAnnotator } ) < / li > * < / ul > */ public static boolean keepDoc ( JCas jCas ) { } }
String lang = jCas . getDocumentLanguage ( ) ; if ( lang . equals ( "x-unspecified" ) ) { LOG . warn ( "document language needed to decide whether to keepDoc(), but document language is not set, pmId" + getHeaderDocId ( jCas ) ) ; } if ( ! ( lang . equals ( "en" ) || lang . equals ( "x-unspecified" ) ) || exists ( jCas , TooFewTokensPerPage . class ) || exists ( jCas , TooManyOOV . class ) ) { return false ; } return true ;
public class ApiOvhMe { /** * Finalize one payment method registration * REST : POST / me / payment / method / { paymentMethodId } / finalize * @ param paymentMethodId [ required ] Payment method ID * @ param expirationMonth [ required ] Expiration month * @ param expirationYear [ required ] Expiration year * @ param registrationId [ required ] Registration ID * API beta */ public OvhPaymentMethod payment_thod_paymentMethodId_finalize_POST ( Long paymentMethodId , Long expirationMonth , Long expirationYear , String registrationId ) throws IOException { } }
String qPath = "/me/payment/method/{paymentMethodId}/finalize" ; StringBuilder sb = path ( qPath , paymentMethodId ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "expirationMonth" , expirationMonth ) ; addBody ( o , "expirationYear" , expirationYear ) ; addBody ( o , "registrationId" , registrationId ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhPaymentMethod . class ) ;
public class JBasePanel { /** * Add the optional scrollers and toolbars to this screen . * @ param baseScreen The new screen ( which has information on scrollers , toolbars , etc ) . */ public JComponent setupNewScreen ( JBasePanel baseScreen ) { } }
JComponent screen = baseScreen ; if ( baseScreen . isAddScrollbars ( ) ) // Add scrollbars ? screen = this . addScrollbars ( screen ) ; return this . setupMenuAndToolbar ( baseScreen , screen ) ;
public class PlaybackService { /** * Unregister a registered listener . * @ param context context used to unregister the listener . * @ param listener listener to unregister . */ public static void unregisterListener ( Context context , PlaybackListener listener ) { } }
LocalBroadcastManager . getInstance ( context . getApplicationContext ( ) ) . unregisterReceiver ( listener ) ;
public class DefaultFileSet { /** * Creates a new builder with the specified base folder and manifest . * @ param baseFolder the base folder * @ param manifest the manifest * @ return returns a new builder * @ throws IllegalArgumentException if the manifest isn ' t a descendant of the base folder */ public static DefaultFileSet . Builder with ( BaseFolder baseFolder , AnnotatedFile manifest ) { } }
return new Builder ( baseFolder , manifest ) ;
public class ModelControllerImpl { /** * Creates a set of child types that are not { @ linkplain ImmutableManagementResourceRegistration # isRemote ( ) remote } * or { @ linkplain ImmutableManagementResourceRegistration # isRuntimeOnly ( ) runtime } child types . * @ param mrr the resource registration to process the child types for * @ return a collection of non - remote and non - runtime only child types */ private static Set < String > getNonIgnoredChildTypes ( ImmutableManagementResourceRegistration mrr ) { } }
final Set < String > result = new LinkedHashSet < > ( ) ; for ( PathElement pe : mrr . getChildAddresses ( PathAddress . EMPTY_ADDRESS ) ) { ImmutableManagementResourceRegistration childMrr = mrr . getSubModel ( PathAddress . pathAddress ( pe ) ) ; if ( childMrr != null && ! childMrr . isRemote ( ) && ! childMrr . isRuntimeOnly ( ) ) { result . add ( pe . getKey ( ) ) ; } } return result ;
public class State { /** * { @ inheritDoc } */ @ Override public < B > State < S , B > zip ( Applicative < Function < ? super A , ? extends B > , State < S , ? > > appFn ) { } }
return Monad . super . zip ( appFn ) . coerce ( ) ;
public class MessageDetailScreen { /** * Set up all the screen fields . */ public void setupSFields ( ) { } }
this . getRecord ( MessageDetail . MESSAGE_DETAIL_FILE ) . getField ( MessageDetail . MESSAGE_TRANSPORT_ID ) . setupDefaultView ( this . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . ANCHOR_DEFAULT ) , this , ScreenConstants . DEFAULT_DISPLAY ) ; this . getRecord ( MessageDetail . MESSAGE_DETAIL_FILE ) . getField ( MessageDetail . DEFAULT_MESSAGE_VERSION_ID ) . setupDefaultView ( this . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . ANCHOR_DEFAULT ) , this , ScreenConstants . DEFAULT_DISPLAY ) ; this . getRecord ( MessageDetail . MESSAGE_DETAIL_FILE ) . getField ( MessageDetail . MESSAGE_PROCESS_INFO_ID ) . setupDefaultView ( this . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . ANCHOR_DEFAULT ) , this , ScreenConstants . DEFAULT_DISPLAY ) ; this . getRecord ( MessageDetail . MESSAGE_DETAIL_FILE ) . getField ( MessageDetail . DESTINATION_SITE ) . setupDefaultView ( this . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . ANCHOR_DEFAULT ) , this , ScreenConstants . DEFAULT_DISPLAY ) ; this . getRecord ( MessageDetail . MESSAGE_DETAIL_FILE ) . getField ( MessageDetail . DESTINATION_PATH ) . setupDefaultView ( this . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . ANCHOR_DEFAULT ) , this , ScreenConstants . DEFAULT_DISPLAY ) ; this . getRecord ( MessageDetail . MESSAGE_DETAIL_FILE ) . getField ( MessageDetail . RETURN_SITE ) . setupDefaultView ( this . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . ANCHOR_DEFAULT ) , this , ScreenConstants . DEFAULT_DISPLAY ) ; this . getRecord ( MessageDetail . MESSAGE_DETAIL_FILE ) . getField ( MessageDetail . XSLT_DOCUMENT ) . setupDefaultView ( this . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . ANCHOR_DEFAULT ) , this , ScreenConstants . DEFAULT_DISPLAY ) ; Converter convDefaultTransport = new CheckConverter ( this . getRecord ( MessageDetail . MESSAGE_DETAIL_FILE ) . getField ( MessageDetail . DEFAULT_MESSAGE_TRANSPORT_ID ) , this . getRecord ( MessageDetail . MESSAGE_DETAIL_FILE ) . getField ( MessageDetail . MESSAGE_TRANSPORT_ID ) , null , true ) ; convDefaultTransport . setupDefaultView ( this . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . ANCHOR_DEFAULT ) , this , ScreenConstants . DEFAULT_DISPLAY ) ; this . getRecord ( MessageDetail . MESSAGE_DETAIL_FILE ) . getField ( MessageDetail . INITIAL_MANUAL_TRANSPORT_STATUS_ID ) . setupDefaultView ( this . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . ANCHOR_DEFAULT ) , this , ScreenConstants . DEFAULT_DISPLAY ) ; this . getRecord ( MessageDetail . MESSAGE_DETAIL_FILE ) . getField ( MessageDetail . PROPERTIES ) . setupDefaultView ( this . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . ANCHOR_DEFAULT ) , this , ScreenConstants . DEFAULT_DISPLAY ) ;
public class CommerceShippingFixedOptionRelPersistenceImpl { /** * Clears the cache for all commerce shipping fixed option rels . * The { @ link EntityCache } and { @ link FinderCache } are both cleared by this method . */ @ Override public void clearCache ( ) { } }
entityCache . clearCache ( CommerceShippingFixedOptionRelImpl . class ) ; finderCache . clearCache ( FINDER_CLASS_NAME_ENTITY ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITH_PAGINATION ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION ) ;
public class CalendarView { /** * $ NON - NLS - 1 $ */ @ Override public ObservableList < Item > getPropertySheetItems ( ) { } }
ObservableList < Item > items = super . getPropertySheetItems ( ) ; items . add ( new Item ( ) { @ Override public Optional < ObservableValue < ? > > getObservableValue ( ) { return Optional . of ( showSourceTrayProperty ( ) ) ; } @ Override public void setValue ( Object value ) { setShowSourceTray ( ( boolean ) value ) ; } @ Override public Object getValue ( ) { return isShowSourceTray ( ) ; } @ Override public Class < ? > getType ( ) { return Boolean . class ; } @ Override public String getName ( ) { return "Calendar Tray" ; // $ NON - NLS - 1 $ } @ Override public String getDescription ( ) { return "Show or hide the calendar tray on the left" ; // $ NON - NLS - 1 $ } @ Override public String getCategory ( ) { return CALENDAR_VIEW_CATEGORY ; } } ) ; items . add ( new Item ( ) { @ Override public Optional < ObservableValue < ? > > getObservableValue ( ) { return Optional . of ( showSearchResultsTrayProperty ( ) ) ; } @ Override public void setValue ( Object value ) { setShowSearchResultsTray ( ( boolean ) value ) ; } @ Override public Object getValue ( ) { return isShowSearchResultsTray ( ) ; } @ Override public Class < ? > getType ( ) { return Boolean . class ; } @ Override public String getName ( ) { return "Search Results Tray" ; // $ NON - NLS - 1 $ } @ Override public String getDescription ( ) { return "Show or hide the search results tray on the right" ; // $ NON - NLS - 1 $ } @ Override public String getCategory ( ) { return CALENDAR_VIEW_CATEGORY ; } } ) ; items . add ( new Item ( ) { @ Override public Optional < ObservableValue < ? > > getObservableValue ( ) { return Optional . of ( transitionsEnabledProperty ( ) ) ; } @ Override public void setValue ( Object value ) { setTransitionsEnabled ( ( boolean ) value ) ; } @ Override public Object getValue ( ) { return isTransitionsEnabled ( ) ; } @ Override public Class < ? > getType ( ) { return Boolean . class ; } @ Override public String getName ( ) { return "Transitions" ; // $ NON - NLS - 1 $ } @ Override public String getDescription ( ) { return "Use transitions when changing pages." ; // $ NON - NLS - 1 $ } @ Override public String getCategory ( ) { return CALENDAR_VIEW_CATEGORY ; } } ) ; items . add ( new Item ( ) { @ Override public Optional < ObservableValue < ? > > getObservableValue ( ) { return Optional . of ( showSearchFieldProperty ( ) ) ; } @ Override public void setValue ( Object value ) { setShowSearchField ( ( boolean ) value ) ; } @ Override public Object getValue ( ) { return isShowSearchField ( ) ; } @ Override public Class < ? > getType ( ) { return Boolean . class ; } @ Override public String getName ( ) { return "Show Search Field" ; // $ NON - NLS - 1 $ } @ Override public String getDescription ( ) { return "Can the user access the search field or not." ; // $ NON - NLS - 1 $ } @ Override public String getCategory ( ) { return CALENDAR_VIEW_CATEGORY ; } } ) ; items . add ( new Item ( ) { @ Override public Optional < ObservableValue < ? > > getObservableValue ( ) { return Optional . of ( showSourceTrayButtonProperty ( ) ) ; } @ Override public void setValue ( Object value ) { setShowSourceTrayButton ( ( boolean ) value ) ; } @ Override public Object getValue ( ) { return isShowSourceTrayButton ( ) ; } @ Override public Class < ? > getType ( ) { return Boolean . class ; } @ Override public String getName ( ) { return "Source Tray Button" ; // $ NON - NLS - 1 $ } @ Override public String getDescription ( ) { return "Can the user access the source tray button or not." ; // $ NON - NLS - 1 $ } @ Override public String getCategory ( ) { return CALENDAR_VIEW_CATEGORY ; } } ) ; items . add ( new Item ( ) { @ Override public Optional < ObservableValue < ? > > getObservableValue ( ) { return Optional . of ( showAddCalendarButtonProperty ( ) ) ; } @ Override public void setValue ( Object value ) { setShowAddCalendarButton ( ( boolean ) value ) ; } @ Override public Object getValue ( ) { return isShowAddCalendarButton ( ) ; } @ Override public Class < ? > getType ( ) { return Boolean . class ; } @ Override public String getName ( ) { return "Add Calendar Button" ; // $ NON - NLS - 1 $ } @ Override public String getDescription ( ) { return "Can the user access the button to add new calendars or not." ; // $ NON - NLS - 1 $ } @ Override public String getCategory ( ) { return CALENDAR_VIEW_CATEGORY ; } } ) ; items . add ( new Item ( ) { @ Override public Optional < ObservableValue < ? > > getObservableValue ( ) { return Optional . of ( showPrintButtonProperty ( ) ) ; } @ Override public void setValue ( Object value ) { setShowPrintButton ( ( boolean ) value ) ; } @ Override public Object getValue ( ) { return isShowPrintButton ( ) ; } @ Override public Class < ? > getType ( ) { return Boolean . class ; } @ Override public String getName ( ) { return "Print Button" ; // $ NON - NLS - 1 $ } @ Override public String getDescription ( ) { return "Can the user access the button to print calendars or not." ; // $ NON - NLS - 1 $ } @ Override public String getCategory ( ) { return CALENDAR_VIEW_CATEGORY ; } } ) ; items . add ( new Item ( ) { @ Override public Optional < ObservableValue < ? > > getObservableValue ( ) { return Optional . of ( showPageToolBarControlsProperty ( ) ) ; } @ Override public void setValue ( Object value ) { setShowPageToolBarControls ( ( boolean ) value ) ; } @ Override public Object getValue ( ) { return isShowPageToolBarControls ( ) ; } @ Override public Class < ? > getType ( ) { return Boolean . class ; } @ Override public String getName ( ) { return "Page Controls" ; // $ NON - NLS - 1 $ } @ Override public String getDescription ( ) { return "Can the user access the page-specific toolbar controls or not." ; // $ NON - NLS - 1 $ } @ Override public String getCategory ( ) { return CALENDAR_VIEW_CATEGORY ; } } ) ; items . add ( new Item ( ) { @ Override public Optional < ObservableValue < ? > > getObservableValue ( ) { return Optional . of ( showPageSwitcherProperty ( ) ) ; } @ Override public void setValue ( Object value ) { setShowPageSwitcher ( ( boolean ) value ) ; } @ Override public Object getValue ( ) { return isShowPageSwitcher ( ) ; } @ Override public Class < ? > getType ( ) { return Boolean . class ; } @ Override public String getName ( ) { return "Show Page Switcher" ; // $ NON - NLS - 1 $ } @ Override public String getDescription ( ) { return "Visibility of the switcher." ; // $ NON - NLS - 1 $ } @ Override public String getCategory ( ) { return CALENDAR_VIEW_CATEGORY ; } } ) ; items . add ( new Item ( ) { @ Override public Optional < ObservableValue < ? > > getObservableValue ( ) { return Optional . of ( showToolBarProperty ( ) ) ; } @ Override public void setValue ( Object value ) { setShowToolBar ( ( boolean ) value ) ; } @ Override public Object getValue ( ) { return isShowToolBar ( ) ; } @ Override public Class < ? > getType ( ) { return Boolean . class ; } @ Override public String getName ( ) { return "Show ToolBar" ; // $ NON - NLS - 1 $ } @ Override public String getDescription ( ) { return "Visibility of the toolbar." ; // $ NON - NLS - 1 $ } @ Override public String getCategory ( ) { return CALENDAR_VIEW_CATEGORY ; } } ) ; return items ;
public class UpdateForClause { /** * Creates an updateFor clause that starts with < code > FOR variable WITHIN path < / code > . * @ param variable the first variable in the clause . * @ param path the first path in the clause , a WITHIN path . * @ return the clause , for chaining . See { @ link # when ( Expression ) } and { @ link # end ( ) } to complete the clause . */ public static UpdateForClause forWithin ( String variable , String path ) { } }
UpdateForClause clause = new UpdateForClause ( ) ; return clause . within ( variable , path ) ;
public class WordDictionary { /** * for ES to initialize the user dictionary . * @ param configFile */ public void init ( Path configFile ) { } }
String abspath = configFile . toAbsolutePath ( ) . toString ( ) ; System . out . println ( "initialize user dictionary:" + abspath ) ; synchronized ( WordDictionary . class ) { if ( loadedPath . contains ( abspath ) ) return ; DirectoryStream < Path > stream ; try { stream = Files . newDirectoryStream ( configFile , String . format ( Locale . getDefault ( ) , "*%s" , USER_DICT_SUFFIX ) ) ; for ( Path path : stream ) { System . err . println ( String . format ( Locale . getDefault ( ) , "loading dict %s" , path . toString ( ) ) ) ; singleton . loadUserDict ( path ) ; } loadedPath . add ( abspath ) ; } catch ( IOException e ) { // TODO Auto - generated catch block // e . printStackTrace ( ) ; System . err . println ( String . format ( Locale . getDefault ( ) , "%s: load user dict failure!" , configFile . toString ( ) ) ) ; } }
public class EditShape { /** * Returns the value of the given user index of a path */ int getPathUserIndex ( int path , int index ) { } }
int pindex = getPathIndex_ ( path ) ; AttributeStreamOfInt32 stream = m_pathindices . get ( index ) ; if ( pindex < stream . size ( ) ) return stream . read ( pindex ) ; else return - 1 ;