idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
6,900
@ Pure 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 ...
Replies the first child node that has the specified type .
133
12
6,901
@ Pure 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 .
61
12
6,902
@ Pure 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 ch...
Replies the text inside the node at the specified path .
177
12
6,903
@ Pure 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 .
77
13
6,904
@ Pure public static Object parseObject ( String xmlSerializedObject ) throws IOException , ClassNotFoundException { assert xmlSerializedObject != null : AssertMessages . notNullParameter ( 0 ) ; try ( ByteArrayInputStream bais = new ByteArrayInputStream ( Base64 . getDecoder ( ) . decode ( xmlSerializedObject ) ) ) { ...
Deserialize an object from the given XML string .
104
11
6,905
@ Pure public static byte [ ] parseString ( String text ) { return Base64 . getDecoder ( ) . decode ( Strings . nullToEmpty ( text ) . trim ( ) ) ; }
Parse a Base64 string with contains a set of bytes .
42
13
6,906
@ Pure 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 .
61
10
6,907
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 .
639
10
6,908
@ Pure 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 ...
Replies the resource URL that is contained inside the XML attribute defined in the given node and with the given XML path .
95
24
6,909
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 .
249
11
6,910
public boolean moveTo ( N newParent ) { if ( newParent == null ) { return false ; } return moveTo ( newParent , newParent . getChildCount ( ) ) ; }
Move this node in the given new parent node .
40
10
6,911
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 .
219
9
6,912
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 .
118
23
6,913
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 .
102
14
6,914
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 .
94
8
6,915
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 LayoutProcessor...
has been found the file will be copied as it is
137
11
6,916
@ Deprecated 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
47
16
6,917
@ Pure public static MACNumber [ ] parse ( String addresses ) { if ( ( addresses == null ) || ( "" . equals ( addresses ) ) ) { //$NON-NLS-1$ return new MACNumber [ 0 ] ; } final String [ ] adrs = addresses . split ( Pattern . quote ( Character . toString ( MACNUMBER_SEPARATOR ) ) ) ; final List < MACNumber > list = ne...
Parse the specified string an repleis the corresponding MAC numbers .
159
14
6,918
@ Pure 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 ...
Join the specified MAC numbers to reply a string .
97
10
6,919
@ Pure 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 ) { N...
Get all of the ethernet addresses associated with the local machine .
158
13
6,920
@ Pure 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 ( interf...
Get all of the internet address and ethernet address mappings on the local machine .
230
17
6,921
@ Pure 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 ( ...
Try to determine the primary ethernet address of the machine .
134
12
6,922
@ Pure public static Collection < InetAddress > getPrimaryAdapterAddresses ( ) { final Enumeration < NetworkInterface > interfaces ; try { interfaces = NetworkInterface . getNetworkInterfaces ( ) ; } catch ( SocketException exception ) { return Collections . emptyList ( ) ; } if ( interfaces != null ) { NetworkInterfac...
Try to determine the primary ethernet address of the machine and replies the associated internet addresses .
217
18
6,923
@ Pure 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 .
49
13
6,924
public Optional < Path > getSourcePath ( ) { File f = this . nytdoc . getSourceFile ( ) ; return f == null ? Optional . empty ( ) : Optional . of ( f . toPath ( ) ) ; }
Accessor for the sourceFile property .
50
8
6,925
public Optional < URL > getUrl ( ) { URL u = this . nytdoc . getUrl ( ) ; return Optional . ofNullable ( u ) ; }
Accessor for the url property .
36
7
6,926
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 .
257
5
6,927
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 .
106
11
6,928
@ Nonnull public static EChange setResponseCompressionEnabled ( final boolean bResponseCompressionEnabled ) { return s_aRWLock . writeLocked ( ( ) -> { if ( s_bResponseCompressionEnabled == bResponseCompressionEnabled ) return EChange . UNCHANGED ; s_bResponseCompressionEnabled = bResponseCompressionEnabled ; LOGGER . ...
Enable or disable the overall compression .
110
7
6,929
@ Nonnull 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 ) ; r...
Enable or disable debug mode
101
5
6,930
@ Override public SAMFileHeader makeSAMFileHeader ( ReadGroupSet readGroupSet , List < Reference > references ) { return ReadUtils . makeSAMFileHeader ( readGroupSet , references ) ; }
Generates a SAMFileHeader from a ReadGroupSet and Reference metadata
44
14
6,931
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 .
53
22
6,932
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 .
53
15
6,933
@ Nonnull public CSP2SourceList addScheme ( @ Nonnull @ Nonempty 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
107
3
6,934
public final void setProxy ( @ Nullable final HttpHost aProxy , @ Nullable final Credentials aProxyCredentials ) { m_aProxy = aProxy ; m_aProxyCredentials = aProxyCredentials ; }
Set proxy host and proxy credentials .
53
7
6,935
@ Nonnull public final HttpClientFactory setRetries ( @ Nonnegative final int nRetries ) { ValueEnforcer . isGE0 ( nRetries , "Retries" ) ; m_nRetries = nRetries ; return this ; }
Set the number of internal retries .
55
8
6,936
@ Nonnull public final HttpClientFactory setRetryMode ( @ Nonnull final ERetryMode eRetryMode ) { ValueEnforcer . notNull ( eRetryMode , "RetryMode" ) ; m_eRetryMode = eRetryMode ; return this ; }
Set the retry mode to use .
63
8
6,937
@ Nullable public static String dnsResolve ( @ Nonnull 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!
71
9
6,938
@ Nonnull @ OverrideOnDemand public EContinue onFilterBefore ( @ Nonnull final HttpServletRequest aHttpRequest , @ Nonnull final HttpServletResponse aHttpResponse , @ Nonnull final IRequestWebScope aRequestScope ) throws IOException , ServletException { // By default continue return EContinue . CONTINUE ; }
Invoked before the rest of the request is processed .
73
11
6,939
public boolean supportsMimeType ( @ Nullable final IMimeType aMimeType ) { if ( aMimeType == null ) return false ; return getQValueOfMimeType ( aMimeType ) . isAboveMinimumQuality ( ) ; }
Check if the passed MIME type is supported incl . fallback handling
55
14
6,940
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 .
81
31
6,941
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 .
118
15
6,942
@ Nonnull 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!
75
22
6,943
@ Nonnull 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!
72
22
6,944
@ Nonnull @ ReturnsMutableCopy public static HttpHeaderMap getResponseHeaderMap ( @ Nonnull final HttpServletResponse aHttpResponse ) { ValueEnforcer . notNull ( aHttpResponse , "HttpResponse" ) ; final HttpHeaderMap ret = new HttpHeaderMap ( ) ; for ( final String sName : aHttpResponse . getHeaderNames ( ) ) for ( fin...
Get a complete response header map as a copy .
117
10
6,945
@ Nonnull public final UnifiedResponse setContentAndCharset ( @ Nonnull final String sContent , @ Nonnull final Charset aCharset ) { ValueEnforcer . notNull ( sContent , "Content" ) ; setCharset ( aCharset ) ; setContent ( sContent . getBytes ( aCharset ) ) ; return this ; }
Utility method to set content and charset at once .
81
12
6,946
@ Nonnull public final UnifiedResponse setContent ( @ Nonnull 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_aCo...
Set the response content provider .
105
6
6,947
@ Nonnull public final UnifiedResponse setContentDispositionFilename ( @ Nonnull @ Nonempty final String sFilename ) { ValueEnforcer . notEmpty ( sFilename , "Filename" ) ; // Ensure that a valid filename is used // -> Strip all paths and replace all invalid characters final String sFilenameToUse = FilenameHelper . get...
Set the content disposition filename for attachment download .
372
9
6,948
@ Nonnull public final UnifiedResponse removeCaching ( ) { // Remove any eventually set headers removeExpires ( ) ; removeCacheControl ( ) ; removeETag ( ) ; removeLastModified ( ) ; m_aResponseHeaderMap . removeHeaders ( CHttpHeader . PRAGMA ) ; return this ; }
Remove all settings and headers relevant to caching .
68
9
6,949
@ Nonnull public final UnifiedResponse disableCaching ( ) { // Remove any eventually set headers removeCaching ( ) ; if ( m_eHttpVersion . is10 ( ) ) { // Set to expire far in the past for HTTP/1.0. m_aResponseHeaderMap . setHeader ( CHttpHeader . EXPIRES , ResponseHelperSettings . EXPIRES_NEVER_STRING ) ; // Set stand...
A utility method that disables caching for this response .
311
11
6,950
@ Nonnull public final UnifiedResponse enableCaching ( @ Nonnegative final int nSeconds ) { ValueEnforcer . isGT0 ( nSeconds , "Seconds" ) ; // Remove any eventually set headers // Note: don't remove Last-Modified and ETag! removeExpires ( ) ; removeCacheControl ( ) ; m_aResponseHeaderMap . removeHeaders ( CHttpHeader ...
Enable caching of this resource for the specified number of seconds .
197
12
6,951
@ Nonnull public final UnifiedResponse setStatusUnauthorized ( @ Nullable 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 .
89
14
6,952
public final void setCustomResponseHeaders ( @ Nullable 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 .
57
15
6,953
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
105
4
6,954
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 .
122
14
6,955
@ Nonnull public QValue getQValueOfEncoding ( @ Nonnull final String sEncoding ) { ValueEnforcer . notNull ( sEncoding , "Encoding" ) ; // Direct search encoding QValue aQuality = m_aMap . get ( _unify ( sEncoding ) ) ; if ( aQuality == null ) { // If not explicitly given, check for "*" aQuality = m_aMap . get ( Accept...
Return the associated quality of the given encoding .
145
9
6,956
public void bind ( ) { program . use ( ) ; if ( textures != null ) { final TIntObjectIterator < Texture > iterator = textures . iterator ( ) ; while ( iterator . hasNext ( ) ) { iterator . advance ( ) ; // Bind the texture to the unit final int unit = iterator . key ( ) ; iterator . value ( ) . bind ( unit ) ; // Bind ...
Binds the material to the OpenGL context .
101
9
6,957
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 .
45
15
6,958
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 .
72
26
6,959
@ Override 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 ( ...
Checks and adds the read if we need to remember it for injection . Returns true if the read was added .
223
23
6,960
@ Override 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 (...
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 .
293
40
6,961
public static void setSessionPassivationAllowed ( final boolean bSessionPassivationAllowed ) { s_aSessionPassivationAllowed . set ( bSessionPassivationAllowed ) ; if ( LOGGER . isInfoEnabled ( ) ) LOGGER . info ( "Session passivation is now " + ( bSessionPassivationAllowed ? "enabled" : "disabled" ) ) ; // For passivat...
Allow or disallow session passivation
347
7
6,962
@ Nullable @ DevelopersNote ( "This is only for project-internal use!" ) public static ISessionWebScope internalGetOrCreateSessionScope ( @ Nonnull final HttpSession aHttpSession , final boolean bCreateIfNotExisting , final boolean bItsOkayToCreateANewScope ) { ValueEnforcer . notNull ( aHttpSession , "HttpSession" ) ;...
Internal method which does the main logic for session web scope creation
316
12
6,963
@ Nullable @ DevelopersNote ( "This is only for project-internal use!" ) public static ISessionWebScope internalGetSessionScope ( final boolean bCreateIfNotExisting , final boolean bItsOkayToCreateANewSession ) { // Try to to resolve the current request scope final IRequestWebScope aRequestScope = getRequestScopeOrNull...
Get the session scope from the current request scope .
104
10
6,964
@ Nullable @ DevelopersNote ( "This is only for project-internal use!" ) public static ISessionWebScope internalGetSessionScope ( @ Nullable final IRequestWebScope aRequestScope , final boolean bCreateIfNotExisting , final boolean bItsOkayToCreateANewSession ) { // Try to to resolve the current request scope if ( aRequ...
Get the session scope of the provided request scope .
208
10
6,965
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 .
86
10
6,966
public void addAttribute ( int index , VertexAttribute attribute ) { attributes . put ( index , attribute ) ; nameToIndex . put ( attribute . getName ( ) , index ) ; }
Adds an attribute .
40
4
6,967
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 .
43
19
6,968
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 .
43
18
6,969
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 .
42
18
6,970
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 .
43
28
6,971
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 .
97
28
6,972
@ Nonnull public QValue getQValueOfLanguage ( @ Nonnull final String sLanguage ) { ValueEnforcer . notNull ( sLanguage , "Language" ) ; // Find language direct QValue aQuality = m_aMap . get ( _unify ( sLanguage ) ) ; if ( aQuality == null ) { // If not explicitly given, check for "*" aQuality = m_aMap . get ( AcceptLa...
Return the associated quality of the given language .
140
9
6,973
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 .
57
9
6,974
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 .
132
15
6,975
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 .
74
23
6,976
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 .
55
14
6,977
@ Nullable public static String encode ( @ Nullable final String sValue , @ Nonnull 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 ( aChars...
Used to encode a string as specified by RFC 2047
125
11
6,978
@ Nullable public static String decode ( @ Nullable final String sValue ) { if ( sValue == null ) return null ; try { // try BCodec first return new RFC1522BCodec ( ) . getDecoded ( sValue ) ; } catch ( final DecodeException de ) { // try QCodec next try { return new RFC1522QCodec ( ) . getDecoded ( sValue ) ; } catch ...
Used to decode a string as specified by RFC 2047
118
11
6,979
public static void addRequest ( @ Nonnull @ Nonempty final String sRequestID , @ Nonnull final IRequestWebScope aRequestScope ) { getInstance ( ) . m_aRequestTrackingMgr . addRequest ( sRequestID , aRequestScope , s_aParallelRunningCallbacks ) ; }
Add new request to the tracking
67
6
6,980
public static void removeRequest ( @ Nonnull @ Nonempty 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 .
76
7
6,981
@ Nonnull public ESuccess queueMail ( @ Nonnull final ISMTPSettings aSMTPSettings , @ Nonnull final IMutableEmailData aMailData ) { return MailAPI . queueMail ( aSMTPSettings , aMailData ) ; }
Unconditionally queue a mail
53
6
6,982
@ Nonnegative public int queueMails ( @ Nonnull final ISMTPSettings aSMTPSettings , @ Nonnull final Collection < ? extends IMutableEmailData > aMailDataList ) { return MailAPI . queueMails ( aSMTPSettings , aMailDataList ) ; }
Queue multiple mails at once .
61
7
6,983
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 .
82
8
6,984
private static boolean _hasMXRecord ( @ Nonnull final String sHostName ) { try { final Record [ ] aRecords = new Lookup ( sHostName , Type . MX ) . run ( ) ; return aRecords != null && aRecords . length > 0 ; } catch ( final Exception ex ) { // Do not log this message, as this method is potentially called very // often...
Check if the passed host name has an MX record .
152
11
6,985
public static boolean isValid ( @ Nullable 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 .
51
36
6,986
public static boolean isValidWithMXCheck ( @ Nullable final String sEmail ) { // First check without MX if ( ! EmailAddressHelper . isValid ( sEmail ) ) return false ; final String sUnifiedEmail = EmailAddressHelper . getUnifiedEmailAddress ( sEmail ) ; // MX record checking final int i = sUnifiedEmail . indexOf ( ' ' ...
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 .
112
36
6,987
@ Nullable public String getResponseBodyAsString ( @ Nonnull final Charset aCharset ) { return m_aResponseBody == null ? null : new String ( m_aResponseBody , aCharset ) ; }
Get the response body as a string in the provided charset .
51
13
6,988
public static String decode ( final String toDecode , final int relocate ) { final StringBuffer sb = new StringBuffer ( ) ; final char [ ] encrypt = toDecode . toCharArray ( ) ; final int arraylength = encrypt . length ; for ( int i = 0 ; i < arraylength ; i ++ ) { final char a = ( char ) ( encrypt [ i ] - relocate ) ;...
Decrypt the given String .
108
6
6,989
public static String encode ( final String secret , final int relocate ) { final StringBuffer sb = new StringBuffer ( ) ; final char [ ] encrypt = secret . toCharArray ( ) ; final int arraylength = encrypt . length ; for ( int i = 0 ; i < arraylength ; i ++ ) { final char a = ( char ) ( encrypt [ i ] + relocate ) ; sb ...
Encrypt the given String .
104
6
6,990
public static PublicKey readPemPublicKey ( final File file ) throws IOException , NoSuchAlgorithmException , InvalidKeySpecException , NoSuchProviderException { final String publicKeyAsString = readPemFileAsBase64 ( file ) ; final byte [ ] decoded = Base64 . decodeBase64 ( publicKeyAsString ) ; return readPublicKey ( d...
reads a public key from a file .
82
8
6,991
public static String toPemFormat ( final PublicKey publicKey ) { final String publicKeyAsBase64String = toBase64 ( publicKey ) ; final List < String > parts = StringExtensions . splitByFixedLength ( publicKeyAsBase64String , 64 ) ; final StringBuilder sb = new StringBuilder ( ) ; sb . append ( PublicKeyReader . BEGIN_P...
Transform the public key in pem format .
171
9
6,992
protected void checkThreshold ( final int nCount ) throws IOException { if ( ! m_bThresholdExceeded && ( m_nWritten + nCount > m_nThreshold ) ) { m_bThresholdExceeded = true ; onThresholdReached ( ) ; } }
Checks to see if writing the specified number of bytes would cause the configured threshold to be exceeded . If so triggers an event to allow a concrete implementation to take action on
65
34
6,993
@ Nonnull public ICommonsList < String > getHeaders ( @ Nullable final String sName ) { return new CommonsArrayList <> ( m_aHeaders . get ( _unifyHeaderName ( sName ) ) ) ; }
Return all values for the given header as a List of value objects .
53
14
6,994
@ Nonnull public static EChange safeInvalidateSession ( @ Nullable final HttpSession aSession ) { if ( aSession != null ) { try { if ( LOGGER . isDebugEnabled ( ) ) LOGGER . debug ( "Invalidating session " + aSession . getId ( ) ) ; aSession . invalidate ( ) ; return EChange . CHANGED ; } catch ( final IllegalStateExce...
Invalidate the session if the session is still active .
107
11
6,995
@ Nonnull public static Enumeration < String > getAllAttributes ( @ Nonnull final HttpSession aSession ) { ValueEnforcer . notNull ( aSession , "Session" ) ; try { return GenericReflection . uncheckedCast ( aSession . getAttributeNames ( ) ) ; } catch ( final IllegalStateException ex ) { // Session no longer valid retu...
Get all attribute names present in the specified session .
89
10
6,996
@ Nonnull public IMicroDocument getAsDocument ( @ Nonnull @ Nonempty final String sFullContextPath ) { final String sNamespaceURL = CXMLSitemap . XML_NAMESPACE_0_9 ; final IMicroDocument ret = new MicroDocument ( ) ; final IMicroElement eSitemapindex = ret . appendElement ( sNamespaceURL , ELEMENT_SITEMAPINDEX ) ; int ...
Get the Index as a micro document .
302
8
6,997
@ Nonnull public static final < T extends AbstractSessionWebSingleton > T getSessionSingleton ( @ Nonnull final Class < T > aClass ) { return getSingleton ( _getStaticScope ( true ) , aClass ) ; }
Get the singleton object in the current session web scope using the passed class . If the singleton is not yet instantiated a new instance is created .
51
31
6,998
@ SuppressWarnings ( "unchecked" ) public static boolean load ( GLImplementation implementation ) { try { final Constructor < ? > constructor = Class . forName ( implementation . getContextName ( ) ) . getDeclaredConstructor ( ) ; constructor . setAccessible ( true ) ; implementations . put ( implementation , ( Constru...
Loads the implementation making it accessible .
138
8
6,999
public void registerServlet ( @ Nonnull final Class < ? extends Servlet > aServletClass , @ Nonnull @ Nonempty final String sServletPath , @ Nonnull @ Nonempty final String sServletName ) { registerServlet ( aServletClass , sServletPath , sServletName , ( Map < String , String > ) null ) ; }
Register a new servlet without servlet init parameters
80
10