idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
3,400
public static tunnelglobal_tunneltrafficpolicy_binding [ ] get ( nitro_service service ) throws Exception { tunnelglobal_tunneltrafficpolicy_binding obj = new tunnelglobal_tunneltrafficpolicy_binding ( ) ; tunnelglobal_tunneltrafficpolicy_binding response [ ] = ( tunnelglobal_tunneltrafficpolicy_binding [ ] ) obj . get...
Use this API to fetch a tunnelglobal_tunneltrafficpolicy_binding resources .
3,401
public static pq_stats get ( nitro_service service ) throws Exception { pq_stats obj = new pq_stats ( ) ; pq_stats [ ] response = ( pq_stats [ ] ) obj . stat_resources ( service ) ; return response [ 0 ] ; }
Use this API to fetch the statistics of all pq_stats resources that are configured on netscaler .
3,402
public static csvserver_authorizationpolicy_binding [ ] get ( nitro_service service , String name ) throws Exception { csvserver_authorizationpolicy_binding obj = new csvserver_authorizationpolicy_binding ( ) ; obj . set_name ( name ) ; csvserver_authorizationpolicy_binding response [ ] = ( csvserver_authorizationpolic...
Use this API to fetch csvserver_authorizationpolicy_binding resources of given name .
3,403
public Tree newTreeNode ( Label parentLabel , List < Tree > children ) { return new LabeledScoredTreeNode ( lf . newLabel ( parentLabel ) , children ) ; }
Create a new non - leaf tree node with the given label
3,404
public static policystringmap_binding get ( nitro_service service , String name ) throws Exception { policystringmap_binding obj = new policystringmap_binding ( ) ; obj . set_name ( name ) ; policystringmap_binding response = ( policystringmap_binding ) obj . get_resource ( service ) ; return response ; }
Use this API to fetch policystringmap_binding resource of given name .
3,405
public static long count ( nitro_service service , clusternodegroup_crvserver_binding obj ) throws Exception { options option = new options ( ) ; option . set_count ( true ) ; option . set_args ( nitro_util . object_to_string_withoutquotes ( obj ) ) ; clusternodegroup_crvserver_binding response [ ] = ( clusternodegroup...
Use this API to count clusternodegroup_crvserver_binding resources configued on NetScaler .
3,406
public static < T > Set < T > asSet ( T [ ] a ) { return new HashSet < T > ( Arrays . asList ( a ) ) ; }
Return a set containing the same elements as the specified array .
3,407
public static double [ ] toDouble ( float [ ] a ) { double [ ] d = new double [ a . length ] ; for ( int i = 0 ; i < a . length ; i ++ ) { d [ i ] = a [ i ] ; } return d ; }
Casts to a double array
3,408
public static double [ ] toDouble ( int [ ] array ) { double [ ] rv = new double [ array . length ] ; for ( int i = 0 ; i < array . length ; i ++ ) { rv [ i ] = array [ i ] ; } return rv ; }
Casts to a double array .
3,409
public static base_response add ( nitro_service client , vpnsessionpolicy resource ) throws Exception { vpnsessionpolicy addresource = new vpnsessionpolicy ( ) ; addresource . name = resource . name ; addresource . rule = resource . rule ; addresource . action = resource . action ; return addresource . add_resource ( c...
Use this API to add vpnsessionpolicy .
3,410
public static base_response update ( nitro_service client , vpnsessionpolicy resource ) throws Exception { vpnsessionpolicy updateresource = new vpnsessionpolicy ( ) ; updateresource . name = resource . name ; updateresource . rule = resource . rule ; updateresource . action = resource . action ; return updateresource ...
Use this API to update vpnsessionpolicy .
3,411
public static vpnsessionpolicy [ ] get ( nitro_service service ) throws Exception { vpnsessionpolicy obj = new vpnsessionpolicy ( ) ; vpnsessionpolicy [ ] response = ( vpnsessionpolicy [ ] ) obj . get_resources ( service ) ; return response ; }
Use this API to fetch all the vpnsessionpolicy resources that are configured on netscaler .
3,412
public static vpnsessionpolicy get ( nitro_service service , String name ) throws Exception { vpnsessionpolicy obj = new vpnsessionpolicy ( ) ; obj . set_name ( name ) ; vpnsessionpolicy response = ( vpnsessionpolicy ) obj . get_resource ( service ) ; return response ; }
Use this API to fetch vpnsessionpolicy resource of given name .
3,413
private static Pair < Double , ClassicCounter < Integer > > readModel ( File modelFile , boolean multiclass ) { int modelLineCount = 0 ; try { int numLinesToSkip = multiclass ? 13 : 10 ; String stopToken = "#" ; BufferedReader in = new BufferedReader ( new FileReader ( modelFile ) ) ; for ( int i = 0 ; i < numLinesToSk...
Reads in a model file in svm light format . It needs to know if its multiclass or not because it affects the number of header lines . Maybe there is another way to tell and we can remove this flag?
3,414
private ClassicCounter < Pair < F , L > > convertWeights ( ClassicCounter < Integer > weights , Index < F > featureIndex , Index < L > labelIndex , boolean multiclass ) { return multiclass ? convertSVMStructWeights ( weights , featureIndex , labelIndex ) : convertSVMLightWeights ( weights , featureIndex , labelIndex ) ...
Converts the weight Counter to be from indexed svm_light format to a format we can use in our LinearClassifier .
3,415
private LinearClassifier < L , L > fitSigmoid ( SVMLightClassifier < L , F > classifier , GeneralDataset < L , F > dataset ) { RVFDataset < L , L > plattDataset = new RVFDataset < L , L > ( ) ; for ( int i = 0 ; i < dataset . size ( ) ; i ++ ) { RVFDatum < L , F > d = dataset . getRVFDatum ( i ) ; Counter < L > scores ...
Builds a sigmoid model to turn the classifier outputs into probabilities .
3,416
public static gslbservice_binding get ( nitro_service service , String servicename ) throws Exception { gslbservice_binding obj = new gslbservice_binding ( ) ; obj . set_servicename ( servicename ) ; gslbservice_binding response = ( gslbservice_binding ) obj . get_resource ( service ) ; return response ; }
Use this API to fetch gslbservice_binding resource of given name .
3,417
public Reader getUrl ( String prefix , String postfix ) throws MtasParserException { String url = getString ( ) ; if ( ( url != null ) && ! url . equals ( "" ) ) { if ( prefix != null ) { url = prefix + url ; } if ( postfix != null ) { url = url + postfix ; } if ( url . startsWith ( "http://" ) || url . startsWith ( "h...
Gets the url .
3,418
public Reader getFile ( String prefix , String postfix ) throws MtasParserException { String file = getString ( ) ; if ( ( file != null ) && ! file . equals ( "" ) ) { if ( prefix != null ) { file = prefix + file ; } if ( postfix != null ) { file = file + postfix ; } Path path = ( new File ( file ) ) . toPath ( ) ; if ...
Gets the file .
3,419
public static service_binding get ( nitro_service service , String name ) throws Exception { service_binding obj = new service_binding ( ) ; obj . set_name ( name ) ; service_binding response = ( service_binding ) obj . get_resource ( service ) ; return response ; }
Use this API to fetch service_binding resource of given name .
3,420
public static systemglobal_authenticationlocalpolicy_binding [ ] get ( nitro_service service ) throws Exception { systemglobal_authenticationlocalpolicy_binding obj = new systemglobal_authenticationlocalpolicy_binding ( ) ; systemglobal_authenticationlocalpolicy_binding response [ ] = ( systemglobal_authenticationlocal...
Use this API to fetch a systemglobal_authenticationlocalpolicy_binding resources .
3,421
public static auditsyslogpolicy_tmglobal_binding [ ] get ( nitro_service service , String name ) throws Exception { auditsyslogpolicy_tmglobal_binding obj = new auditsyslogpolicy_tmglobal_binding ( ) ; obj . set_name ( name ) ; auditsyslogpolicy_tmglobal_binding response [ ] = ( auditsyslogpolicy_tmglobal_binding [ ] )...
Use this API to fetch auditsyslogpolicy_tmglobal_binding resources of given name .
3,422
String readLine ( boolean ignoreLF ) throws IOException { StringBuffer s = null ; int startChar ; synchronized ( lock ) { ensureOpen ( ) ; boolean omitLF = ignoreLF || skipLF ; for ( ; ; ) { if ( nextChar >= nChars ) fill ( ) ; if ( nextChar >= nChars ) { if ( s != null && s . length ( ) > 0 ) return s . toString ( ) ;...
Read line .
3,423
public static base_response unset ( nitro_service client , vpnparameter resource , String [ ] args ) throws Exception { vpnparameter unsetresource = new vpnparameter ( ) ; return unsetresource . unset_resource ( client , args ) ; }
Use this API to unset the properties of vpnparameter resource . Properties that need to be unset are specified in args array .
3,424
public static vpnparameter get ( nitro_service service , options option ) throws Exception { vpnparameter obj = new vpnparameter ( ) ; vpnparameter [ ] response = ( vpnparameter [ ] ) obj . get_resources ( service , option ) ; return response [ 0 ] ; }
Use this API to fetch all the vpnparameter resources that are configured on netscaler .
3,425
public Iterator < List < IN > > getIterator ( Reader r ) { Tokenizer < IN > tokenizer = tokenizerFactory . getTokenizer ( r ) ; List < IN > words = new ArrayList < IN > ( ) ; IN previous = tokenFactory . makeToken ( ) ; StringBuilder prepend = new StringBuilder ( ) ; while ( tokenizer . hasNext ( ) ) { IN w = tokenizer...
sentence splitting as now
3,426
public static lbvserver_dospolicy_binding [ ] get ( nitro_service service , String name ) throws Exception { lbvserver_dospolicy_binding obj = new lbvserver_dospolicy_binding ( ) ; obj . set_name ( name ) ; lbvserver_dospolicy_binding response [ ] = ( lbvserver_dospolicy_binding [ ] ) obj . get_resources ( service ) ; ...
Use this API to fetch lbvserver_dospolicy_binding resources of given name .
3,427
public static nsrunningconfig get ( nitro_service service ) throws Exception { nsrunningconfig obj = new nsrunningconfig ( ) ; nsrunningconfig [ ] response = ( nsrunningconfig [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ; }
Use this API to fetch all the nsrunningconfig resources that are configured on netscaler .
3,428
public static nsrunningconfig [ ] get ( nitro_service service , nsrunningconfig_args args ) throws Exception { nsrunningconfig obj = new nsrunningconfig ( ) ; options option = new options ( ) ; option . set_args ( nitro_util . object_to_string_withoutquotes ( args ) ) ; nsrunningconfig [ ] response = ( nsrunningconfig ...
Use this API to fetch all the nsrunningconfig resources that are configured on netscaler . This uses nsrunningconfig_args which is a way to provide additional arguments while fetching the resources .
3,429
public static servicegroup_servicegroupmember_binding [ ] get ( nitro_service service , String servicegroupname ) throws Exception { servicegroup_servicegroupmember_binding obj = new servicegroup_servicegroupmember_binding ( ) ; obj . set_servicegroupname ( servicegroupname ) ; servicegroup_servicegroupmember_binding r...
Use this API to fetch servicegroup_servicegroupmember_binding resources of given name .
3,430
public static aaagroup_auditnslogpolicy_binding [ ] get ( nitro_service service , String groupname ) throws Exception { aaagroup_auditnslogpolicy_binding obj = new aaagroup_auditnslogpolicy_binding ( ) ; obj . set_groupname ( groupname ) ; aaagroup_auditnslogpolicy_binding response [ ] = ( aaagroup_auditnslogpolicy_bin...
Use this API to fetch aaagroup_auditnslogpolicy_binding resources of given name .
3,431
public static nd6ravariables_onlinkipv6prefix_binding [ ] get ( nitro_service service , Long vlan ) throws Exception { nd6ravariables_onlinkipv6prefix_binding obj = new nd6ravariables_onlinkipv6prefix_binding ( ) ; obj . set_vlan ( vlan ) ; nd6ravariables_onlinkipv6prefix_binding response [ ] = ( nd6ravariables_onlinki...
Use this API to fetch nd6ravariables_onlinkipv6prefix_binding resources of given name .
3,432
public static double [ ] exp ( double [ ] a ) { double [ ] result = new double [ a . length ] ; for ( int i = 0 ; i < a . length ; i ++ ) { result [ i ] = Math . exp ( a [ i ] ) ; } return result ; }
OPERATIONS ON AN ARRAY - NONDESTRUCTIVE
3,433
public static void expInPlace ( double [ ] a ) { for ( int i = 0 ; i < a . length ; i ++ ) { a [ i ] = Math . exp ( a [ i ] ) ; } }
OPERATIONS ON AN ARRAY - DESTRUCTIVE
3,434
public static void addInPlace ( double [ ] a , double b ) { for ( int i = 0 ; i < a . length ; i ++ ) { a [ i ] = a [ i ] + b ; } }
Increases the values in this array by b . Does it in place .
3,435
public static void addMultInPlace ( double [ ] a , double [ ] b , double c ) { for ( int i = 0 ; i < a . length ; i ++ ) { a [ i ] += b [ i ] * c ; } }
Add c times the array b to array a . Does it in place .
3,436
public static void multiplyInPlace ( double [ ] a , double b ) { for ( int i = 0 ; i < a . length ; i ++ ) { a [ i ] = a [ i ] * b ; } }
Scales the values in this array by b . Does it in place .
3,437
public static double [ ] add ( double [ ] a , double c ) { double [ ] result = new double [ a . length ] ; for ( int i = 0 ; i < a . length ; i ++ ) { result [ i ] = a [ i ] + c ; } return result ; }
OPERATIONS WITH SCALAR - NONDESTRUCTIVE
3,438
public static double [ ] pow ( double [ ] a , double c ) { double [ ] result = new double [ a . length ] ; for ( int i = 0 ; i < a . length ; i ++ ) { result [ i ] = Math . pow ( a [ i ] , c ) ; } return result ; }
raises each entry in array a by power c
3,439
public static int [ ] pairwiseAdd ( int [ ] a , int [ ] b ) { int [ ] result = new int [ a . length ] ; for ( int i = 0 ; i < a . length ; i ++ ) { result [ i ] = a [ i ] + b [ i ] ; } return result ; }
OPERATIONS WITH TWO ARRAYS - NONDESTRUCTIVE
3,440
public static double [ ] pairwiseMultiply ( double [ ] a , double [ ] b ) { if ( a . length != b . length ) { throw new RuntimeException ( "Can't pairwise multiple different lengths: a.length=" + a . length + " b.length=" + b . length ) ; } double [ ] result = new double [ a . length ] ; for ( int i = 0 ; i < result . ...
Assumes that both arrays have same length .
3,441
public static double norm_1 ( double [ ] a ) { double sum = 0 ; for ( double anA : a ) { sum += ( anA < 0 ? - anA : anA ) ; } return sum ; }
Computes 1 - norm of vector
3,442
public static double norm ( double [ ] a ) { double squaredSum = 0 ; for ( double anA : a ) { squaredSum += anA * anA ; } return Math . sqrt ( squaredSum ) ; }
Computes 2 - norm of vector
3,443
public static double innerProduct ( double [ ] a , double [ ] b ) { double result = 0.0 ; int len = Math . min ( a . length , b . length ) ; for ( int i = 0 ; i < len ; i ++ ) { result += a [ i ] * b [ i ] ; } return result ; }
LINEAR ALGEBRAIC FUNCTIONS
3,444
public static void normalize ( double [ ] a ) { double total = sum ( a ) ; if ( total == 0.0 || Double . isNaN ( total ) ) { throw new RuntimeException ( "Can't normalize an array with sum 0.0 or NaN: " + Arrays . toString ( a ) ) ; } multiplyInPlace ( a , 1.0 / total ) ; }
Makes the values in this array sum to 1 . 0 . Does it in place . If the total is 0 . 0 or NaN throws an RuntimeException .
3,445
public static void standardize ( double [ ] a ) { double m = mean ( a ) ; if ( Double . isNaN ( m ) ) throw new RuntimeException ( "Can't standardize array whose mean is NaN" ) ; double s = stdev ( a ) ; if ( s == 0.0 || Double . isNaN ( s ) ) throw new RuntimeException ( "Can't standardize array whose standard deviati...
Standardize values in this array i . e . subtract the mean and divide by the standard deviation . If standard deviation is 0 . 0 throws an RuntimeException .
3,446
public static int sampleFromDistribution ( double [ ] d , Random random ) { double r = random . nextDouble ( ) ; double total = 0 ; for ( int i = 0 ; i < d . length - 1 ; i ++ ) { if ( Double . isNaN ( d [ i ] ) ) { throw new RuntimeException ( "Can't sample from NaN" ) ; } total += d [ i ] ; if ( r < total ) { return ...
Samples from the distribution over values 0 through d . length given by d . Assumes that the distribution sums to 1 . 0 .
3,447
public static void sampleWithoutReplacement ( int [ ] array , int numArgClasses , Random rand ) { int [ ] temp = new int [ numArgClasses ] ; for ( int i = 0 ; i < temp . length ; i ++ ) { temp [ i ] = i ; } shuffle ( temp , rand ) ; System . arraycopy ( temp , 0 , array , 0 , array . length ) ; }
Fills the array with sample from 0 to numArgClasses - 1 without replacement .
3,448
private static double absDiffOfMeans ( double [ ] A , double [ ] B , boolean randomize ) { Random random = new Random ( ) ; double aTotal = 0.0 ; double bTotal = 0.0 ; for ( int i = 0 ; i < A . length ; i ++ ) { if ( randomize && random . nextBoolean ( ) ) { aTotal += B [ i ] ; bTotal += A [ i ] ; } else { aTotal += A ...
Assumes input arrays have equal non - zero length .
3,449
public static appfwpolicy_lbvserver_binding [ ] get ( nitro_service service , String name ) throws Exception { appfwpolicy_lbvserver_binding obj = new appfwpolicy_lbvserver_binding ( ) ; obj . set_name ( name ) ; appfwpolicy_lbvserver_binding response [ ] = ( appfwpolicy_lbvserver_binding [ ] ) obj . get_resources ( se...
Use this API to fetch appfwpolicy_lbvserver_binding resources of given name .
3,450
public static Session getSession ( String wrapper , Object ... parameters ) { org . riverframework . wrapper . Session < ? > _session = null ; Session session = map . get ( wrapper ) ; if ( session != null && session . isOpen ( ) ) { if ( parameters . length > 0 ) { throw new RiverException ( "There is already an open ...
Loads a wrapper that wraps libraries as lotus . domino or org . openntf . domino and creates a core Session object . Its behavior will depend on how the wrapper is implemented . Anyway this method creates the session just one time and returns the same every time is called . To free the memory resources etc . it s neces...
3,451
public static void closeSession ( String wrapper ) { Session session = map . get ( wrapper ) ; if ( session != null ) { Method method ; try { method = session . getClass ( ) . getDeclaredMethod ( "protectedClose" ) ; method . setAccessible ( true ) ; method . invoke ( session ) ; } catch ( InvocationTargetException e )...
Calls the Session close method to free resources memory etc . Also it will remove it from its internal table .
3,452
public static base_response update ( nitro_service client , ntpparam resource ) throws Exception { ntpparam updateresource = new ntpparam ( ) ; updateresource . authentication = resource . authentication ; updateresource . trustedkey = resource . trustedkey ; updateresource . autokeylogsec = resource . autokeylogsec ; ...
Use this API to update ntpparam .
3,453
public static base_response unset ( nitro_service client , ntpparam resource , String [ ] args ) throws Exception { ntpparam unsetresource = new ntpparam ( ) ; return unsetresource . unset_resource ( client , args ) ; }
Use this API to unset the properties of ntpparam resource . Properties that need to be unset are specified in args array .
3,454
public static ntpparam get ( nitro_service service ) throws Exception { ntpparam obj = new ntpparam ( ) ; ntpparam [ ] response = ( ntpparam [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ; }
Use this API to fetch all the ntpparam resources that are configured on netscaler .
3,455
public static base_response update ( nitro_service client , snmpengineid resource ) throws Exception { snmpengineid updateresource = new snmpengineid ( ) ; updateresource . engineid = resource . engineid ; updateresource . ownernode = resource . ownernode ; return updateresource . update_resource ( client ) ; }
Use this API to update snmpengineid .
3,456
public static base_responses update ( nitro_service client , snmpengineid resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { snmpengineid updateresources [ ] = new snmpengineid [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) ...
Use this API to update snmpengineid resources .
3,457
public static base_response unset ( nitro_service client , Long ownernode , String args [ ] ) throws Exception { snmpengineid unsetresource = new snmpengineid ( ) ; unsetresource . ownernode = ownernode ; return unsetresource . unset_resource ( client , args ) ; }
Use this API to unset the properties of snmpengineid resource . Properties that need to be unset are specified in args array .
3,458
public static base_responses unset ( nitro_service client , Long ownernode [ ] , String args [ ] ) throws Exception { base_responses result = null ; if ( ownernode != null && ownernode . length > 0 ) { snmpengineid unsetresources [ ] = new snmpengineid [ ownernode . length ] ; for ( int i = 0 ; i < ownernode . length ;...
Use this API to unset the properties of snmpengineid resources . Properties that need to be unset are specified in args array .
3,459
public static snmpengineid [ ] get ( nitro_service service ) throws Exception { snmpengineid obj = new snmpengineid ( ) ; snmpengineid [ ] response = ( snmpengineid [ ] ) obj . get_resources ( service ) ; return response ; }
Use this API to fetch all the snmpengineid resources that are configured on netscaler .
3,460
public static snmpengineid get ( nitro_service service , Long ownernode ) throws Exception { snmpengineid obj = new snmpengineid ( ) ; obj . set_ownernode ( ownernode ) ; snmpengineid response = ( snmpengineid ) obj . get_resource ( service ) ; return response ; }
Use this API to fetch snmpengineid resource of given name .
3,461
public static snmpengineid [ ] get ( nitro_service service , Long ownernode [ ] ) throws Exception { if ( ownernode != null && ownernode . length > 0 ) { snmpengineid response [ ] = new snmpengineid [ ownernode . length ] ; snmpengineid obj [ ] = new snmpengineid [ ownernode . length ] ; for ( int i = 0 ; i < ownernode...
Use this API to fetch snmpengineid resources of given names .
3,462
public static base_response enable ( nitro_service client , sslfipssimsource resource ) throws Exception { sslfipssimsource enableresource = new sslfipssimsource ( ) ; enableresource . targetsecret = resource . targetsecret ; enableresource . sourcesecret = resource . sourcesecret ; return enableresource . perform_oper...
Use this API to enable sslfipssimsource .
3,463
public static base_response init ( nitro_service client , sslfipssimsource resource ) throws Exception { sslfipssimsource initresource = new sslfipssimsource ( ) ; initresource . certfile = resource . certfile ; return initresource . perform_operation ( client , "init" ) ; }
Use this API to init sslfipssimsource .
3,464
public static base_response renumber ( nitro_service client ) throws Exception { nspbrs renumberresource = new nspbrs ( ) ; return renumberresource . perform_operation ( client , "renumber" ) ; }
Use this API to renumber nspbrs .
3,465
public static base_response clear ( nitro_service client ) throws Exception { nspbrs clearresource = new nspbrs ( ) ; return clearresource . perform_operation ( client , "clear" ) ; }
Use this API to clear nspbrs .
3,466
public static base_response apply ( nitro_service client ) throws Exception { nspbrs applyresource = new nspbrs ( ) ; return applyresource . perform_operation ( client , "apply" ) ; }
Use this API to apply nspbrs .
3,467
public static appflowpolicylabel_appflowpolicy_binding [ ] get ( nitro_service service , String labelname ) throws Exception { appflowpolicylabel_appflowpolicy_binding obj = new appflowpolicylabel_appflowpolicy_binding ( ) ; obj . set_labelname ( labelname ) ; appflowpolicylabel_appflowpolicy_binding response [ ] = ( a...
Use this API to fetch appflowpolicylabel_appflowpolicy_binding resources of given name .
3,468
@ SuppressWarnings ( "unchecked" ) private void repairPrefixItems ( NamedList < Object > mtasResponse ) { try { ArrayList < NamedList < ? > > list = ( ArrayList < NamedList < ? > > ) mtasResponse . findRecursive ( NAME ) ; if ( list != null ) { for ( NamedList < ? > item : list ) { SortedSet < String > singlePosition =...
Repair prefix items .
3,469
private static Set < String > collectKnownPrefixes ( FieldInfo fi ) throws IOException { if ( fi != null ) { HashSet < String > result = new HashSet < > ( ) ; String singlePositionPrefixes = fi . getAttribute ( MtasCodecPostingsFormat . MTAS_FIELDINFO_ATTRIBUTE_PREFIX_SINGLE_POSITION ) ; String multiplePositionPrefixes...
Collect known prefixes .
3,470
private static Set < String > collectIntersectionPrefixes ( FieldInfo fi ) throws IOException { if ( fi != null ) { Set < String > result = new HashSet < > ( ) ; String intersectingPrefixes = fi . getAttribute ( MtasCodecPostingsFormat . MTAS_FIELDINFO_ATTRIBUTE_PREFIX_INTERSECTION ) ; if ( intersectingPrefixes != null...
Collect intersection prefixes .
3,471
private static void collectPrefixes ( FieldInfos fieldInfos , String field , ComponentField fieldInfo , Status status ) throws IOException { if ( fieldInfo . prefix != null ) { FieldInfo fi = fieldInfos . fieldInfo ( field ) ; if ( fi != null ) { String singlePositionPrefixes = fi . getAttribute ( MtasCodecPostingsForm...
Collect prefixes .
3,472
private static Map < GroupHit , Spans > collectSpansForOccurences ( Set < GroupHit > occurences , Set < String > prefixes , String field , IndexSearcher searcher , LeafReaderContext lrc ) throws IOException { Map < GroupHit , Spans > list = new HashMap < > ( ) ; IndexReader reader = searcher . getIndexReader ( ) ; fina...
Collect spans for occurences .
3,473
private static MtasSpanQuery createQueryFromGroupHit ( Set < String > prefixes , String field , GroupHit hit ) { if ( prefixes == null || field == null || hit == null ) { return null ; } else { MtasSpanQuery query = null ; if ( hit . missingLeft != null && hit . missingLeft . length > 0 ) { for ( int i = 0 ; i < hit . ...
Creates the query from group hit .
3,474
private static MtasSpanQuery createSubQueryFromGroupHit ( List < String > [ ] subHit , boolean reverse , String field ) { MtasSpanQuery query = null ; if ( subHit != null && subHit . length > 0 ) { List < MtasSpanSequenceItem > items = new ArrayList < > ( ) ; List < String > subHitItem ; for ( int i = 0 ; i < subHit . ...
Creates the sub query from group hit .
3,475
private static Map < Integer , Integer > computePositions ( CodecInfo mtasCodecInfo , LeafReader r , LeafReaderContext lrc , String field , List < Integer > docSet ) throws IOException { HashMap < Integer , Integer > positionsData ; if ( mtasCodecInfo != null ) { if ( docSet . size ( ) < Math . log ( r . maxDoc ( ) ) )...
Compute positions .
3,476
private static Map < Integer , long [ ] > computeArguments ( Map < MtasSpanQuery , Map < Integer , Integer > > spansNumberData , MtasSpanQuery [ ] queries , Integer [ ] docSet ) { Map < Integer , long [ ] > args = new HashMap < > ( ) ; for ( int q = 0 ; q < queries . length ; q ++ ) { Map < Integer , Integer > tmpData ...
Compute arguments .
3,477
private static Integer [ ] intersectedDocList ( int [ ] facetDocList , Integer [ ] docSet ) { if ( facetDocList != null && docSet != null ) { Integer [ ] c = new Integer [ Math . min ( facetDocList . length , docSet . length ) ] ; int ai = 0 ; int bi = 0 ; int ci = 0 ; while ( ai < facetDocList . length && bi < docSet ...
Intersected doc list .
3,478
private static void createPositions ( List < ComponentPosition > statsPositionList , Map < Integer , Integer > positionsData , List < Integer > docSet ) throws IOException { if ( statsPositionList != null ) { for ( ComponentPosition position : statsPositionList ) { position . dataCollector . initNewList ( 1 ) ; Integer...
Creates the positions .
3,479
private static void createTokens ( List < ComponentToken > statsTokenList , Map < Integer , Integer > tokensData , List < Integer > docSet ) throws IOException { if ( statsTokenList != null ) { for ( ComponentToken token : statsTokenList ) { token . dataCollector . initNewList ( 1 ) ; Integer tmpValue ; long [ ] values...
Creates the tokens .
3,480
private static boolean availablePrefixes ( ComponentGroup group , Set < String > knownPrefixes ) { if ( knownPrefixes != null ) { for ( String prefix : group . prefixes ) { if ( knownPrefixes . contains ( prefix ) ) { return true ; } } } return false ; }
Available prefixes .
3,481
private static boolean intersectionPrefixes ( ComponentGroup group , Set < String > intersectionPrefixes ) { if ( intersectionPrefixes != null ) { for ( String prefix : group . prefixes ) { if ( intersectionPrefixes . contains ( prefix ) ) { return true ; } } } return false ; }
Intersection prefixes .
3,482
private static IntervalTreeNodeData < String > createPositionHit ( Match m , ComponentGroup group ) { Integer start = null ; Integer end = null ; if ( group . hitInside != null || group . hitInsideLeft != null || group . hitInsideRight != null ) { start = m . startPosition ; end = m . endPosition - 1 ; } else { start =...
Creates the position hit .
3,483
private static void sortMatchList ( List < Match > list ) { if ( list != null ) { Collections . sort ( list , ( Match m1 , Match m2 ) -> ( Integer . compare ( m1 . startPosition , m2 . startPosition ) ) ) ; } }
Sort match list .
3,484
private static String groupedKeyName ( String key , Double baseRangeSize , Double baseRangeBase ) { final double precision = 0.000001 ; if ( baseRangeSize == null || baseRangeSize <= 0 ) { return key ; } else { Double doubleKey ; Double doubleBase ; Double doubleNumber ; Double doubleStart ; Double doubleEnd ; try { do...
Grouped key name .
3,485
private static Integer [ ] mergeDocLists ( Integer [ ] a , Integer [ ] b ) { Integer [ ] answer = new Integer [ a . length + b . length ] ; int i = 0 ; int j = 0 ; int k = 0 ; Integer tmp ; while ( i < a . length && j < b . length ) { tmp = a [ i ] < b [ j ] ? a [ i ++ ] : b [ j ++ ] ; for ( ; i < a . length && a [ i ]...
Merge doc lists .
3,486
private static void createFacet ( List < ComponentFacet > facetList , Map < Integer , Integer > positionsData , Map < MtasSpanQuery , Map < Integer , Integer > > spansNumberData , Map < String , SortedMap < String , int [ ] > > facetData , List < Integer > docSet ) throws IOException { if ( facetList != null ) { for ( ...
Creates the facet .
3,487
private static boolean validateTermWithStartValue ( BytesRef term , ComponentTermVector termVector ) { if ( termVector . startValue == null ) { return true ; } else if ( termVector . subComponentFunction . sortType . equals ( CodecUtil . SORT_TERM ) ) { if ( term . length > termVector . startValue . length ) { byte [ ]...
Validate term with start value .
3,488
private static boolean validateTermWithDistance ( BytesRef term , ComponentTermVector termVector ) throws IOException { if ( termVector . distances == null || termVector . distances . isEmpty ( ) ) { return true ; } else { for ( SubComponentDistance item : termVector . distances ) { if ( item . maximum == null ) { cont...
Validate term with distance .
3,489
private static boolean needSecondRoundTermvector ( List < ComponentTermVector > termVectorList ) throws IOException { boolean needSecondRound = false ; for ( ComponentTermVector termVector : termVectorList ) { if ( ! termVector . full && termVector . list == null ) { boolean doCheck ; doCheck = termVector . subComponen...
Need second round termvector .
3,490
private static boolean preliminaryRegisterValue ( BytesRef term , ComponentTermVector termVector , TermvectorNumberBasic number , Integer termNumberMaximum , Integer segmentNumber , String [ ] mutableKey ) throws IOException { long sortValue = 0 ; if ( termVector . subComponentFunction . sortDirection . equals ( CodecU...
Preliminary register value .
3,491
private static TermvectorNumberFull computeTermvectorNumberFull ( List < Integer > docSet , int termDocId , TermsEnum termsEnum , LeafReaderContext lrc , PostingsEnum postingsEnum , Map < Integer , Integer > positionsData ) throws IOException { TermvectorNumberFull result = new TermvectorNumberFull ( docSet . size ( ) ...
Compute termvector number full .
3,492
public boolean containsKey ( String key ) { key = key . toLowerCase ( ) ; key = key . trim ( ) ; return map . containsKey ( key ) ; }
Does the word exist in the dictionary?
3,493
public Map < String , Set < String > > getReverseMap ( ) { Set < Map . Entry < String , Set < String > > > entries = map . entrySet ( ) ; Map < String , Set < String > > rMap = new HashMap < String , Set < String > > ( entries . size ( ) ) ; for ( Map . Entry < String , Set < String > > me : entries ) { String k = me ....
Returns a reversed map of the current map .
3,494
public int addMap ( Map < String , Set < String > > addM ) { int newTrans = 0 ; for ( Map . Entry < String , Set < String > > me : addM . entrySet ( ) ) { String k = me . getKey ( ) ; Set < String > addList = me . getValue ( ) ; Set < String > origList = map . get ( k ) ; if ( origList == null ) { map . put ( k , new L...
Add all of the mappings from the specified map to the current map .
3,495
public static base_response add ( nitro_service client , dnssoarec resource ) throws Exception { dnssoarec addresource = new dnssoarec ( ) ; addresource . domain = resource . domain ; addresource . originserver = resource . originserver ; addresource . contact = resource . contact ; addresource . serial = resource . se...
Use this API to add dnssoarec .
3,496
public static base_responses add ( nitro_service client , dnssoarec resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { dnssoarec addresources [ ] = new dnssoarec [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { addresources ...
Use this API to add dnssoarec resources .
3,497
public static base_responses delete ( nitro_service client , dnssoarec resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { dnssoarec deleteresources [ ] = new dnssoarec [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { deleter...
Use this API to delete dnssoarec resources .
3,498
public static base_response update ( nitro_service client , dnssoarec resource ) throws Exception { dnssoarec updateresource = new dnssoarec ( ) ; updateresource . domain = resource . domain ; updateresource . originserver = resource . originserver ; updateresource . contact = resource . contact ; updateresource . seri...
Use this API to update dnssoarec .
3,499
public static base_responses update ( nitro_service client , dnssoarec resources [ ] ) throws Exception { base_responses result = null ; if ( resources != null && resources . length > 0 ) { dnssoarec updateresources [ ] = new dnssoarec [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { updater...
Use this API to update dnssoarec resources .