idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
6,900
protected Class < ? > defineClass ( String name , sun . misc . Resource res ) throws IOException { final int i = name . lastIndexOf ( '.' ) ; final URL url = res . getCodeSourceURL ( ) ; if ( i != - 1 ) { final String pkgname = name . substring ( 0 , i ) ; final Package pkg = getPackage ( pkgname ) ; final Manifest man...
Defines a Class using the class bytes obtained from the specified Resource . The resulting Class must be resolved before it can be used .
6,901
@ SuppressWarnings ( "checkstyle:npathcomplexity" ) protected Package definePackage ( String name , Manifest man , URL url ) throws IllegalArgumentException { final String path = name . replace ( '.' , '/' ) . concat ( "/" ) ; String specTitle = null ; String specVersion = null ; String specVendor = null ; String implT...
Defines a new package by name in this ClassLoader . The attributes contained in the specified Manifest will be used to obtain package version and sealing information . For sealed packages the additional URL specifies the code source URL from which the package was loaded .
6,902
public URL findResource ( final String name ) { final URL url = AccessController . doPrivileged ( new PrivilegedAction < URL > ( ) { public URL run ( ) { return DynamicURLClassLoader . this . ucp . findResource ( name , true ) ; } } , this . acc ) ; return url != null ? this . ucp . checkURL ( url ) : null ; }
Finds the resource with the specified name on the URL search path .
6,903
public Enumeration < URL > findResources ( final String name ) throws IOException { final Enumeration < ? > e = this . ucp . findResources ( name , true ) ; return new Enumeration < URL > ( ) { private URL url ; private boolean next ( ) { if ( this . url != null ) { return true ; } do { final URL u = AccessController ....
Returns an Enumeration of URLs representing all of the resources on the URL search path having the specified name .
6,904
protected PermissionCollection getPermissions ( CodeSource codesource ) { final PermissionCollection perms = super . getPermissions ( codesource ) ; final URL url = codesource . getLocation ( ) ; Permission permission ; URLConnection urlConnection ; try { urlConnection = url . openConnection ( ) ; permission = urlConne...
Returns the permissions for the given codesource object . The implementation of this method first calls super . getPermissions and then adds permissions based on the URL of the codesource .
6,905
private static URL [ ] mergeClassPath ( URL ... urls ) { final String path = System . getProperty ( "java.class.path" ) ; final String separator = System . getProperty ( "path.separator" ) ; final String [ ] parts = path . split ( Pattern . quote ( separator ) ) ; final URL [ ] u = new URL [ parts . length + urls . len...
Merge the specified URLs to the current classpath .
6,906
public static < E > int remove ( List < E > list , Comparator < ? super E > comparator , E data ) { assert list != null ; assert comparator != null ; assert data != null ; int first = 0 ; int last = list . size ( ) - 1 ; while ( last >= first ) { final int center = ( first + last ) / 2 ; final E dt = list . get ( cente...
Remove the given element from the list using a dichotomic algorithm .
6,907
@ Inline ( value = "add($1, $2, $3, false, false)" ) public static < E > int addIfAbsent ( List < E > list , Comparator < ? super E > comparator , E data ) { return add ( list , comparator , data , false , false ) ; }
Add the given element in the main list using a dichotomic algorithm if the element is not already present .
6,908
public static < E > int add ( List < E > list , Comparator < ? super E > comparator , E data , boolean allowMultipleOccurencesOfSameValue , boolean allowReplacement ) { assert list != null ; assert comparator != null ; assert data != null ; int first = 0 ; int last = list . size ( ) - 1 ; while ( last >= first ) { fina...
Add the given element in the main list using a dichotomic algorithm .
6,909
public static < E > boolean contains ( List < E > list , Comparator < ? super E > comparator , E data ) { assert list != null ; assert comparator != null ; assert data != null ; int first = 0 ; int last = list . size ( ) - 1 ; while ( last >= first ) { final int center = ( first + last ) / 2 ; final E dt = list . get (...
Replies if the given element is inside the list using a dichotomic algorithm .
6,910
public static < T > Iterator < T > reverseIterator ( final List < T > list ) { return new Iterator < T > ( ) { private int next = list . size ( ) - 1 ; public boolean hasNext ( ) { return this . next >= 0 ; } public T next ( ) { final int n = this . next ; -- this . next ; try { return list . get ( n ) ; } catch ( Inde...
Replies an iterator that goes from end to start of the given list .
6,911
public static Class < ? > getAttributeClassWithDefault ( Node document , boolean caseSensitive , Class < ? > defaultValue , String ... path ) { assert document != null : AssertMessages . notNullParameter ( 0 ) ; final String v = getAttributeValue ( document , caseSensitive , 0 , path ) ; if ( v != null && ! v . isEmpty...
Read a java class .
6,912
public static < T extends Node > T getChild ( Node parent , Class < T > type ) { assert parent != null : AssertMessages . notNullParameter ( 0 ) ; assert type != null : AssertMessages . notNullParameter ( 1 ) ; final NodeList children = parent . getChildNodes ( ) ; final int len = children . getLength ( ) ; for ( int i...
Replies the first child node that has the specified type .
6,913
public static Document getDocumentFor ( Node node ) { Node localnode = node ; while ( localnode != null ) { if ( localnode instanceof Document ) { return ( Document ) localnode ; } localnode = localnode . getParentNode ( ) ; } return null ; }
Replies the XML Document that is containing the given node .
6,914
public static String getText ( Node document , String ... path ) { assert document != null : AssertMessages . notNullParameter ( 0 ) ; Node parentNode = getNodeFromPath ( document , path ) ; if ( parentNode == null ) { parentNode = document ; } final StringBuilder text = new StringBuilder ( ) ; final NodeList children ...
Replies the text inside the node at the specified path .
6,915
public static Iterator < Node > iterate ( Node parent , String nodeName ) { assert parent != null : AssertMessages . notNullParameter ( 0 ) ; assert nodeName != null && ! nodeName . isEmpty ( ) : AssertMessages . notNullParameter ( 0 ) ; return new NameBasedIterator ( parent , nodeName ) ; }
Replies an iterator on nodes that have the specified node name .
6,916
public static Object parseObject ( String xmlSerializedObject ) throws IOException , ClassNotFoundException { assert xmlSerializedObject != null : AssertMessages . notNullParameter ( 0 ) ; try ( ByteArrayInputStream bais = new ByteArrayInputStream ( Base64 . getDecoder ( ) . decode ( xmlSerializedObject ) ) ) { final O...
Deserialize an object from the given XML string .
6,917
public static byte [ ] parseString ( String text ) { return Base64 . getDecoder ( ) . decode ( Strings . nullToEmpty ( text ) . trim ( ) ) ; }
Parse a Base64 string with contains a set of bytes .
6,918
public static Document parseXML ( String xmlString ) { assert xmlString != null : AssertMessages . notNullParameter ( 0 ) ; try { return readXML ( new StringReader ( xmlString ) ) ; } catch ( Exception e ) { } return null ; }
Parse a string representation of an XML document .
6,919
public static void writeResources ( Element node , XMLResources resources , XMLBuilder builder ) { if ( resources != null ) { final Element resourcesNode = builder . createElement ( NODE_RESOURCES ) ; for ( final java . util . Map . Entry < Long , Entry > pair : resources . getPairs ( ) . entrySet ( ) ) { final Entry e...
Write the given resources into the given XML node .
6,920
public static URL readResourceURL ( Element node , XMLResources resources , String ... path ) { final String stringValue = getAttributeValue ( node , path ) ; if ( XMLResources . isStringIdentifier ( stringValue ) ) { try { final long id = XMLResources . getNumericalIdentifier ( stringValue ) ; return resources . getRe...
Replies the resource URL that is contained inside the XML attribute defined in the given node and with the given XML path .
6,921
protected static StackTraceElement getTraceElementAt ( int level ) { if ( level < 0 ) { return null ; } try { final StackTraceElement [ ] stackTrace = Thread . currentThread ( ) . getStackTrace ( ) ; int j = - 1 ; boolean found = false ; Class < ? > type ; for ( int i = 0 ; i < stackTrace . length ; ++ i ) { if ( found...
Replies the stack trace element for the given level .
6,922
public boolean moveTo ( N newParent ) { if ( newParent == null ) { return false ; } return moveTo ( newParent , newParent . getChildCount ( ) ) ; }
Move this node in the given new parent node .
6,923
public final boolean addChild ( int index , N newChild ) { if ( newChild == null ) { return false ; } final int count = ( this . children == null ) ? 0 : this . children . size ( ) ; final N oldParent = newChild . getParentNode ( ) ; if ( oldParent != this && oldParent != null ) { newChild . removeFromParent ( ) ; } fi...
Add a child node at the specified index .
6,924
public static final < T extends Comparable < T > > Ordering < Scored < T > > ByScoreThenByItem ( Ordering < T > itemOrdering ) { final Ordering < Scored < T > > byItem = itemOrdering . onResultOf ( Scoreds . < T > itemsOnly ( ) ) ; final Ordering < Scored < T > > byScore = Scoreds . < T > ByScoreOnly ( ) ; return Order...
Comparator which compares Scoreds first by score then by item where the item ordering to use is explicitly specified .
6,925
public static final < T extends Comparable < T > > Ordering < Scored < T > > ByScoreThenByItem ( ) { final Ordering < Scored < T > > byItem = Scoreds . < T > ByItemOnly ( ) ; final Ordering < Scored < T > > byScore = Scoreds . < T > ByScoreOnly ( ) ; return Ordering . compound ( ImmutableList . of ( byScore , byItem ) ...
Comparator which compares Scoreds first by score then by item .
6,926
protected void onFileChoose ( JFileChooser fileChooser , ActionEvent actionEvent ) { final int returnVal = fileChooser . showOpenDialog ( parent ) ; if ( returnVal == JFileChooser . APPROVE_OPTION ) { final File file = fileChooser . getSelectedFile ( ) ; onApproveOption ( file , actionEvent ) ; } else { onCancel ( acti...
Callback method to interact on file choose .
6,927
LayoutProcessorOutput applyLayout ( FileResource resource , Locale locale , Map < String , Object > model ) { Optional < Path > layout = findLayout ( resource ) ; return layout . map ( Path :: toString ) . map ( Files :: getFileExtension ) . map ( layoutEngines :: get ) . orElse ( lParam -> new LayoutProcessorOutput ( ...
has been found the file will be copied as it is
6,928
public Timex2Time modifiedCopy ( final Modifier modifier ) { return new Timex2Time ( val , modifier , set , granularity , periodicity , anchorVal , anchorDir , nonSpecific ) ; }
Returns a copy of this Timex which is the same except with the specified modifier
6,929
public static MACNumber [ ] parse ( String addresses ) { if ( ( addresses == null ) || ( "" . equals ( addresses ) ) ) { return new MACNumber [ 0 ] ; } final String [ ] adrs = addresses . split ( Pattern . quote ( Character . toString ( MACNUMBER_SEPARATOR ) ) ) ; final List < MACNumber > list = new ArrayList < > ( ) ;...
Parse the specified string an repleis the corresponding MAC numbers .
6,930
public static String join ( MACNumber ... addresses ) { if ( ( addresses == null ) || ( addresses . length == 0 ) ) { return null ; } final StringBuilder buf = new StringBuilder ( ) ; for ( final MACNumber number : addresses ) { if ( buf . length ( ) > 0 ) { buf . append ( MACNUMBER_SEPARATOR ) ; } buf . append ( numbe...
Join the specified MAC numbers to reply a string .
6,931
public static Collection < MACNumber > getAllAdapters ( ) { final List < MACNumber > av = new ArrayList < > ( ) ; final Enumeration < NetworkInterface > interfaces ; try { interfaces = NetworkInterface . getNetworkInterfaces ( ) ; } catch ( SocketException exception ) { return av ; } if ( interfaces != null ) { Network...
Get all of the ethernet addresses associated with the local machine .
6,932
public static Map < InetAddress , MACNumber > getAllMappings ( ) { final Map < InetAddress , MACNumber > av = new HashMap < > ( ) ; final Enumeration < NetworkInterface > interfaces ; try { interfaces = NetworkInterface . getNetworkInterfaces ( ) ; } catch ( SocketException exception ) { return av ; } if ( interfaces !...
Get all of the internet address and ethernet address mappings on the local machine .
6,933
public static MACNumber getPrimaryAdapter ( ) { final Enumeration < NetworkInterface > interfaces ; try { interfaces = NetworkInterface . getNetworkInterfaces ( ) ; } catch ( SocketException exception ) { return null ; } if ( interfaces != null ) { NetworkInterface inter ; while ( interfaces . hasMoreElements ( ) ) { i...
Try to determine the primary ethernet address of the machine .
6,934
public static Collection < InetAddress > getPrimaryAdapterAddresses ( ) { final Enumeration < NetworkInterface > interfaces ; try { interfaces = NetworkInterface . getNetworkInterfaces ( ) ; } catch ( SocketException exception ) { return Collections . emptyList ( ) ; } if ( interfaces != null ) { NetworkInterface inter...
Try to determine the primary ethernet address of the machine and replies the associated internet addresses .
6,935
public boolean isNull ( ) { for ( int i = 0 ; i < this . bytes . length ; ++ i ) { if ( this . bytes [ i ] != 0 ) { return false ; } } return true ; }
Replies if all the MAC address number are equal to zero .
6,936
public Optional < Path > getSourcePath ( ) { File f = this . nytdoc . getSourceFile ( ) ; return f == null ? Optional . empty ( ) : Optional . of ( f . toPath ( ) ) ; }
Accessor for the sourceFile property .
6,937
public Optional < URL > getUrl ( ) { URL u = this . nytdoc . getUrl ( ) ; return Optional . ofNullable ( u ) ; }
Accessor for the url property .
6,938
public void load ( File authorizationFile ) throws AuthorizationFileException { FileInputStream fis = null ; try { fis = new FileInputStream ( authorizationFile ) ; ANTLRInputStream stream = new ANTLRInputStream ( fis ) ; SAFPLexer lexer = new SAFPLexer ( stream ) ; CommonTokenStream tokens = new CommonTokenStream ( le...
Load the authorization file .
6,939
public static void deleteAlias ( final File keystoreFile , String alias , final String password ) throws NoSuchAlgorithmException , CertificateException , FileNotFoundException , KeyStoreException , IOException { KeyStore keyStore = KeyStoreFactory . newKeyStore ( KeystoreType . JKS . name ( ) , password , keystoreFile...
Delete the given alias from the given keystore file .
6,940
public static EChange setResponseCompressionEnabled ( final boolean bResponseCompressionEnabled ) { return s_aRWLock . writeLocked ( ( ) -> { if ( s_bResponseCompressionEnabled == bResponseCompressionEnabled ) return EChange . UNCHANGED ; s_bResponseCompressionEnabled = bResponseCompressionEnabled ; LOGGER . info ( "Co...
Enable or disable the overall compression .
6,941
public static EChange setDebugModeEnabled ( final boolean bDebugModeEnabled ) { return s_aRWLock . writeLocked ( ( ) -> { if ( s_bDebugModeEnabled == bDebugModeEnabled ) return EChange . UNCHANGED ; s_bDebugModeEnabled = bDebugModeEnabled ; LOGGER . info ( "CompressFilter debugMode=" + bDebugModeEnabled ) ; return ECha...
Enable or disable debug mode
6,942
public SAMFileHeader makeSAMFileHeader ( ReadGroupSet readGroupSet , List < Reference > references ) { return ReadUtils . makeSAMFileHeader ( readGroupSet , references ) ; }
Generates a SAMFileHeader from a ReadGroupSet and Reference metadata
6,943
public boolean hasUser ( String userName ) { boolean result = false ; for ( User item : getUsersList ( ) ) { if ( item . getName ( ) . equals ( userName ) ) { result = true ; } } return result ; }
Check to see if a given user name is within the list of users . Checking will be done case sensitive .
6,944
public User getUser ( String userName ) { User result = null ; for ( User item : getUsersList ( ) ) { if ( item . getName ( ) . equals ( userName ) ) { result = item ; } } return result ; }
Get the particular User instance if the user can be found . Null otherwise .
6,945
public CSP2SourceList addScheme ( final String sScheme ) { ValueEnforcer . notEmpty ( sScheme , "Scheme" ) ; ValueEnforcer . isTrue ( sScheme . length ( ) > 1 && sScheme . endsWith ( ":" ) , ( ) -> "Passed scheme '" + sScheme + "' is invalid!" ) ; m_aList . add ( sScheme ) ; return this ; }
Add a scheme
6,946
public final void setProxy ( final HttpHost aProxy , final Credentials aProxyCredentials ) { m_aProxy = aProxy ; m_aProxyCredentials = aProxyCredentials ; }
Set proxy host and proxy credentials .
6,947
public final HttpClientFactory setRetries ( final int nRetries ) { ValueEnforcer . isGE0 ( nRetries , "Retries" ) ; m_nRetries = nRetries ; return this ; }
Set the number of internal retries .
6,948
public final HttpClientFactory setRetryMode ( final ERetryMode eRetryMode ) { ValueEnforcer . notNull ( eRetryMode , "RetryMode" ) ; m_eRetryMode = eRetryMode ; return this ; }
Set the retry mode to use .
6,949
public static String dnsResolve ( final String sHostName ) { final InetAddress aAddress = resolveByName ( sHostName ) ; if ( aAddress == null ) return null ; return new IPV4Addr ( aAddress . getAddress ( ) ) . getAsString ( ) ; }
JavaScript callback function! Do not rename!
6,950
public EContinue onFilterBefore ( final HttpServletRequest aHttpRequest , final HttpServletResponse aHttpResponse , final IRequestWebScope aRequestScope ) throws IOException , ServletException { return EContinue . CONTINUE ; }
Invoked before the rest of the request is processed .
6,951
public boolean supportsMimeType ( final IMimeType aMimeType ) { if ( aMimeType == null ) return false ; return getQValueOfMimeType ( aMimeType ) . isAboveMinimumQuality ( ) ; }
Check if the passed MIME type is supported incl . fallback handling
6,952
public void configure ( String rootUrl , Settings settings ) { Data < Read , ReadGroupSet , Reference > data = dataSources . get ( rootUrl ) ; if ( data == null ) { data = new Data < Read , ReadGroupSet , Reference > ( settings , null ) ; dataSources . put ( rootUrl , data ) ; } else { data . settings = settings ; } }
Sets the settings for a given root url that will be used for creating the data source . Has no effect if the data source has already been created .
6,953
public GenomicsDataSource < Read , ReadGroupSet , Reference > get ( String rootUrl ) { Data < Read , ReadGroupSet , Reference > data = dataSources . get ( rootUrl ) ; if ( data == null ) { data = new Data < Read , ReadGroupSet , Reference > ( new Settings ( ) , null ) ; dataSources . put ( rootUrl , data ) ; } if ( dat...
Lazily creates and returns the data source for a given root url .
6,954
public EChange setConnectionTimeoutMilliSecs ( final long nMilliSecs ) { if ( m_nConnectionTimeoutMilliSecs == nMilliSecs ) return EChange . UNCHANGED ; m_nConnectionTimeoutMilliSecs = nMilliSecs ; return EChange . CHANGED ; }
Set the connection timeout in milliseconds . Values &le ; 0 are interpreted as indefinite timeout which is not recommended!
6,955
public EChange setTimeoutMilliSecs ( final long nMilliSecs ) { if ( m_nTimeoutMilliSecs == nMilliSecs ) return EChange . UNCHANGED ; m_nTimeoutMilliSecs = nMilliSecs ; return EChange . CHANGED ; }
Set the socket timeout in milliseconds . Values &le ; 0 are interpreted as indefinite timeout which is not recommended!
6,956
public static HttpHeaderMap getResponseHeaderMap ( final HttpServletResponse aHttpResponse ) { ValueEnforcer . notNull ( aHttpResponse , "HttpResponse" ) ; final HttpHeaderMap ret = new HttpHeaderMap ( ) ; for ( final String sName : aHttpResponse . getHeaderNames ( ) ) for ( final String sValue : aHttpResponse . getHea...
Get a complete response header map as a copy .
6,957
public final UnifiedResponse setContentAndCharset ( final String sContent , final Charset aCharset ) { ValueEnforcer . notNull ( sContent , "Content" ) ; setCharset ( aCharset ) ; setContent ( sContent . getBytes ( aCharset ) ) ; return this ; }
Utility method to set content and charset at once .
6,958
public final UnifiedResponse setContent ( final IHasInputStream aISP ) { ValueEnforcer . notNull ( aISP , "InputStreamProvider" ) ; if ( hasContent ( ) ) logInfo ( "Overwriting content with content provider!" ) ; m_aContentArray = null ; m_nContentArrayOfs = - 1 ; m_nContentArrayLength = - 1 ; m_aContentISP = aISP ; re...
Set the response content provider .
6,959
public final UnifiedResponse setContentDispositionFilename ( final String sFilename ) { ValueEnforcer . notEmpty ( sFilename , "Filename" ) ; final String sFilenameToUse = FilenameHelper . getWithoutPath ( FilenameHelper . getAsSecureValidFilename ( sFilename ) ) ; if ( ! sFilename . equals ( sFilenameToUse ) ) logWarn...
Set the content disposition filename for attachment download .
6,960
public final UnifiedResponse removeCaching ( ) { removeExpires ( ) ; removeCacheControl ( ) ; removeETag ( ) ; removeLastModified ( ) ; m_aResponseHeaderMap . removeHeaders ( CHttpHeader . PRAGMA ) ; return this ; }
Remove all settings and headers relevant to caching .
6,961
public final UnifiedResponse disableCaching ( ) { removeCaching ( ) ; if ( m_eHttpVersion . is10 ( ) ) { m_aResponseHeaderMap . setHeader ( CHttpHeader . EXPIRES , ResponseHelperSettings . EXPIRES_NEVER_STRING ) ; m_aResponseHeaderMap . setHeader ( CHttpHeader . PRAGMA , "no-cache" ) ; } else { final CacheControlBuilde...
A utility method that disables caching for this response .
6,962
public final UnifiedResponse enableCaching ( final int nSeconds ) { ValueEnforcer . isGT0 ( nSeconds , "Seconds" ) ; removeExpires ( ) ; removeCacheControl ( ) ; m_aResponseHeaderMap . removeHeaders ( CHttpHeader . PRAGMA ) ; if ( m_eHttpVersion . is10 ( ) ) { m_aResponseHeaderMap . setDateHeader ( CHttpHeader . EXPIRE...
Enable caching of this resource for the specified number of seconds .
6,963
public final UnifiedResponse setStatusUnauthorized ( final String sAuthenticate ) { _setStatus ( HttpServletResponse . SC_UNAUTHORIZED ) ; if ( StringHelper . hasText ( sAuthenticate ) ) m_aResponseHeaderMap . setHeader ( CHttpHeader . WWW_AUTHENTICATE , sAuthenticate ) ; return this ; }
Special handling for returning status code 401 UNAUTHORIZED .
6,964
public final void setCustomResponseHeaders ( final HttpHeaderMap aOther ) { m_aResponseHeaderMap . removeAll ( ) ; if ( aOther != null ) m_aResponseHeaderMap . setAllHeaders ( aOther ) ; }
Set many custom headers at once . All existing headers are unconditionally removed .
6,965
static private JsonTransformer factory ( Object jsonObject ) throws InvalidTransformerException { if ( jsonObject instanceof JSONObject ) { return factory ( ( JSONObject ) jsonObject ) ; } else if ( jsonObject instanceof JSONArray ) { return factory ( ( JSONArray ) jsonObject ) ; } else if ( jsonObject instanceof Strin...
Convenient private method
6,966
public void invalidate ( ) { if ( m_bInvalidated ) throw new IllegalStateException ( "Request scope already invalidated!" ) ; m_bInvalidated = true ; if ( m_aServletContext != null ) { final ServletRequestEvent aSRE = new ServletRequestEvent ( m_aServletContext , this ) ; for ( final ServletRequestListener aListener : ...
Invalidate this request clearing its state and invoking all HTTP event listener .
6,967
public QValue getQValueOfEncoding ( final String sEncoding ) { ValueEnforcer . notNull ( sEncoding , "Encoding" ) ; QValue aQuality = m_aMap . get ( _unify ( sEncoding ) ) ; if ( aQuality == null ) { aQuality = m_aMap . get ( AcceptEncodingHandler . ANY_ENCODING ) ; if ( aQuality == null ) { return QValue . MIN_QVALUE ...
Return the associated quality of the given encoding .
6,968
public void bind ( ) { program . use ( ) ; if ( textures != null ) { final TIntObjectIterator < Texture > iterator = textures . iterator ( ) ; while ( iterator . hasNext ( ) ) { iterator . advance ( ) ; final int unit = iterator . key ( ) ; iterator . value ( ) . bind ( unit ) ; program . bindSampler ( unit ) ; } } }
Binds the material to the OpenGL context .
6,969
public void setProgram ( Program program ) { if ( program == null ) { throw new IllegalStateException ( "Program cannot be null" ) ; } program . checkCreated ( ) ; this . program = program ; }
Sets the program to be used by this material to shade the models .
6,970
public void addTexture ( int unit , Texture texture ) { if ( texture == null ) { throw new IllegalStateException ( "Texture cannot be null" ) ; } texture . checkCreated ( ) ; if ( textures == null ) { textures = new TIntObjectHashMap < > ( ) ; } textures . put ( unit , texture ) ; }
Adds a texture to the material . If a texture is a already present in the same unit as this one it will be replaced .
6,971
public boolean maybeAddRead ( Read read ) { if ( ! isUnmappedMateOfMappedRead ( read ) ) { return false ; } final String reference = read . getNextMatePosition ( ) . getReferenceName ( ) ; String key = getReadKey ( read ) ; Map < String , ArrayList < Read > > reads = unmappedReads . get ( reference ) ; if ( reads == nu...
Checks and adds the read if we need to remember it for injection . Returns true if the read was added .
6,972
public ArrayList < Read > getUnmappedMates ( Read read ) { if ( read . getNumberReads ( ) < 2 || ( read . hasNextMatePosition ( ) && read . getNextMatePosition ( ) != null ) || ! read . hasAlignment ( ) || read . getAlignment ( ) == null || ! read . getAlignment ( ) . hasPosition ( ) || read . getAlignment ( ) . getPos...
Checks if the passed read has unmapped mates that need to be injected and if so - returns them . The returned list is sorted by read number to handle the case of multi - read fragments .
6,973
public static void setSessionPassivationAllowed ( final boolean bSessionPassivationAllowed ) { s_aSessionPassivationAllowed . set ( bSessionPassivationAllowed ) ; if ( LOGGER . isInfoEnabled ( ) ) LOGGER . info ( "Session passivation is now " + ( bSessionPassivationAllowed ? "enabled" : "disabled" ) ) ; final ScopeSess...
Allow or disallow session passivation
6,974
@ DevelopersNote ( "This is only for project-internal use!" ) public static ISessionWebScope internalGetOrCreateSessionScope ( final HttpSession aHttpSession , final boolean bCreateIfNotExisting , final boolean bItsOkayToCreateANewScope ) { ValueEnforcer . notNull ( aHttpSession , "HttpSession" ) ; final String sSessio...
Internal method which does the main logic for session web scope creation
6,975
@ DevelopersNote ( "This is only for project-internal use!" ) public static ISessionWebScope internalGetSessionScope ( final boolean bCreateIfNotExisting , final boolean bItsOkayToCreateANewSession ) { final IRequestWebScope aRequestScope = getRequestScopeOrNull ( ) ; return internalGetSessionScope ( aRequestScope , bC...
Get the session scope from the current request scope .
6,976
@ DevelopersNote ( "This is only for project-internal use!" ) public static ISessionWebScope internalGetSessionScope ( final IRequestWebScope aRequestScope , final boolean bCreateIfNotExisting , final boolean bItsOkayToCreateANewSession ) { if ( aRequestScope != null ) { final HttpSession aHttpSession = aRequestScope ....
Get the session scope of the provided request scope .
6,977
public ByteBuffer getIndicesBuffer ( ) { final ByteBuffer buffer = CausticUtil . createByteBuffer ( indices . size ( ) * DataType . INT . getByteSize ( ) ) ; for ( int i = 0 ; i < indices . size ( ) ; i ++ ) { buffer . putInt ( indices . get ( i ) ) ; } buffer . flip ( ) ; return buffer ; }
Returns a byte buffer containing all the current indices .
6,978
public void addAttribute ( int index , VertexAttribute attribute ) { attributes . put ( index , attribute ) ; nameToIndex . put ( attribute . getName ( ) , index ) ; }
Adds an attribute .
6,979
public int getAttributeSize ( int index ) { final VertexAttribute attribute = getAttribute ( index ) ; if ( attribute == null ) { return - 1 ; } return attribute . getSize ( ) ; }
Returns the size of the attribute at the provided index or - 1 if none can be found .
6,980
public DataType getAttributeType ( int index ) { final VertexAttribute attribute = getAttribute ( index ) ; if ( attribute == null ) { return null ; } return attribute . getType ( ) ; }
Returns the type of the attribute at the provided index or null if none can be found .
6,981
public String getAttributeName ( int index ) { final VertexAttribute attribute = getAttribute ( index ) ; if ( attribute == null ) { return null ; } return attribute . getName ( ) ; }
Returns the name of the attribute at the provided index or null if none can be found .
6,982
public ByteBuffer getAttributeBuffer ( int index ) { final VertexAttribute attribute = getAttribute ( index ) ; if ( attribute == null ) { return null ; } return attribute . getData ( ) ; }
Returns the buffer for the attribute at the provided index or null if none can be found . The buffer is returned filled and ready for reading .
6,983
public void copy ( VertexData data ) { clear ( ) ; indices . addAll ( data . indices ) ; final TIntObjectIterator < VertexAttribute > iterator = data . attributes . iterator ( ) ; while ( iterator . hasNext ( ) ) { iterator . advance ( ) ; attributes . put ( iterator . key ( ) , iterator . value ( ) . clone ( ) ) ; } n...
Replaces the contents of this vertex data by the provided one . This is a deep copy . The vertex attribute are each individually cloned .
6,984
public QValue getQValueOfLanguage ( final String sLanguage ) { ValueEnforcer . notNull ( sLanguage , "Language" ) ; QValue aQuality = m_aMap . get ( _unify ( sLanguage ) ) ; if ( aQuality == null ) { aQuality = m_aMap . get ( AcceptLanguageHandler . ANY_LANGUAGE ) ; if ( aQuality == null ) { return QValue . MIN_QVALUE ...
Return the associated quality of the given language .
6,985
public void setVertexArray ( VertexArray vertexArray ) { if ( vertexArray == null ) { throw new IllegalArgumentException ( "Vertex array cannot be null" ) ; } vertexArray . checkCreated ( ) ; this . vertexArray = vertexArray ; }
Sets the vertex array for this model .
6,986
public Matrix4f getMatrix ( ) { if ( updateMatrix ) { final Matrix4f matrix = Matrix4f . createScaling ( scale . toVector4 ( 1 ) ) . rotate ( rotation ) . translate ( position ) ; if ( parent == null ) { this . matrix = matrix ; } else { childMatrix = matrix ; } updateMatrix = false ; } if ( parent != null ) { final Ma...
Returns the transformation matrix that represent the model s current scale rotation and position .
6,987
public void setParent ( Model parent ) { if ( parent == this ) { throw new IllegalArgumentException ( "The model can't be its own parent" ) ; } if ( parent == null ) { this . parent . children . remove ( this ) ; } else { parent . children . add ( this ) ; } this . parent = parent ; }
Sets the parent model . This model s position rotation and scale will be relative to that model if not null .
6,988
public boolean hasAlias ( String aliasName ) { boolean result = false ; for ( Alias item : getAliasesList ( ) ) { if ( item . getName ( ) . equals ( aliasName ) ) { result = true ; } } return result ; }
Check if the given alias exists in the list of aliases or not .
6,989
public static String encode ( final String sValue , final Charset aCharset , final ECodec eCodec ) { if ( sValue == null ) return null ; try { switch ( eCodec ) { case Q : return new RFC1522QCodec ( aCharset ) . getEncoded ( sValue ) ; case B : default : return new RFC1522BCodec ( aCharset ) . getEncoded ( sValue ) ; }...
Used to encode a string as specified by RFC 2047
6,990
public static String decode ( final String sValue ) { if ( sValue == null ) return null ; try { return new RFC1522BCodec ( ) . getDecoded ( sValue ) ; } catch ( final DecodeException de ) { try { return new RFC1522QCodec ( ) . getDecoded ( sValue ) ; } catch ( final Exception ex ) { return sValue ; } } catch ( final Ex...
Used to decode a string as specified by RFC 2047
6,991
public static void addRequest ( final String sRequestID , final IRequestWebScope aRequestScope ) { getInstance ( ) . m_aRequestTrackingMgr . addRequest ( sRequestID , aRequestScope , s_aParallelRunningCallbacks ) ; }
Add new request to the tracking
6,992
public static void removeRequest ( final String sRequestID ) { final RequestTracker aTracker = getGlobalSingletonIfInstantiated ( RequestTracker . class ) ; if ( aTracker != null ) aTracker . m_aRequestTrackingMgr . removeRequest ( sRequestID , s_aParallelRunningCallbacks ) ; }
Remove a request from the tracking .
6,993
public ESuccess queueMail ( final ISMTPSettings aSMTPSettings , final IMutableEmailData aMailData ) { return MailAPI . queueMail ( aSMTPSettings , aMailData ) ; }
Unconditionally queue a mail
6,994
public int queueMails ( final ISMTPSettings aSMTPSettings , final Collection < ? extends IMutableEmailData > aMailDataList ) { return MailAPI . queueMails ( aSMTPSettings , aMailDataList ) ; }
Queue multiple mails at once .
6,995
public static void setPerformMXRecordCheck ( final boolean bPerformMXRecordCheck ) { s_aPerformMXRecordCheck . set ( bPerformMXRecordCheck ) ; if ( LOGGER . isInfoEnabled ( ) ) LOGGER . info ( "Email address record check is " + ( bPerformMXRecordCheck ? "enabled" : "disabled" ) ) ; }
Set the global check MX record flag .
6,996
private static boolean _hasMXRecord ( final String sHostName ) { try { final Record [ ] aRecords = new Lookup ( sHostName , Type . MX ) . run ( ) ; return aRecords != null && aRecords . length > 0 ; } catch ( final Exception ex ) { if ( LOGGER . isWarnEnabled ( ) ) LOGGER . warn ( "Failed to check for MX record on host...
Check if the passed host name has an MX record .
6,997
public static boolean isValid ( final String sEmail ) { return s_aPerformMXRecordCheck . get ( ) ? isValidWithMXCheck ( sEmail ) : EmailAddressHelper . isValid ( sEmail ) ; }
Checks if a value is a valid e - mail address . Depending on the global value for the MX record check the check is performed incl . the MX record check or without .
6,998
public static boolean isValidWithMXCheck ( final String sEmail ) { if ( ! EmailAddressHelper . isValid ( sEmail ) ) return false ; final String sUnifiedEmail = EmailAddressHelper . getUnifiedEmailAddress ( sEmail ) ; final int i = sUnifiedEmail . indexOf ( '@' ) ; final String sHostName = sUnifiedEmail . substring ( i ...
Checks if a value is a valid e - mail address according to a complex regular expression . Additionally an MX record lookup is performed to see whether this host provides SMTP services .
6,999
public String getResponseBodyAsString ( final Charset aCharset ) { return m_aResponseBody == null ? null : new String ( m_aResponseBody , aCharset ) ; }
Get the response body as a string in the provided charset .