idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
16,300
public static Method getMethod ( Class < ? > target , MethodFilter methodFilter ) { Set < Method > methods = getMethods ( target , methodFilter ) ; if ( ! methods . isEmpty ( ) ) { return methods . iterator ( ) . next ( ) ; } return null ; }
Returns the method declared by the target class and any of its super classes which matches the supplied methodFilter if method is found null is returned . If more than one method is found the first in the resulting set iterator is returned .
16,301
public static void verifyMethodSignature ( Method method , Class < ? > returnType , Class < ? > ... parameters ) { if ( method == null ) { throw new IllegalArgumentException ( "Method is null" ) ; } if ( ! method . getReturnType ( ) . equals ( returnType ) ) { throw new IllegalArgumentException ( "Method " + method + "...
Verify that the supplied method s signature matches return type and parameters types
16,302
public void addButtons ( ) { this . addButton ( Constants . BACK ) ; this . addButton ( Constants . GRID ) ; this . addButton ( Constants . SUBMIT ) ; this . addButton ( Constants . RESET ) ; this . addButton ( Constants . DELETE ) ; this . addButton ( Constants . HELP ) ; }
Add the buttons to this window .
16,303
public void setOwner ( ListenerOwner owner ) { if ( owner != null ) if ( m_buffer == null ) { KeyArea keyArea = ( ( Record ) owner ) . getKeyArea ( - 1 ) ; m_buffer = new VectorBuffer ( null ) ; keyArea . setupKeyBuffer ( m_buffer , DBConstants . FILE_KEY_AREA ) ; } super . setOwner ( owner ) ; }
Set the record that owns this listener . This method caches the current key values .
16,304
public void fill ( IntBiPredicate isInside , int replacement ) { fill ( 0 , 0 , width , height , isInside , ( x , y ) -> replacement ) ; }
Fills area . Pixels fullfilling target are replaced with replacement color .
16,305
protected Properties getLockProperties ( String name ) { return lockProperties != null ? lockProperties . get ( name ) : null ; }
Get a lock s properties
16,306
public User getUser ( ) { ClientResource resource = new ClientResource ( Route . ME . url ( ) ) ; resource . setChallengeResponse ( this . auth . toChallenge ( ) ) ; try { Representation repr = resource . get ( ) ; return mapper . readValue ( repr . getText ( ) , User . class ) ; } catch ( IOException ex ) { LEX4JLogge...
Returns the current user
16,307
public List < User > getUserList ( boolean concise , int start , int amount ) { ClientResource resource = new ClientResource ( Route . ALL_USER . url ( ) ) ; Reference ref = resource . getReference ( ) ; Map < String , Object > param = new HashMap < > ( ) ; param . put ( "concise" , concise ) ; param . put ( "start" , ...
Returns all users
16,308
public List < DownloadListItem > getDownloadList ( ) { ClientResource resource = new ClientResource ( Route . DOWNLOAD_LIST . url ( ) ) ; resource . setChallengeResponse ( this . auth . toChallenge ( ) ) ; try { Representation repr = resource . get ( ) ; return mapper . readValue ( repr . getText ( ) , new TypeReferenc...
Returns the download list of the current user
16,309
public List < DownloadHistoryItem > getDownloadHistory ( ) { ClientResource resource = new ClientResource ( Route . DOWNLOAD_HISTORY . url ( ) ) ; resource . setChallengeResponse ( this . auth . toChallenge ( ) ) ; try { String result = resource . get ( ) . getText ( ) ; return mapper . readValue ( result , new TypeRef...
Returns the download history of the current user
16,310
public void postRegistration ( String username , String password , String email , String fullname ) { ClientResource resource = new ClientResource ( Route . REGISTER . url ( ) ) ; Form form = new Form ( ) ; form . add ( "username" , username ) ; form . add ( "password_1" , password ) ; form . add ( "password_2" , passw...
Registers a new user for the SC4D LEX
16,311
public void getActivation ( String key ) { ClientResource resource = new ClientResource ( Route . ACTIVATE . url ( ) ) ; Reference ref = resource . getReference ( ) ; Map < String , Object > param = new HashMap < > ( ) ; param . put ( "activation_key" , key ) ; Route . addParameters ( ref , param ) ; resource . get ( )...
Activates a user on the SC4D LEX
16,312
protected void createWebAppContext ( ) { webapp = new WebAppContext ( ) ; webapp . setThrowUnavailableOnStartupException ( true ) ; webapp . setServerClasses ( getServerClasses ( ) ) ; webapp . setContextPath ( getContextPath ( ) ) ; webapp . setTempDirectory ( createTempDir ( "jetty-app-" ) ) ; setSecureCookies ( ) ; ...
Create the WebAppContext with basic configurations set like context path etc .
16,313
public void startServer ( ) { server = new Server ( httpPort ) ; server . setHandler ( wrapHandlers ( ) ) ; if ( isWebSocketInClassPath ( ) ) { setupForWebSocket ( ) ; } try { server . start ( ) ; log ( ) . info ( "server started" ) ; Runtime . getRuntime ( ) . addShutdownHook ( new Thread ( new ShutdownRunnable ( ) ) ...
Start the Jetty server .
16,314
protected void setSecureCookies ( ) { SessionManager sessionManager = webapp . getSessionHandler ( ) . getSessionManager ( ) ; if ( ! ( sessionManager instanceof AbstractSessionManager ) ) { throw new RuntimeException ( "Cannot set secure cookies on session manager." ) ; } AbstractSessionManager abstractSessionManager ...
Set the secure cookies setting on the jetty session manager .
16,315
public static File copy ( InputStream stream ) throws IOException { File file = createTempFile ( ) ; copy ( stream , new FileOutputStream ( file ) ) ; return file ; }
Binary copy to temporary file . Be aware that temporary file is removed at JVM exit .
16,316
public static File copy ( URL url , String encoding ) throws IOException , IllegalArgumentException { Params . notNull ( url , "Source URL" ) ; URLConnection connection = url . openConnection ( ) ; connection . setDoInput ( true ) ; return copy ( connection . getInputStream ( ) , encoding ) ; }
Copy text from URL using specified encoding to local temporary file then close both URL input stream and temporary file .
16,317
public static File copy ( InputStream stream , String encoding ) throws IOException { File file = createTempFile ( ) ; copy ( new InputStreamReader ( stream , encoding ) , new OutputStreamWriter ( new FileOutputStream ( file ) , encoding ) ) ; return file ; }
Copy text from byte stream using specified encoding to temporary file then close both input stream and temporary file . Be aware that temporary file is removed at JVM exit .
16,318
public static File copy ( Reader reader ) throws IOException { File file = createTempFile ( ) ; copy ( reader , new FileWriter ( file ) ) ; return file ; }
Copy text from character stream to temporary file then close both the source reader and temporary file . Be aware that temporary file is removed at JVM exit .
16,319
public static long copy ( File source , File target ) throws FileNotFoundException , IOException { return copy ( new FileInputStream ( source ) , new FileOutputStream ( target ) ) ; }
Copy source file to target . Copy destination should be a file and this method throws access denied if attempt to write to a directory . Source file should exist but target is created by this method but if not already exist .
16,320
public static int copy ( Reader reader , Writer writer ) throws IOException { Params . notNull ( reader , "Reader" ) ; Params . notNull ( writer , "Writer" ) ; if ( ! ( reader instanceof BufferedReader ) ) { reader = new BufferedReader ( reader ) ; } if ( ! ( writer instanceof BufferedWriter ) ) { writer = new Buffered...
Copy characters from a reader to a given writer then close both character streams .
16,321
public static long copy ( InputStream inputStream , File file ) throws FileNotFoundException , IOException { return copy ( inputStream , new FileOutputStream ( file ) ) ; }
Copy bytes from requested input stream to given target file . This method creates the target file if does not already exist .
16,322
public static long copy ( URL url , File file ) throws FileNotFoundException , IOException { return copy ( url , new FileOutputStream ( file ) ) ; }
Copy bytes from remote file denoted by given URL to specified local file . This method creates local file if not already exists .
16,323
public static long copy ( File file , OutputStream outputStream ) throws IOException { Params . notNull ( file , "Input file" ) ; return copy ( new FileInputStream ( file ) , outputStream ) ; }
Copy source file bytes to requested output stream . Note that output stream is closed after transfer completes including on error .
16,324
public static void dump ( InputStream inputStream ) throws IOException { if ( ! ( inputStream instanceof BufferedInputStream ) ) { inputStream = new BufferedInputStream ( inputStream ) ; } try { byte [ ] buffer = new byte [ BUFFER_SIZE ] ; int length ; while ( ( length = inputStream . read ( buffer ) ) != - 1 ) { Syste...
Dump byte input stream content to standard output till end of input stream . Input stream is closed .
16,325
public static boolean move ( String sourcePath , String targetPath ) throws IllegalArgumentException { Params . notNull ( sourcePath , "Source path" ) ; Params . notNull ( targetPath , "Target path" ) ; File sourceFile = new File ( sourcePath ) ; if ( ! sourceFile . exists ( ) ) { log . error ( "Missing file to move |%...
Move source file to requested destination but do not overwrite . This method takes care to not overwrite destination file and returns false if it already exists . Note that this method does not throw exceptions if move fails and caller should always test returned boolean to determine if operation completes .
16,326
public static List < String > getPathComponents ( File file ) { if ( file == null ) { return Collections . emptyList ( ) ; } List < String > pathComponents = new ArrayList < String > ( ) ; do { pathComponents . add ( 0 , file . getName ( ) ) ; file = file . getParentFile ( ) ; } while ( file != null ) ; return pathComp...
Get file path components . Return a list of path components in their natural order . List first item is path root stored as an empty string ; if file argument is empty returned list contains only root . If file argument is null returns empty list .
16,327
public static String removeExtension ( String path ) throws IllegalArgumentException { Params . notNull ( path , "Path" ) ; int extensionIndex = path . lastIndexOf ( '.' ) ; return extensionIndex != - 1 ? path . substring ( 0 , extensionIndex ) : path ; }
Remove extension from given file path and return resulting path .
16,328
public static File removeExtension ( File file ) throws IllegalArgumentException { Params . notNull ( file , "File" ) ; return new File ( removeExtension ( file . getPath ( ) ) ) ; }
Remove extension from given file and create a new one with resulting path .
16,329
public static String replaceExtension ( String path , String newExtension ) throws IllegalArgumentException { Params . notNull ( path , "Path" ) ; Params . notNull ( newExtension , "New extension" ) ; if ( newExtension . charAt ( 0 ) == '.' ) { newExtension = newExtension . substring ( 1 ) ; } int extensionDotIndex = p...
Replace extension on given file path and return resulting path . Is legal for new extension parameter to start with dot extension separator but is not mandatory .
16,330
public static File replaceExtension ( File file , String newExtension ) throws IllegalArgumentException { Params . notNull ( file , "File" ) ; return new File ( replaceExtension ( file . getPath ( ) , newExtension ) ) ; }
Replace extension on given file and return resulting file .
16,331
public static String dot2path ( String qualifiedName ) { return qualifiedName != null ? DOT_PATTERN . matcher ( qualifiedName ) . replaceAll ( Matcher . quoteReplacement ( File . separator ) ) : null ; }
Replace all dots from given qualified name with platform specific path separator .
16,332
public static String basename ( String path ) { return path != null ? basename ( new File ( path ) ) : null ; }
Return base name for given file path . Returns null if given path parameter is null .
16,333
private static File createTempFile ( ) throws IOException { File file = File . createTempFile ( TMP_FILE_PREFIX , TMP_FILE_EXTENSION ) ; file . deleteOnExit ( ) ; return file ; }
Create temporary file using library specific prefix and extension . Created file is removed at JVM exit .
16,334
public static boolean isImage ( File file ) { return file != null ? IMAGE_FILE_EXTENSIONS . contains ( Files . getExtension ( file ) ) : false ; }
Guess if file is an image file based on file extension . This is a very trivial test relying on file extension and obviously cannot guarantee correct results .
16,335
public static byte [ ] getFileDigest ( InputStream inputStream ) throws IOException { if ( ! ( inputStream instanceof BufferedInputStream ) ) { inputStream = new BufferedInputStream ( inputStream ) ; } MessageDigest messageDigest = null ; try { byte [ ] buffer = new byte [ 1024 ] ; messageDigest = MessageDigest . getIn...
Create MD5 message digest for bytes produced by given input stream till its end . This method returns a 16 - bytes array with computed MD5 message digest value . Note that input stream is read till its end and is closed before this method returning including on stream read error .
16,336
public static void delete ( File file ) throws IOException { Params . notNull ( file , "File" ) ; if ( file . exists ( ) && ! file . delete ( ) ) { throw new IOException ( Strings . format ( "Fail to delete file |%s|." , file ) ) ; } }
Delete file if exists throwing exception if delete fails . Note that this method does nothing if file does not exist ; anyway null parameter sanity check is still performed .
16,337
public static String normalizePath ( String path ) { if ( File . separatorChar == '/' ) { return path . replace ( '\\' , '/' ) ; } return path . replace ( '/' , '\\' ) ; }
Ensure that path separators are compatible with current operating system .
16,338
public String getProperties ( String strCommand , Map < String , Object > properties ) { int iIndex = strCommand . indexOf ( '=' ) ; if ( iIndex != - 1 ) { if ( this . getParentScreen ( ) . getTask ( ) != null ) Util . parseArgs ( properties , strCommand ) ; if ( properties . get ( DBParams . COMMAND ) != null ) strCom...
Parse the command string into properties .
16,339
public static Predicate < String > notEmptyString ( ) { return new Predicate < String > ( ) { public boolean test ( String testValue ) { if ( notNull ( ) . test ( testValue ) ) { for ( Character c : testValue . toCharArray ( ) ) { if ( ! Character . isWhitespace ( c ) ) { return true ; } } } return false ; } } ; }
Predicate to check that a String is not empty i . e . not null and contains other than whitespace characters .
16,340
public static < T > Predicate < T > notNull ( ) { return new Predicate < T > ( ) { public boolean test ( T testValue ) { return testValue != null ; } } ; }
Predicate to check that a value is not null .
16,341
public static < T > Predicate < T > contains ( final Iterable < T > iterable ) { return new Predicate < T > ( ) { public boolean test ( final T testValue ) { return Iterables . contains ( iterable , testValue ) ; } } ; }
Returns a predicate that that tests if an iterable contains an argument .
16,342
public static < T > Predicate < T > negate ( final Predicate < ? super T > predicate ) { return new Predicate < T > ( ) { public boolean test ( final T testValue ) { return ! predicate . test ( testValue ) ; } } ; }
Negate an existing predicate s test result .
16,343
public static < T > Predicate < T > and ( final Predicate < ? super T > first , final Predicate < ? super T > second ) { return new Predicate < T > ( ) { public boolean test ( final T testValue ) { return first . test ( testValue ) && second . test ( testValue ) ; } } ; }
Create a predicate which is a logical and of two existing predicate .
16,344
public static < T > Predicate < T > or ( final Predicate < ? super T > first , final Predicate < ? super T > second ) { return new Predicate < T > ( ) { public boolean test ( final T testValue ) { return first . test ( testValue ) || second . test ( testValue ) ; } } ; }
Create a predicate which is a logical or of two existing predicate .
16,345
public void addConstant ( ConstantField field ) { constantList . add ( field ) ; constants . put ( field . name , field ) ; }
Manually add a field to the list of constants .
16,346
public void register ( Class < ? > aClass ) { List < ConstantField > tmp = inspector . getConstants ( aClass ) ; constantList . addAll ( tmp ) ; for ( ConstantField constant : tmp ) constants . put ( constant . name , constant ) ; }
Extracts the constant fields from the specified class using the ClassInspector .
16,347
public void loadSettings ( String file ) throws IOException { Path path = Paths . get ( file ) ; try ( BufferedReader reader = Files . newBufferedReader ( path , StandardCharsets . UTF_8 ) ) { Properties props = new Properties ( ) ; props . load ( reader ) ; loadSettings ( props ) ; } }
Loads constant settings from a file in Properties format .
16,348
public void saveSettings ( String file ) throws IOException { Path path = Paths . get ( file ) ; try ( BufferedWriter reader = Files . newBufferedWriter ( path , StandardCharsets . UTF_8 ) ) { Properties props = new Properties ( ) ; saveSettings ( props ) ; props . store ( reader , "Saved by LiveConstantTweaker" ) ; } ...
Saves constant settings to a file in Properties format .
16,349
public void set ( String name , int i ) { ConstantField constant = constants . get ( name ) ; ( ( IntConstantField ) constant ) . set ( i ) ; }
Set an integer field with name given .
16,350
public static void sleep ( long timeout , TimeUnit unit ) throws SystemException { suppress ( ( Long sleepTimeout ) -> Thread . sleep ( sleepTimeout ) ) . accept ( TimeUnit . MILLISECONDS . convert ( timeout , unit ) ) ; }
Causes the current thread to wait until the specified waiting time elapses .
16,351
public static < T extends Collection > T untilEmpty ( Callable < T > callable , long timeout , TimeUnit unit ) { return SleepBuilder . < T > sleep ( ) . withComparer ( argument -> argument . isEmpty ( ) ) . withTimeout ( timeout , unit ) . withStatement ( callable ) . build ( ) ; }
Causes the current thread to wait until the callable is returning empty collection or the specified waiting time elapses .
16,352
public void init ( ) { if ( wurflDirPath == null ) throw new IllegalStateException ( "wurflDirPath not properly set" ) ; File wurflDir = new File ( wurflDirPath ) ; if ( ! wurflDir . exists ( ) && servletContext != null ) wurflDir = new File ( servletContext . getRealPath ( wurflDirPath ) ) ; if ( ! wurflDir . exists (...
init will properly initialize this service . this would look for wurfl files and instantiate a wurfl holder
16,353
protected synchronized void startWatchingFiles ( ) { famList . clear ( ) ; FilesystemAlterationMonitor fam = new FilesystemAlterationMonitor ( ) ; FileChangeListener wurflListener = new WurflFileListener ( ) ; fam . addListener ( wurflFile , wurflListener ) ; fam . start ( ) ; famList . add ( fam ) ; logger . debug ( "...
create listeners and monitors for wurfl and its patches
16,354
public static Exception checkFile ( final File file ) { Exception ex = null ; String error = null ; if ( ! file . exists ( ) ) { error = "The " + file + " does not exists." ; ex = new FileDoesNotExistException ( error ) ; return ex ; } if ( ! file . isDirectory ( ) ) { error = "The " + file + " is not a directory." ; e...
Checks the File if it is a directory or if its exists or if it is empty .
16,355
public static void delete ( final File file ) throws IOException { if ( file . isDirectory ( ) ) { DeleteFileExtensions . deleteAllFiles ( file ) ; } else { String error = null ; if ( ! file . delete ( ) ) { error = "Cannot delete the File " + file . getAbsolutePath ( ) + "." ; throw new IOException ( error ) ; } } }
Tries to delete a file and if its a directory than its deletes all the sub - directories .
16,356
public static void deleteAllFiles ( final File file ) throws IOException { String error = null ; if ( ! file . exists ( ) ) { return ; } final Exception ex = checkFile ( file ) ; if ( ex != null ) { try { throw ex ; } catch ( final Exception e ) { e . printStackTrace ( ) ; } } DeleteFileExtensions . deleteFiles ( file ...
Deletes the File and if it is an directory it deletes his sub - directories recursively .
16,357
public static void deleteAllFilesWithSuffix ( final File file , final String theSuffix ) throws IOException { final String filePath = file . getAbsolutePath ( ) ; final String suffix [ ] = { theSuffix } ; final List < File > files = FileSearchExtensions . findFiles ( filePath , suffix ) ; final int fileCount = files . ...
Deletes all files with the given suffix recursively .
16,358
public static void deleteFiles ( final File file ) throws IOException { final File [ ] ff = file . listFiles ( ) ; if ( ff != null ) { for ( final File f : ff ) { DeleteFileExtensions . delete ( f ) ; } } }
Tries to delete all files in the Directory .
16,359
public static void deleteFilesWithFileFilter ( final File source , final FileFilter includeFileFilter ) throws FileIsNotADirectoryException , IOException , FileIsSecurityRestrictedException { DeleteFileExtensions . deleteFilesWithFileFilter ( source , includeFileFilter , null ) ; }
Tries to delete all files that match to the given includeFileFilter from the given source directory .
16,360
public static void deleteFilesWithFileFilter ( final File source , final FileFilter includeFileFilter , final FileFilter excludeFileFilter ) throws FileIsNotADirectoryException , IOException , FileIsSecurityRestrictedException { if ( ! source . isDirectory ( ) ) { throw new FileIsNotADirectoryException ( "Source file '...
Tries to delete all files that match to the given includeFileFilter and does not delete the files that match the excludeFileFilter from the given source directory .
16,361
public static void deleteFilesWithFilenameFilter ( final File source , final FilenameFilter includeFilenameFilter ) throws FileIsNotADirectoryException , IOException , FileIsSecurityRestrictedException { DeleteFileExtensions . deleteFilesWithFilenameFilter ( source , includeFilenameFilter , null ) ; }
Tries to delete all files that match to the given includeFilenameFilter from the given source directory .
16,362
public static void deleteFilesWithFilenameFilter ( final File source , final FilenameFilter includeFilenameFilter , final FilenameFilter excludeFilenameFilter ) throws FileIsNotADirectoryException , IOException , FileIsSecurityRestrictedException { if ( ! source . isDirectory ( ) ) { throw new FileIsNotADirectoryExcept...
Tries to delete all files that match to the given includeFilenameFilter and does not delete the files that match the excludeFilenameFilter from the given source directory .
16,363
public boolean contains ( final LocalDate date ) { if ( date == null ) { return false ; } if ( endDate ( ) == null ) { if ( startDate ( ) == null ) { return true ; } if ( date . isEqual ( startDate ( ) ) || date . isAfter ( startDate ( ) ) ) { return true ; } return false ; } return asInterval ( ) . contains ( date . t...
Does this date contain the specified time interval .
16,364
public int days ( ) { if ( isInfinite ( ) ) { return 0 ; } Period p = new Period ( asInterval ( ) , PeriodType . days ( ) ) ; return p . getDays ( ) ; }
The duration in days
16,365
protected String dateToString ( LocalDate localDate , String format ) { return localDate == null ? "----------" : localDate . toString ( format ) ; }
For benefit of subclass toString implementations .
16,366
@ SuppressWarnings ( "unchecked" ) public T overlap ( final T otherInterval ) { if ( otherInterval == null ) { return null ; } if ( otherInterval . isInfinite ( ) ) { return ( T ) this ; } if ( this . isInfinite ( ) ) { return otherInterval ; } final Interval thisAsInterval = asInterval ( ) ; final Interval otherAsInte...
Gets the overlap between this interval and another interval .
16,367
public double horizontalForce ( Double T , double d ) { return AE * Math . sqrt ( Math . pow ( T / AE + 1 , 2 ) - 2 * w * d / AE ) - AE ; }
Horizontal force for a given fairlead tension T
16,368
public String getKey ( String strValue ) { for ( String key : m_resourceBundle . keySet ( ) ) { String strKeyValue = m_resourceBundle . getString ( key ) ; if ( strValue . startsWith ( strKeyValue ) ) return key ; } return strValue ; }
From the value find the key . Does a reverse - lookup for the key from this value . This is useful for foreign - language buttons that do a command using their english name .
16,369
public static RequestInfo getRequestInfo ( HttpServletRequest request ) { RequestInfo requestInfo = ( RequestInfo ) request . getAttribute ( REQUEST_INFO ) ; if ( requestInfo == null ) { requestInfo = new RequestInfo ( request ) ; request . setAttribute ( REQUEST_INFO , requestInfo ) ; } return requestInfo ; }
this either creates a new RequestInfo or gets the cached instance from the reqeust
16,370
public int handleMessage ( BaseMessage message ) { Map < String , Object > properties = new HashMap < String , Object > ( ) ; String strMessageType = ( String ) message . get ( MessageConstants . MESSAGE_TYPE_PARAM ) ; String strStartIndex = ( String ) message . get ( START_INDEX_PARAM ) ; String strEndIndex = ( String...
Handle this message . Update the model depending of the message .
16,371
public String getLink ( ) { String strType = this . getField ( ClassInfo . CLASS_TYPE ) . getString ( ) ; String strLink = this . getField ( ClassInfo . CLASS_NAME ) . getString ( ) ; if ( this . getField ( ClassInfo . CLASS_PACKAGE ) . getLength ( ) > 0 ) strLink = DBConstants . ROOT_PACKAGE + this . getField ( ClassI...
Get the link that will run this class .
16,372
public ClassInfoModel readClassInfo ( PropertyOwner recordOwner , String className ) { String strParamRecord = null ; String strParamScreenType = null ; String strParamMenu = null ; String strParamHelp = null ; if ( className == null ) { strParamRecord = recordOwner . getProperty ( DBParams . RECORD ) ; className = rec...
Read the ClassInfoService record
16,373
public String getPackageName ( ClassProject . CodeType codeType ) { if ( codeType == null ) codeType = ClassProject . CodeType . THICK ; String packageName = this . getField ( ClassInfo . CLASS_PACKAGE ) . toString ( ) ; ClassProject classProject = ( ClassProject ) ( ( ReferenceField ) this . getField ( ClassInfo . CLA...
Get the full class name .
16,374
public String getFullClassName ( ) { String className = this . getField ( ClassInfo . CLASS_NAME ) . toString ( ) ; ClassProject classProject = ( ClassProject ) ( ( ReferenceField ) this . getField ( ClassInfo . CLASS_PROJECT_ID ) ) . getReference ( ) ; String packageName = classProject . getFullPackage ( ClassProject ...
GetFullClassName Method .
16,375
public void printHtmlTechInfo ( PrintWriter out , String strTag , String strParams , String strData ) { FieldData fieldInfo = new FieldData ( this . findRecordOwner ( ) ) ; String strClass = this . getClassName ( ) ; fieldInfo . setKeyArea ( FieldData . FIELD_FILE_NAME_KEY ) ; fieldInfo . addListener ( new StringSubFil...
PrintHtmlTechInfo Method .
16,376
public boolean isARecord ( boolean isAFile ) { Record recFileHdr = ( Record ) this . getRecordOwner ( ) . getRecord ( FileHdr . FILE_HDR_FILE ) ; if ( recFileHdr == null ) { recFileHdr = new FileHdr ( this . getRecordOwner ( ) ) ; this . addListener ( new FreeOnFreeHandler ( recFileHdr ) ) ; } if ( ! recFileHdr . getFi...
IsARecord Method .
16,377
public void startDocument ( String namespaceURI , String localName , String qName , Attributes attr ) throws SAXException { startTable = false ; col = 0 ; row = 0 ; }
StartDocument Method .
16,378
public void startElement ( String namespaceURI , String localName , String qName , Attributes attr ) { if ( localName . equalsIgnoreCase ( TABLE ) ) { String strClass = attr . getValue ( "" , "class" ) ; if ( strClass != null ) if ( strClass . equalsIgnoreCase ( "table-in" ) ) { startTable = true ; row = - 1 ; } } else...
StartElement Method .
16,379
public void endElement ( String namespaceURI , String localName , String qName ) throws SAXException { if ( localName . equalsIgnoreCase ( TABLE ) ) { if ( startTable ) if ( m_record . getEditMode ( ) == DBConstants . EDIT_ADD ) { try { m_record . add ( ) ; } catch ( DBException e ) { e . printStackTrace ( ) ; } } star...
EndElement Method .
16,380
public void characters ( char [ ] ch , int start , int length ) throws SAXException { if ( startTable ) { try { String string = new String ( ch , start , length ) ; for ( int i = string . length ( ) - 1 ; i >= 0 ; i -- ) { int x = Character . getNumericValue ( string . charAt ( i ) ) ; if ( ( Character . isWhitespace (...
Characters Method .
16,381
public void simulate ( LocationSource locationSource , long period , boolean isDaemon ) throws IOException { this . locationSource = locationSource ; dis = new DataInputStream ( new BufferedInputStream ( url . openStream ( ) ) ) ; if ( timer == null ) { timer = new Timer ( "AnchorageSimulator" , isDaemon ) ; } timer . ...
Starts simulating anchorige .
16,382
public static < T > Iterator < T > iterator ( Queue < T > queue ) { return new XIteratorImpl < > ( ( ) -> ! queue . isEmpty ( ) , queue :: remove ) ; }
Returns Queue as iterator . Calls isEmpty and remove methods
16,383
public static < T > Iterator < T > iterator ( BlockingQueue < T > queue ) { return iterator ( queue , Long . MAX_VALUE , TimeUnit . MILLISECONDS ) ; }
Returns Queue as iterator . Calls poll method
16,384
public static < T > Iterator < T > iterator ( BlockingQueue < T > queue , long time , TimeUnit unit ) { return new XIteratorImpl < > ( ( ) -> true , ( ) -> { try { T item = queue . poll ( time , unit ) ; if ( item == null ) { throw new NoSuchElementException ( "timeout" ) ; } return item ; } catch ( InterruptedExceptio...
Returns Queue as iterator . Calls poll method . When timeout throws NoSuchElementException which will remove it from merger .
16,385
@ SuppressWarnings ( { "unchecked" , "rawtypes" } ) public C merge ( final C other ) { return ( C ) ConfigurationUtils . defaultMerge ( ( ConfigurationComponent ) this , ( ConfigurationComponent ) other ) ; }
Performs a default merge operation between current bean instance and defaults instance
16,386
@ SuppressWarnings ( "rawtypes" ) public void basicValidate ( final String section ) throws ConfigException { ConfigurationUtils . defaultValidate ( ( ConfigurationComponent ) this , section ) ; }
Skeleton validation triggering validate on any subComponents
16,387
public static final IntStream reducingStream ( IntStream stream , ReducingFunction func ) { return StreamSupport . intStream ( new ReducingSpliterator ( stream , func ) , false ) ; }
Converts Stream to Stream where one or more int items are mapped to one int item . Mapping is done by func method . Func must return true after calling consumer method . Otherwise behavior is unpredictable .
16,388
public static Closeable getInstance ( InputStream inputStream , Type type ) throws IOException { Params . notNull ( inputStream , "Input stream" ) ; if ( type == InputStream . class ) { return inputStream ; } if ( type == ZipInputStream . class ) { return new ZipInputStream ( inputStream ) ; } if ( type == JarInputStre...
Create stream of requested type wrapping given input stream . Both returned bytes and character streams are closeable .
16,389
public String getSQLType ( boolean bIncludeLength , Map < String , Object > properties ) { String strType = ( String ) properties . get ( DBSQLTypes . STRING ) ; if ( strType == null ) strType = "VARCHAR" ; if ( this . getMaxLength ( ) < 127 ) { String strStart = ( String ) properties . get ( "LONGSTRINGSTART" ) ; if (...
Get the SQL type of this field . Typically STRING VARCHAR or LONGSTRING if over 127 chars .
16,390
public int setString ( String strString , boolean bDisplayOption , int iMoveMode ) { int iMaxLength = this . getMaxLength ( ) ; if ( strString != null ) if ( strString . length ( ) > iMaxLength ) strString = strString . substring ( 0 , iMaxLength ) ; if ( strString == null ) strString = Constants . BLANK ; return this ...
Convert and move string to this field . Data is already in string format so just move it!
16,391
public void writeit ( String strTemp ) { String strTabs = "" ; int i = 0 ; for ( i = 0 ; i < m_iTabs ; i ++ ) { strTabs += "\t" ; } if ( m_bTabOnNextLine ) if ( ( strTemp . length ( ) > 0 ) && ( strTemp . charAt ( 0 ) != '\n' ) ) strTemp = strTabs + strTemp ; m_bTabOnNextLine = false ; int iIndex = 0 ; int iIndex2 ; wh...
Writeit Method .
16,392
public Set < Class < ? > > getDeclaredInterfaces ( ClassFilter filter ) { return ClassUtils . getDeclaredInterfaces ( target , filter ) ; }
Returns a set of interfaces that that passes the supplied filter .
16,393
public Set < Field > getDeclaredFields ( FieldFilter filter ) { return FieldUtils . getDeclaredFields ( target , filter ) ; }
Returns a set of all fields matching the supplied filter declared in the target class .
16,394
public int setParam ( String param , Object value ) { int i = findParam ( param ) ; if ( value == null && i < 0 ) { return i ; } if ( i < 0 ) { i = extraInfo . length ; extraInfo = Arrays . copyOf ( extraInfo , i + 1 ) ; } if ( value == null ) { extraInfo = ( String [ ] ) ArrayUtils . remove ( extraInfo , i ) ; } else ...
Sets the value for a parameter in extra info .
16,395
public String getDisplayText ( ) { StringBuilder sb = new StringBuilder ( ) ; appendText ( sb , getPatientName ( ) , "patient" ) ; appendText ( sb , getSubject ( ) , "subject" ) ; appendText ( sb , getSenderName ( ) , "sender" ) ; appendText ( sb , DateUtil . formatDate ( getDeliveryDate ( ) ) , "delivered" ) ; appendT...
Returns the display text for this notification .
16,396
private void appendText ( StringBuilder sb , String text , String format ) { if ( text != null && ! text . isEmpty ( ) ) { format = "@vistanotification.detail." + format + ".label" ; sb . append ( StrUtil . formatMessage ( format , text ) ) . append ( "\n" ) ; } }
Appends a text element if it is not null or empty .
16,397
public int getLengthPrefix ( ) { int length = 1 ; length += 4 ; if ( this . rules != null ) { for ( SubscriptionRequestRule rule : this . rules ) { ++ length ; length += 4 + rule . getNumTransmitters ( ) * Transmitter . TRANSMITTER_ID_SIZE * 2 ; length += 8 ; } } return length ; }
Returns the length prefix value for this message as encoded according to the Solver - Aggregator protocol .
16,398
public int fieldChanged ( boolean bDisplayOption , int iMoveMode ) { double srcValue = ( ( NumberField ) this . getOwner ( ) ) . getValue ( ) ; BaseField fldTarget = this . getFieldTarget ( ) ; if ( this . getOwner ( ) . isNull ( ) ) return fldTarget . moveFieldToThis ( this . getOwner ( ) , bDisplayOption , iMoveMode ...
The Field has Changed . Get the value of this listener s owner pass it to the computeValue method and set the returned value to the target field .
16,399
public BaseField getFieldTarget ( ) { BaseField fldTarget = m_fldTarget ; if ( fldTarget == null ) if ( targetFieldName != null ) fldTarget = ( NumberField ) ( this . getOwner ( ) . getRecord ( ) . getField ( targetFieldName ) ) ; if ( fldTarget == null ) fldTarget = this . getOwner ( ) ; return fldTarget ; }
Get the field target .