idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
15,500
public MDecimal getHz ( ) { MDecimal result = new MDecimal ( currentUnit . getConverterTo ( HERTZ ) . convert ( doubleValue ( ) ) ) ; logger . trace ( MMarker . GETTER , "Converting from {} to Hertz : {}" , currentUnit , result ) ; return result ; }
Hz is the SI unit
15,501
public static byte [ ] encodeSHA ( byte [ ] rgbValue ) throws NoSuchAlgorithmException { MessageDigest md = MessageDigest . getInstance ( "SHA" ) ; md . update ( rgbValue ) ; rgbValue = md . digest ( ) ; return rgbValue ; }
Returns the string run through the SHA hash .
15,502
public static byte [ ] encodeToBytes ( byte [ ] bytes ) { try { char [ ] chars = Base64 . encode ( bytes ) ; String string = new String ( chars ) ; return string . getBytes ( DEFAULT_ENCODING ) ; } catch ( UnsupportedEncodingException e ) { e . printStackTrace ( ) ; return null ; } }
Encode this string as base64 .
15,503
public static String decode ( String string ) { try { byte [ ] bytes = Base64 . decode ( string . toCharArray ( ) ) ; return new String ( bytes , DEFAULT_ENCODING ) ; } catch ( UnsupportedEncodingException e ) { e . printStackTrace ( ) ; return null ; } }
Decode this base64 string to a regular string .
15,504
public void set ( int i , int j , T v ) { consumer . set ( i , j , v ) ; }
Sets item at i j
15,505
public void runTask ( ) { String strProcess = this . getProperty ( DBParams . PROCESS ) ; BaseProcess job = ( BaseProcess ) ClassServiceUtility . getClassService ( ) . makeObjectFromClassName ( strProcess ) ; if ( job != null ) { this . runProcess ( job , m_properties ) ; } else { String strClass = this . getProperty (...
Get the name of this process and run it .
15,506
public Object doGetData ( ) { String data = ( String ) super . doGetData ( ) ; FileListener listener = this . getRecord ( ) . getListener ( PropertiesStringFileListener . class ) ; if ( this . getComponent ( 0 ) == null ) if ( enableConversion ) if ( listener != null ) if ( listener . isEnabled ( ) ) data = Utility . r...
DoGetData Method .
15,507
public BasePanel getSubScreen ( BasePanel parentScreen , ScreenLocation screenLocation , Map < String , Object > properties , int screenNo ) { switch ( screenNo ) { case 0 : return new LogicFileGridScreen ( null , screenLocation , parentScreen , null , ScreenConstants . DONT_DISPLAY_FIELD_DESC , properties ) ; case 1 :...
GetSubScreen Method .
15,508
public void start ( Supplier < ExecutorService > executorFactory ) throws IOException { future = executorFactory . get ( ) . submit ( this ) ; }
Start virtual circuit
15,509
public void waitForFinish ( ) throws IOException { if ( future == null ) { throw new IllegalStateException ( "not started" ) ; } try { future . get ( ) ; } catch ( InterruptedException | ExecutionException ex ) { throw new IOException ( ex ) ; } }
Wait until other peer has closed connection or virtual circuit is closed by interrupt .
15,510
public void setRequestCompletionFilter ( ITraceFilterExt val ) { RequestWriter requestWriter = ( RequestWriter ) m_connection . getTraceWriter ( ) ; requestWriter . getRequestSeparator ( ) . setRequestCompletionFilter ( val ) ; }
The request api will consider a thread is completed processing when a particular method fires an exit event . Which method? The one indicated on the parameters of this method . As you d expect this needs to be called before events start firing . This the inTrace client will not be running in the same JVM as the system ...
15,511
public void onApplicationEvent ( final ContextRefreshedEvent event ) { if ( ! hasStarted ) { hasStarted = true ; log . info ( Markers . AUDIT , message ) ; } }
Logs the provided message at log level info when it first receives an event
15,512
public ParameterizedOperator operator ( Point2D . Double ... controlPoints ) { if ( controlPoints . length != length ) { throw new IllegalArgumentException ( "control-points length not " + length ) ; } double [ ] cp = convert ( controlPoints ) ; return operator ( cp ) ; }
Creates Bezier function for fixed control points .
15,513
public ParameterizedOperator operator ( double ... controlPoints ) { if ( controlPoints . length != 2 * length ) { throw new IllegalArgumentException ( "control-points length not " + length ) ; } return operator ( controlPoints , 0 ) ; }
Creates Bezier function for fixed control points . Note that it is not same if you pass an array or separate parameters . Array is not copied so if you modify it it will make change . If you want to have function with immutable control points use separate parameters or copy the array .
15,514
private ParameterizedOperator derivative ( double ... controlPoints ) { if ( controlPoints . length != 2 * length ) { throw new IllegalArgumentException ( "control-points length not " + length ) ; } return derivative ( controlPoints , 0 ) ; }
Create first derivative function for fixed control points .
15,515
private ParameterizedOperator secondDerivative ( double ... controlPoints ) { if ( controlPoints . length != 2 * length ) { throw new IllegalArgumentException ( "control-points length not " + length ) ; } return secondDerivative ( controlPoints , 0 ) ; }
Create second derivative function for fixed control points .
15,516
public static BezierCurve getInstance ( int degree ) { if ( degree < 1 ) { throw new IllegalArgumentException ( "illegal degree" ) ; } switch ( degree ) { case 1 : return LINE ; case 2 : return QUAD ; case 3 : return CUBIC ; default : return new BezierCurve ( degree ) ; } }
Creates or gets BezierCurve instance
15,517
public static void main ( String args [ ] ) { Map < String , Object > properties = null ; if ( args != null ) { properties = new Hashtable < String , Object > ( ) ; Util . parseArgs ( properties , args ) ; } BaseApplication app = new MainApplication ( null , properties , null ) ; app . getTaskScheduler ( ) . addTask ( ...
Run this stand - alone .
15,518
public Object doRemoteAction ( String strCommand , Map < String , Object > properties ) throws DBException , RemoteException { return null ; }
Do a remote action . Not implemented .
15,519
public void setDfn ( String dfn ) { this . dfn = VistAUtil . validateIEN ( dfn ) ? dfn : null ; }
Sets the DFN of the associated patient if any .
15,520
public PreferredValueMakersRegistry add ( Matcher < ? > settableMatcher , Maker < ? > maker ) { Preconditions . checkNotNull ( settableMatcher ) ; Preconditions . checkNotNull ( maker ) ; makers . put ( settableMatcher , maker ) ; return this ; }
Add a maker with custom matcher .
15,521
public static boolean valueMatchesRegularExpression ( String val , String regexp ) { Pattern p = cache . get ( regexp ) ; if ( p == null ) { p = Pattern . compile ( regexp ) ; cache . put ( regexp , p ) ; } return valueMatchesRegularExpression ( val , p ) ; }
Returns true only if the value matches the regular expression only once and exactly .
15,522
public static boolean valueMatchesRegularExpression ( String val , Pattern regexp ) { Matcher m = regexp . matcher ( val ) ; try { return m . matches ( ) ; } catch ( StackOverflowError e ) { e . printStackTrace ( ) ; System . out . println ( "-> [" + val + "][" + regexp + "]" ) ; System . out . println ( "-> " + val . ...
Returns true only if the value matches the regular expression at least once .
15,523
public static Payload decode ( String base64 ) { JsonObject json = decodeToJson ( base64 ) ; Payload payload = new Payload ( ) ; json . keySet ( ) . forEach ( key -> { switch ( key ) { case "iss" : payload . issuer = json . getString ( key ) ; break ; case "sub" : payload . subject = json . getString ( key ) ; break ; ...
Decode the base64 - string to Payload .
15,524
@ SuppressWarnings ( { "unchecked" } ) public boolean perform ( TherianContext context , final Convert < ? , ? > convert ) { return new Delegate ( convert ) . perform ( context , convert ) ; }
specifically avoid doing typed ops as we want to catch stuff that slips through the cracks
15,525
private static Iterable < String > getAssociationTables ( EntityClass entityClass ) { Iterable < Settable > association = filter ( entityClass . getElements ( ) , and ( or ( has ( ManyToMany . class ) , has ( ElementCollection . class ) ) , has ( JoinTable . class ) ) ) ; return transform ( association , new Function <...
This will find all ManyToMany and ElementCollection annotated tables .
15,526
public final void createCatalog ( ClusterName targetCluster , CatalogMetadata catalogMetadata ) throws ExecutionException , UnsupportedException { try { connectionHandler . startJob ( targetCluster . getName ( ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Creating catalog [" + catalogMetadata . getName (...
This method creates a catalog .
15,527
public final void createTable ( ClusterName targetCluster , TableMetadata tableMetadata ) throws UnsupportedException , ExecutionException { try { connectionHandler . startJob ( targetCluster . getName ( ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Creating table [" + tableMetadata . getName ( ) . getNa...
This method creates a table .
15,528
public final void dropCatalog ( ClusterName targetCluster , CatalogName name ) throws UnsupportedException , ExecutionException { try { connectionHandler . startJob ( targetCluster . getName ( ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Dropping catalog [" + name . getName ( ) + "] in cluster [" + targ...
This method drop a catalog .
15,529
public final void dropTable ( ClusterName targetCluster , TableName name ) throws UnsupportedException , ExecutionException { try { connectionHandler . startJob ( targetCluster . getName ( ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Dropping table [" + name . getName ( ) + "] in cluster [" + targetClus...
This method drop a table .
15,530
public final void createIndex ( ClusterName targetCluster , IndexMetadata indexMetadata ) throws UnsupportedException , ExecutionException { try { connectionHandler . startJob ( targetCluster . getName ( ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Creating index [" + indexMetadata . getName ( ) . getNa...
This method creates an index .
15,531
public final void alterTable ( ClusterName targetCluster , TableName name , AlterOptions alterOptions ) throws UnsupportedException , ExecutionException { try { connectionHandler . startJob ( targetCluster . getName ( ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Altering table[" + name . getName ( ) + "...
This method add delete or modify columns in an existing table .
15,532
public final void alterCatalog ( ClusterName targetCluster , CatalogName catalogName , Map < Selector , Selector > options ) throws UnsupportedException , ExecutionException { try { connectionHandler . startJob ( targetCluster . getName ( ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Altering catalog[" +...
Alter options in an existing table .
15,533
public void notifyStart ( String projectApiId , String projectVersion , String category ) { try { if ( isStarted ( ) ) { JSONObject startNotification = new JSONObject ( ) . put ( "project" , new JSONObject ( ) . put ( "apiId" , projectApiId ) . put ( "version" , projectVersion ) ) . put ( "category" , category ) ; sock...
Send a starting notification to the agent
15,534
public void notifyEnd ( String projectApiId , String projectVersion , String category , long duration ) { try { if ( isStarted ( ) ) { JSONObject endNotification = new JSONObject ( ) . put ( "project" , new JSONObject ( ) . put ( "apiId" , projectApiId ) . put ( "version" , projectVersion ) ) . put ( "category" , categ...
Send a ending notification to the agent
15,535
public void send ( TestRun testRun ) { try { if ( isStarted ( ) ) { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; new JsonSerializer ( ) . serializePayload ( new OutputStreamWriter ( baos ) , testRun , false ) ; socket . emit ( "payload" , new String ( baos . toByteArray ( ) ) ) ; } else { LOGGER . log (...
Send a test result to the agent . This is a best effort and when the request failed there is no crash
15,536
public List < FilterDefinition > getFilters ( ) { try { if ( isStarted ( ) ) { final FilterAcknowledger acknowledger = new FilterAcknowledger ( ) ; new Thread ( new Runnable ( ) { public void run ( ) { try { LOGGER . finest ( "Retrieve filters" ) ; socket . emit ( "filters:get" , acknowledger ) ; } catch ( Exception e ...
Try to get a filter list from the agent
15,537
private Socket createConnectedSocket ( final String url ) { try { final Socket initSocket = IO . socket ( url ) ; final Callback callback = new Callback ( ) ; initSocket . on ( Socket . EVENT_CONNECT , callback ) ; initSocket . on ( Socket . EVENT_CONNECT_ERROR , callback ) ; initSocket . on ( Socket . EVENT_CONNECT_TI...
Create a new connection to the agent
15,538
public void push ( double value ) { if ( top >= stack . length ) { stack = Arrays . copyOf ( stack , ( int ) ( stack . length * growFactor ) ) ; } stack [ top ++ ] = value ; }
Adds value to the top .
15,539
public void dup ( ) { if ( top < 1 ) { throw new EmptyStackException ( ) ; } if ( top >= stack . length ) { stack = Arrays . copyOf ( stack , ( int ) ( stack . length * growFactor ) ) ; } top ++ ; stack [ top - 1 ] = stack [ top - 2 ] ; }
Top element is pushed .
15,540
public void fixRecord ( Record record ) { super . fixRecord ( record ) ; if ( this . getProperty ( "field" ) != null ) { BaseField field = this . getMainRecord ( ) . getField ( this . getProperty ( "field" ) . toString ( ) ) ; if ( field != null ) this . fixCapitalization ( field ) ; } }
FixRecord Method .
15,541
public void dispose ( final FullTextSession session ) { if ( session != null && session . isOpen ( ) ) { logger . trace ( "Disposing of hibernate fulltext session." ) ; session . close ( ) ; } }
Dispose of the fulltext session if it hasn t already been closed .
15,542
public static TranslatedContentSpecWrapper getTranslatedContentSpecById ( final DataProviderFactory providerFactory , final Integer id , final Integer rev ) { final CollectionWrapper < TranslatedContentSpecWrapper > translatedContentSpecs = providerFactory . getProvider ( ContentSpecProvider . class ) . getContentSpecT...
Gets a translated content spec based on a content spec id and revision
15,543
public static TranslatedContentSpecWrapper getClosestTranslatedContentSpecById ( final DataProviderFactory providerFactory , final Integer id , final Integer rev ) { final CollectionWrapper < TranslatedContentSpecWrapper > translatedContentSpecs = providerFactory . getProvider ( ContentSpecProvider . class ) . getConte...
Gets a translated content spec based on a id and revision . The translated content spec that is returned will be less then or equal to the revision that is passed . If the revision is null then the latest translated content spec will be returned .
15,544
public static Map < Integer , List < TagWrapper > > getCategoryMappingFromTagList ( final Collection < TagWrapper > tags ) { final HashMap < Integer , List < TagWrapper > > mapping = new HashMap < Integer , List < TagWrapper > > ( ) ; for ( final TagWrapper tag : tags ) { final List < CategoryInTagWrapper > catList = t...
Converts a list of tags into a mapping of categories to tags . The key is the Category and the value is a List of Tags for that category .
15,545
public static TopicWrapper getCSNodeTopicEntity ( final CSNodeWrapper node , final TopicProvider topicProvider ) { if ( ! isNodeATopic ( node ) ) return null ; return topicProvider . getTopic ( node . getEntityId ( ) , node . getEntityRevision ( ) ) ; }
Gets the CSNode Topic entity that is represented by the node .
15,546
public static boolean isNodeATopic ( final BaseCSNodeWrapper < ? > node ) { switch ( node . getNodeType ( ) ) { case CommonConstants . CS_NODE_TOPIC : case CommonConstants . CS_NODE_INITIAL_CONTENT_TOPIC : case CommonConstants . CS_NODE_META_DATA_TOPIC : return true ; default : return false ; } }
Checks to see if the node is some representation of a Topic entity .
15,547
public static boolean isNodeALevel ( final BaseCSNodeWrapper < ? > node ) { switch ( node . getNodeType ( ) ) { case CommonConstants . CS_NODE_APPENDIX : case CommonConstants . CS_NODE_CHAPTER : case CommonConstants . CS_NODE_PART : case CommonConstants . CS_NODE_PREFACE : case CommonConstants . CS_NODE_PROCESS : case ...
Checks to see if an entity node is a level representation .
15,548
public static boolean hasContentSpecMetaDataChanged ( final String metaDataName , final String currentValue , final ContentSpecWrapper contentSpecEntity ) { final CSNodeWrapper metaData = contentSpecEntity . getMetaData ( metaDataName ) ; if ( metaData != null && metaData . getAdditionalText ( ) != null && ! metaData ....
Checks to see if a Content Spec Meta Data element has changed .
15,549
public static LocaleWrapper findLocaleFromString ( final CollectionWrapper < LocaleWrapper > locales , final String localeString ) { if ( localeString == null ) return null ; for ( final LocaleWrapper locale : locales . getItems ( ) ) { if ( localeString . equals ( locale . getValue ( ) ) ) { return locale ; } } return...
Finds the matching locale entity from a locale string .
15,550
public static LocaleWrapper findTranslationLocaleFromString ( final LocaleProvider localeProvider , final String localeString ) { if ( localeString == null ) return null ; final CollectionWrapper < LocaleWrapper > locales = localeProvider . getLocales ( ) ; for ( final LocaleWrapper locale : locales . getItems ( ) ) { ...
Finds the matching locale entity from a translation locale string .
15,551
public String firstMandatoryNullProperty ( ) { for ( String property : model . propertyList ) { if ( model . mandatorySet . contains ( property ) && model . defaultMap . get ( property ) == null && data . get ( property ) == null ) { return property ; } } return firstMandatoryNullProperty ( model . propertyList ) ; }
Returns The first in property order property which is mandatory and is not set . If all mandatory properties have values returns null .
15,552
public void populate ( Map < String , String [ ] > map ) { for ( Entry < String , String [ ] > entry : map . entrySet ( ) ) { String property = entry . getKey ( ) ; if ( model . typeMap . containsKey ( property ) ) { String [ ] values = entry . getValue ( ) ; if ( values . length > 1 ) { throw new UnsupportedOperationE...
Convenience method to support ServletRequest .
15,553
public static void writeCSV ( DataObjectModel model , Collection < ? extends DataObject > collection , OutputStream os ) throws IOException { BufferedOutputStream bos = new BufferedOutputStream ( os ) ; OutputStreamWriter osw = new OutputStreamWriter ( bos , "ISO-8859-1" ) ; CSVWriter writer = new CSVWriter ( osw , ','...
Writes collection of DataObjects in csv format . OutputStream is not closed after operation .
15,554
public static HashMap < String , String > getUrlVariables ( final Filter filter ) { final HashMap < String , String > vars = new HashMap < String , String > ( ) ; for ( final FilterTag filterTag : filter . getFilterTags ( ) ) { final Tag tag = filterTag . getTag ( ) ; final Integer tagState = filterTag . getTagState ( ...
Translate the contents of this filter its tags and categories into variables that can be appended to a url
15,555
static NessEvent createEvent ( @ JsonProperty ( "user" ) final UUID user , @ JsonProperty ( "timestamp" ) final DateTime timestamp , @ JsonProperty ( "id" ) final UUID id , @ JsonProperty ( "type" ) final NessEventType type , @ JsonProperty ( "payload" ) final Map < String , ? extends Object > payload ) { return new Ne...
Create a new event from over - the - wire json .
15,556
public static NessEvent createEvent ( final UUID user , final DateTime timestamp , final NessEventType type , final Map < String , ? extends Object > payload ) { return new NessEvent ( user , timestamp , type , payload , UUID . randomUUID ( ) ) ; }
Create a new event .
15,557
public static NessEvent createEvent ( final UUID user , final NessEventType type ) { return new NessEvent ( user , new DateTime ( DateTimeZone . UTC ) , type , Collections . < String , Object > emptyMap ( ) , UUID . randomUUID ( ) ) ; }
Convenience constructor that assumes no payload .
15,558
public BaseField getHistorySourceDate ( ) { if ( m_fldSourceHistoryDate == null ) { if ( m_iSourceDateSeq != null ) m_fldSourceHistoryDate = this . getOwner ( ) . getField ( m_iSourceDateSeq ) ; else if ( this . getHistoryRecord ( ) instanceof VirtualRecord ) m_fldSourceHistoryDate = this . getOwner ( ) . getField ( Vi...
Get the date source from this record
15,559
public Date bumpTime ( DateTimeField fieldTarget ) { Date dateBefore = fieldTarget . getDateTime ( ) ; Calendar calTarget = fieldTarget . getCalendar ( ) ; calTarget . add ( Calendar . SECOND , 1 ) ; fieldTarget . setCalendar ( calTarget , DBConstants . DISPLAY , DBConstants . SCREEN_MOVE ) ; return dateBefore ; }
Bump time field by a second .
15,560
public FieldSchema getField ( String name ) { for ( FieldSchema field : fieldSchemas ) if ( field . getName ( ) . equals ( name ) ) return field ; return null ; }
Returns the schema for the field on this annotation class whose name matches the provided name . This method returns null if no field matches .
15,561
public static void copyFile ( File in , File out ) throws IOException { FileChannel inChannel = new FileInputStream ( in ) . getChannel ( ) ; FileChannel outChannel = new FileOutputStream ( out ) . getChannel ( ) ; try { inChannel . transferTo ( 0 , inChannel . size ( ) , outChannel ) ; } catch ( IOException e ) { thro...
Copy file a file from one location to another .
15,562
private boolean adjustParam ( DenseMatrix64F X , DenseMatrix64F Y , double prevCost ) { double lambda = initialLambda ; double difference = 1000 ; for ( int iter = 0 ; iter < iter1 && difference > maxDifference ; iter ++ ) { computeDandH ( param , X , Y ) ; boolean foundBetter = false ; for ( int i = 0 ; i < iter2 ; i ...
Iterate until the difference between the costs is insignificant or it iterates too many times
15,563
private void computeDandH ( DenseMatrix64F param , DenseMatrix64F x , DenseMatrix64F y ) { func . compute ( param , x , tempDH ) ; subtractEquals ( tempDH , y ) ; if ( jacobianFactory != null ) { jacobianFactory . computeJacobian ( param , x , jacobian ) ; } else { computeNumericalJacobian ( param , x , jacobian ) ; } ...
Computes the d and H parameters . Where d is the average error gradient and H is an approximation of the hessian .
15,564
public BaseSessionProxy checkForSession ( String strClassAndID ) { int iColon = strClassAndID . indexOf ( CLASS_SEPARATOR ) ; String strSessionClass = null ; if ( iColon != - 1 ) strSessionClass = strClassAndID . substring ( 0 , iColon ) ; String strID = strClassAndID . substring ( iColon + 1 ) ; if ( REMOTE_SESSION . ...
Check for session .
15,565
protected String getDefaultBaseUrlRegex ( ) { String baseUrl = getBaseUrl ( ) ; return baseUrl == null ? null : Pattern . quote ( baseUrl ) ; }
Default base URL regex for pages . Override this for different value .
15,566
protected File getDefaultReportDir ( ) { File reportsRootDir = getReportsRootDir ( ) ; if ( reportsRootDir == null ) { throw new SebException ( "Reports root directory is null" ) ; } if ( ! reportsRootDir . exists ( ) ) { try { Files . createDirectories ( reportsRootDir . toPath ( ) ) ; } catch ( IOException e ) { thro...
Returns directory for storing Seb report files . As default unique directory is created inside reports root directory . Override this for different value .
15,567
protected List < SebListener > getDefaultListeners ( ) { return new ArrayList < > ( Arrays . asList ( new ConfigListener ( ) , new LoggingListener ( ) , new SebLogListener ( ) , new WebDriverLogListener ( ) , new PageSourceListener ( ) , new ScreenshotListener ( ) ) ) ; }
Returns default list of Seb event listeners . Override this for different value .
15,568
protected Level getDefaultLogLevel ( ) { String levelStr = getProperty ( LOG_LEVEL ) ; Level level = null ; if ( levelStr != null ) { level = Level . parse ( levelStr ) ; } if ( level == null ) level = Level . INFO ; return level ; }
Basic log level . Override this for different value .
15,569
public String getTitle ( ) { for ( int i = 0 ; i < this . getSFieldCount ( ) ; i ++ ) { if ( this . getSField ( i ) instanceof BaseScreen ) return ( ( BaseScreen ) this . getSField ( i ) ) . getTitle ( ) ; } return super . getTitle ( ) ; }
Title for this screen .
15,570
public void print ( CharSequence charSequence ) { try { consoleReader . println ( charSequence ) ; consoleReader . flush ( ) ; } catch ( IOException e ) { throw new IllegalStateException ( "Can't write to console" , e ) ; } }
Print charSequence to console
15,571
public void setCompleters ( List < Completer > completers ) { for ( Completer completer : consoleReader . getCompleters ( ) ) { consoleReader . removeCompleter ( completer ) ; } if ( Iterables . size ( completers ) > 1 ) { Completer completer = new AggregateCompleter ( completers ) ; consoleReader . addCompleter ( comp...
Remove all completers and add the new ones . If completers contains more then one element create an AggregateCompleter with the completers and add it .
15,572
public String getInput ( ) { try { String ret = consoleReader . readLine ( ) ; if ( ret != null ) { ret = ret . trim ( ) ; } if ( ret != null && ! ret . isEmpty ( ) && consoleReader . isHistoryEnabled ( ) && history != null ) { history . add ( ret ) ; history . flush ( ) ; } return ret ; } catch ( IOException e ) { thr...
Get User input
15,573
private String format ( double duration , Units units ) { StringBuilder builder = new StringBuilder ( ) ; builder . append ( numberFormat . format ( duration ) ) ; builder . append ( ' ' ) ; builder . append ( units . display ( ) ) ; return builder . toString ( ) ; }
Build time duration representation for given numeric value and units .
15,574
public String getMetaRedirect ( ) { if ( this . getProperty ( XMLTags . META_REDIRECT ) != null ) return this . getProperty ( XMLTags . META_REDIRECT ) ; return DBConstants . BLANK ; }
Get the name of the meta tag .
15,575
public String getThisURL ( ) { String strURL = DBConstants . BLANK ; strURL = Utility . addURLParam ( strURL , DBParams . RECORD , this . getProperty ( DBParams . RECORD ) , false ) ; strURL = Utility . addURLParam ( strURL , DBParams . SCREEN , this . getProperty ( DBParams . SCREEN ) , false ) ; strURL = Utility . ad...
Get the URL to display this page .
15,576
void executeStartupCommands ( ) { if ( m_startupCommands != null ) { StringBuilder sb = new StringBuilder ( ) ; for ( IAgentCommand cmd : m_startupCommands ) { sb . append ( cmd . getMessage ( ) ) ; } getControlThread ( ) . sendMessage ( sb . toString ( ) ) ; } }
Immediately after the connection is first established execute all the commands in this . m_startupCommands . This method concatenates the commands of all those given in the array and attempts to execute them in a single round - trip call .
15,577
public String getNamespaceFromVersion ( String version ) { MessageVersion recMessageVersion = this . getMessageVersion ( version ) ; String namespace = this . getField ( MessageControl . BASE_NAMESPACE ) . toString ( ) ; if ( namespace == null ) namespace = DBConstants . BLANK ; if ( ( recMessageVersion != null ) && ( ...
GetNamespaceFromVersion Method .
15,578
public MessageVersion getMessageVersion ( String version ) { MessageVersion recMessageVersion = this . getMessageVersion ( ) ; recMessageVersion . setKeyArea ( MessageVersion . CODE_KEY ) ; version = MessageControl . fixVersion ( version ) ; recMessageVersion . getField ( MessageVersion . CODE ) . setString ( version )...
GetMessageVersion Method .
15,579
public String getNumericVersionFromVersion ( String version ) { MessageVersion recMessageVersion = this . getMessageVersion ( version ) ; String numericVersion = DBConstants . BLANK ; if ( ( recMessageVersion != null ) && ( ! recMessageVersion . getField ( MessageVersion . NAMESPACE ) . isNull ( ) ) ) numericVersion = ...
GetNumericVersionFromVersion Method .
15,580
public String getIdFromVersion ( String version ) { MessageVersion recMessageVersion = this . getMessageVersion ( version ) ; String idVersion = DBConstants . BLANK ; if ( ( idVersion != null ) && ( ! recMessageVersion . getField ( MessageVersion . NAMESPACE ) . isNull ( ) ) ) idVersion = recMessageVersion . getField (...
GetIdFromVersion Method .
15,581
public static String fixVersion ( String version ) { if ( version != null ) if ( version . length ( ) > 0 ) { version = version . toUpperCase ( ) ; if ( Character . isLetter ( version . charAt ( 0 ) ) ) version = version . substring ( 1 , version . length ( ) ) + version . substring ( 0 , 1 ) ; } return version ; }
FixVersion Method .
15,582
public String getVersionFromSchemaLocation ( String schemaLocation ) { MessageVersion recMessageVersion = this . getMessageVersion ( ) ; recMessageVersion . close ( ) ; try { while ( recMessageVersion . hasNext ( ) ) { recMessageVersion . next ( ) ; String messageSchemaLocation = this . getSchemaLocation ( recMessageVe...
GetVersionFromSchemaLocation Method .
15,583
public Date getEndDate ( ) { if ( ( m_startTime != null ) && ( m_endTime != null ) ) { if ( m_endTime . before ( m_startTime ) ) return m_startTime ; } return m_endTime ; }
Get the ending time of this service .
15,584
public int setString ( String strString , boolean bDisplayOption , int iMoveMode ) { if ( this . getNextConverter ( ) != null ) return this . getNextConverter ( ) . setString ( strString , bDisplayOption , iMoveMode ) ; else return super . setString ( strString , bDisplayOption , iMoveMode ) ; }
Convert and move string to this field . Set the current string of the current next converter ..
15,585
public ScreenComponent setupDefaultView ( ScreenLoc itsLocation , ComponentParent targetScreen , Convert convert , int iDisplayFieldDesc , Map < String , Object > properties ) { ScreenComponent sField = null ; Converter converter = this . getNextConverter ( ) ; if ( converter != null ) sField = converter . setupDefault...
Set up the default control for this field . Adds the default screen control for the current converter and makes me it s converter .
15,586
public Converter getNextConverter ( ) { BaseTable currentTable = m_MergeRecord . getTable ( ) . getCurrentTable ( ) ; if ( currentTable == null ) return null ; if ( m_FieldSeq != - 1 ) { if ( m_strLinkedRecord == null ) return currentTable . getRecord ( ) . getField ( m_FieldSeq ) ; else return currentTable . getRecord...
Get the Current converter .
15,587
public static List < Field > getInstanceFields ( Class type ) { List < Field > fields = Lists . newArrayList ( type . getDeclaredFields ( ) ) ; return ImmutableList . copyOf ( Iterables . filter ( fields , InstanceFieldPredicate . PREDICATE ) ) ; }
Return all non - static and non - transient fields .
15,588
public static IDataEncoder getEncoder ( final String mimeType ) throws ClassNotFoundException , IllegalAccessException , InstantiationException { populateCache ( ) ; if ( ! cache . containsKey ( mimeType ) ) { throw new ClassNotFoundException ( String . format ( "IDataEncoder for" + " mimeType [%s] not found." , mimeTy...
Retrieve a encoder for a specified mime type .
15,589
public < T > T asObject ( String string , Class < T > valueType ) throws BugError { if ( string . length ( ) > 1 ) { throw new ConverterException ( "Trying to convert a larger string into a single character." ) ; } return ( T ) ( Character ) string . charAt ( 0 ) ; }
Return the first character from given string .
15,590
public String [ ] getFileList ( ) { String [ ] files = null ; String strFilename = this . getProperty ( "filename" ) ; if ( strFilename != null ) { files = new String [ 1 ] ; files [ 0 ] = strFilename ; } String strDirname = this . getProperty ( "folder" ) ; if ( strDirname != null ) { FileList list = new FileList ( st...
Get the list of files to read thru and import .
15,591
void add ( Scalar o ) { if ( ! type . equals ( o . type ) ) { throw new UnsupportedOperationException ( "Action with wrong kind of class" ) ; } value += o . value ; }
Add o value to this
15,592
void subtract ( Scalar o ) { if ( ! type . equals ( o . type ) ) { throw new UnsupportedOperationException ( "Action with wrong kind of class" ) ; } value -= o . value ; }
Subtract o value from this
15,593
protected void destroyRepository ( ) { final RepositoryImpl repository = ( RepositoryImpl ) getRepository ( ) ; repository . shutdown ( ) ; LOG . info ( "Destroyed repository at {}" , repository . getConfig ( ) . getHomeDir ( ) ) ; }
Closes the admin session and in case of local transient respository for unit test shuts down the repository and cleans all temporary files .
15,594
protected RepositoryImpl createRepository ( ) throws IOException { try { final RepositoryConfig config = createRepositoryConfiguration ( ) ; return RepositoryImpl . create ( config ) ; } catch ( final ConfigurationException e ) { LOG . error ( "Configuration invalid" , e ) ; throw new AssertionError ( e . getMessage ( ...
Creates a transient repository with files in the local temp directory .
15,595
public static final String delimitedLower ( String text , String delim ) { return stream ( text ) . map ( ( String s ) -> { return s . toLowerCase ( ) ; } ) . collect ( Collectors . joining ( delim ) ) ; }
Return camel - case if delim = -
15,596
public static final String delimited ( String text , String delim ) { return stream ( text ) . collect ( Collectors . joining ( delim ) ) ; }
Returns Camel - Case if delim = -
15,597
public int compare ( final Issue i1 , final Issue i2 ) { if ( null == i1 && null == i2 ) { return 0 ; } else if ( null == i1 ) { return 1 ; } else if ( null == i2 ) { return - 1 ; } else { return i1 . getCreatedOn ( ) . compareTo ( i2 . getCreatedOn ( ) ) ; } }
Compare creation date of given issues .
15,598
public ExecutorCommand < V > withExcludedExceptions ( List < Class < ? extends Exception > > excludedExceptions ) { config . setExcludedExceptions ( excludedExceptions ) ; return this ; }
If wrapped method throws one of passed exceptions breaker will pass it without opening connection .
15,599
public < V > V invoke ( Callable < V > callable ) throws Exception { return service . executeSynchronously ( callable , config ) ; }
Invokes callable synchronously with respecting circuit logic and cache logic if configured .