idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
15,400 | public int getLength ( ) { int length = 4 + 4 ; if ( this . identifierPatterns != null ) { for ( String identifier : this . identifierPatterns ) { try { length += ( 4 + identifier . getBytes ( "UTF-16BE" ) . length ) ; } catch ( UnsupportedEncodingException e ) { log . error ( "Unable to encode to UTF-16BE." ) ; } } } ... | Length of this object when encoded according to the Solver - World Model protocol . |
15,401 | public < T > T asObject ( String string , Class < T > valueType ) throws BugError { if ( "null" . equals ( string ) ) { return null ; } Number number = string . isEmpty ( ) ? 0 : parseNumber ( string ) ; if ( Types . equalsAny ( valueType , int . class , Integer . class ) ) { return ( T ) ( Integer ) number . intValue ... | Convert a string to a number of given type . If given string can t be stored into required type silent rounding is applied . If given string is empty return 0 since it is considered as an optional numeric input . |
15,402 | private Number parseNumber ( String string ) { if ( string . length ( ) > 2 && string . charAt ( 0 ) == '0' && string . charAt ( 1 ) == 'x' ) { return Long . parseLong ( string . substring ( 2 ) , 16 ) ; } return Double . parseDouble ( string ) ; } | Parse numeric string value to a number . |
15,403 | public static < T > ListDataKey < T > create ( String name , Class < T > dataClass ) { return create ( name , dataClass , true ) ; } | creates a list data key with the given name and type . Null types are allowed . |
15,404 | public XMLGregorianCalendar getTimeStamp ( ) { GregorianCalendar cal = new GregorianCalendar ( ) ; DatatypeFactory dt ; try { dt = DatatypeFactory . newInstance ( ) ; return dt . newXMLGregorianCalendar ( cal ) ; } catch ( DatatypeConfigurationException e ) { e . printStackTrace ( ) ; } return null ; } | Get the current timestamp . |
15,405 | public void setPayloadProperties ( BaseMessage message , Object msg ) { MessageDataDesc messageDataDesc = message . getMessageDataDesc ( null ) ; if ( messageDataDesc != null ) { Map < String , Class < ? > > mapPropertyNames = messageDataDesc . getPayloadPropertyNames ( null ) ; if ( mapPropertyNames != null ) { for ( ... | Move the standard payload properties from the message to the xml . |
15,406 | public void setPayloadProperty ( BaseMessage message , Object msg , String strKey , Class < ? > classKey ) { Object data = message . get ( strKey ) ; if ( data == null ) return ; this . setPayloadProperty ( data , msg , strKey , classKey ) ; } | Move this standard payload properties from the message to the xml . |
15,407 | public void setPayloadProperty ( Object data , Object msg , String strKey , Class < ? > classKey ) { String name = "set" + strKey ; try { Class < ? > [ ] params = { classKey } ; Method method = msg . getClass ( ) . getMethod ( name , params ) ; if ( method != null ) { Object [ ] datas = new Object [ 1 ] ; if ( data != ... | Move this standard payload data to the xml . |
15,408 | private static void populateCache ( ) { if ( cache == null ) { cache = new LinkedHashMap < > ( ) ; logger . info ( "IDataDecoders found:" ) ; ServiceLoader < IDataDecoder > loader = ServiceLoader . load ( IDataDecoder . class ) ; for ( IDataDecoder discoveredDecoder : loader ) { String name = discoveredDecoder . getCla... | Populates the cache . |
15,409 | public static IDataDecoder getDecoder ( final String mimeType ) throws ClassNotFoundException , IllegalAccessException , InstantiationException { populateCache ( ) ; if ( ! cache . containsKey ( mimeType ) ) { throw new ClassNotFoundException ( String . format ( "IDataDecoder for" + " mimeType [%s] not found." , mimeTy... | Retrieve a decoder for a specified mime type . |
15,410 | public final void setCancelable ( final Cancelable cancelable ) { if ( SwingUtilities . isEventDispatchThread ( ) ) { setCancelableIntern ( cancelable ) ; } else { try { SwingUtilities . invokeLater ( new Runnable ( ) { public void run ( ) { setCancelableIntern ( cancelable ) ; } } ) ; } catch ( final Exception ex ) { ... | Sets the listener to inform about the user cancelling the current transfer . |
15,411 | public static void main ( final String [ ] args ) { SwingUtilities . invokeLater ( new Runnable ( ) { public void run ( ) { Utils4Swing . initSystemLookAndFeel ( ) ; Utils4Swing . createShowAndPosition ( "Test Progress Dialog" , new FileCopyProgressPanel ( ) , true , new ScreenCenterPositioner ( ) ) ; } } ) ; } | Main method to test the panel . Only for testing purposes . |
15,412 | public int fieldChanged ( boolean bDisplayOption , int iMoveMode ) { if ( this . getOwner ( ) != null ) { IntegerField thisField = ( ( IntegerField ) this . getOwner ( ) . getRecord ( ) . getField ( m_iMainFilesFieldSeq ) ) ; if ( this . getOwner ( ) . getRecord ( ) . getRecordOwner ( ) != null ) if ( this . getOwner (... | The Field has Changed . Change the changed by user field . |
15,413 | protected void eliminate ( ) { int count = end - begin ; int mod = Math . floorMod ( begin , size ) ; while ( count > 0 && isRemovable ( mod ) ) { remove ( mod ) ; begin ++ ; count -- ; mod = Math . floorMod ( begin , size ) ; } } | Eliminate values that are no longer used in calculation |
15,414 | protected Object newArray ( Object old , int oldLen , Object arr ) { int sb = Math . floorMod ( begin , oldLen ) ; int se = Math . floorMod ( end , oldLen ) ; if ( sb < se ) { System . arraycopy ( old , sb , arr , sb , se - sb ) ; } else { System . arraycopy ( old , sb , arr , sb , oldLen - sb ) ; System . arraycopy ( ... | Returns new oldLen ring buffer |
15,415 | public List < String > readFile ( Reader reader ) throws Exception { try { if ( characteristics . doIgnoreCase ( ) ) { if ( characteristics . aloneOnLine ( ) ) { return readFileIgnoreCaseAloneOnLine ( reader ) ; } else { throw new Exception ( "Batch separator detection scheme not implemented" ) ; } } else { if ( charac... | Reads an SQL - script and identifies individual statements . The batch separator handling is dependent on the database manager |
15,416 | public void syncRecords ( Record recAlt , Record recMain ) { boolean bFieldsInSync = true ; m_buffer = new VectorBuffer ( null ) ; for ( int iIndex = 0 ; iIndex < recMain . getFieldCount ( ) ; iIndex ++ ) { BaseField fieldAlt = recAlt . getField ( iIndex ) ; BaseField fieldMain = null ; if ( bFieldsInSync ) fieldMain =... | Save the record state and copy the localized fields from the language record to the main record . |
15,417 | public void restoreMainRecord ( Record record , boolean altMatchesToNull ) { Iterator < BaseTable > iterator = this . getTables ( ) ; while ( iterator . hasNext ( ) ) { BaseTable table = iterator . next ( ) ; if ( ( table != null ) && ( table != this . getNextTable ( ) ) ) { Record record2 = table . getRecord ( ) ; thi... | Restore the unchangeable info from the buffer to this main record . |
15,418 | public void restoreMainRecord ( Record recAlt , Record recMain , boolean altMatchesToNull ) { if ( m_buffer != null ) m_buffer . resetPosition ( ) ; boolean bFieldsInSync = true ; for ( int iIndex = 0 ; iIndex < recAlt . getFieldCount ( ) ; iIndex ++ ) { BaseField fieldAlt = recAlt . getField ( iIndex ) ; BaseField fie... | Restore the main record s string fields to their original state from the buffer . |
15,419 | public int moveFieldToThis ( BaseField field , boolean bDisplayOption , int iMoveMode ) { if ( field == null ) return DBConstants . NORMAL_RETURN ; if ( field instanceof CounterField ) { if ( this . getReferenceRecord ( null , false ) == null ) if ( field . getRecord ( ) . getListener ( ClearFieldReferenceOnCloseHandle... | Move data to this field from another field . If these isn t a reference record yet figures out the reference record . |
15,420 | public Record getReference ( ) { Record record = this . getReferenceRecord ( ) ; if ( record != null ) { try { if ( this . getData ( ) == null ) { record . addNew ( ) ; return record ; } Object bookmark = this . getData ( ) ; if ( ( record . getEditMode ( ) == Constants . EDIT_IN_PROGRESS ) || ( record . getEditMode ( ... | Get the record that this field references and make it current . |
15,421 | public String getReferenceRecordName ( ) { if ( m_recordReference != null ) return this . getReferenceRecord ( ) . getTableNames ( false ) ; else { if ( this . getClass ( ) . getName ( ) . indexOf ( "Field" ) != - 1 ) return this . getClass ( ) . getName ( ) . substring ( Math . max ( 0 , this . getClass ( ) . getName ... | Get the record name that this field references . |
15,422 | public int setReference ( Record record , boolean bDisplayOption , int iMoveMode ) { return this . moveFieldToThis ( ( BaseField ) record . getCounterField ( ) , bDisplayOption , iMoveMode ) ; } | Make this field a reference to the current object in this record info class . |
15,423 | public void syncReference ( Record record ) { this . setReferenceRecord ( record ) ; BaseField recordKeyField = ( BaseField ) record . getCounterField ( ) ; if ( ( recordKeyField . isNull ( ) ) && ( ! this . isNull ( ) ) && ( ! record . isModified ( ) ) && ( record . getEditMode ( ) != DBConstants . EDIT_CURRENT ) && (... | Synchronize this refernce field with this record . Adds the behaviors to sync this field and the record . Used for popup screenfields where the referencerecord has a detail to display on change . |
15,424 | public ScreenComponent setupIconView ( ScreenLoc itsLocation , ComponentParent targetScreen , Convert converter , int iDisplayFieldDesc , boolean bIncludeBlankOption ) { ScreenComponent screenField = null ; Record record = this . makeReferenceRecord ( ) ; ImageField fldDisplayFieldDesc = this . getIconField ( record ) ... | Display a button that shows the icon from the current record in the secondary file . |
15,425 | public ImageField getIconField ( Record record ) { if ( record == null ) record = this . getReferenceRecord ( ) ; for ( int i = 0 ; i < record . getFieldCount ( ) ; i ++ ) { BaseField field = record . getField ( i ) ; if ( field instanceof ImageField ) return ( ImageField ) field ; } return null ; } | Get the IconField from this record . |
15,426 | public ScreenComponent setupPopupView ( ScreenLoc itsLocation , ComponentParent targetScreen , Convert converter , int iDisplayFieldDesc , boolean bIncludeBlankOption ) { ScreenComponent screenField = null ; Record record = this . makeReferenceRecord ( ) ; screenField = this . setupIconView ( itsLocation , targetScreen... | Add icon to popup . |
15,427 | public static boolean copyDirectory ( final File source , final File destination ) throws FileIsSecurityRestrictedException , IOException , FileIsADirectoryException , FileIsNotADirectoryException , DirectoryAlreadyExistsException { return copyDirectory ( source , destination , true ) ; } | Copies the given source directory to the given destination directory . |
15,428 | public static boolean copyDirectory ( final File source , final File destination , final boolean lastModified ) throws FileIsSecurityRestrictedException , IOException , FileIsADirectoryException , FileIsNotADirectoryException , DirectoryAlreadyExistsException { return copyDirectoryWithFileFilter ( source , destination ... | Copies the given source directory to the given destination directory with the option to set the lastModified time from the given destination file or directory . |
15,429 | public static boolean copyDirectoryWithFileFilter ( final File source , final File destination , final FileFilter fileFilter , final boolean lastModified ) throws IOException , FileIsNotADirectoryException , FileIsADirectoryException , FileIsSecurityRestrictedException , DirectoryAlreadyExistsException { return copyDir... | Copies all files that match to the FileFilter from the given source directory to the given destination directory with the option to set the lastModified time from the given destination file or directory . |
15,430 | public static boolean copyDirectoryWithFileFilter ( final File source , final File destination , final FileFilter includeFileFilter , final FileFilter excludeFileFilter , final Collection < File > excludeFiles , final boolean lastModified ) throws IOException , FileIsNotADirectoryException , FileIsADirectoryException ,... | Copies all files that match to the given includeFileFilter and does not copy all the files that match the excludeFileFilter from the given source directory to the given destination directory with the option to set the lastModified time from the given destination file or directory . |
15,431 | public static boolean copyDirectoryWithFilenameFilter ( final File source , final File destination , final FilenameFilter filenameFilter , final boolean lastModified ) throws IOException , FileIsNotADirectoryException , FileIsADirectoryException , FileIsSecurityRestrictedException , DirectoryAlreadyExistsException { re... | Copies all files that match to the FilenameFilter from the given source directory to the given destination directory with the option to set the lastModified time from the given destination file or directory . |
15,432 | public static boolean copyDirectoryWithFilenameFilter ( final File source , final File destination , final FilenameFilter includeFilenameFilter , final FilenameFilter excludeFilenameFilter , final boolean lastModified ) throws IOException , FileIsNotADirectoryException , FileIsADirectoryException , FileIsSecurityRestri... | Copies all files that match to the given includeFilenameFilter and does not copy all the files that match the excludeFilenameFilter from the given source directory to the given destination directory with the option to set the lastModified time from the given destination file or directory . |
15,433 | public static boolean copyFile ( final File source , final File destination ) throws IOException , FileIsADirectoryException { return copyFile ( source , destination , true ) ; } | Copies the given source file to the given destination file . |
15,434 | public static boolean copyFile ( final File source , final File destination , final boolean lastModified ) throws IOException { return copyFile ( source , destination , null , null , lastModified ) ; } | Copies the given source file to the given destination file with the option to set the lastModified time from the given destination file . |
15,435 | public static boolean copyFile ( final File source , final File destination , final Charset sourceEncoding , final Charset destinationEncoding , final boolean lastModified ) throws IOException { if ( source . isDirectory ( ) ) { throw new IllegalArgumentException ( "The source File " + destination . getName ( ) + " sho... | Copies the given source file to the given destination file with the given source encodings and destination encodings . |
15,436 | public static boolean copyFileToDirectory ( final File source , final File destinationDir ) throws FileIsNotADirectoryException , IOException , FileIsADirectoryException { return copyFileToDirectory ( source , destinationDir , true ) ; } | Copies the given source file to the given destination directory . |
15,437 | public static boolean copyFileToDirectory ( final File source , final File destinationDir , final boolean lastModified ) throws FileIsNotADirectoryException , IOException , FileIsADirectoryException { if ( null == destinationDir ) { throw new IllegalArgumentException ( "Destination must not be null" ) ; } if ( ! destin... | Copies the given source file to the given destination directory with the option to set the lastModified time from the given destination directory . |
15,438 | protected int doUpdate ( JdbcTemplate jdbcTemplate , TaskRequest req , TaskResponse res ) { final List < Phrase > parametersInUse = update_parameters != null ? update_parameters : parameters ; final PreparedStatementSetter preparedStatementSetter = new PhraseParameterPreparedStatementSetter ( parametersInUse , req , re... | Executes the update and returns the affected row count |
15,439 | protected int doInsert ( JdbcTemplate jdbcTemplate , TaskRequest req , TaskResponse res ) { final List < Phrase > parametersInUse = insert_parameters != null ? insert_parameters : parameters ; final PreparedStatementSetter preparedStatementSetter = new PhraseParameterPreparedStatementSetter ( parametersInUse , req , re... | Executes the insert and returns the affected row count |
15,440 | public static int decodeSingle ( final byte [ ] input , final int inoff ) { if ( input == null ) { throw new NullPointerException ( "input" ) ; } if ( input . length < 2 ) { throw new IllegalArgumentException ( "input.length(" + input . length + ") < 2" ) ; } if ( inoff < 0 ) { throw new IllegalArgumentException ( "ino... | Decodes two nibbles in given input array and returns the decoded octet . |
15,441 | public static void decodeSingle ( final byte [ ] input , final int inoff , final byte [ ] output , final int outoff ) { if ( output == null ) { throw new NullPointerException ( "output" ) ; } if ( outoff < 0 ) { throw new IllegalArgumentException ( "outoff(" + outoff + ") < 0" ) ; } if ( outoff >= output . length ) { t... | Decodes two nibbles in given input array and writes the resulting single octet into specified output array . |
15,442 | public static void decodeMultiple ( final byte [ ] input , int inoff , final byte [ ] output , int outoff , final int count ) { if ( count < 0 ) { throw new IllegalArgumentException ( "count(" + count + ") < 0" ) ; } for ( int i = 0 ; i < count ; i ++ ) { decodeSingle ( input , inoff , output , outoff ) ; inoff += 2 ; ... | Decodes multiple units in given input array and writes the resulting octets into specifed output array . |
15,443 | public static byte [ ] decodeMultiple ( final byte [ ] input ) { if ( input == null ) { throw new NullPointerException ( "input" ) ; } final byte [ ] output = new byte [ input . length >> 1 ] ; decodeMultiple ( input , 0 , output , 0 , output . length ) ; return output ; } | Encodes given sequence of nibbles into a sequence of octets . |
15,444 | public String decodeToString ( final byte [ ] input , final String outputCharset ) throws UnsupportedEncodingException { return new String ( decode ( input ) , outputCharset ) ; } | Decodes given sequence of nibbles into a string . |
15,445 | public int setString ( String strField , boolean bDisplayOption , int iMoveMode ) { int iFieldLength = 0 ; Object objTempBinary = null ; if ( strField != null ) { iFieldLength = strField . length ( ) ; int iMaxLength = this . getMaxLength ( ) ; if ( ( iFieldLength > iMaxLength ) || ( iFieldLength > 40 ) ) iFieldLength ... | Convert and move string to this field . This Data is in a binary format so convert it and move it . |
15,446 | public Distance getRadius ( Velocity velocity ) { Distance circle = velocity . getDistance ( getTimeForFullCircle ( ) ) ; circle . mul ( 1 / Math . PI ) ; return circle ; } | Returns the radius of the circle |
15,447 | public Motion getMotionAfter ( Motion motion , TimeSpan span ) { return new Motion ( motion . getSpeed ( ) , getBearingAfter ( motion . getAngle ( ) , span ) ) ; } | Return s motion after timespan |
15,448 | public Map < String , Object > apply ( final Map < String , Object > row ) { Map < String , Object > cleanRow , filteredRow ; if ( row == null ) { cleanRow = new LinkedHashMap < > ( ) ; } else { cleanRow = new LinkedHashMap < > ( row ) ; } filteredRow = new LinkedHashMap < > ( ) ; for ( String column : columns ) { if (... | Apply the filter . |
15,449 | public File collect ( Path projectRoot ) throws IOException , ZipException { DataArchiver dataArchiver = new DataArchiver ( projectRoot ) ; try { ProjectFileVisitor fileVisitor = new ProjectFileVisitor ( dataArchiver , projectRoot ) ; Files . walkFileTree ( projectRoot , fileVisitor ) ; dataArchiver . add ( "DWFileList... | Gathers needed information about project |
15,450 | public static URL locateContextConfig ( String webappRootContext , String userSpecifiedContextLocation , URL defaultLocation ) { if ( webappRootContext == null ) { String msg = "Argument 'webappRootContext' cannot be null." ; throw new IllegalArgumentException ( msg ) ; } URL rslt = null ; if ( userSpecifiedContextLoca... | Locate the configuration file if present for a Portlet or Servlet . |
15,451 | public static Class compileClass ( String name , String code , List < Class > classPath ) throws Exception { JavaCompiler compiler = ToolProvider . getSystemJavaCompiler ( ) ; DiagnosticCollector < JavaFileObject > diagnostics = new DiagnosticCollector < JavaFileObject > ( ) ; MemoryJavaFileManager fileManager = new Me... | Compiles Java code and returns compiled class back . |
15,452 | public void init ( BaseMessage message , Object objRawMessage ) { m_message = message ; if ( message != null ) message . setExternalMessage ( this ) ; if ( objRawMessage != null ) this . setRawData ( objRawMessage ) ; } | Initialize new ExternalTrxMessage . |
15,453 | public void moveHeaderParams ( Map < String , Object > mapMessage , Map < String , Object > mapHeader ) { for ( int i = 0 ; i < m_rgstrHeaderParams . length ; i ++ ) { if ( mapMessage . get ( m_rgstrHeaderParams [ i ] ) != null ) if ( mapHeader . get ( m_rgstrHeaderParams [ i ] ) == null ) { Object objValue = mapMessag... | Move the header params from the message map to the header map . |
15,454 | public Document getScratchDocument ( DocumentBuilder db ) { if ( m_doc == null ) { m_doc = db . newDocument ( ) ; } return m_doc ; } | Get the scratch document for this message . Creates a new document the first time . |
15,455 | public String getXSLTDocument ( ) { TrxMessageHeader messageHeader = ( TrxMessageHeader ) this . getMessage ( ) . getMessageHeader ( ) ; String strDocument = null ; if ( messageHeader != null ) strDocument = ( String ) messageHeader . get ( TrxMessageHeader . XSLT_DOCUMENT ) ; return strDocument ; } | Get the XSLT Document to do the conversion . Override this if you have a standard document to suppyl . |
15,456 | public StreamSource getTransformerStream ( String strDocument ) { StreamSource source = null ; if ( strDocument == null ) strDocument = this . getXSLTDocument ( ) ; if ( strDocument == null ) { Reader reader = new StringReader ( XSL_CONVERT ) ; source = new StreamSource ( reader ) ; return source ; } if ( strDocument .... | Get the XSLT transformer stream from this file or URL String . |
15,457 | public Collection < PatientListItem > getListItems ( ) { if ( ! noCaching && patients != null ) { return patients ; } patients = new ArrayList < > ( ) ; AbstractPatientListFilter filter = isFiltered ( ) ? getActiveFilter ( ) : null ; PatientListFilterEntity entity = filter == null ? null : ( PatientListFilterEntity ) f... | Returns the patient list . |
15,458 | public static final < K , V > MapList < K , V > unmodifiableMapList ( MapList < K , V > map ) { return new UnmodifiableMapList ( Collections . unmodifiableMap ( map ) , map . getComparator ( ) ) ; } | Returns unmodifiable MapList . |
15,459 | public static final < K , V > MapSet < K , V > unmodifiableMapSet ( MapSet < K , V > set ) { return new UnmodifiableMapSet ( set ) ; } | Returns unmodifiable MapSet . |
15,460 | public void free ( ) { m_keyArea . removeKeyField ( this ) ; m_keyArea = null ; m_field = null ; if ( m_fieldTempParam != null ) m_fieldTempParam . free ( ) ; m_fieldTempParam = null ; if ( m_fieldStartParam != null ) m_fieldStartParam . free ( ) ; m_fieldStartParam = null ; if ( m_fieldEndParam != null ) m_fieldEndPar... | Free this key field . |
15,461 | public BaseField getField ( int iAreaDesc ) { switch ( iAreaDesc ) { default : case DBConstants . FILE_KEY_AREA : return m_field ; case DBConstants . TEMP_KEY_AREA : if ( m_fieldTempParam == null ) { try { m_fieldTempParam = ( BaseField ) m_field . clone ( ) ; m_fieldTempParam . setFieldName ( new String ( m_field . ge... | Get the field that this KeyField points to . |
15,462 | private String getInjectionSetting ( final String input , final char startDelim ) { return input == null || input . equals ( "" ) ? null : StringUtilities . split ( input , startDelim ) [ 0 ] . trim ( ) ; } | Gets the Injection Setting for these options when using the String Constructor . |
15,463 | public int removeCallback ( IConnectionStateCallback criteria ) { List < IConnectionStateCallback > listCallbacks = getConnectionDetail ( ) . getConnCallbacks ( ) ; if ( listCallbacks . size ( ) <= 1 ) { getConnectionDetail ( ) . unHappyDisconnect ( ) ; listCallbacks . remove ( criteria ) ; DefaultConnectionList connLi... | Returns the count of callbacks still listening to this . This method will perform a hard disconnect if 0 is returned . |
15,464 | public Site overrideWith ( final Site other ) { return new Site ( other . id > 0L ? other . id : this . id , other . baseURL != null ? other . baseURL : this . baseURL , other . title != null ? other . title : this . title , other . description != null ? other . description : this . description , other . permalinkStruc... | Overrides values in this site with those in another if set . |
15,465 | public String buildPermalink ( final Post post ) { final String authorSlug = post . author != null ? Strings . nullToEmpty ( post . author . slug ) : "" ; final List < TaxonomyTerm > categories = post . categories ( ) ; final Term categoryTerm = categories . size ( ) > 0 ? categories . get ( 0 ) . term : defaultCategor... | Builds the permalink for a post from this site . |
15,466 | public void init ( Object obj ) { for ( int i = 0 ; i < MAX_ICONS ; i ++ ) { ImageIcon icon = this . getImageIcon ( i ) ; if ( icon == null ) break ; this . addIcon ( icon , i ) ; } } | Creates new JBlinkLabel . |
15,467 | public java . awt . Component getTableCellRendererComponent ( JTable table , Object value , boolean isSelected , boolean hasFocus , int row , int column ) { if ( m_table == null ) { m_table = table ; TableColumnModel columnModel = table . getColumnModel ( ) ; for ( int iColumn = 0 ; iColumn < columnModel . getColumnCou... | If this control is in a JTable this is how to render it . |
15,468 | public ImageIcon getImageIcon ( Object value ) { if ( value == null ) return m_rgIcons [ 0 ] ; String strType = value . toString ( ) ; int iType = 0 ; try { iType = Integer . parseInt ( strType ) ; } catch ( NumberFormatException ex ) { } if ( m_rgIcons == null ) return null ; int iIconCount = 0 ; for ( int i = 1 ; i <... | Here is the value of this object display the correct image . |
15,469 | public void addIcon ( Object icon , int iIndex ) { if ( m_rgIcons == null ) { m_rgIcons = new ImageIcon [ MAX_ICONS ] ; m_timer = new javax . swing . Timer ( 500 , this ) ; m_timer . start ( ) ; } if ( iIndex < MAX_ICONS ) if ( icon instanceof ImageIcon ) m_rgIcons [ iIndex ] = ( ImageIcon ) icon ; } | Add this icon to the list of icons alternating for this label . |
15,470 | public void set ( Object value ) { try { Object v = ConvertUtility . convert ( type , value ) ; if ( field != null ) { field . set ( getBase ( ) , v ) ; } else { setter . invoke ( getBase ( ) , v ) ; } } catch ( IllegalAccessException | IllegalArgumentException | InvocationTargetException ex ) { throw new IllegalArgume... | Set value using type conversions |
15,471 | public void renderItem ( final Comboitem item , final Document doc ) { item . setLabel ( doc . getTitle ( ) ) ; } | Render the combo item for the specified document . |
15,472 | public String readFile ( String filename ) { String path = m_fileSource . getParent ( ) ; String string = Utility . transferURLStream ( "file:" + path + '/' + filename , null , null , null ) ; if ( string != null ) { int start = string . indexOf ( "<repository" ) ; if ( start != - 1 ) start = string . indexOf ( ">" , s... | ReadFile Method . |
15,473 | public static boolean compareFilesByAbsolutePath ( final File sourceFile , final File fileToCompare ) { return CompareFileExtensions . compareFiles ( sourceFile , fileToCompare , false , true , true , true , true , true ) . getAbsolutePathEquality ( ) ; } | Compare files by absolute path . |
15,474 | public static boolean compareFilesByChecksumCRC32 ( final File sourceFile , final File fileToCompare ) throws IOException { final long checksumSourceFile = ChecksumExtensions . getCheckSumCRC32 ( sourceFile ) ; final long checksumFileToCompare = ChecksumExtensions . getCheckSumCRC32 ( fileToCompare ) ; return checksumS... | Compare files by checksum with the algorithm CRC32 . |
15,475 | public static boolean compareFilesByContent ( final File sourceFile , final File fileToCompare ) { return CompareFileExtensions . compareFiles ( sourceFile , fileToCompare , true , true , true , true , true , false ) . getContentEquality ( ) ; } | Compare files by content . |
15,476 | public static boolean compareFilesByExtension ( final File sourceFile , final File fileToCompare ) { return CompareFileExtensions . compareFiles ( sourceFile , fileToCompare , true , false , true , true , true , true ) . getFileExtensionEquality ( ) ; } | Compare files by extension . |
15,477 | public static boolean compareFilesByLastModified ( final File sourceFile , final File fileToCompare ) { return CompareFileExtensions . compareFiles ( sourceFile , fileToCompare , true , true , true , false , true , true ) . getLastModifiedEquality ( ) ; } | Compare files by last modified . |
15,478 | public static boolean compareFilesByLength ( final File sourceFile , final File fileToCompare ) { return CompareFileExtensions . compareFiles ( sourceFile , fileToCompare , true , true , false , true , true , true ) . getLengthEquality ( ) ; } | Compare files by length . |
15,479 | public static boolean compareFilesByName ( final File sourceFile , final File fileToCompare ) { return CompareFileExtensions . compareFiles ( sourceFile , fileToCompare , true , true , true , true , false , true ) . getNameEquality ( ) ; } | Compare files by name . |
15,480 | public < T extends Exception > T rethrow ( Class < T > exceptionType ) { return exceptionType . cast ( getCause ( ) ) ; } | Get the wrapped exception for re - throwing . |
15,481 | private MediaTracker getTracker ( ) { synchronized ( this ) { if ( tracker == null ) { @ SuppressWarnings ( "serial" ) Component comp = new Component ( ) { } ; tracker = new MediaTracker ( comp ) ; } } return ( MediaTracker ) tracker ; } | Returns the MediaTracker for the current AppContext creating a new MediaTracker if necessary . |
15,482 | public void run ( Reader in , Writer out ) throws RuleException { try { AddDoc addDoc = AddDoc . read ( in ) ; addDoc . getFields ( ) . add ( field ) ; addDoc . write ( out ) ; } catch ( JAXBException jaxbe ) { throw new RuleException ( jaxbe . getLinkedException ( ) ) ; } } | Adds a single field to a Solr document |
15,483 | public static FilesIterator < String > getRelativeNamesIterator ( File baseDir ) { return new FilesIterator < String > ( baseDir , Strategy . RELATIVE_NAMES ) ; } | Create relative file names iterator . |
15,484 | public static FilesIterator < File > getAbsoluteIterator ( String baseDir ) { return new FilesIterator < File > ( new File ( baseDir ) , Strategy . FILES ) ; } | Create absolute path files iterator . |
15,485 | public static FilesIterator < File > getRelativeIterator ( String baseDir ) { return new FilesIterator < File > ( new File ( baseDir ) , Strategy . RELATIVE_FILES ) ; } | Create relative path files iterator . |
15,486 | public static FilesIterator < String > getAbsoluteNamesIterator ( String baseDir ) { return new FilesIterator < String > ( new File ( baseDir ) , Strategy . NAMES ) ; } | Create absolute file names iterator . |
15,487 | private boolean isLoopExitCondition ( ) { while ( workingDirectory . index == workingDirectory . files . length ) { if ( stack . isEmpty ( ) ) { return true ; } pop ( ) ; } return false ; } | Test for iteration loop exit condition . Iteration loop is ended if current working directory index reaches its files count and there is no more directories on stack . |
15,488 | public void init ( Record record , RecordOwner recordOwner , Record recordToSync , boolean bUpdateOnSelect , int iEventToTrigger ) { super . init ( record ) ; m_recordOwner = recordOwner ; m_recordToSync = recordToSync ; m_bUpdateOnSelect = bUpdateOnSelect ; m_iEventToTrigger = iEventToTrigger ; } | OnSelectHandler - Constructor . |
15,489 | public void setOwner ( ListenerOwner owner ) { super . setOwner ( owner ) ; if ( owner != null ) if ( m_recordToSync != null ) { if ( ! m_recordToSync . getBaseRecord ( ) . getTableNames ( false ) . equals ( this . getOwner ( ) . getBaseRecord ( ) . getTableNames ( false ) ) ) { m_recordToSync = null ; return ; } m_rec... | Set the field or file that owns this listener . I Check to make sure that the base tables are the same first . |
15,490 | public RecordMessage createMessage ( Object bookmark ) { int iRecordMessageType = DBConstants . SELECT_TYPE ; RecordMessageHeader messageHeader = new RecordMessageHeader ( this . getOwner ( ) , bookmark , null , iRecordMessageType , null ) ; RecordMessage message = new RecordMessage ( messageHeader ) ; message . put ( ... | Create the record message . Override this to add information to the message . |
15,491 | public boolean shutdownService ( Object service , BundleContext context ) { if ( service instanceof BaseServiceMessageTransport ) ( ( BaseServiceMessageTransport ) service ) . free ( ) ; return super . shutdownService ( service , context ) ; } | Stop this service . Override this to do all the startup . |
15,492 | public void fork ( K to , M msg ) { if ( maxParallelism == 0 ) { throw new IllegalArgumentException ( "maxParallelism == 0, fork() not allowed! Use switchTo." ) ; } try { stopSemaphore . acquire ( ) ; parallelSet . add ( getCurrentKey ( ) ) ; doFork ( to , msg ) ; } catch ( InterruptedException ex ) { throw new Illegal... | Fork executing thread . |
15,493 | public M join ( ) { if ( threadMap . isEmpty ( ) ) { throw new IllegalStateException ( "threads are already interrupted" ) ; } Thread currentThread = Thread . currentThread ( ) ; Semaphore currentSemaphore = semaphoreMap . get ( currentThread ) ; if ( currentSemaphore == null ) { throw new IllegalStateException ( "Curr... | Thread waits until another thread calls fork switchTo or endTo method using threads key . Returns message from another thread . |
15,494 | public M switchTo ( K to , M msg ) { doFork ( to , msg ) ; return doJoin ( ) ; } | Switch executing thread . |
15,495 | public void endTo ( K to , M msg ) { K key = getCurrentKey ( ) ; if ( key . equals ( to ) ) { throw new IllegalArgumentException ( "current and to are equals" ) ; } if ( key != null ) { kill ( key ) ; doFork ( to , msg ) ; throw new ThreadStoppedException ( "suicide" ) ; } else { throw new IllegalArgumentException ( "c... | Ends the current thread and switches to |
15,496 | public K getCurrentKey ( ) { lock . lock ( ) ; try { Thread currentThread = Thread . currentThread ( ) ; for ( Entry < K , Thread > entry : threadMap . entrySet ( ) ) { if ( currentThread . equals ( entry . getValue ( ) ) ) { return entry . getKey ( ) ; } } return null ; } finally { lock . unlock ( ) ; } } | Returns key for current thread . Returns null if current thread is not part of the workflow . |
15,497 | public void waitAndStopThreads ( ) { try { if ( threadMap . isEmpty ( ) ) { throw new IllegalStateException ( "threads are already interrupted" ) ; } stopSemaphore . acquire ( maxParallelism ) ; stopThreads ( ) ; } catch ( InterruptedException ex ) { throw new IllegalArgumentException ( ex ) ; } } | Wait until parallel excecuting threads have joined . After that interrupt all other than the calling thread . |
15,498 | public void stopThreads ( ) { if ( threadMap . isEmpty ( ) ) { throw new IllegalStateException ( "threads are already interrupted" ) ; } lock . lock ( ) ; try { Thread currentThread = Thread . currentThread ( ) ; for ( Thread thread : threadMap . values ( ) ) { if ( ! currentThread . equals ( thread ) ) { thread . inte... | Interrupt all other than the calling thread . |
15,499 | public < R > R accessContext ( ContextAccess < C , R > access ) { contextLock . lock ( ) ; try { return access . access ( context ) ; } finally { contextLock . unlock ( ) ; } } | Provides thread save access to the context object . ContextAccess . access method is called inside a lock to prevent concurrent modification to the object . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.