idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
12,000
@ SuppressWarnings ( "unchecked" ) public boolean containsKey ( Object key ) { synchronized ( this ) { SoftReference ref ; V item ; if ( ! cache . containsKey ( key ) ) { return false ; } ref = cache . get ( key ) ; item = ( V ) ref . get ( ) ; if ( item == null ) { return false ; } if ( item instanceof CachedItem ) { ...
This method will verify both that the key exists and the value is currently value for the cache .
12,001
public boolean containsValue ( Object val ) { synchronized ( this ) { for ( V item : values ( ) ) { if ( item instanceof CachedItem ) { CachedItem ci = ( CachedItem ) item ; if ( ci . isValidForCache ( ) && ci . equals ( val ) ) { return true ; } } else if ( item . equals ( val ) ) { return true ; } } } return false ; ...
Verifies that the specified value is in the cache .
12,002
public Set < Entry < K , V > > entrySet ( ) { TreeSet < Entry < K , V > > set = new TreeSet < Entry < K , V > > ( ) ; synchronized ( this ) { for ( K key : keySet ( ) ) { if ( containsKey ( key ) ) { get ( key ) ; set . add ( getEntry ( key ) ) ; } } return set ; } }
Returns a set of entries in this cache .
12,003
@ SuppressWarnings ( "unchecked" ) public V get ( Object key ) { synchronized ( this ) { SoftReference ref ; V item ; if ( ! containsKey ( key ) ) { return null ; } ref = cache . get ( key ) ; item = ( V ) ref . get ( ) ; if ( item == null ) { return null ; } if ( item instanceof CachedItem ) { CachedItem ci = ( Cached...
Retrieves the item associated with the specified key if it is currently valid for the cache .
12,004
private Entry < K , V > getEntry ( K key ) { final K k = key ; return new Entry < K , V > ( ) { public boolean equals ( Object ob ) { if ( ob instanceof Entry ) { Entry entry = ( Entry ) ob ; if ( ! entry . getKey ( ) . equals ( getKey ( ) ) ) { return false ; } if ( ! entry . getValue ( ) . equals ( getValue ( ) ) ) {...
Returns an entry value for the specified
12,005
public V getOrLoad ( K key , CacheLoader < V > loader ) { V item ; if ( containsKey ( key ) ) { return get ( key ) ; } item = loader . load ( ) ; if ( item != null ) { putIfAbsent ( key , item ) ; return get ( key ) ; } else { return null ; } }
Retrieves the value for the specified key . If no value is present this method will attempt to load a value and place it into the cache . This method appears atomic in accordance with the contract of a
12,006
public V put ( K key , V val ) { SoftReference < V > ref = new SoftReference < V > ( val ) ; cache . put ( key , ref ) ; return get ( key ) ; }
Places the specified value into the cache .
12,007
public void putAll ( Map < ? extends K , ? extends V > map ) { for ( K key : map . keySet ( ) ) { put ( key , map . get ( key ) ) ; } }
Places all elements in the specified map into this cache .
12,008
public V putIfAbsent ( K key , V val ) { V item ; if ( ! containsKey ( key ) ) { return put ( key , val ) ; } item = get ( key ) ; if ( item instanceof CachedItem ) { CachedItem ci = ( CachedItem ) item ; if ( ! ci . isValidForCache ( ) ) { put ( key , val ) ; return null ; } } return item ; }
Conditionally associates the specified value with the specified key if no value currently exists for the key . The actual value stored with the key is returned .
12,009
public boolean remove ( Object key , Object val ) { String k = key . toString ( ) ; V item ; if ( ! containsKey ( k ) ) { return false ; } item = get ( k ) ; if ( val == null && item == null ) { remove ( k ) ; return true ; } if ( val == null || item == null ) { return false ; } if ( val . equals ( item ) ) { remove ( ...
Removes the specified key only if the current value equals the specified value . If the value does not match the current value the removal will not occur .
12,010
public V replace ( K key , V val ) { if ( ! containsKey ( key ) ) { return null ; } return put ( key , val ) ; }
Replaces the specified key only if it has some current value .
12,011
public boolean replace ( K key , V ov , V nv ) { if ( ! remove ( key , ov ) ) { return false ; } put ( key , nv ) ; return true ; }
Replaces the current value of the specified key with the proposed new value only if the current value matches the specified old value .
12,012
public static < S , SS extends S , T , TT extends T > Tuple2 < S , T > of ( SS s , TT t ) { return new Tuple2 < S , T > ( s , t ) ; }
Creates a new 2 - tuple consisting of the given elements
12,013
public DeploymentManager getDeploymentManager ( String uri , String userName , String password ) throws DeploymentManagerCreationException { Set clone ; synchronized ( deploymentFactories ) { clone = new HashSet ( deploymentFactories ) ; } for ( Iterator i = clone . iterator ( ) ; i . hasNext ( ) ; ) { DeploymentFactor...
Get a connected deployment manager
12,014
private Set < OWLEntity > getChangeSignature ( ) { Set < OWLEntity > result = new HashSet < OWLEntity > ( ) ; final OWLOntologyChangeDataVisitor < Set < OWLEntity > , RuntimeException > visitor = new OWLOntologyChangeDataVisitor < Set < OWLEntity > , RuntimeException > ( ) { public Set < OWLEntity > visit ( AddAxiomDat...
Gets the signature in the set of change records in this list .
12,015
public OptionGroup removeOption ( String value ) { if ( value == null ) { value = "" ; } options . remove ( value ) ; return this ; }
Removes an option from this group by value if present
12,016
public OptionGroup removeOption ( Option option ) { if ( option == null ) { throw new IllegalArgumentException ( "Option cannot be null" ) ; } options . remove ( option . getValue ( ) ) ; return this ; }
Removes an option from this gruop if present
12,017
public boolean hasValueEnabled ( String value ) { return enabled && options . containsKey ( value ) && options . get ( value ) . isEnabled ( ) ; }
Indicates if the group has an option with the given value which is also enabled . This group must also be enabled .
12,018
public List < Option > getOptions ( boolean includeDisabled ) { List < Option > result = new ArrayList < > ( ) ; if ( ! includeDisabled && ! enabled ) { return result ; } for ( Option option : options . values ( ) ) { if ( includeDisabled || option . isEnabled ( ) ) { result . add ( option ) ; } } return result ; }
Returns all the options in this group in list order .
12,019
public Set < String > getEnabledOptionValues ( ) { Set < String > result = new HashSet < > ( ) ; if ( ! enabled ) { return result ; } for ( Option option : options . values ( ) ) { if ( option . isEnabled ( ) ) { result . add ( option . getValue ( ) ) ; } } return result ; }
Returns all the values of the options of this group that are enabled . If the group itself is disabled its options are also considered as disabled .
12,020
public B newProcessBuilder ( Locale locale ) { return newProcessBuilder ( new Class [ ] { Queue . class , Locale . class } , new Object [ ] { this , locale } ) ; }
Get a new ProcessBuilder using the supplied Locale .
12,021
private B newProcessBuilder ( Class [ ] param_types , Object [ ] params ) { if ( process_builder_class != null ) { try { Constructor < B > constructor = process_builder_class . getDeclaredConstructor ( param_types ) ; return constructor . newInstance ( params ) ; } catch ( Exception e ) { throw new QueujException ( e )...
Private method to instantiate the Queues ProcessBuilder . Will ask the parent Queue to instantiate its ProcessBuilder if this Queue doesn t have one .
12,022
public < P extends ProcessBuilder > QueueBuilder < P > newQueueBuilder ( Class < P > process_builder_class ) { return QueueFactory . newQueueBuilder ( this , process_builder_class ) ; }
Gets a new QueueBuilder using this Queue as the parent .
12,023
public BatchProcessServer getBatchProcessServer ( ) { if ( process_server_class != null ) { try { return process_server_class . newInstance ( ) ; } catch ( Exception e ) { throw new QueujException ( e ) ; } } if ( parent_queue != null ) return parent_queue . getBatchProcessServer ( ) ; throw new QueujException ( "No Ba...
Instantiate the Queues BatchProcessServer . Will ask the parent Queue to instantiate its BatchProcessServer if this Queue doesn t have one .
12,024
Occurrence getDefaultOccurrence ( ) { if ( default_occurence != null ) return default_occurence ; if ( parent_queue != null ) return parent_queue . getDefaultOccurrence ( ) ; return null ; }
Gets the Queues default Occurrence . Will ask the parent Queue to get its default Occurrence if this Queue doesn t have one .
12,025
Visibility getDefaultVisibility ( ) { if ( default_visibility != null ) return default_visibility ; if ( parent_queue != null ) return parent_queue . getDefaultVisibility ( ) ; return null ; }
Gets the Queues default Visibility . Will ask the parent Queue to get its default Visibility if this Queue doesn t have one .
12,026
Access getDefaultAccess ( ) { if ( default_access != null ) return default_access ; if ( parent_queue != null ) return parent_queue . getDefaultAccess ( ) ; return null ; }
Gets the Queues default Access . Will ask the parent Queue to get its default Access if this Queue doesn t have one .
12,027
Resilience getDefaultResilience ( ) { if ( default_resilience != null ) return default_resilience ; if ( parent_queue != null ) return parent_queue . getDefaultResilience ( ) ; return null ; }
Gets the Queues default Resilience . Will ask the parent Queue to get its default Resilience if this Queue doesn t have one .
12,028
Output getDefaultOutput ( ) { if ( default_output != null ) return default_output ; if ( parent_queue != null ) return parent_queue . getDefaultOutput ( ) ; return null ; }
Gets the Queues default Output . Will ask the parent Queue to get its default Output if this Queue doesn t have one .
12,029
public boolean canRun ( Process process ) { boolean can_run = restriction == null ? true : restriction . canRun ( process . getQueue ( ) , process ) ; if ( can_run && parent_queue != null ) return parent_queue . canRun ( process ) ; return can_run ; }
Check with this Queue and the parent Queue whether the supplied Process can run .
12,030
private String getSelfString ( ) { String queue_string = " {" + new_line ; if ( restriction != null ) queue_string += " restriction: " + restriction . toString ( ) + new_line ; if ( index != null ) queue_string += " index: " + index . getClass ( ) . getName ( ) + new_line ; if ( ! implementation_options . isEmpty ( )...
Get the unique String for this Queue .
12,031
private static synchronized int setId ( Queue queue ) { String queue_string = queue . toString ( ) ; if ( ! queues . contains ( queue_string ) ) queues . add ( queue_string ) ; return queues . indexOf ( queue_string ) ; }
Set the unique id for this Queue .
12,032
public Date getConvertedValue ( ) { String dateStr = this . getFirstValue ( ) ; if ( dateStr != null && ! dateStr . trim ( ) . isEmpty ( ) ) { dateStr = dateStr . trim ( ) ; try { return dateFormat . parse ( dateStr ) ; } catch ( ParseException ex ) { throw new UniformException ( String . format ( "Could not parse date...
Returns the value of this element as a Date automatically converting the value string with the configured date format . If the value is not empty and its format is incorrect an exception will be thrown .
12,033
public ElementWithOptions addOptionGroup ( OptionGroup optionGroup ) { if ( optionGroup == null ) { throw new IllegalArgumentException ( "Group cannot be null" ) ; } String groupId = optionGroup . getId ( ) ; if ( optionGroups . containsKey ( groupId ) ) { throw new IllegalArgumentException ( "The group id '" + groupId...
Adds an option group to this element .
12,034
public ElementWithOptions addOption ( Object value , String text ) { return addOptionToGroup ( value , text , null ) ; }
Adds an option to the default option group of this element .
12,035
public ElementWithOptions removeOption ( String value ) { for ( OptionGroup group : optionGroups . values ( ) ) { group . removeOption ( value ) ; } return this ; }
Removes an option of this element by value .
12,036
public ElementWithOptions removeOption ( Option option ) { if ( option == null ) { throw new IllegalArgumentException ( "Option cannot be null" ) ; } for ( OptionGroup group : optionGroups . values ( ) ) { group . removeOption ( option ) ; } return this ; }
Removes an option of this element .
12,037
public List < Option > getOptions ( boolean includeDisabled ) { List < Option > result = new ArrayList < > ( ) ; for ( OptionGroup group : optionGroups . values ( ) ) { result . addAll ( group . getOptions ( includeDisabled ) ) ; } return result ; }
Returns all the options in this element in list order .
12,038
public Set < String > getOptionsValues ( ) { Set < String > result = new HashSet < > ( ) ; for ( OptionGroup group : optionGroups . values ( ) ) { result . addAll ( group . getOptionValues ( ) ) ; } return result ; }
Returns all the values of the options of this element .
12,039
public Set < String > getEnabledOptionValues ( ) { Set < String > result = new HashSet < > ( ) ; for ( OptionGroup group : optionGroups . values ( ) ) { result . addAll ( group . getEnabledOptionValues ( ) ) ; } return result ; }
Returns all the values of the options of this element that are enabled . If a group itself is disabled its options are also considered as disabled .
12,040
public ElementWithOptions setOptions ( LinkedHashMap < String , String > options ) { this . optionGroups . clear ( ) ; for ( Map . Entry < String , String > entry : options . entrySet ( ) ) { this . addOption ( entry . getKey ( ) , entry . getValue ( ) ) ; } return this ; }
Replaces all options of this element .
12,041
public boolean hasValueEnabled ( String value ) { for ( OptionGroup group : optionGroups . values ( ) ) { if ( group . hasValueEnabled ( value ) ) { return true ; } } return false ; }
Indicates if the element has an enabled value in any of its groups that must also be enabled .
12,042
private void createProcessOutputPump ( InputStream is , OutputStream os ) { outputThread = createPump ( is , os , CLOSE_STDOUT_AND_STDERR_INSTREAMS_WHEN_EXHAUSTED ) ; }
Create the pump to handle process output .
12,043
private void createProcessErrorPump ( InputStream is , OutputStream os ) { errorThread = createPump ( is , os , CLOSE_STDOUT_AND_STDERR_INSTREAMS_WHEN_EXHAUSTED ) ; }
Create the pump to handle error output .
12,044
public void incrementCurrentSection ( ) { if ( runner_controlled_sections ) { rollback_section = current_section ; current_section = getCurrentSection ( ) . incrementCurrentSection ( current_section ) ; } else { rollback_section = current_section ; current_section ++ ; } }
normally just increments but for Integration defers to the run object
12,045
public QueryParameters updateType ( String key , Integer type ) { this . types . put ( processKey ( key ) , type ) ; return this ; }
Updates type of specified key
12,046
public QueryParameters updateDirection ( String key , Direction direction ) { this . direction . put ( processKey ( key ) , direction ) ; return this ; }
Updates direction of specified key
12,047
public QueryParameters updatePosition ( String key , Integer position ) { while ( this . order . size ( ) < position + 1 ) { this . order . add ( null ) ; } this . order . set ( position , processKey ( key ) ) ; return this ; }
Updates position of specified key
12,048
public QueryParameters updateValue ( String key , Object value ) { this . values . put ( processKey ( key ) , value ) ; return this ; }
Updates value of specified key
12,049
public Integer getFirstPosition ( String key ) { int position = - 1 ; String processedKey = processKey ( key ) ; if ( this . values . containsKey ( processedKey ) == true ) { position = this . order . indexOf ( processedKey ) ; } return position ; }
Returns position of specified key
12,050
public List < Integer > getOrderList ( String key ) { List < Integer > result = new ArrayList < Integer > ( ) ; String processedKey = processKey ( key ) ; String orderKey = null ; for ( int i = 0 ; i < this . order . size ( ) ; i ++ ) { orderKey = this . order . get ( i ) ; if ( orderKey != null && orderKey . equals ( ...
Returns list of positions of specified key
12,051
public boolean isOutParameter ( String key ) { boolean isOut = false ; if ( this . getDirection ( processKey ( key ) ) == Direction . INOUT || this . getDirection ( processKey ( key ) ) == Direction . OUT ) { isOut = true ; } return isOut ; }
Checks is specified key is OUT parameter . OUT and INOUT parameter would be considered as OUT parameter
12,052
public boolean isInParameter ( String key ) { boolean isIn = false ; if ( this . getDirection ( processKey ( key ) ) == Direction . INOUT || this . getDirection ( processKey ( key ) ) == Direction . IN ) { isIn = true ; } return isIn ; }
Checks is specified key is IN parameter . IN and INOUT parameter would be considered as IN parameter
12,053
public String getNameByPosition ( Integer position ) { String name = null ; name = this . order . get ( position ) ; return name ; }
Returns Key by searching key assigned to that position
12,054
public Object getValueByPosition ( Integer position ) throws NoSuchFieldException { String name = null ; Object value = null ; name = this . getNameByPosition ( position ) ; if ( name != null ) { value = this . getValue ( name ) ; } else { throw new NoSuchFieldException ( ) ; } return value ; }
Returns value by searching key assigned to that position
12,055
public void remove ( String key ) { String processedKey = processKey ( key ) ; String orderKey = null ; for ( int i = 0 ; i < this . order . size ( ) ; i ++ ) { orderKey = this . order . get ( i ) ; if ( orderKey != null && orderKey . equals ( processedKey ) == true ) { this . order . remove ( i ) ; } } this . types . ...
Removes specified key
12,056
public Object [ ] getValuesArray ( ) { this . assertIncorrectOrder ( ) ; Object [ ] params = new Object [ this . order . size ( ) ] ; String parameterName = null ; for ( int i = 0 ; i < this . order . size ( ) ; i ++ ) { parameterName = this . getNameByPosition ( i ) ; params [ i ] = this . getValue ( parameterName ) ;...
Utility function . Returns array of values
12,057
private String processKey ( String key ) { AssertUtils . assertNotNull ( key , "Key cannot be null" ) ; String result = null ; if ( this . isCaseSensitive ( ) == false ) { result = key . toLowerCase ( Locale . ENGLISH ) ; } else { result = key ; } return result ; }
Utility function . Processes key and converts it s case if required
12,058
public void parseObjectAsQueryMap ( List < String > params , Object o ) throws FoxHttpRequestException { try { Class clazz = o . getClass ( ) ; HashMap < String , String > paramMap = new HashMap < > ( ) ; for ( String param : params ) { Field field = clazz . getDeclaredField ( param ) ; field . setAccessible ( true ) ;...
Parse an object as query map
12,059
public Map < String , Object > handle ( List < QueryParameters > outputList ) throws MjdbcException { return this . outputProcessor . toMap ( outputList ) ; }
Converts first row of query output into Map
12,060
public void onResize ( int width , int height ) { int lineWidth = lineElement . getOffsetWidth ( ) ; lineLeftOffset = ( width / 2 ) - ( lineWidth / 2 ) ; DOM . setStyleAttribute ( lineElement , "left" , lineLeftOffset + "px" ) ; drawLabels ( ) ; drawTicks ( ) ; drawKnob ( ) ; }
This method is called when the dimensions of the parent element change . Subclasses should override this method as needed .
12,061
public void redraw ( ) { if ( isAttached ( ) ) { int width = getElement ( ) . getClientWidth ( ) ; int height = getElement ( ) . getClientHeight ( ) ; onResize ( width , height ) ; } }
Redraw the progress bar when something changes the layout .
12,062
public void setCurrentValue ( double curValue , boolean fireEvent ) { this . curValue = Math . max ( minValue , Math . min ( maxValue , curValue ) ) ; double remainder = ( this . curValue - minValue ) % stepSize ; this . curValue -= remainder ; if ( ( remainder > ( stepSize / 2 ) ) && ( ( this . curValue + stepSize ) <...
Set the current value and optionally fire the onValueChange event .
12,063
public void setEnabled ( boolean enabled ) { this . enabled = enabled ; if ( enabled ) { DOM . setElementProperty ( lineElement , "className" , SLIDER_LINE ) ; } else { DOM . setElementProperty ( lineElement , "className" , SLIDER_LINE + " " + SLIDER_LINE_DISABLED ) ; } redraw ( ) ; }
Sets whether this widget is enabled .
12,064
protected double getKnobPercent ( ) { if ( maxValue <= minValue ) { return 0 ; } double percent = ( curValue - minValue ) / ( maxValue - minValue ) ; return Math . max ( 0.0 , Math . min ( 1.0 , percent ) ) ; }
Get the percentage of the knob s position relative to the size of the line . The return value will be between 0 . 0 and 1 . 0 .
12,065
private void drawKnob ( ) { if ( ! isAttached ( ) ) { return ; } Element knobElement = knobImage . getElement ( ) ; int lineWidth = lineElement . getOffsetWidth ( ) ; int knobWidth = knobElement . getOffsetWidth ( ) ; int knobLeftOffset = ( int ) ( lineLeftOffset + ( getKnobPercent ( ) * lineWidth ) - ( knobWidth / 2 )...
Draw the knob where it is supposed to be relative to the line .
12,066
private void drawLabels ( ) { if ( ! isAttached ( ) ) { return ; } int lineWidth = lineElement . getOffsetWidth ( ) ; if ( numLabels > 0 ) { for ( int i = 0 ; i <= numLabels ; i ++ ) { Element label = null ; if ( i < labelElements . size ( ) ) { label = labelElements . get ( i ) ; } else { label = DOM . createDiv ( ) ;...
Draw the labels along the line . NOT USED IN KEYSTONE
12,067
private void drawTicks ( ) { if ( ! isAttached ( ) ) { return ; } int lineWidth = lineElement . getOffsetWidth ( ) ; if ( numTicks > 0 ) { for ( int i = 0 ; i <= numTicks ; i ++ ) { Element tick = null ; if ( i < tickElements . size ( ) ) { tick = tickElements . get ( i ) ; } else { tick = DOM . createDiv ( ) ; DOM . s...
Draw the tick along the line .
12,068
private void slideKnob ( Event event ) { int x = DOM . eventGetClientX ( event ) ; if ( x > 0 ) { int lineWidth = lineElement . getOffsetWidth ( ) ; int lineLeft = lineElement . getAbsoluteLeft ( ) ; double percent = ( double ) ( x - lineLeft ) / lineWidth * 1.0 ; setCurrentValue ( getTotalRange ( ) * percent + minValu...
Slide the knob to a new location .
12,069
private void startSliding ( boolean highlight , boolean fireEvent ) { if ( highlight ) { DOM . setElementProperty ( lineElement , "className" , SLIDER_LINE + " " + SLIDER_LINE_SLIDING ) ; DOM . setElementProperty ( knobImage . getElement ( ) , "className" , SLIDER_KNOB + " " + SLIDER_KNOB_SLIDING ) ; } }
Start sliding the knob .
12,070
private void stopSliding ( boolean unhighlight , boolean fireEvent ) { if ( unhighlight ) { DOM . setElementProperty ( lineElement , "className" , SLIDER_LINE ) ; DOM . setElementProperty ( knobImage . getElement ( ) , "className" , SLIDER_KNOB ) ; } }
Stop sliding the knob .
12,071
public static < T > List < T > toList ( Iterator < T > iterator ) { Objects . requireNonNull ( iterator , "The iterator is null" ) ; return Iterators . toCollection ( iterator , new ArrayList < T > ( ) ) ; }
Drains all elements from the given iterator into a list
12,072
public static < T > Set < T > toSet ( Iterator < T > iterator ) { Objects . requireNonNull ( iterator , "The iterator is null" ) ; return Iterators . toCollection ( iterator , new LinkedHashSet < T > ( ) ) ; }
Drains all elements from the given iterator into a set
12,073
public static < T , C extends Collection < ? super T > > C toCollection ( Iterator < T > iterator , C collection ) { Objects . requireNonNull ( iterator , "The iterator is null" ) ; Objects . requireNonNull ( iterator , "The collection is null" ) ; while ( iterator . hasNext ( ) ) { collection . add ( iterator . next (...
Drains all elements that are provided by the given iterator into the given collection
12,074
public static < T > Iterator < T > weakeningIterator ( final Iterator < ? extends T > delegate ) { Objects . requireNonNull ( delegate , "The delegate is null" ) ; return new Iterator < T > ( ) { public boolean hasNext ( ) { return delegate . hasNext ( ) ; } public T next ( ) { return delegate . next ( ) ; } public voi...
Returns an iterator that removes the type bound of another iterator
12,075
public static < T > Iterator < T > iteratorOverIterators ( Iterator < ? extends T > iterator0 , Iterator < ? extends T > iterator1 ) { Objects . requireNonNull ( iterator0 , "The iterator0 is null" ) ; Objects . requireNonNull ( iterator1 , "The iterator1 is null" ) ; List < Iterator < ? extends T > > iterators = new A...
Returns an iterator that combines the given iterators .
12,076
public static < S extends Iterator < ? extends T > , T > Iterator < T > iteratorOverIterators ( Iterator < S > iteratorsIterator ) { Objects . requireNonNull ( iteratorsIterator , "The iteratorsIterator is null" ) ; return new CombiningIterator < T > ( iteratorsIterator ) ; }
Returns an iterator that combines the iterators that are returned by the given iterator .
12,077
public static < S extends Iterator < ? extends T > , T > Iterator < T > iteratorOverIterators ( Iterable < S > iteratorsIterable ) { Objects . requireNonNull ( iteratorsIterable , "The iteratorsIterable is null" ) ; return new CombiningIterator < T > ( iteratorsIterable . iterator ( ) ) ; }
Returns an iterator that combines the iterators that are returned by the iterator that is returned by the given iterable .
12,078
public static < S extends Iterable < ? extends T > , T > Iterator < T > iteratorOverIterables ( Iterator < S > iterablesIterator ) { Objects . requireNonNull ( iterablesIterator , "The iterablesIterator is null" ) ; TransformingIterator < S , Iterator < ? extends T > > iteratorIterator = new TransformingIterator < S , ...
Returns an iterator that combines the iterators that are returned by the iterables that are provided by the given iterator
12,079
public static < S extends Iterable < ? extends T > , T > Iterator < T > iteratorOverIterables ( Iterable < S > iterablesIterable ) { Objects . requireNonNull ( iterablesIterable , "The iterablesIterable is null" ) ; return iteratorOverIterables ( iterablesIterable . iterator ( ) ) ; }
Returns an iterator that combines the iterators that are returned by the iterables that are provided by the iterator that is provided by the given iterable
12,080
public static < T > Iterator < T > iteratorOverIterables ( Iterable < ? extends T > iterable0 , Iterable < ? extends T > iterable1 ) { Objects . requireNonNull ( iterable0 , "The iterable0 is null" ) ; Objects . requireNonNull ( iterable1 , "The iterable1 is null" ) ; List < Iterable < ? extends T > > iterables = new A...
Returns an iterator that combines the iterators that are returned by the given iterables
12,081
public static < S , T > Iterator < T > transformingIterator ( Iterator < ? extends S > iterator , Function < S , ? extends T > function ) { Objects . requireNonNull ( iterator , "The iterator is null" ) ; Objects . requireNonNull ( function , "The function is null" ) ; return new TransformingIterator < S , T > ( iterat...
Creates an iterator that passes the values that are provided by the given delegate iterator to the given function and returns the resulting values
12,082
public static < T > Iterator < T > filteringIterator ( Iterator < ? extends T > iterator , Predicate < ? super T > predicate ) { Objects . requireNonNull ( iterator , "The iterator is null" ) ; Objects . requireNonNull ( predicate , "The predicate is null" ) ; return new FilteringIterator < T > ( iterator , predicate )...
Creates an iterator that only returns the elements from the given iterator to which the given predicate applies .
12,083
public StorageRef getTables ( OnTableSnapshot onTableSnapshot , OnError onError ) { PostBodyBuilder pbb = new PostBodyBuilder ( context ) ; Rest r = new Rest ( context , RestType . LISTTABLES , pbb , null ) ; r . onError = onError ; r . onTableSnapshot = onTableSnapshot ; context . processRest ( r ) ; return this ; }
Retrieves a list of the names of all tables created by the user s subscription .
12,084
public StorageRef isAuthenticated ( String authenticationToken , OnBooleanResponse onBooleanResponse , OnError onError ) { PostBodyBuilder pbb = new PostBodyBuilder ( context ) ; Rest r = new Rest ( context , RestType . ISAUTHENTICATED , pbb , null ) ; r . onError = onError ; r . onBooleanResponse = onBooleanResponse ;...
Checks if a specified authentication token is authenticated .
12,085
public void setSqlParameterValues ( List < Object > sqlParameterValues ) { if ( sqlParameterValues != null ) { this . sqlParameterValues = new ArrayList < Object > ( sqlParameterValues ) ; } else { this . sqlParameterValues = null ; } }
Sets list of parameter values
12,086
public String getParameterName ( Integer position ) { String name = null ; if ( this . sqlParameterNames != null ) { name = this . sqlParameterNames . get ( position ) ; } return name ; }
Returns parameter name by specifying it s position
12,087
public Integer getAmountOfParameters ( ) { Integer size = 0 ; if ( this . sqlParameterNames != null ) { size = this . sqlParameterNames . size ( ) ; } return size ; }
Returns amount of parameters specified in this instance of ProcessedInput
12,088
public void fillParameterValues ( Map < String , Object > valuesMap ) { AssertUtils . assertNotNull ( valuesMap , "Value map cannot be null" ) ; if ( this . sqlParameterNames != null ) { String parameterName = null ; this . sqlParameterValues = new ArrayList < Object > ( ) ; for ( int i = 0 ; i < this . sqlParameterNam...
Utility function . Fills this ProcessedInput with values . This function iterates over parameter names list and loads corresponding value from MAp
12,089
public static String put ( String username , final int seconds ) { String key = UUID . randomUUID ( ) . toString ( ) ; cache . setex ( key , seconds , username ) ; return key ; }
Put username into the token storage with an expire time .
12,090
private int primitiveAmount ( Object ... values ) { int result = 0 ; for ( int i = 0 ; i < values . length ; i ++ ) { if ( MappingUtils . isPrimitive ( values [ i ] ) == true ) { result ++ ; } } return result ; }
Iterates over values and returns amount of primitive values in it . Used to check if values supplied via constructors aren t mixed as only primitive or complex types are allows
12,091
public String getStringBody ( Charset charset ) throws IOException { BufferedReader rd = new BufferedReader ( new InputStreamReader ( getInputStreamBody ( ) , charset ) ) ; String line ; StringBuilder response = new StringBuilder ( ) ; while ( ( line = rd . readLine ( ) ) != null ) { if ( response . length ( ) != 0 ) {...
Get the response body as string
12,092
protected V createRow ( QueryParameters params ) throws MjdbcException { return this . outputProcessor . toBean ( params , type ) ; }
Converts query output into Map of Beans .
12,093
public int updateCache ( DatabaseMetaData metaData , String catalogName , String schemaName , String procedureName ) throws SQLException { String dbProductName = MetadataUtils . processDatabaseProductName ( metaData . getDatabaseProductName ( ) ) ; ResultSet procedures = null ; ResultSet procedureParameters = null ; Li...
Function which is responsible for retrieving Stored Procedure parameters and storage it into cache . This function doesn t perform cache read - only cache update .
12,094
private String processCatalogName ( String dbProvideName , String userName , String catalogName ) { String result = null ; if ( catalogName != null ) { result = catalogName . toUpperCase ( ) ; } else { if ( "Oracle" . equals ( dbProvideName ) == true ) { result = "" ; } } return result ; }
Processes Catalog name so it would be compatible with database
12,095
private String processSchemaName ( String dbProductName , String userName , String schemaName ) { String result = null ; if ( schemaName != null ) { result = schemaName . toUpperCase ( ) ; } else { if ( "DB2" . equals ( dbProductName ) == true || "Apache Derby" . equals ( dbProductName ) == true || "Oracle" . equals ( ...
Processes Schema name so it would be compatible with database
12,096
public < H extends Annotation > void scanForAnnotation ( Class < H > expectedAnnotation , Listener < T , H > listener ) { BeanInfo beanInfo ; try { beanInfo = Introspector . getBeanInfo ( beanType ) ; } catch ( IntrospectionException e ) { throw new RuntimeException ( "Can't get bean info of " + beanType ) ; } for ( Pr...
Scan given class and look for possible references annotated by given annotation
12,097
public T cache ( T item ) { HashMap < String , Object > keys ; if ( item == null ) { throw new NullPointerException ( "Multi caches may not have null values." ) ; } keys = getKeys ( item ) ; synchronized ( this ) { item = getCurrent ( item ) ; for ( String key : caches . keySet ( ) ) { ConcurrentCache < Object , T > ca...
Places the specified item in the cache . It will not replace an existing item in the cache . Instead if an item already exists in the cache it will make sure that item is cached across all identifiers and then return the cached item .
12,098
public T find ( Map < String , Object > vals ) { String key = order . get ( 0 ) ; Object val = vals . get ( key ) ; CacheLoader < T > loader ; if ( val == null ) { throw new CacheManagementException ( "No value specified for key: " + key ) ; } loader = new MapLoader < T > ( target ) ; return find ( key , val , loader ...
Finds the object in the cache matching the values in the specified value map . If a matching argument is not in the cache this method will instantiate an instance of the object and assign the mapping values to that instantiated object . In order for this to work the keys in this mapping must have the same names as the ...
12,099
public T find ( String key , Object val , CacheLoader < T > loader , Object ... args ) { ConcurrentCache < Object , T > cache = caches . get ( key ) ; T item ; if ( val instanceof BigDecimal ) { val = ( ( BigDecimal ) val ) . longValue ( ) ; } item = cache . get ( val ) ; if ( item == null && loader != null ) { item = ...
Seeks the item from the cache that is identified by the specified key having the specified value . If no match is found the specified loader will be called with the specified arguments in order to place an instantiated item into the cache .