idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
29,900
public static Set < Method > getMethods ( Class < ? > clazz , Filter < Method > filter ) { Set < Method > methods = new HashSet < Method > ( ) ; Class < ? > cursor = clazz ; while ( cursor != null && cursor != Object . class ) { methods . addAll ( Filter . apply ( filter , cursor . getDeclaredMethods ( ) ) ) ; cursor =...
Returns the filtered set of methods of the given class including those inherited from the super - classes ; if provided complex filter criteria can be applied .
29,901
public static String getPackageName ( Class < ? > cls ) { Package pkg ; String str ; int pos ; if ( cls == null ) throw new NullPointerException ( "cls is null" ) ; if ( ( pkg = cls . getPackage ( ) ) != null ) return pkg . getName ( ) ; str = cls . getName ( ) ; if ( ( pos = str . lastIndexOf ( '.' ) ) >= 0 ) return s...
Get the package name for a class .
29,902
public static String getPackageName ( Object obj ) { if ( obj == null ) throw new NullPointerException ( "obj is null" ) ; return getPackageName ( obj . getClass ( ) ) ; }
Get the package name for a object .
29,903
public static String getResourcePathFor ( CharSequence name , Class < ? > cls ) { int nameLen ; StringBuilder sb ; if ( name == null ) throw new NullPointerException ( "name is null" ) ; if ( cls == null ) throw new NullPointerException ( "cls is null" ) ; nameLen = name . length ( ) ; sb = new StringBuilder ( cls . ge...
Gets a resource path using cls s package name as the prefix .
29,904
public static String getResourcePathFor ( CharSequence name , Object obj ) { if ( obj == null ) throw new NullPointerException ( "obj is null" ) ; return getResourcePathFor ( name , obj . getClass ( ) ) ; }
Gets a resource path using obj s class s package name as the prefix .
29,905
public static InputStream getFor ( String name , Class < ? > cls ) { InputStream ret ; if ( cls == null ) throw new NullPointerException ( "cls is null" ) ; if ( ( ret = cls . getResourceAsStream ( getResourcePathFor ( name , cls ) ) ) == null ) throw new ResourceException ( "Unable to find resource for " + name + " an...
Gets a InputStream for a class s package .
29,906
public static InputStream getFor ( String name , Object obj ) { if ( obj == null ) throw new NullPointerException ( "obj is null" ) ; return getFor ( name , obj . getClass ( ) ) ; }
Gets a InputStream for a objects s package .
29,907
public InputStream get ( String name ) { InputStream ret ; if ( name == null ) throw new NullPointerException ( "name is null" ) ; if ( ( ret = loader . getResourceAsStream ( prefix + name ) ) == null ) throw new ResourceException ( "Unable to find resource for " + name ) ; return ret ; }
Gets a InputStream for a named resource
29,908
public String getString ( String name ) { InputStream in = null ; if ( name == null ) throw new NullPointerException ( "name is null" ) ; try { if ( ( in = loader . getResourceAsStream ( prefix + name ) ) == null ) throw new ResourceException ( "Unable to find resource for " + name ) ; return IOUtils . toString ( in ) ...
Gets a resource as a String
29,909
public boolean send ( RoxPayload payload ) throws MalformedURLException { final URL payloadResourceUrl = getPayloadResourceUrl ( ) ; if ( payloadResourceUrl == null ) { return false ; } LOGGER . info ( "Connected to ROX Center API at {}" , configuration . getServerConfiguration ( ) . getApiUrl ( ) ) ; if ( configuratio...
Send a payload to ROX
29,910
private boolean sendPayload ( URL payloadResourceUrl , RoxPayload payload , boolean optimized ) { HttpURLConnection conn = null ; final String payloadLogString = optimized ? "optimized payload" : "payload" ; try { conn = uploadPayload ( payloadResourceUrl , payload ) ; if ( conn . getResponseCode ( ) == 202 ) { LOGGER ...
Internal method to send the payload to ROX center agnostic to the payload optimization
29,911
private void optimizeStart ( ) { if ( configuration . isPayloadCache ( ) ) { if ( configuration . getOptimizerStoreClass ( ) == null ) { store = new CacheOptimizerStore ( ) ; store . start ( configuration ) ; return ; } try { store = ( OptimizerStore ) Class . forName ( configuration . getOptimizerStoreClass ( ) ) . ne...
Start the optimization
29,912
private RoxPayload optimize ( RoxPayload payload ) { if ( store != null ) { return payload . getOptimizer ( ) . optimize ( store , payload ) ; } return payload ; }
Process the payload optimization
29,913
public void start ( ) { logger . info ( "\n###starting..." ) ; try { Container container = this . getActualContainer ( ) ; Server server = new ContainerServer ( container ) ; connection = new SocketConnection ( server ) ; SocketAddress address = new InetSocketAddress ( port ) ; socketAddress = ( InetSocketAddress ) con...
Starts the simulator at the supplied port exposing the end point .
29,914
public void stop ( ) { try { logger . info ( "\n###stopping..." ) ; connection . close ( ) ; this . isRunning = false ; logger . info ( "\n#" + getSimulatorName ( ) + "\nstopped." ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } }
Stops the simulator .
29,915
private Object [ ] _asArray ( final Object obj ) { Object [ ] array = null ; if ( obj instanceof Object [ ] ) { array = ( Object [ ] ) obj ; if ( array . length == 0 ) { throw new IllegalArgumentException ( "ERROR: empty array" ) ; } } else { array = new Object [ ] { obj } ; } return array ; }
Converts the type of specified object to array . If the type of the object is array it is simply casted . Otherwise an unary array that contains only the specified object is created .
29,916
protected T _jdoLoad ( final K id ) { if ( id == null ) { return null ; } Object p_object = null ; try { p_object = getCastorTemplate ( ) . load ( _objectType , id ) ; } catch ( DataAccessException ex ) { Throwable cause = ex . getMostSpecificCause ( ) ; if ( ObjectNotFoundException . class . isInstance ( cause ) ) { p...
Load the object of the specified identity . If no such object exist this method returns NULL .
29,917
private List < Object > _jdoExecuteQuery ( final String oql , final Object [ ] params ) { List < Object > results = null ; try { results = getExtendedCastorTemplate ( ) . findByQuery ( oql , params ) ; } catch ( DataAccessException ex ) { throw new PersistenceException ( ex . getMostSpecificCause ( ) ) ; } return resul...
Executes the specified OQL query .
29,918
public static String dumpStack ( final Throwable cause ) { if ( cause == null ) { return "Throwable was null" ; } final StringWriter sw = new StringWriter ( ) ; final PrintWriter s = new PrintWriter ( sw ) ; cause . printStackTrace ( s ) ; final String stack = sw . toString ( ) ; try { sw . close ( ) ; } catch ( final ...
Returns the stack trace as a string .
29,919
public static Digest valueOf ( final String value ) { final String [ ] parts = value . split ( "=" , 2 ) ; if ( parts . length == 2 ) { return new Digest ( parts [ 0 ] , parts [ 1 ] ) ; } return null ; }
Get a Digest object from a string - based header value
29,920
public Control [ ] getControls ( ) { Control [ ] controls = line . getControls ( ) ; for ( int i = 0 ; i < controls . length ; i ++ ) { Control control = controls [ i ] ; if ( control . getType ( ) . toString ( ) . equals ( BooleanControl . Type . MUTE . toString ( ) ) ) { controls [ i ] = new FakeMuteControl ( ) ; } }...
Obtains the set of controls associated with this line . Some controls may only be available when the line is open . If there are no controls this method returns an array of length 0 . The mute - control operation may be overridden by the System .
29,921
public Control getControl ( Control . Type control ) throws IllegalArgumentException { if ( control . toString ( ) . equals ( BooleanControl . Type . MUTE . toString ( ) ) ) { return new FakeMuteControl ( ) ; } else { return line . getControl ( control ) ; } }
Obtains a control of the specified type if there is any . Some controls may only be available when the line is open . The mute - control operation may be overridden by the System .
29,922
protected String parseDateToString ( Date date , Context context , Arguments args ) { final DateFormat dateFormat = parseFormatter ( context , args ) ; dateFormat . setTimeZone ( context . get ( Contexts . TIMEZONE ) ) ; return dateFormat . format ( date ) ; }
Parses the given date to a string depending on the context .
29,923
public List < String > asList ( ) { return Lists . newLinkedList ( Splitter . on ( separator . toString ( ) ) . split ( gets ( ) ) ) ; }
Returns the all lookup results as a list
29,924
public MultiPos < String , String , String > find ( ) { return new MultiPos < String , String , String > ( null , null ) { protected String result ( ) { return findingReplacing ( EMPTY , 'L' , pos , position ) ; } } ; }
Returns a NegateMultiPos instance with all lookup results
29,925
void fileReadCheck ( String filePath ) { File potentialFile = new File ( filePath ) ; String canonicalPath ; try { canonicalPath = potentialFile . getCanonicalPath ( ) ; } catch ( IOException e ) { error ( "Error getting canonical path" , e ) ; throw getException ( filePath ) ; } if ( forbiddenReadFiles . stream ( ) . ...
Determines if the file at the given file path is safe to read from in all aspects if so returns true else false
29,926
void fileWriteCheck ( String filePath , AddOnModel addOnModel ) { File request ; try { request = new File ( filePath ) . getCanonicalFile ( ) ; } catch ( IOException e ) { error ( "Error getting canonical path" , e ) ; throw getException ( filePath ) ; } isForbidden ( request , addOnModel ) ; boolean success = false ; ...
Determines if the file at the given file path is safe to write to in all aspects if so returns true else false
29,927
private void isForbidden ( File request , AddOnModel addOnModel ) { if ( forbiddenWriteDirectories . stream ( ) . anyMatch ( compare -> request . toPath ( ) . startsWith ( compare . toPath ( ) ) ) ) { throw getException ( "file: " + request . toString ( ) + " is forbidden. Attempt made by: " + addOnModel . getID ( ) ) ...
throws an Exception if the
29,928
public long list ( List < Map < String , Object > > list , Map < String , Object > search , int skip , int max ) { return 0 ; }
Get log messages
29,929
public static BigDecimal cutInvalidSacle ( BigDecimal val ) { if ( val == null ) return null ; double d = val . doubleValue ( ) ; int i = val . intValue ( ) ; if ( d == i ) return new BigDecimal ( i ) ; return new BigDecimal ( Double . toString ( d ) ) ; }
Cut invalid scale .
29,930
public void init ( String name , Map < String , Object > config ) { if ( config == null ) config = Objects . newSOHashMap ( ) ; this . name = name ; this . config = config ; }
Initializing with name and config
29,931
public synchronized Session getSession ( ) { if ( session == null ) { if ( authenticator != null ) { session = Session . getInstance ( properties , authenticator ) ; } else { session = Session . getInstance ( properties ) ; } } return session ; }
Gets the Session - object .
29,932
private void loadPropertiesQueitly ( ) { try { properties = PropertiesFileExtensions . loadProperties ( this , EmailConstants . PROPERTIES_FILENAME ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } }
On load properties .
29,933
protected Runtime createRuntime ( ResourceLoader resourceLoader , ClassLoader classLoader , RuntimeOptions runtimeOptions ) throws InitializationError , IOException { ClassFinder classFinder = new ResourceLoaderClassFinder ( resourceLoader , classLoader ) ; return new Runtime ( resourceLoader , classFinder , classLoade...
Create the Runtime . Can be overridden to customize the runtime or backend .
29,934
private static void processSeasons ( EpisodeList epList , NodeList nlSeasons ) { if ( nlSeasons == null || nlSeasons . getLength ( ) == 0 ) { return ; } Node nEpisodeList ; for ( int loop = 0 ; loop < nlSeasons . getLength ( ) ; loop ++ ) { nEpisodeList = nlSeasons . item ( loop ) ; if ( nEpisodeList . getNodeType ( ) ...
process the individual seasons
29,935
private static void processSeasonEpisodes ( Element eEpisodeList , EpisodeList epList ) { String season = eEpisodeList . getAttribute ( "no" ) ; NodeList nlEpisode = eEpisodeList . getElementsByTagName ( EPISODE ) ; if ( nlEpisode == null || nlEpisode . getLength ( ) == 0 ) { return ; } for ( int eLoop = 0 ; eLoop < nl...
Process the episodes in the season and add them to the EpisodeList
29,936
private static List < ShowInfo > processShowInfo ( String searchUrl , String tagName ) throws TVRageException { List < ShowInfo > showList = new ArrayList < > ( ) ; ShowInfo showInfo ; Document doc = getDocFromUrl ( searchUrl ) ; NodeList nlShowInfo = doc . getElementsByTagName ( tagName ) ; if ( nlShowInfo == null || ...
Get a list of the ShowInfo from the specified tag
29,937
private static Episode parseEpisode ( Element eEpisode , String season ) { Episode episode = new Episode ( ) ; EpisodeNumber en = new EpisodeNumber ( ) ; en . setSeason ( season ) ; en . setEpisode ( DOMHelper . getValueFromElement ( eEpisode , "seasonnum" ) ) ; en . setAbsolute ( DOMHelper . getValueFromElement ( eEpi...
Parse the episode node into an Episode object
29,938
private static Episode parseEpisodeInfo ( Element eEpisodeInfo ) { Episode episode = new Episode ( ) ; episode . setTitle ( DOMHelper . getValueFromElement ( eEpisodeInfo , TITLE ) ) ; episode . setAirDate ( DOMHelper . getValueFromElement ( eEpisodeInfo , AIRDATE ) ) ; episode . setLink ( DOMHelper . getValueFromEleme...
Parse the episode info node into an Episode object
29,939
private static ShowInfo parseNextShowInfo ( Element eShowInfo ) { ShowInfo showInfo = new ShowInfo ( ) ; String text ; showInfo . setShowID ( DOMHelper . getValueFromElement ( eShowInfo , "showid" ) ) ; text = DOMHelper . getValueFromElement ( eShowInfo , "showname" ) ; if ( ! TVRageApi . isValidString ( text ) ) { tex...
Parse the show info element into a ShowInfo object
29,940
private static void processNetwork ( ShowInfo showInfo , Element eShowInfo ) { NodeList nlNetwork = eShowInfo . getElementsByTagName ( "network" ) ; for ( int nodeLoop = 0 ; nodeLoop < nlNetwork . getLength ( ) ; nodeLoop ++ ) { Node nShowInfo = nlNetwork . item ( nodeLoop ) ; if ( nShowInfo . getNodeType ( ) == Node ....
Process network information
29,941
private static void processAka ( ShowInfo showInfo , Element eShowInfo ) { NodeList nlAkas = eShowInfo . getElementsByTagName ( "aka" ) ; for ( int loop = 0 ; loop < nlAkas . getLength ( ) ; loop ++ ) { Node nShowInfo = nlAkas . item ( loop ) ; if ( nShowInfo . getNodeType ( ) == Node . ELEMENT_NODE ) { Element eAka = ...
Process AKA information
29,942
public Response . ResponseBuilder getTimeMapBuilder ( final LdpRequest req , final IOService serializer , final String baseUrl ) { final List < MediaType > acceptableTypes = req . getHeaders ( ) . getAcceptableMediaTypes ( ) ; final String identifier = getBaseUrl ( baseUrl , req ) + req . getPartition ( ) + req . getPa...
Create a response builder for a TimeMap response
29,943
public Response . ResponseBuilder getTimeGateBuilder ( final LdpRequest req , final String baseUrl ) { final String identifier = getBaseUrl ( baseUrl , req ) + req . getPartition ( ) + req . getPath ( ) ; return Response . status ( FOUND ) . location ( fromUri ( identifier + "?version=" + req . getDatetime ( ) . getIns...
Create a response builder for a TimeGate response
29,944
public static Stream < Link > getMementoLinks ( final String identifier , final List < VersionRange > mementos ) { return concat ( getTimeMap ( identifier , mementos . stream ( ) ) , mementos . stream ( ) . map ( mementoToLink ( identifier ) ) ) ; }
Retrieve all of the Memento - related link headers given a stream of VersionRange objects
29,945
public static void main ( String [ ] args ) { System . out . println ( "Jaguar " + MAJOR + "." + MINER + BUILD ) ; System . out . println ( "Copyright (C) 2009-2011 Eiichiro Uchiumi. All Rights Reserved." ) ; }
Prints the version &amp ; copyright information .
29,946
public String [ ] tokenise ( String string ) { String str = string ; if ( str == null || str . length ( ) == 0 ) { return null ; } List < String > list = new ArrayList < String > ( ) ; int length = delimiter . length ( ) ; int idx = str . indexOf ( delimiter ) ; while ( idx != - 1 ) { String token = str . substring ( 0...
Tokenises the input string using the given delimiter .
29,947
public static SecureStorage createSecureStorage ( Main main ) throws IllegalAccessException { if ( ! exists ) { SecureStorage secureStorage = new SecureStorageImpl ( main ) ; exists = true ; SecureStorageImpl . secureStorage = secureStorage ; return secureStorage ; } throw new IllegalAccessException ( "Cannot create mo...
Creates an SecureStorage . There can only be one single SecureStorage so calling this method twice will cause an illegal access exception .
29,948
private SecretKey retrieveKey ( ) { SecretKey key = null ; try { String workingDir = getMain ( ) . getFileSystemManager ( ) . getSystemLocation ( ) . getAbsolutePath ( ) ; final String keyStoreFile = workingDir + File . separator + "izou.keystore" ; KeyStore keyStore = createKeyStore ( keyStoreFile , "4b[X:+H4CS&avY<)"...
Retrieves the izou aes key stored in a keystore
29,949
private void storeKey ( SecretKey key ) { final String keyStoreFile = getMain ( ) . getFileSystemManager ( ) . getSystemLocation ( ) + File . separator + "izou.keystore" ; KeyStore keyStore = createKeyStore ( keyStoreFile , "4b[X:+H4CS&avY<)" ) ; try { KeyStore . SecretKeyEntry keyStoreEntry = new KeyStore . SecretKeyE...
Stores the izou aes key in a keystore
29,950
private KeyStore createKeyStore ( String fileName , String password ) { File file = new File ( fileName ) ; KeyStore keyStore = null ; try { keyStore = KeyStore . getInstance ( "JCEKS" ) ; if ( file . exists ( ) ) { keyStore . load ( new FileInputStream ( file ) , password . toCharArray ( ) ) ; } else { keyStore . load...
Creates a new keystore for the izou aes key
29,951
public static byte [ ] decodeHex ( char [ ] data ) throws DecoderException { int len = data . length ; if ( ( len & 0x01 ) != 0 ) { throw new DecoderException ( "Odd number of characters." ) ; } byte [ ] out = new byte [ len >> 1 ] ; for ( int i = 0 , j = 0 ; j < len ; i ++ ) { int f = toDigit ( data [ j ] , j ) << 4 ;...
Converts an array of characters representing hexidecimal values into an array of bytes of those same values . The returned array will be half the length of the passed array as it takes two characters to represent any given byte . An exception is thrown if the passed char array has an odd number of elements .
29,952
public static char [ ] encodeHex ( byte [ ] data ) { int l = data . length ; char [ ] out = new char [ l << 1 ] ; for ( int i = 0 , j = 0 ; i < l ; i ++ ) { out [ j ++ ] = DIGITS [ ( 0xF0 & data [ i ] ) >>> 4 ] ; out [ j ++ ] = DIGITS [ 0x0F & data [ i ] ] ; } return out ; }
Converts an array of bytes into an array of characters representing the hexidecimal values of each byte in order . The returned array will be double the length of the passed array as it takes two characters to represent any given byte .
29,953
public Object decode ( Object object ) throws DecoderException { try { char [ ] charArray = object instanceof String ? ( ( String ) object ) . toCharArray ( ) : ( char [ ] ) object ; return decodeHex ( charArray ) ; } catch ( ClassCastException e ) { throw new DecoderException ( e . getMessage ( ) ) ; } }
Converts a String or an array of character bytes representing hexidecimal values into an array of bytes of those same values . The returned array will be half the length of the passed String or array as it takes two characters to represent any given byte . An exception is thrown if the passed char array has an odd numb...
29,954
public Object encode ( Object object ) throws EncoderException { try { byte [ ] byteArray = object instanceof String ? ( ( String ) object ) . getBytes ( ) : ( byte [ ] ) object ; return encodeHex ( byteArray ) ; } catch ( ClassCastException e ) { throw new EncoderException ( e . getMessage ( ) ) ; } }
Converts a String or an array of bytes into an array of characters representing the hexidecimal values of each byte in order . The returned array will be double the length of the passed String or array as it takes two characters to represent any given byte .
29,955
static TrialContext makeContext ( UUID trialId , int trialNumber , Experiment experiment ) { return new TrialContext ( trialId , trialNumber , experiment ) ; }
Makes a new TrialContext that can be used to invoke
29,956
public void add ( JComponent component , String label ) { components . add ( component ) ; component2LabelMap . put ( component , label ) ; if ( components . size ( ) == 1 ) { baseComponent . add ( component ) ; } else if ( components . size ( ) > 1 ) { baseComponent . removeAll ( ) ; for ( JComponent c : components ) ...
Adds a component to this node . If there are multiple components they will be stacked in a tabbed pane .
29,957
public String getLabel ( JComponent component ) { String label = component2LabelMap . get ( component ) ; if ( label != null ) { return label ; } else { return "" ; } }
Gets the label for the specified component .
29,958
public boolean anyMatch ( String lookupAny ) { return keyMatch ( lookupAny ) || nameMatch ( lookupAny ) || tagMatch ( lookupAny ) || ticketMatch ( lookupAny ) ; }
Match any condition
29,959
public boolean keyMatch ( String lookupKey ) { if ( key . isEmpty ( ) ) { return technicalName . contains ( lookupKey ) ; } else { return key . contains ( lookupKey ) ; } }
Match key condition
29,960
public static String getSLLL ( String [ ] soilParas ) { if ( soilParas != null && soilParas . length >= 3 ) { return divide ( calcMoisture1500Kpa ( soilParas [ 0 ] , soilParas [ 1 ] , soilParas [ 2 ] ) , "100" , 3 ) ; } else { return null ; } }
For calculating SLLL
29,961
public static String getSLDUL ( String [ ] soilParas ) { if ( soilParas != null && soilParas . length >= 3 ) { return divide ( calcMoisture33Kpa ( soilParas [ 0 ] , soilParas [ 1 ] , soilParas [ 2 ] ) , "100" , 3 ) ; } else { return null ; } }
For calculating SLDUL
29,962
public static String getSLSAT ( String [ ] soilParas ) { if ( soilParas != null && soilParas . length >= 3 ) { return divide ( calcSaturatedMoisture ( soilParas [ 0 ] , soilParas [ 1 ] , soilParas [ 2 ] ) , "100" , 3 ) ; } else { return null ; } }
For calculating SLSAT
29,963
public static String getSKSAT ( String [ ] soilParas ) { if ( soilParas != null && soilParas . length >= 3 ) { if ( soilParas . length >= 4 ) { return divide ( calcSatBulk ( soilParas [ 0 ] , soilParas [ 1 ] , soilParas [ 2 ] , divide ( soilParas [ 3 ] , "100" ) ) , "10" , 3 ) ; } else { return divide ( calcSatMatric (...
For calculating SKSAT
29,964
public static String getSLBDM ( String [ ] soilParas ) { if ( soilParas != null && soilParas . length >= 3 ) { if ( soilParas . length >= 4 ) { return round ( calcGravePlusDensity ( soilParas [ 0 ] , soilParas [ 1 ] , soilParas [ 2 ] , divide ( soilParas [ 3 ] , "100" ) ) , 2 ) ; } else { return round ( calcNormalDensi...
For calculating SLBDM
29,965
public static String calcMoisture1500Kpa ( String slsnd , String slcly , String omPct ) { if ( ( slsnd = checkPctVal ( slsnd ) ) == null || ( slcly = checkPctVal ( slcly ) ) == null || ( omPct = checkPctVal ( omPct ) ) == null ) { LOG . error ( "Invalid input parameters for calculating 1500 kPa moisture, %v" ) ; return...
Equation 1 for calculating 1500 kPa moisture %v
29,966
public static String calcMoisture33Kpa ( String slsnd , String slcly , String omPct ) { String ret ; if ( ( slsnd = checkPctVal ( slsnd ) ) == null || ( slcly = checkPctVal ( slcly ) ) == null || ( omPct = checkPctVal ( omPct ) ) == null ) { LOG . error ( "Invalid input parameters for calculating 33 kPa moisture, norma...
Equation 2 for 33 kPa moisture normal density %v
29,967
private static String calcMoisture33KpaFst ( String slsnd , String slcly , String omPct ) { String ret = sum ( product ( "-0.251" , slsnd ) , product ( "0.195" , slcly ) , product ( "1.1" , omPct ) , product ( "0.006" , slsnd , omPct ) , product ( "-0.027" , slcly , omPct ) , product ( "0.00452" , slsnd , slcly ) , "29...
Equation 2 for calculating 33 kPa moisture first solution %v
29,968
private static String calcLamda ( String slsnd , String slcly , String omPct ) { String mt33 = divide ( calcMoisture33Kpa ( slsnd , slcly , omPct ) , "100" ) ; String mt1500 = divide ( calcMoisture1500Kpa ( slsnd , slcly , omPct ) , "100" ) ; String ret = divide ( substract ( log ( mt33 ) , log ( mt1500 ) ) , CONST_LN1...
Equation 15 for calculating Slope of logarithmic tension - moisture curve
29,969
public WhereCondition WHERE ( WhereCondition whereCondition ) { checkTokenOrderIsCorrect ( ESqlToken . WHERE ) ; mSgSQL . append ( "(" ) ; mSgSQL . append ( whereCondition . toWhereConditionPart ( ) ) ; mSgSQL . append ( ")" ) ; return WhereCondition . this ; }
Add WhereCondition object itself surrounded with bracket into where clause
29,970
public WhereCondition Col ( String columnName ) { mSgSQL . append ( columnName ) ; checkTokenOrderIsCorrect ( ESqlToken . COLUMN ) ; return WhereCondition . this ; }
Add columnName into WHERE clause
29,971
public WhereCondition Val ( Object val ) { if ( "?" . equals ( val ) ) { mSgSQL . append ( " ?" ) ; } else { mSgSQL . append ( "'" ) ; mSgSQL . append ( val . toString ( ) ) ; mSgSQL . append ( "'" ) ; } checkTokenOrderIsCorrect ( ESqlToken . VALUE ) ; return WhereCondition . this ; }
Add value of column into WHERE clause
29,972
private void checkTokenOrderIsCorrect ( ESqlToken tokenTobeAdded ) { switch ( tokenTobeAdded ) { case COLUMN : if ( mPreviousToken != ESqlToken . CONDITION && mPreviousToken != ESqlToken . NOTHING ) { throw new D6RuntimeException ( "AND or OR method is required at here." + " '" + mSgSQL . toString ( ) + "'<==error occu...
Confirm whether the token is built in the correct order and throws an exception if there is a problem .
29,973
String toWhereConditionPart ( ) { if ( mPreviousToken != ESqlToken . VALUE && mPreviousToken != ESqlToken . WHERE ) { throw new D6RuntimeException ( "Where condition is not completed." + " '" + mSgSQL . toString ( ) + "'<==error occurred around here." ) ; } return mSgSQL . toString ( ) ; }
where condition part
29,974
public static boolean isWhitespace ( int ch ) { return CHAR_WHITE_SPACE == ch || TAB == ch || LF == ch || CR == ch ; }
Checks if a Character is white space
29,975
public static boolean contains ( String target , String ... containWith ) { return contains ( target , Arrays . asList ( containWith ) ) ; }
Checks if target string contains any string in the given string array
29,976
public static boolean contains ( String target , List < String > containWith ) { if ( isNull ( target ) ) { return false ; } return matcher ( target ) . contains ( containWith ) ; }
Checks if target string contains any string in the given string list
29,977
public static int indexAny ( String target , String ... indexWith ) { return indexAny ( target , 0 , Arrays . asList ( indexWith ) ) ; }
Search target string to find the first index of any string in the given string array
29,978
public static int indexAny ( String target , Integer fromIndex , String ... indexWith ) { return indexAny ( target , fromIndex , Arrays . asList ( indexWith ) ) ; }
Search target string to find the first index of any string in the given string array starting at the specified index
29,979
public static int indexAny ( String target , Integer fromIndex , List < String > indexWith ) { if ( isNull ( target ) ) { return INDEX_NONE_EXISTS ; } return matcher ( target ) . indexs ( fromIndex , checkNotNull ( indexWith ) . toArray ( new String [ indexWith . size ( ) ] ) ) ; }
Search target string to find the first index of any string in the given string list starting at the specified index
29,980
public static boolean endAny ( String target , String ... endWith ) { return endAny ( target , Arrays . asList ( endWith ) ) ; }
Check if target string ends with any of an array of specified strings .
29,981
public static boolean endAny ( String target , List < String > endWith ) { if ( isNull ( target ) ) { return false ; } return matcher ( target ) . ends ( endWith ) ; }
Check if target string ends with any of a list of specified strings .
29,982
public static boolean startAny ( String target , String ... startWith ) { return startAny ( target , 0 , Arrays . asList ( startWith ) ) ; }
Check if target string starts with any of an array of specified strings .
29,983
public static boolean startAny ( String target , Integer toffset , String ... startWith ) { return startAny ( target , toffset , Arrays . asList ( startWith ) ) ; }
Check if target string starts with any of an array of specified strings beginning at the specified index .
29,984
public static boolean startAny ( String target , Integer toffset , List < String > startWith ) { if ( isNull ( target ) ) { return false ; } return matcher ( target ) . starts ( toffset , startWith ) ; }
Check if target string starts with any of a list of specified strings beginning at the specified index .
29,985
static < T > T iterate ( Object o , Closure < IterateBean , Object > closure ) { return ( T ) iterateNamedObjectFromLeaf ( null , "" , o , closure ) ; }
Iterate through Object tree and call callback for each leaf callback call order is - leafs first then root
29,986
public IStack < Object > tierOneUp ( boolean newStack ) { ++ tier ; IStack < Object > result ; if ( newStack || tierStack . size ( ) == tier ) { if ( logging ) { result = new LogStack < > ( new ProcessStack < > ( ) , System . out ) ; } else { result = new ProcessStack < > ( ) ; } tierStack . add ( result ) ; } else { r...
get Stack of the next tier if no exist get a new one .
29,987
protected IStack < Object > removeTierStack ( ) { IStack < Object > result = tierStack . remove ( tier ) ; -- tier ; return result ; }
remove tierStack . Remove a tier .
29,988
public Primitive getPrimitiveVariable ( Object key ) { Primitive object = null ; for ( int i = working . size ( ) - 1 ; i >= 0 ; -- i ) { Map < Object , Object > map = working . get ( i ) ; object = ( Primitive ) map . get ( key ) ; if ( object != null ) break ; } if ( object == null ) object = ( Primitive ) global . g...
get a Primitive variable first from the highest block hierarchy down to the global variables
29,989
public Object getVariable ( Object key ) { Object object = null ; for ( int i = working . size ( ) - 1 ; i >= 0 ; -- i ) { Map < Object , Object > map = working . get ( i ) ; object = map . get ( key ) ; if ( object != null ) break ; } if ( object == null ) object = global . get ( key ) ; return object ; }
get a variable first from the highest block hierarchy down to the global variables .
29,990
public boolean setVariable ( Object key , Object value ) { boolean success = false ; Object object = null ; for ( int i = working . size ( ) - 1 ; i >= 0 ; -- i ) { Map < Object , Object > map = working . get ( i ) ; object = map . get ( key ) ; if ( object != null ) { map . put ( key , value ) ; success = true ; break...
set an already defined variable first from the highest block hierarchy down to the global variables .
29,991
public boolean setNewVariable ( Object key , Object value ) { boolean success = false ; success = setLocalVariable ( key , value ) ; if ( ! success ) { setGlobalVariable ( key , value ) ; success = true ; } return success ; }
set a new variable on the highest block hierarchy or global if no hierarchy exists .
29,992
public boolean setLocalVariable ( Object key , Object value ) { boolean success = false ; if ( working . size ( ) > 0 ) { Map < Object , Object > map = working . get ( working . size ( ) - 1 ) ; map . put ( key , value ) ; success = true ; } return success ; }
set a new local variable on the highest block hierarchy .
29,993
public boolean removeLastBlockVariableMap ( ) { boolean success = false ; if ( testing ) { success = true ; } else { if ( working . size ( ) > 0 ) { if ( working . remove ( working . size ( ) - 1 ) != null ) success = true ; } } return success ; }
remove the last block hierarchy variable map .
29,994
public boolean restoreLastMapFromArchive ( ) { boolean success = false ; List < Map < Object , Object > > object = null ; if ( oldBlockHierarchy . size ( ) > 0 ) { object = oldBlockHierarchy . remove ( oldBlockHierarchy . size ( ) - 1 ) ; if ( object != null ) { working = object ; success = true ; } } return success ; ...
restore the last block hierarchy variable map from archive to working .
29,995
public synchronized ExtendedLogger createFileLogger ( String addOnId , String level ) { try { LoggerContext ctx = LogManager . getContext ( false ) ; Configuration config = ( ( org . apache . logging . log4j . core . LoggerContext ) ctx ) . getConfiguration ( ) ; Layout layout = PatternLayout . createLayout ( "%d %-5p ...
Creates a new file - logger for an addOn . The logger will log to a file with the addOnId as name in the logs folder of Izou
29,996
public void setDefault ( String category , String key , String value ) { if ( this . hasProperty ( category , key ) ) return ; this . setProperty ( category , key , value ) ; }
Sets the property unless it already had a value
29,997
public boolean hasProperty ( String category , String key ) { return this . categories . containsKey ( category ) && this . categories . get ( category ) . containsKey ( key ) ; }
Checks whether the specified key is present in the specified category
29,998
public String getProperty ( String category , String key , String defaultValue ) { category = ( this . compressedSpaces ? category . replaceAll ( "\\s+" , " " ) : category ) . trim ( ) ; if ( Strings . isNullOrEmpty ( category ) ) category = "Main" ; key = ( this . compressedSpaces ? key . replaceAll ( "\\s+" , " " ) :...
Gets a property
29,999
protected void detectHandlerMethods ( ) { processAtmostRequestMappingInfo ( ) ; try { registerNativeFunctionHandlers ( handlerMappingInfoStorage . getHandlerMappingInfos ( ) , NativeFunctionResponseBodyHandler . class ) ; registerNativeFunctionHandlers ( handlerMappingInfoStorage . getHandlerWithViewMappingInfos ( ) , ...
read user - defined javascript files in configured directory and register handler methods in those files as Spring MVC handler .