signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class RequestHttpBase { /** * Returns the server ' s port . */
public int getServerPort ( ) { } } | String host = null ; CharSequence rawHost ; if ( ( rawHost = getHost ( ) ) != null ) { int length = rawHost . length ( ) ; int i ; for ( i = length - 1 ; i >= 0 ; i -- ) { if ( rawHost . charAt ( i ) == ':' ) { int port = 0 ; for ( i ++ ; i < length ; i ++ ) { char ch = rawHost . charAt ( i ) ; if ( '0' <= ch && ch <= '9' ) { port = 10 * port + ch - '0' ; } } return port ; } } // server / 0521 vs server / 052o
// because of proxies , need to use the host header ,
// not the actual port
return isSecure ( ) ? 443 : 80 ; } if ( host == null ) { return connTcp ( ) . portLocal ( ) ; } int p1 = host . lastIndexOf ( ':' ) ; if ( p1 < 0 ) return isSecure ( ) ? 443 : 80 ; else { int length = host . length ( ) ; int port = 0 ; for ( int i = p1 + 1 ; i < length ; i ++ ) { char ch = host . charAt ( i ) ; if ( '0' <= ch && ch <= '9' ) { port = 10 * port + ch - '0' ; } } return port ; } |
public class FileSystem { /** * Make the given filename relative to the given root path .
* @ param filenameToMakeRelative is the name to make relative .
* @ param rootPath is the root path from which the relative path will be set .
* @ return a relative filename .
* @ throws IOException when is is impossible to retreive canonical paths .
* @ since 6.0 */
@ Pure public static File makeRelative ( URL filenameToMakeRelative , URL rootPath ) throws IOException { } } | if ( filenameToMakeRelative == null || rootPath == null ) { throw new IllegalArgumentException ( ) ; } final String basename = largeBasename ( filenameToMakeRelative ) ; final URL dir = dirname ( filenameToMakeRelative ) ; final String [ ] parts1 = split ( dir ) ; final String [ ] parts2 = split ( rootPath ) ; final String relPath = makeRelative ( parts1 , parts2 , basename ) ; return new File ( CURRENT_DIRECTORY , relPath ) ; |
public class MBeanServerProxy { /** * { @ inheritDoc } */
public Object getAttribute ( ObjectName name , String attribute ) throws MBeanException , AttributeNotFoundException , InstanceNotFoundException , ReflectionException { } } | return delegate . getAttribute ( name , attribute ) ; |
public class AutoDetector { /** * 递归加载目录下面的所有资源
* 并监控目录变化
* @ param path 目录路径
* @ param resourceLoader 资源自定义加载逻辑
* @ param resourcePaths 资源的所有路径 , 用于资源监控
* @ return 目录所有资源内容 */
private static List < String > loadAndWatchDir ( Path path , ResourceLoader resourceLoader , String resourcePaths ) { } } | final List < String > result = new ArrayList < > ( ) ; try { Files . walkFileTree ( path , new SimpleFileVisitor < Path > ( ) { @ Override public FileVisitResult visitFile ( Path file , BasicFileAttributes attrs ) throws IOException { result . addAll ( load ( file . toAbsolutePath ( ) . toString ( ) ) ) ; return FileVisitResult . CONTINUE ; } } ) ; } catch ( IOException ex ) { LOGGER . error ( "加载资源失败:" + path , ex ) ; } DirectoryWatcher . WatcherCallback watcherCallback = new DirectoryWatcher . WatcherCallback ( ) { private long lastExecute = System . currentTimeMillis ( ) ; @ Override public void execute ( WatchEvent . Kind < ? > kind , String path ) { // 一秒内发生的多个相同事件认定为一次 , 防止短时间内多次加载资源
if ( System . currentTimeMillis ( ) - lastExecute > 1000 ) { lastExecute = System . currentTimeMillis ( ) ; LOGGER . info ( "事件:" + kind . name ( ) + " ,路径:" + path ) ; synchronized ( AutoDetector . class ) { DirectoryWatcher dw = WATCHER_CALLBACKS . get ( this ) ; String paths = RESOURCES . get ( dw ) ; ResourceLoader loader = RESOURCE_LOADERS . get ( dw ) ; LOGGER . info ( "重新加载数据" ) ; loadAndWatch ( loader , paths ) ; } } } } ; DirectoryWatcher directoryWatcher = DirectoryWatcher . getDirectoryWatcher ( watcherCallback , StandardWatchEventKinds . ENTRY_CREATE , StandardWatchEventKinds . ENTRY_MODIFY , StandardWatchEventKinds . ENTRY_DELETE ) ; directoryWatcher . watchDirectoryTree ( path ) ; WATCHER_CALLBACKS . put ( watcherCallback , directoryWatcher ) ; RESOURCES . put ( directoryWatcher , resourcePaths ) ; RESOURCE_LOADERS . put ( directoryWatcher , resourceLoader ) ; return result ; |
public class Internal { /** * Returns the length , in bytes , of the qualifier : 2 or 4 bytes
* @ param qualifier The qualifier to parse
* @ param offset An offset within the byte array
* @ return The length of the qualifier in bytes
* @ throws IllegalArgumentException if the qualifier is null or the offset falls
* outside of the qualifier array
* @ since 2.0 */
public static short getQualifierLength ( final byte [ ] qualifier , final int offset ) { } } | validateQualifier ( qualifier , offset ) ; if ( ( qualifier [ offset ] & Const . MS_BYTE_FLAG ) == Const . MS_BYTE_FLAG ) { if ( ( offset + 4 ) > qualifier . length ) { throw new IllegalArgumentException ( "Detected a millisecond flag but qualifier length is too short" ) ; } return 4 ; } else { if ( ( offset + 2 ) > qualifier . length ) { throw new IllegalArgumentException ( "Qualifier length is too short" ) ; } return 2 ; } |
public class ApiOvhEmaildomain { /** * Create new ACL
* REST : POST / email / domain / { domain } / acl
* @ param accountId [ required ] Deleguates rights to
* @ param domain [ required ] Name of your domain name */
public OvhAcl domain_acl_POST ( String domain , String accountId ) throws IOException { } } | String qPath = "/email/domain/{domain}/acl" ; StringBuilder sb = path ( qPath , domain ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "accountId" , accountId ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhAcl . class ) ; |
public class ModelGenerator { /** * Creates JS code based on the provided { @ link ModelBean } in the specified
* { @ link OutputFormat } . Code can be generated in pretty or compressed format . The
* generated code is cached unless debug is true . A second call to this method with
* the same model name and format will return the code from the cache .
* @ param model generate code based on this { @ link ModelBean }
* @ param format specifies which code ( ExtJS or Touch ) the generator should create
* @ param debug if true the generator creates the output in pretty format , false the
* output is compressed
* @ return the generated model object ( JS code ) */
public static String generateJavascript ( ModelBean model , OutputFormat format , boolean debug ) { } } | OutputConfig outputConfig = new OutputConfig ( ) ; outputConfig . setOutputFormat ( format ) ; outputConfig . setDebug ( debug ) ; return generateJavascript ( model , outputConfig ) ; |
public class FileSaverView { /** * Update the file chooser ' s filter settings . */
protected void setFileFilter ( ) { } } | m_fileChooser . setAcceptAllFileFilterUsed ( false ) ; String [ ] extensions = m_model . getExtensions ( ) ; for ( int extensionIndex = 0 ; extensionIndex < extensions . length ; extensionIndex += 2 ) { m_fileChooser . setFileFilter ( new FileNameExtensionFilter ( extensions [ extensionIndex ] . toUpperCase ( ) + " File" , extensions [ extensionIndex + 1 ] ) ) ; } |
public class Utils4J { /** * Encrypts some data based on a password .
* @ param algorithm
* PBE algorithm like " PBEWithMD5AndDES " or " PBEWithMD5AndTripleDES " - Cannot be < code > null < / code > .
* @ param data
* Data to encrypt - Cannot be < code > null < / code > .
* @ param password
* Password - Cannot be < code > null < / code > .
* @ param salt
* Salt usable with algorithm - Cannot be < code > null < / code > .
* @ param count
* Iterations .
* @ return Encrypted data . */
public static byte [ ] encryptPasswordBased ( final String algorithm , final byte [ ] data , final char [ ] password , final byte [ ] salt , final int count ) { } } | checkNotNull ( "algorithm" , algorithm ) ; checkNotNull ( "data" , data ) ; checkNotNull ( "password" , password ) ; checkNotNull ( "salt" , salt ) ; try { final Cipher cipher = createCipher ( algorithm , Cipher . ENCRYPT_MODE , password , salt , count ) ; return cipher . doFinal ( data ) ; } catch ( final Exception ex ) { throw new RuntimeException ( "Error encrypting the password!" , ex ) ; } |
public class ProxyConnection { /** * Keep < b > Proxy < / b > Alive , then return or close < b > Client < / b > < p >
* Must Follow a " < code > server . onComplete . accept ( proxy ) < / code > "
* @ param closed < code > false < / code > to return Client to pool and < code > true < / code > to close Client */
void reset ( boolean closed ) { } } | attributeMap . clear ( ) ; request . reset ( ) ; handler . setBufferSize ( MAX_BUFFER_SIZE ) ; server . proxyTimeoutQueue . offer ( this ) ; // " proxy " may close or return " client " before reset
if ( logLevel >= LOG_VERBOSE && client != null ) { Log . v ( ( closed ? "Client Closed" : "Client Kept Alive" ) + " and Request Unblocked due to Complete Request and Response, " + client . toString ( false ) ) ; } if ( ! closed && client != null ) { server . returnClient ( client ) ; } client = null ; read ( ) ; |
public class AcceptMimeTypeList { /** * Return the associated quality of the given MIME type using the fallback
* mechanism .
* @ param aMimeType
* The MIME type to query . May be < code > null < / code > .
* @ return 0 means not accepted , 1 means fully accepted . If the passed MIME
* type is < code > null < / code > , the " not accepted " quality is returned . */
public double getQualityOfMimeType ( @ Nullable final IMimeType aMimeType ) { } } | if ( aMimeType == null ) return QValue . MIN_QUALITY ; return getQValueOfMimeType ( aMimeType ) . getQuality ( ) ; |
public class MultiNote { /** * Returns the note with the biggest duration from the given array of notes .
* @ param notes An array of notes .
* @ return The note with the biggest duration from the given array of notes .
* @ see Note # getDuration ( ) */
public static Note getLongestNote ( Note [ ] notes ) { } } | float length = 0 ; float currentNoteLength = 0 ; Note maxNote = null ; for ( int i = 0 ; i < notes . length && maxNote == null ; i ++ ) { currentNoteLength = notes [ i ] . getDuration ( ) ; if ( currentNoteLength > length ) maxNote = notes [ i ] ; } return maxNote ; |
public class IcalSchema { public void applyParamsSchema ( String rule , Map < String , String > params , IcalObject out ) throws ParseException { } } | for ( Map . Entry < String , String > param : params . entrySet ( ) ) { String name = param . getKey ( ) ; applyParamSchema ( rule , name , param . getValue ( ) , out ) ; } |
public class CdiUtils { /** * Retrieves the bean for the given class from the bean manager available
* via JNDI qualified with the given annotation ( s ) .
* @ param < T > The type of the bean to look for
* @ param clazz The class of the bean to look for
* @ param annotationClasses The qualifiers the bean for the given class must have
* @ return The bean instance if found , otherwise null */
public static < T > T getBean ( Class < T > clazz , Annotation ... annotations ) { } } | return getBean ( getBeanManager ( ) , clazz , annotations ) ; |
public class EnvelopeSchemaConverter { /** * Get payload field from GenericRecord and convert to byte array */
public byte [ ] getPayload ( GenericRecord inputRecord , String payloadFieldName ) { } } | ByteBuffer bb = ( ByteBuffer ) inputRecord . get ( payloadFieldName ) ; byte [ ] payloadBytes ; if ( bb . hasArray ( ) ) { payloadBytes = bb . array ( ) ; } else { payloadBytes = new byte [ bb . remaining ( ) ] ; bb . get ( payloadBytes ) ; } String hexString = new String ( payloadBytes , StandardCharsets . UTF_8 ) ; return DatatypeConverter . parseHexBinary ( hexString ) ; |
public class DefaultDatastoreReader { /** * Loads and returns the entities with the given < b > names ( a . k . a String IDs ) < / b > . The entities are
* assumed to be root entities ( no parent ) . The entity kind is determined from the supplied class .
* @ param entityClass
* the entity class
* @ param identifiers
* the IDs of the entities
* @ return the list of entity objects in the same order as the given list of identifiers . If one
* or more requested IDs do not exist in the Cloud Datastore , the corresponding item in
* the returned list be < code > null < / code > .
* @ throws EntityManagerException
* if any error occurs while inserting . */
public < E > List < E > loadByName ( Class < E > entityClass , List < String > identifiers ) { } } | Key [ ] nativeKeys = stringListToNativeKeys ( entityClass , identifiers ) ; return fetch ( entityClass , nativeKeys ) ; |
public class RequestHelper { /** * Utility method that determines whether the request contains
* < code > multipart / form - data < / code > content .
* @ param sContentType
* The content type to be checked . May be < code > null < / code > .
* @ return < code > true < / code > if the passed , lowercased content type starts
* with < code > multipart / form - data < / code > ; < code > false < / code >
* otherwise . */
public static boolean isMultipartFormDataContent ( @ Nullable final String sContentType ) { } } | return sContentType != null && sContentType . toLowerCase ( Locale . US ) . startsWith ( MULTIPART_FORM_DATA ) ; |
public class ZonedDateTime { /** * Returns a copy of this date - time changing the zone offset to the
* later of the two valid offsets at a local time - line overlap .
* This method only has any effect when the local time - line overlaps , such as
* at an autumn daylight savings cutover . In this scenario , there are two
* valid offsets for the local date - time . Calling this method will return
* a zoned date - time with the later of the two selected .
* If this method is called when it is not an overlap , { @ code this }
* is returned .
* This instance is immutable and unaffected by this method call .
* @ return a { @ code ZonedDateTime } based on this date - time with the later offset , not null */
@ Override public ZonedDateTime withLaterOffsetAtOverlap ( ) { } } | ZoneOffsetTransition trans = getZone ( ) . getRules ( ) . getTransition ( toLocalDateTime ( ) ) ; if ( trans != null ) { ZoneOffset laterOffset = trans . getOffsetAfter ( ) ; if ( laterOffset . equals ( offset ) == false ) { return new ZonedDateTime ( dateTime , laterOffset , zone ) ; } } return this ; |
public class DerbyFileSystem { /** * { @ inheritDoc } */
@ Override public void close ( ) throws FileSystemException { } } | super . close ( ) ; if ( shutdownOnClose ) { try { ( ( DerbyConnectionHelper ) conHelper ) . shutDown ( driver ) ; } catch ( SQLException e ) { throw new FileSystemException ( "failed to shutdown Derby" , e ) ; } } |
public class Analyser { /** * Basic sanity - checking to ensure we can fulfil the & # 64 ; FreeBuilder contract for this type . */
private void verifyType ( TypeElement type , PackageElement pkg ) throws CannotGenerateCodeException { } } | if ( pkg . isUnnamed ( ) ) { messager . printMessage ( ERROR , "FreeBuilder does not support types in unnamed packages" , type ) ; throw new CannotGenerateCodeException ( ) ; } switch ( type . getNestingKind ( ) ) { case TOP_LEVEL : break ; case MEMBER : if ( ! type . getModifiers ( ) . contains ( Modifier . STATIC ) ) { messager . printMessage ( ERROR , "Inner classes cannot be FreeBuilder types (did you forget the static keyword?)" , type ) ; throw new CannotGenerateCodeException ( ) ; } if ( type . getModifiers ( ) . contains ( Modifier . PRIVATE ) ) { messager . printMessage ( ERROR , "FreeBuilder types cannot be private" , type ) ; throw new CannotGenerateCodeException ( ) ; } for ( Element e = type . getEnclosingElement ( ) ; e != null ; e = e . getEnclosingElement ( ) ) { if ( e . getModifiers ( ) . contains ( Modifier . PRIVATE ) ) { messager . printMessage ( ERROR , "FreeBuilder types cannot be private, but enclosing type " + e . getSimpleName ( ) + " is inaccessible" , type ) ; throw new CannotGenerateCodeException ( ) ; } } break ; default : messager . printMessage ( ERROR , "Only top-level or static nested types can be FreeBuilder types" , type ) ; throw new CannotGenerateCodeException ( ) ; } switch ( type . getKind ( ) ) { case ANNOTATION_TYPE : messager . printMessage ( ERROR , "FreeBuilder does not support annotation types" , type ) ; throw new CannotGenerateCodeException ( ) ; case CLASS : verifyTypeIsConstructible ( type ) ; break ; case ENUM : messager . printMessage ( ERROR , "FreeBuilder does not support enum types" , type ) ; throw new CannotGenerateCodeException ( ) ; case INTERFACE : // Nothing extra needs to be checked on an interface
break ; default : throw new AssertionError ( "Unexpected element kind " + type . getKind ( ) ) ; } |
public class LoggerWrapper { /** * Returns or creates a logger that forwards messages to a { @ link ProgressManager } . If the
* logger does not yet have any progress manager assigned , the given one will be used .
* @ param name The logger ' s unique name . By default the calling class ' name is used .
* @ param pm The logger ' s progress manager . This value is only used if a logger object has to
* be created or a logger with a given name does not yet have any progress manager
* assigned or if the default progress manager is used .
* @ return A logger that forwards messages to a { @ link ProgressManager } . */
public static LoggerWrapper getLogger ( String name , ProgressManager pm ) { } } | LoggerWrapper ret = getLogger ( name ) ; if ( ret . getProgressManager ( ) == null || ret . getProgressManager ( ) == LoggerWrapper . defaultProgressManager ) { ret . setProgressManager ( pm ) ; } return ret ; |
public class Console { /** * Displays list of availables repositories .
* @ param names names of repositories . */
public void showRepositories ( Collection < RepositoryName > names ) { } } | repositoriesList . show ( names ) ; display ( repositoriesList ) ; this . hideRepository ( ) ; |
public class RepeatOnErrorUntilTrue { /** * Sleep amount of time in between iterations . */
private void doAutoSleep ( ) { } } | if ( autoSleep > 0 ) { log . info ( "Sleeping " + autoSleep + " milliseconds" ) ; try { Thread . sleep ( autoSleep ) ; } catch ( InterruptedException e ) { log . error ( "Error during doc generation" , e ) ; } log . info ( "Returning after " + autoSleep + " milliseconds" ) ; } |
public class FnDateTime { /** * It converts a { @ link Calendar } into a { @ link DateTime } in the given { @ link DateTimeZone }
* @ param dateTimeZone the the time zone ( { @ link DateTimeZone } ) to be used
* @ return the { @ link DateTime } created from the input and arguments */
public static final < T extends Calendar > Function < T , DateTime > calendarToDateTime ( DateTimeZone dateTimeZone ) { } } | return new CalendarToDateTime < T > ( dateTimeZone ) ; |
public class ConcurrentLinkedHashMap { /** * Gets the entry ' s total number .
* @ return entry ' s number */
@ Override public int size ( ) { } } | try { lockAllSegments ( ) ; int size = 0 ; for ( LinkedHashMapSegment < K , V > seg : segments ) { size += seg . size ( ) ; } return size ; } finally { unlockAllSegments ( ) ; } |
public class AnnisBaseUI { /** * Handle common errors like database / service connection problems and display a unified
* error message .
* This will not log the exception , only display information to the user .
* @ param ex
* @ return True if error was handled , false otherwise . */
public static boolean handleCommonError ( Throwable ex , String action ) { } } | if ( ex != null ) { Throwable rootCause = ex ; while ( rootCause . getCause ( ) != null ) { rootCause = rootCause . getCause ( ) ; } if ( rootCause instanceof UniformInterfaceException ) { UniformInterfaceException uniEx = ( UniformInterfaceException ) rootCause ; if ( uniEx . getResponse ( ) != null ) { if ( uniEx . getResponse ( ) . getStatus ( ) == 503 ) { // database connection error
Notification n = new Notification ( "Can't execute " + ( action == null ? "" : "\"" + action + "\"" ) + " action because database server is not responding.<br/>" + "There might be too many users using this service right now." , Notification . Type . WARNING_MESSAGE ) ; n . setDescription ( "<p><strong>Please try again later.</strong> If the error persists inform the administrator of this server.</p>" + "<p>Click on this message to close it.</p>" + "<p style=\"font-size:9pt;color:gray;\">Pinguin picture by Polar Cruises [CC BY 2.0 (http://creativecommons.org/licenses/by/2.0)], via Wikimedia Commons</p>" ) ; n . setIcon ( PINGUIN_IMAGE ) ; n . setHtmlContentAllowed ( true ) ; n . setDelayMsec ( 15000 ) ; n . show ( Page . getCurrent ( ) ) ; return true ; } } } } return false ; |
public class AmazonRDSClient { /** * Describes all available options .
* @ param describeOptionGroupOptionsRequest
* @ return Result of the DescribeOptionGroupOptions operation returned by the service .
* @ sample AmazonRDS . DescribeOptionGroupOptions
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / rds - 2014-10-31 / DescribeOptionGroupOptions " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public DescribeOptionGroupOptionsResult describeOptionGroupOptions ( DescribeOptionGroupOptionsRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeDescribeOptionGroupOptions ( request ) ; |
public class FastFullList { /** * Postcondition : this . list . get ( this . list . size ( ) - 1 ) ! = blankElement */
private void removeTrail ( ) { } } | int last = this . size - 1 ; while ( last >= 0 && this . arr [ last ] == this . blankElement ) { last -- ; } this . size = last + 1 ; |
public class Variables { /** * Type - safe wrapper around setVariable which sets only one framed vertex . */
public void setSingletonVariable ( String name , WindupVertexFrame frame ) { } } | setVariable ( name , Collections . singletonList ( frame ) ) ; |
public class JsonConvert { /** * - - - - - convertTo - - - - - */
@ Override public String convertTo ( final Object value ) { } } | if ( value == null ) return "null" ; return convertTo ( value . getClass ( ) , value ) ; |
public class TinValidator { /** * check the Tax Identification Number number , country version for Estonia .
* @ param ptin vat id to check
* @ return true if checksum is ok */
private boolean checkEeTin ( final String ptin ) { } } | final int checkSum = ptin . charAt ( 10 ) - '0' ; int calculatedCheckSum = ( ( ptin . charAt ( 0 ) - '0' ) * 1 + ( ptin . charAt ( 1 ) - '0' ) * 2 + ( ptin . charAt ( 2 ) - '0' ) * 3 + ( ptin . charAt ( 3 ) - '0' ) * 4 + ( ptin . charAt ( 4 ) - '0' ) * 5 + ( ptin . charAt ( 5 ) - '0' ) * 6 + ( ptin . charAt ( 6 ) - '0' ) * 7 + ( ptin . charAt ( 7 ) - '0' ) * 8 + ( ptin . charAt ( 8 ) - '0' ) * 9 + ( ptin . charAt ( 9 ) - '0' ) * 1 ) % MODULO_11 ; if ( calculatedCheckSum == 10 ) { calculatedCheckSum = ( ( ptin . charAt ( 0 ) - '0' ) * 3 + ( ptin . charAt ( 1 ) - '0' ) * 4 + ( ptin . charAt ( 2 ) - '0' ) * 5 + ( ptin . charAt ( 3 ) - '0' ) * 6 + ( ptin . charAt ( 4 ) - '0' ) * 7 + ( ptin . charAt ( 5 ) - '0' ) * 8 + ( ptin . charAt ( 6 ) - '0' ) * 9 + ( ptin . charAt ( 7 ) - '0' ) * 1 + ( ptin . charAt ( 8 ) - '0' ) * 2 + ( ptin . charAt ( 9 ) - '0' ) * 3 ) % MODULO_11 % 10 ; } return checkSum == calculatedCheckSum ; |
public class Convolution { /** * ND Convolution
* @ param input the input to op
* @ param kernel the kerrnel to op with
* @ param type the opType of convolution
* @ param axes the axes to do the convolution along
* @ return the convolution of the given input and kernel */
public static INDArray convn ( INDArray input , INDArray kernel , Type type , int [ ] axes ) { } } | return Nd4j . getConvolution ( ) . convn ( input , kernel , type , axes ) ; |
public class HttpUtils { /** * Execute http response .
* @ param url the url
* @ param method the method
* @ param basicAuthUsername the basic auth username
* @ param basicAuthPassword the basic auth password
* @ param headers the headers
* @ return the http response */
public static HttpResponse execute ( final String url , final String method , final String basicAuthUsername , final String basicAuthPassword , final Map < String , Object > headers ) { } } | return execute ( url , method , basicAuthUsername , basicAuthPassword , new HashMap < > ( ) , headers ) ; |
public class WordVectorTrainer { /** * This is cheap and moderate in quality .
* @ param max - Upper range limit .
* @ return int between 0 - ( max - 1 ) . */
private int cheapRandInt ( int max ) { } } | _seed ^= ( _seed << 21 ) ; _seed ^= ( _seed >>> 35 ) ; _seed ^= ( _seed << 4 ) ; int r = ( int ) _seed % max ; return r > 0 ? r : - r ; |
public class PhotosApi { /** * Get permissions for a photo .
* < br >
* This method requires authentication with ' read ' permission .
* @ param photoId Required . The id of the photo to fetch permissions for .
* @ return object with permissions for the photo .
* @ throws JinxException if the photo id is null or empty , or if there are any errors .
* @ see < a href = " https : / / www . flickr . com / services / api / flickr . photos . getPerms . html " > flickr . photos . getPerms < / a > */
public PhotoPerms getPerms ( String photoId ) throws JinxException { } } | JinxUtils . validateParams ( photoId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.photos.getPerms" ) ; params . put ( "photo_id" , photoId ) ; return jinx . flickrGet ( params , PhotoPerms . class ) ; |
public class ModelUtils { /** * Returns an { @ link AnnotationMirror } for the annotation of type { @ code annotationClassName } on
* { @ code element } , or { @ link Optional # empty ( ) } if no such annotation exists . */
public static Optional < AnnotationMirror > findAnnotationMirror ( Element element , String annotationClassName ) { } } | for ( AnnotationMirror annotationMirror : element . getAnnotationMirrors ( ) ) { TypeElement annotationTypeElement = ( TypeElement ) ( annotationMirror . getAnnotationType ( ) . asElement ( ) ) ; if ( annotationTypeElement . getQualifiedName ( ) . contentEquals ( annotationClassName ) ) { return Optional . of ( annotationMirror ) ; } } return Optional . empty ( ) ; |
public class PropertiesReader { /** * Reads a float property .
* @ param property The property name .
* @ return The property value .
* @ throws ConfigurationException if the property is not present */
public float getFloat ( String property ) { } } | return getProperty ( property , value -> { try { return Float . valueOf ( value ) ; } catch ( NumberFormatException e ) { throw new ConfigurationException ( "malformed property value: " + property + " must be a float" ) ; } } ) ; |
public class AbstractTemplateView { /** * Returns the width ratio .
* @ return the width ratio */
protected NumberBinding bindWidth ( ) { } } | return Bindings . divide ( model ( ) . localFacade ( ) . globalFacade ( ) . application ( ) . stage ( ) . widthProperty ( ) , 1024 ) ; |
public class ResourcePath { /** * Returns the complete resource path string .
* @ return resource path string */
public String getResourcePath ( ) { } } | final StringBuilder sb = new StringBuilder ( ) ; for ( final String r : resource ) sb . append ( r + '/' ) ; return sb . substring ( 0 , Math . max ( 0 , sb . length ( ) - 1 ) ) ; |
public class JNvgraph { /** * Update the vertex set # setnum with the data in * vertexData , sets have 0 - based index
* Conversions are not sopported so nvgraphTopologyType _ t should match the graph structure */
public static int nvgraphSetVertexData ( nvgraphHandle handle , nvgraphGraphDescr descrG , Pointer vertexData , long setnum ) { } } | return checkResult ( nvgraphSetVertexDataNative ( handle , descrG , vertexData , setnum ) ) ; |
public class StructrPath { /** * - - - - - protected methods - - - - - */
protected String normalizeFileNameForJavaIdentifier ( final String src ) { } } | String dst = src ; dst = dst . replace ( '/' , '_' ) ; dst = dst . replace ( '.' , '_' ) ; dst = dst . replace ( '-' , '_' ) ; dst = dst . replace ( '+' , '_' ) ; dst = dst . replace ( '~' , '_' ) ; dst = dst . replace ( '#' , '_' ) ; dst = dst . replace ( '\'' , '_' ) ; dst = dst . replace ( '\"' , '_' ) ; dst = dst . replace ( '`' , '_' ) ; dst = dst . replace ( '(' , '_' ) ; dst = dst . replace ( ')' , '_' ) ; dst = dst . replace ( '[' , '_' ) ; dst = dst . replace ( ']' , '_' ) ; dst = dst . replace ( '{' , '_' ) ; dst = dst . replace ( '}' , '_' ) ; dst = dst . replace ( '!' , '_' ) ; dst = dst . replace ( '$' , '_' ) ; dst = dst . replace ( '§' , '_' ) ; dst = dst . replace ( '%' , '_' ) ; dst = dst . replace ( '&' , '_' ) ; dst = dst . replace ( '=' , '_' ) ; dst = dst . replace ( ':' , '_' ) ; dst = dst . replace ( '<' , '_' ) ; dst = dst . replace ( '>' , '_' ) ; dst = dst . replace ( '|' , '_' ) ; dst = dst . replace ( '^' , '_' ) ; dst = dst . replace ( '°' , '_' ) ; return dst ; |
public class VimGenerator2 { /** * Replies the script for detecting the SARL files .
* @ return the content of the " ftdetect " script . */
protected CharSequence getFileTypeDetectionScript ( ) { } } | return concat ( "\" Vim filetype-detection file" , // $ NON - NLS - 1 $
"\" Language: " + getLanguageSimpleName ( ) , // $ NON - NLS - 1 $
"\" Version: " + getLanguageVersion ( ) , // $ NON - NLS - 1 $
"" , // $ NON - NLS - 1 $
"au BufRead,BufNewFile *." + getLanguage ( ) . getFileExtensions ( ) . get ( 0 ) // $ NON - NLS - 1 $
+ " set filetype=" + getLanguageSimpleName ( ) . toLowerCase ( ) ) ; // $ NON - NLS - 1 $ |
public class Call { /** * Executes a method on the target object which returns Object . Parameters must match
* those of the method .
* @ param methodName the name of the method
* @ param optionalParameters the ( optional ) parameters of the method .
* @ return the result of the method execution */
public static Function < Object , Object > methodForObject ( final String methodName , final Object ... optionalParameters ) { } } | return new Call < Object , Object > ( Types . OBJECT , methodName , VarArgsUtil . asOptionalObjectArray ( Object . class , optionalParameters ) ) ; |
public class CPTaxCategoryPersistenceImpl { /** * Returns the last cp tax category in the ordered set where groupId = & # 63 ; .
* @ param groupId the group ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the last matching cp tax category
* @ throws NoSuchCPTaxCategoryException if a matching cp tax category could not be found */
@ Override public CPTaxCategory findByGroupId_Last ( long groupId , OrderByComparator < CPTaxCategory > orderByComparator ) throws NoSuchCPTaxCategoryException { } } | CPTaxCategory cpTaxCategory = fetchByGroupId_Last ( groupId , orderByComparator ) ; if ( cpTaxCategory != null ) { return cpTaxCategory ; } StringBundler msg = new StringBundler ( 4 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "groupId=" ) ; msg . append ( groupId ) ; msg . append ( "}" ) ; throw new NoSuchCPTaxCategoryException ( msg . toString ( ) ) ; |
public class Atom10Parser { /** * Parse entry from reader . */
public static Entry parseEntry ( final Reader rd , final String baseURI , final Locale locale ) throws JDOMException , IOException , IllegalArgumentException , FeedException { } } | // Parse entry into JDOM tree
final SAXBuilder builder = new SAXBuilder ( ) ; final Document entryDoc = builder . build ( rd ) ; final Element fetchedEntryElement = entryDoc . getRootElement ( ) ; fetchedEntryElement . detach ( ) ; // Put entry into a JDOM document with ' feed ' root so that Rome can
// handle it
final Feed feed = new Feed ( ) ; feed . setFeedType ( "atom_1.0" ) ; final WireFeedOutput wireFeedOutput = new WireFeedOutput ( ) ; final Document feedDoc = wireFeedOutput . outputJDom ( feed ) ; feedDoc . getRootElement ( ) . addContent ( fetchedEntryElement ) ; if ( baseURI != null ) { feedDoc . getRootElement ( ) . setAttribute ( "base" , baseURI , Namespace . XML_NAMESPACE ) ; } final WireFeedInput input = new WireFeedInput ( false , locale ) ; final Feed parsedFeed = ( Feed ) input . build ( feedDoc ) ; return parsedFeed . getEntries ( ) . get ( 0 ) ; |
public class MediaIntents { /** * Creates an intent that will launch the camera to take a picture that ' s saved to a temporary file so you can use
* it directly without going through the gallery .
* @ param tempFile the file that should be used to temporarily store the picture
* @ return the intent */
public static Intent newTakePictureIntent ( File tempFile ) { } } | Intent intent = new Intent ( MediaStore . ACTION_IMAGE_CAPTURE ) ; intent . putExtra ( MediaStore . EXTRA_OUTPUT , Uri . fromFile ( tempFile ) ) ; return intent ; |
public class Gauge { /** * Defines if the minor tickmarks should be drawn
* @ param VISIBLE */
public void setMinorTickMarksVisible ( final boolean VISIBLE ) { } } | if ( null == minorTickMarksVisible ) { _minorTickMarksVisible = VISIBLE ; fireUpdateEvent ( REDRAW_EVENT ) ; } else { minorTickMarksVisible . set ( VISIBLE ) ; } |
public class BELScriptParser { /** * BELScript . g : 63:1 : set _ statement _ group : ' SET ' STATEMENT _ GROUP _ KEYWORD ' = ' ( quoted _ value | OBJECT _ IDENT ) ; */
public final BELScriptParser . set_statement_group_return set_statement_group ( ) throws RecognitionException { } } | BELScriptParser . set_statement_group_return retval = new BELScriptParser . set_statement_group_return ( ) ; retval . start = input . LT ( 1 ) ; Object root_0 = null ; Token string_literal19 = null ; Token STATEMENT_GROUP_KEYWORD20 = null ; Token char_literal21 = null ; Token OBJECT_IDENT23 = null ; BELScriptParser . quoted_value_return quoted_value22 = null ; Object string_literal19_tree = null ; Object STATEMENT_GROUP_KEYWORD20_tree = null ; Object char_literal21_tree = null ; Object OBJECT_IDENT23_tree = null ; paraphrases . push ( "in set statement group." ) ; try { // BELScript . g : 66:5 : ( ' SET ' STATEMENT _ GROUP _ KEYWORD ' = ' ( quoted _ value | OBJECT _ IDENT ) )
// BELScript . g : 67:5 : ' SET ' STATEMENT _ GROUP _ KEYWORD ' = ' ( quoted _ value | OBJECT _ IDENT )
{ root_0 = ( Object ) adaptor . nil ( ) ; string_literal19 = ( Token ) match ( input , 24 , FOLLOW_24_in_set_statement_group226 ) ; string_literal19_tree = ( Object ) adaptor . create ( string_literal19 ) ; adaptor . addChild ( root_0 , string_literal19_tree ) ; STATEMENT_GROUP_KEYWORD20 = ( Token ) match ( input , STATEMENT_GROUP_KEYWORD , FOLLOW_STATEMENT_GROUP_KEYWORD_in_set_statement_group228 ) ; STATEMENT_GROUP_KEYWORD20_tree = ( Object ) adaptor . create ( STATEMENT_GROUP_KEYWORD20 ) ; adaptor . addChild ( root_0 , STATEMENT_GROUP_KEYWORD20_tree ) ; char_literal21 = ( Token ) match ( input , 25 , FOLLOW_25_in_set_statement_group230 ) ; char_literal21_tree = ( Object ) adaptor . create ( char_literal21 ) ; adaptor . addChild ( root_0 , char_literal21_tree ) ; // BELScript . g : 67:39 : ( quoted _ value | OBJECT _ IDENT )
int alt4 = 2 ; int LA4_0 = input . LA ( 1 ) ; if ( ( LA4_0 == QUOTED_VALUE ) ) { alt4 = 1 ; } else if ( ( LA4_0 == OBJECT_IDENT ) ) { alt4 = 2 ; } else { NoViableAltException nvae = new NoViableAltException ( "" , 4 , 0 , input ) ; throw nvae ; } switch ( alt4 ) { case 1 : // BELScript . g : 67:40 : quoted _ value
{ pushFollow ( FOLLOW_quoted_value_in_set_statement_group233 ) ; quoted_value22 = quoted_value ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , quoted_value22 . getTree ( ) ) ; } break ; case 2 : // BELScript . g : 67:55 : OBJECT _ IDENT
{ OBJECT_IDENT23 = ( Token ) match ( input , OBJECT_IDENT , FOLLOW_OBJECT_IDENT_in_set_statement_group237 ) ; OBJECT_IDENT23_tree = ( Object ) adaptor . create ( OBJECT_IDENT23 ) ; adaptor . addChild ( root_0 , OBJECT_IDENT23_tree ) ; } break ; } } retval . stop = input . LT ( - 1 ) ; retval . tree = ( Object ) adaptor . rulePostProcessing ( root_0 ) ; adaptor . setTokenBoundaries ( retval . tree , retval . start , retval . stop ) ; paraphrases . pop ( ) ; } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; retval . tree = ( Object ) adaptor . errorNode ( input , retval . start , input . LT ( - 1 ) , re ) ; } finally { } return retval ; |
public class SOCPLogarithmicBarrier { /** * Create the barrier function for the Phase I .
* It is an instance of this class for the constraints :
* < br > | | Ai . x + bi | | < ci . x + di + t , i = 1 , . . . , m
* @ see " S . Boyd and L . Vandenberghe , Convex Optimization , 11.6.2" */
@ Override public BarrierFunction createPhase1BarrierFunction ( ) { } } | final int dimPh1 = dim + 1 ; List < SOCPConstraintParameters > socpConstraintParametersPh1List = new ArrayList < SOCPConstraintParameters > ( ) ; SOCPLogarithmicBarrier bfPh1 = new SOCPLogarithmicBarrier ( socpConstraintParametersPh1List , dimPh1 ) ; for ( int i = 0 ; i < socpConstraintParametersList . size ( ) ; i ++ ) { SOCPConstraintParameters param = socpConstraintParametersList . get ( i ) ; RealMatrix A = param . getA ( ) ; RealVector b = param . getB ( ) ; RealVector c = param . getC ( ) ; double d = param . getD ( ) ; RealMatrix APh1 = MatrixUtils . createRealMatrix ( A . getRowDimension ( ) , dimPh1 ) ; APh1 . setSubMatrix ( A . getData ( ) , 0 , 0 ) ; RealVector bPh1 = b ; RealVector cPh1 = new ArrayRealVector ( c . getDimension ( ) + 1 ) ; cPh1 . setSubVector ( 0 , c ) ; cPh1 . setEntry ( c . getDimension ( ) , 1 ) ; double dPh1 = d ; SOCPConstraintParameters paramsPh1 = new SOCPConstraintParameters ( APh1 . getData ( ) , bPh1 . toArray ( ) , cPh1 . toArray ( ) , dPh1 ) ; socpConstraintParametersPh1List . add ( socpConstraintParametersPh1List . size ( ) , paramsPh1 ) ; } return bfPh1 ; |
public class Utils { /** * Formats a messages containing { 0 } , { 1 } . . . etc . Used for translation .
* @ param msg a message with placeholders
* @ param params objects used to populate the placeholders
* @ return a formatted message */
public static String formatMessage ( String msg , Object ... params ) { } } | try { // required by MessageFormat , single quotes break string interpolation !
msg = StringUtils . replace ( msg , "'" , "''" ) ; return StringUtils . isBlank ( msg ) ? "" : MessageFormat . format ( msg , params ) ; } catch ( IllegalArgumentException e ) { return msg ; } |
public class DBEngineVersion { /** * A list of features supported by the DB engine . Supported feature names include the following .
* < ul >
* < li >
* s3Import
* < / li >
* < / ul >
* @ return A list of features supported by the DB engine . Supported feature names include the following . < / p >
* < ul >
* < li >
* s3Import
* < / li > */
public java . util . List < String > getSupportedFeatureNames ( ) { } } | if ( supportedFeatureNames == null ) { supportedFeatureNames = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return supportedFeatureNames ; |
public class StoreStats { /** * Method to service public recording APIs
* @ param op Operation being tracked
* @ param timeNS Duration of operation
* @ param numEmptyResponses Number of empty responses being sent back ,
* i . e . : requested keys for which there were no values ( GET and GET _ ALL only )
* @ param valueSize Size in bytes of the value
* @ param keySize Size in bytes of the key
* @ param getAllAggregateRequests Total of amount of keys requested in the operation ( GET _ ALL only ) */
private void recordTime ( Tracked op , long timeNS , long numEmptyResponses , long valueSize , long keySize , long getAllAggregateRequests ) { } } | counters . get ( op ) . addRequest ( timeNS , numEmptyResponses , valueSize , keySize , getAllAggregateRequests ) ; if ( logger . isTraceEnabled ( ) && ! storeName . contains ( "aggregate" ) && ! storeName . contains ( "voldsys$" ) ) logger . trace ( "Store '" + storeName + "' logged a " + op . toString ( ) + " request taking " + ( ( double ) timeNS / voldemort . utils . Time . NS_PER_MS ) + " ms" ) ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcDistributionControlElement ( ) { } } | if ( ifcDistributionControlElementEClass == null ) { ifcDistributionControlElementEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 181 ) ; } return ifcDistributionControlElementEClass ; |
public class CSSMediaRuleImpl { /** * { @ inheritDoc } */
@ Override public String getCssText ( ) { } } | final StringBuilder sb = new StringBuilder ( "@media " ) ; sb . append ( getMediaList ( ) . getMediaText ( ) ) ; sb . append ( " {" ) ; for ( int i = 0 ; i < getCssRules ( ) . getLength ( ) ; i ++ ) { final AbstractCSSRuleImpl rule = getCssRules ( ) . getRules ( ) . get ( i ) ; sb . append ( rule . getCssText ( ) ) . append ( " " ) ; } sb . append ( "}" ) ; return sb . toString ( ) ; |
public class cachepolicy_stats { /** * Use this API to fetch the statistics of all cachepolicy _ stats resources that are configured on netscaler . */
public static cachepolicy_stats [ ] get ( nitro_service service ) throws Exception { } } | cachepolicy_stats obj = new cachepolicy_stats ( ) ; cachepolicy_stats [ ] response = ( cachepolicy_stats [ ] ) obj . stat_resources ( service ) ; return response ; |
public class PeopleApi { /** * Returns information for the calling user related to photo uploads .
* < br >
* This method requires authentication with ' read ' permission .
* @ return upload status information for the calling user .
* @ throws JinxException if there are any errors .
* @ see < a href = " https : / / www . flickr . com / services / api / flickr . people . getUploadStatus . html " > flickr . people . getUploadStatus < / a > */
public UploadStatus getUploadStatus ( ) throws JinxException { } } | Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.people.getUploadStatus" ) ; return jinx . flickrGet ( params , UploadStatus . class ) ; |
public class AcadColor { /** * Initialize an Autocad color table
* @ return AcadColor [ ] Object of this class that represents Acad color to Java color
* conversion */
public static AcadColor [ ] initTable ( ) { } } | colors = new AcadColor [ 256 ] ; new AcadColor ( 0 , 0 , 0 , 0 , 0 , 0 , 0 ) ; new AcadColor ( 1 , 1 , 0 , 0 , 255 , 0 , 0 ) ; new AcadColor ( 2 , 1 , 1 , 0 , 255 , 255 , 0 ) ; new AcadColor ( 3 , 0 , 1 , 0 , 0 , 255 , 0 ) ; new AcadColor ( 4 , 0 , 1 , 1 , 0 , 255 , 255 ) ; new AcadColor ( 5 , 0 , 0 , 1 , 0 , 0 , 255 ) ; new AcadColor ( 6 , 1 , 0 , 1 , 255 , 0 , 255 ) ; new AcadColor ( 7 , 0 , 0 , 0 , 0 , 0 , 0 ) ; new AcadColor ( 8 , 0 , 0 , 0 , 0 , 0 , 0 ) ; new AcadColor ( 9 , 0 , 0 , 0 , 0 , 0 , 0 ) ; new AcadColor ( 10 , 1 , 0 , 0 , 255 , 0 , 0 ) ; new AcadColor ( 11 , 1.0 , 0.5 , 0.5 , 255.0 , 127.5 , 127.5 ) ; new AcadColor ( 12 , 0.65 , 0 , 0 , 165.75 , 0 , 0 ) ; new AcadColor ( 13 , 0.65 , 0.325 , 0.325 , 165.75 , 82.875 , 82.875 ) ; new AcadColor ( 14 , 0.5 , 0 , 0 , 127.5 , 0 , 0 ) ; new AcadColor ( 15 , 0.5 , 0.25 , 0.25 , 127.5 , 63.75 , 63.75 ) ; new AcadColor ( 16 , 0.3 , 0 , 0 , 76.5 , 0 , 0 ) ; new AcadColor ( 17 , 0.3 , 0.15 , 0.15 , 76.5 , 38.25 , 38.25 ) ; new AcadColor ( 18 , 0.15 , 0 , 0 , 38.25 , 0 , 0 ) ; new AcadColor ( 19 , 0.15 , 0.075 , 0.075 , 38.25 , 19.125 , 19.125 ) ; new AcadColor ( 20 , 1 , 0.25 , 0 , 255 , 63.75 , 0 ) ; new AcadColor ( 21 , 1 , 0.625 , 0.5 , 255 , 159.375 , 127.5 ) ; new AcadColor ( 22 , 0.65 , 0.1625 , 0 , 165.75 , 41.4375 , 0 ) ; new AcadColor ( 23 , 0.65 , 0.4063 , 0.325 , 165.75 , 103.6065 , 82.875 ) ; new AcadColor ( 24 , 0.5 , 0.125 , 0 , 127.5 , 31.875 , 0 ) ; new AcadColor ( 25 , 0.5 , 0.3125 , 0.25 , 127.5 , 79.6875 , 63.75 ) ; new AcadColor ( 26 , 0.3 , 0.075 , 0 , 76.5 , 19.125 , 0 ) ; new AcadColor ( 27 , 0.3 , 0.1875 , 0.15 , 76.5 , 47.8125 , 38.25 ) ; new AcadColor ( 28 , 0.15 , 0.0375 , 0 , 38.25 , 9.5625 , 0 ) ; new AcadColor ( 29 , 0.15 , 0.0938 , 0.075 , 38.25 , 23.919 , 19.125 ) ; new AcadColor ( 30 , 1 , 0.5 , 0 , 255 , 127.5 , 0 ) ; new AcadColor ( 31 , 1 , 0.75 , 0.5 , 255 , 191.25 , 127.5 ) ; new AcadColor ( 32 , 0.65 , 0.325 , 0 , 165.75 , 82.875 , 0 ) ; new AcadColor ( 33 , 0.65 , 0.4875 , 0.325 , 165.75 , 124.3125 , 82.875 ) ; new AcadColor ( 34 , 0.5 , 0.25 , 0 , 127.5 , 63.75 , 0 ) ; new AcadColor ( 35 , 0.5 , 0.375 , 0.25 , 127.5 , 95.625 , 63.75 ) ; new AcadColor ( 36 , 0.3 , 0.15 , 0 , 76.5 , 38.25 , 0 ) ; new AcadColor ( 37 , 0.3 , 0.225 , 0.15 , 76.5 , 57.375 , 38.25 ) ; new AcadColor ( 38 , 0.15 , 0.075 , 0 , 38.25 , 19.125 , 0 ) ; new AcadColor ( 39 , 0.15 , 0.1125 , 0.075 , 38.25 , 28.6875 , 19.125 ) ; new AcadColor ( 40 , 1 , 0.75 , 0 , 255 , 191.25 , 0 ) ; new AcadColor ( 41 , 1 , 0.875 , 0.5 , 255 , 223.125 , 127.5 ) ; new AcadColor ( 42 , 0.65 , 0.4875 , 0 , 165.75 , 124.3125 , 0 ) ; new AcadColor ( 43 , 0.65 , 0.5688 , 0.325 , 165.75 , 145.044 , 82.875 ) ; new AcadColor ( 44 , 0.5 , 0.375 , 0 , 127.5 , 95.625 , 0 ) ; new AcadColor ( 45 , 0.5 , 0.4375 , 0.25 , 127.5 , 111.5625 , 63.75 ) ; new AcadColor ( 46 , 0.3 , 0.225 , 0 , 76.5 , 57.375 , 0 ) ; new AcadColor ( 47 , 0.3 , 0.2625 , 0.15 , 76.5 , 66.9375 , 38.25 ) ; new AcadColor ( 48 , 0.15 , 0.1125 , 0 , 38.25 , 28.6875 , 0 ) ; new AcadColor ( 49 , 0.15 , 0.1313 , 0.075 , 38.25 , 33.4815 , 19.125 ) ; new AcadColor ( 50 , 1 , 1 , 0 , 255 , 255 , 0 ) ; new AcadColor ( 51 , 1 , 1 , 0.5 , 255 , 255 , 127.5 ) ; new AcadColor ( 52 , 0.65 , 0.65 , 0 , 165.75 , 165.75 , 0 ) ; new AcadColor ( 53 , 0.65 , 0.65 , 0.325 , 165.75 , 165.75 , 82.875 ) ; new AcadColor ( 54 , 0.5 , 0.5 , 0 , 127.5 , 127.5 , 0 ) ; new AcadColor ( 55 , 0.5 , 0.5 , 0.25 , 127.5 , 127.5 , 63.75 ) ; new AcadColor ( 56 , 0.3 , 0.3 , 0 , 76.5 , 76.5 , 0 ) ; new AcadColor ( 57 , 0.3 , 0.3 , 0.15 , 76.5 , 76.5 , 38.25 ) ; new AcadColor ( 58 , 0.15 , 0.15 , 0 , 38.25 , 38.25 , 0 ) ; new AcadColor ( 59 , 0.15 , 0.15 , 0.075 , 38.25 , 38.25 , 19.125 ) ; new AcadColor ( 60 , 0.75 , 1 , 0 , 191.25 , 255 , 0 ) ; new AcadColor ( 61 , 0.875 , 1 , 0.5 , 223.125 , 255 , 127.5 ) ; new AcadColor ( 62 , 0.4875 , 0.65 , 0 , 124.3125 , 165.75 , 0 ) ; new AcadColor ( 63 , 0.5688 , 0.65 , 0.325 , 145.044 , 165.75 , 82.875 ) ; new AcadColor ( 64 , 0.375 , 0.5 , 0 , 95.625 , 127.5 , 0 ) ; new AcadColor ( 65 , 0.4375 , 0.5 , 0.25 , 111.5625 , 127.5 , 63.75 ) ; new AcadColor ( 66 , 0.225 , 0.3 , 0 , 57.375 , 76.5 , 0 ) ; new AcadColor ( 67 , 0.2625 , 0.3 , 0.15 , 66.9375 , 76.5 , 38.25 ) ; new AcadColor ( 68 , 0.1125 , 0.15 , 0 , 28.6875 , 38.25 , 0 ) ; new AcadColor ( 69 , 0.1313 , 0.15 , 0.075 , 33.4815 , 38.25 , 19.125 ) ; new AcadColor ( 70 , 0.5 , 1 , 0 , 127.5 , 255 , 0 ) ; new AcadColor ( 71 , 0.75 , 1 , 0.5 , 191.25 , 255 , 127.5 ) ; new AcadColor ( 72 , 0.325 , 0.65 , 0 , 82.875 , 165.75 , 0 ) ; new AcadColor ( 73 , 0.4875 , 0.65 , 0.325 , 124.3125 , 165.75 , 82.875 ) ; new AcadColor ( 74 , 0.25 , 0.5 , 0 , 63.75 , 127.5 , 0 ) ; new AcadColor ( 75 , 0.375 , 0.5 , 0.25 , 95.625 , 127.5 , 63.75 ) ; new AcadColor ( 76 , 0.15 , 0.3 , 0 , 38.25 , 76.5 , 0 ) ; new AcadColor ( 77 , 0.225 , 0.3 , 0.15 , 57.375 , 76.5 , 38.25 ) ; new AcadColor ( 78 , 0.075 , 0.15 , 0 , 19.125 , 38.25 , 0 ) ; new AcadColor ( 79 , 0.1125 , 0.15 , 0.075 , 28.6875 , 38.25 , 19.125 ) ; new AcadColor ( 80 , 0.25 , 1 , 0 , 63.75 , 255 , 0 ) ; new AcadColor ( 81 , 0.625 , 1 , 0.5 , 159.375 , 255 , 127.5 ) ; new AcadColor ( 82 , 0.1625 , 0.65 , 0 , 41.4375 , 165.75 , 0 ) ; new AcadColor ( 83 , 0.4063 , 0.65 , 0.325 , 103.6065 , 165.75 , 82.875 ) ; new AcadColor ( 84 , 0.125 , 0.5 , 0 , 31.875 , 127.5 , 0 ) ; new AcadColor ( 85 , 0.3125 , 0.5 , 0.25 , 79.6875 , 127.5 , 63.75 ) ; new AcadColor ( 86 , 0.075 , 0.3 , 0 , 19.125 , 76.5 , 0 ) ; new AcadColor ( 87 , 0.1875 , 0.3 , 0.15 , 47.8125 , 76.5 , 38.25 ) ; new AcadColor ( 88 , 0.0375 , 0.15 , 0 , 9.5625 , 38.25 , 0 ) ; new AcadColor ( 89 , 0.0938 , 0.15 , 0.075 , 23.919 , 38.25 , 19.125 ) ; new AcadColor ( 90 , 0 , 1 , 0 , 0 , 255 , 0 ) ; new AcadColor ( 91 , 0.5 , 1 , 0.5 , 127.5 , 255 , 127.5 ) ; new AcadColor ( 92 , 0 , 0.65 , 0 , 0 , 165.75 , 0 ) ; new AcadColor ( 93 , 0.325 , 0.65 , 0.325 , 82.875 , 165.75 , 82.875 ) ; new AcadColor ( 94 , 0 , 0.5 , 0 , 0 , 127.5 , 0 ) ; new AcadColor ( 95 , 0.25 , 0.5 , 0.25 , 63.75 , 127.5 , 63.75 ) ; new AcadColor ( 96 , 0 , 0.3 , 0 , 0 , 76.5 , 0 ) ; new AcadColor ( 97 , 0.15 , 0.3 , 0.15 , 38.25 , 76.5 , 38.25 ) ; new AcadColor ( 98 , 0 , 0.15 , 0 , 0 , 38.25 , 0 ) ; new AcadColor ( 99 , 0.075 , 0.15 , 0.075 , 19.125 , 38.25 , 19.125 ) ; new AcadColor ( 100 , 0 , 1 , 0.25 , 0 , 255 , 63.75 ) ; new AcadColor ( 101 , 0.5 , 1 , 0.625 , 127.5 , 255 , 159.375 ) ; new AcadColor ( 102 , 0 , 0.65 , 0.1625 , 0 , 165.75 , 41.4375 ) ; new AcadColor ( 103 , 0.325 , 0.65 , 0.4063 , 82.875 , 165.75 , 103.6065 ) ; new AcadColor ( 104 , 0 , 0.5 , 0.125 , 0 , 127.5 , 31.875 ) ; new AcadColor ( 105 , 0.25 , 0.5 , 0.3125 , 63.75 , 127.5 , 79.6875 ) ; new AcadColor ( 106 , 0 , 0.3 , 0.075 , 0 , 76.5 , 19.125 ) ; new AcadColor ( 107 , 0.15 , 0.3 , 0.1875 , 38.25 , 76.5 , 47.8125 ) ; new AcadColor ( 108 , 0 , 0.15 , 0.0375 , 0 , 38.25 , 9.5625 ) ; new AcadColor ( 109 , 0.075 , 0.15 , 0.0938 , 19.125 , 38.25 , 23.919 ) ; new AcadColor ( 110 , 0 , 1 , 0.5 , 0 , 255 , 127.5 ) ; new AcadColor ( 111 , 0.5 , 1 , 0.75 , 127.5 , 255 , 191.25 ) ; new AcadColor ( 112 , 0 , 0.65 , 0.325 , 0 , 165.75 , 82.875 ) ; new AcadColor ( 113 , 0.325 , 0.65 , 0.4875 , 82.875 , 165.75 , 124.3125 ) ; new AcadColor ( 114 , 0 , 0.5 , 0.25 , 0 , 127.5 , 63.75 ) ; new AcadColor ( 115 , 0.25 , 0.5 , 0.375 , 63.75 , 127.5 , 95.625 ) ; new AcadColor ( 116 , 0 , 0.3 , 0.15 , 0 , 76.5 , 38.25 ) ; new AcadColor ( 117 , 0.15 , 0.3 , 0.225 , 38.25 , 76.5 , 57.375 ) ; new AcadColor ( 118 , 0 , 0.15 , 0.075 , 0 , 38.25 , 19.125 ) ; new AcadColor ( 119 , 0.075 , 0.15 , 0.1125 , 19.125 , 38.25 , 28.6875 ) ; new AcadColor ( 120 , 0 , 1 , 0.75 , 0 , 255 , 191.25 ) ; new AcadColor ( 121 , 0.5 , 1 , 0.875 , 127.5 , 255 , 223.125 ) ; new AcadColor ( 122 , 0 , 0.65 , 0.4875 , 0 , 165.75 , 124.3125 ) ; new AcadColor ( 123 , 0.325 , 0.65 , 0.5688 , 82.875 , 165.75 , 145.044 ) ; new AcadColor ( 124 , 0 , 0.5 , 0.375 , 0 , 127.5 , 95.625 ) ; new AcadColor ( 125 , 0.25 , 0.5 , 0.4375 , 63.75 , 127.5 , 111.5625 ) ; new AcadColor ( 126 , 0 , 0.3 , 0.225 , 0 , 76.5 , 57.375 ) ; new AcadColor ( 127 , 0.15 , 0.3 , 0.2625 , 38.25 , 76.5 , 66.9375 ) ; new AcadColor ( 128 , 0 , 0.15 , 0.1125 , 0 , 38.25 , 28.6875 ) ; new AcadColor ( 129 , 0.075 , 0.15 , 0.1313 , 19.125 , 38.25 , 33.4815 ) ; new AcadColor ( 130 , 0 , 1 , 1 , 0 , 255 , 255 ) ; new AcadColor ( 131 , 0.5 , 1 , 1 , 127.5 , 255 , 255 ) ; new AcadColor ( 132 , 0 , 0.65 , 0.65 , 0 , 165.75 , 165.75 ) ; new AcadColor ( 133 , 0.325 , 0.65 , 0.65 , 82.875 , 165.75 , 165.75 ) ; new AcadColor ( 134 , 0 , 0.5 , 0.5 , 0 , 127.5 , 127.5 ) ; new AcadColor ( 135 , 0.25 , 0.5 , 0.5 , 63.75 , 127.5 , 127.5 ) ; new AcadColor ( 136 , 0 , 0.3 , 0.3 , 0 , 76.5 , 76.5 ) ; new AcadColor ( 137 , 0.15 , 0.3 , 0.3 , 38.25 , 76.5 , 76.5 ) ; new AcadColor ( 138 , 0 , 0.15 , 0.15 , 0 , 38.25 , 38.25 ) ; new AcadColor ( 139 , 0.075 , 0.15 , 0.15 , 19.125 , 38.25 , 38.25 ) ; new AcadColor ( 140 , 0 , 0.75 , 1 , 0 , 191.25 , 255 ) ; new AcadColor ( 141 , 0.5 , 0.875 , 1 , 127.5 , 223.125 , 255 ) ; new AcadColor ( 142 , 0 , 0.4875 , 0.65 , 0 , 124.3125 , 165.75 ) ; new AcadColor ( 143 , 0.325 , 0.5688 , 0.65 , 82.875 , 145.044 , 165.75 ) ; new AcadColor ( 144 , 0 , 0.375 , 0.5 , 0 , 95.625 , 127.5 ) ; new AcadColor ( 145 , 0.25 , 0.4375 , 0.5 , 63.75 , 111.5625 , 127.5 ) ; new AcadColor ( 146 , 0 , 0.225 , 0.3 , 0 , 57.375 , 76.5 ) ; new AcadColor ( 147 , 0.15 , 0.2625 , 0.3 , 38.25 , 66.9375 , 76.5 ) ; new AcadColor ( 148 , 0 , 0.1125 , 0.15 , 0 , 28.6875 , 38.25 ) ; new AcadColor ( 149 , 0.075 , 0.1313 , 0.15 , 19.125 , 33.4815 , 38.25 ) ; new AcadColor ( 150 , 0 , 0.5 , 1 , 0 , 127.5 , 255 ) ; new AcadColor ( 151 , 0.5 , 0.75 , 1 , 127.5 , 191.25 , 255 ) ; new AcadColor ( 152 , 0 , 0.325 , 0.65 , 0 , 82.875 , 165.75 ) ; new AcadColor ( 153 , 0.325 , 0.4875 , 0.65 , 82.875 , 124.3125 , 165.75 ) ; new AcadColor ( 154 , 0 , 0.25 , 0.5 , 0 , 63.75 , 127.5 ) ; new AcadColor ( 155 , 0.25 , 0.375 , 0.5 , 63.75 , 95.625 , 127.5 ) ; new AcadColor ( 156 , 0 , 0.15 , 0.3 , 0 , 38.25 , 76.5 ) ; new AcadColor ( 157 , 0.15 , 0.225 , 0.3 , 38.25 , 57.375 , 76.5 ) ; new AcadColor ( 158 , 0 , 0.075 , 0.15 , 0 , 19.125 , 38.25 ) ; new AcadColor ( 159 , 0.075 , 0.1125 , 0.15 , 19.125 , 28.6875 , 38.25 ) ; new AcadColor ( 160 , 0 , 0.25 , 1 , 0 , 63.75 , 255 ) ; new AcadColor ( 161 , 0.5 , 0.625 , 1 , 127.5 , 159.375 , 255 ) ; new AcadColor ( 162 , 0 , 0.1625 , 0.65 , 0 , 41.4375 , 165.75 ) ; new AcadColor ( 163 , 0.325 , 0.4063 , 0.65 , 82.875 , 103.6065 , 165.75 ) ; new AcadColor ( 164 , 0 , 0.125 , 0.5 , 0 , 31.875 , 127.5 ) ; new AcadColor ( 165 , 0.25 , 0.3125 , 0.5 , 63.75 , 79.6875 , 127.5 ) ; new AcadColor ( 166 , 0 , 0.075 , 0.3 , 0 , 19.125 , 76.5 ) ; new AcadColor ( 167 , 0.15 , 0.1875 , 0.3 , 38.25 , 47.8125 , 76.5 ) ; new AcadColor ( 168 , 0 , 0.0375 , 0.15 , 0 , 9.5625 , 38.25 ) ; new AcadColor ( 169 , 0.075 , 0.0938 , 0.15 , 19.125 , 23.919 , 38.25 ) ; new AcadColor ( 170 , 0 , 0 , 1 , 0 , 0 , 255 ) ; new AcadColor ( 171 , 0.5 , 0.5 , 1 , 127.5 , 127.5 , 255 ) ; new AcadColor ( 172 , 0 , 0 , 0.65 , 0 , 0 , 165.75 ) ; new AcadColor ( 173 , 0.325 , 0.325 , 0.65 , 82.875 , 82.875 , 165.75 ) ; new AcadColor ( 174 , 0 , 0 , 0.5 , 0 , 0 , 127.5 ) ; new AcadColor ( 175 , 0.25 , 0.25 , 0.5 , 63.75 , 63.75 , 127.5 ) ; new AcadColor ( 176 , 0 , 0 , 0.3 , 0 , 0 , 76.5 ) ; new AcadColor ( 177 , 0.15 , 0.15 , 0.3 , 38.25 , 38.25 , 76.5 ) ; new AcadColor ( 178 , 0 , 0 , 0.15 , 0 , 0 , 38.25 ) ; new AcadColor ( 179 , 0.075 , 0.075 , 0.15 , 19.125 , 19.125 , 38.25 ) ; new AcadColor ( 180 , 0.25 , 0 , 1 , 63.75 , 0 , 255 ) ; new AcadColor ( 181 , 0.625 , 0.5 , 1 , 159.375 , 127.5 , 255 ) ; new AcadColor ( 182 , 0.1625 , 0 , 0.65 , 41.4375 , 0 , 165.75 ) ; new AcadColor ( 183 , 0.4063 , 0.325 , 0.65 , 103.6065 , 82.875 , 165.75 ) ; new AcadColor ( 184 , 0.125 , 0 , 0.5 , 31.875 , 0 , 127.5 ) ; new AcadColor ( 185 , 0.3125 , 0.25 , 0.5 , 79.6875 , 63.75 , 127.5 ) ; new AcadColor ( 186 , 0.075 , 0 , 0.3 , 19.125 , 0 , 76.5 ) ; new AcadColor ( 187 , 0.1875 , 0.15 , 0.3 , 47.8125 , 38.25 , 76.5 ) ; new AcadColor ( 188 , 0.0375 , 0 , 0.15 , 9.5625 , 0 , 38.25 ) ; new AcadColor ( 189 , 0.0938 , 0.075 , 0.15 , 23.919 , 19.125 , 38.25 ) ; new AcadColor ( 190 , 0.5 , 0 , 1 , 127.5 , 0 , 255 ) ; new AcadColor ( 191 , 0.75 , 0.5 , 1 , 191.25 , 127.5 , 255 ) ; new AcadColor ( 192 , 0.325 , 0 , 0.65 , 82.875 , 0 , 165.75 ) ; new AcadColor ( 193 , 0.4875 , 0.325 , 0.65 , 124.3125 , 82.875 , 165.75 ) ; new AcadColor ( 194 , 0.25 , 0 , 0.5 , 63.75 , 0 , 127.5 ) ; new AcadColor ( 195 , 0.375 , 0.25 , 0.5 , 95.625 , 63.75 , 127.5 ) ; new AcadColor ( 196 , 0.15 , 0 , 0.3 , 38.25 , 0 , 76.5 ) ; new AcadColor ( 197 , 0.225 , 0.15 , 0.3 , 57.375 , 38.25 , 76.5 ) ; new AcadColor ( 198 , 0.075 , 0 , 0.15 , 19.125 , 0 , 38.25 ) ; new AcadColor ( 199 , 0.1125 , 0.075 , 0.15 , 28.6875 , 19.125 , 38.25 ) ; new AcadColor ( 200 , 0.75 , 0 , 1 , 191.25 , 0 , 255 ) ; new AcadColor ( 201 , 0.875 , 0.5 , 1 , 223.125 , 127.5 , 255 ) ; new AcadColor ( 202 , 0.4875 , 0 , 0.65 , 124.3125 , 0 , 165.75 ) ; new AcadColor ( 203 , 0.5688 , 0.325 , 0.65 , 145.044 , 82.875 , 165.75 ) ; new AcadColor ( 204 , 0.375 , 0 , 0.5 , 95.625 , 0 , 127.5 ) ; new AcadColor ( 205 , 0.4375 , 0.25 , 0.5 , 111.5625 , 63.75 , 127.5 ) ; new AcadColor ( 206 , 0.225 , 0 , 0.3 , 57.375 , 0 , 76.5 ) ; new AcadColor ( 207 , 0.2625 , 0.15 , 0.3 , 66.9375 , 38.25 , 76.5 ) ; new AcadColor ( 208 , 0.1125 , 0 , 0.15 , 28.6875 , 0 , 38.25 ) ; new AcadColor ( 209 , 0.1313 , 0.075 , 0.15 , 33.4815 , 19.125 , 38.25 ) ; new AcadColor ( 210 , 1 , 0 , 1 , 255 , 0 , 255 ) ; new AcadColor ( 211 , 1 , 0.5 , 1 , 255 , 127.5 , 255 ) ; new AcadColor ( 212 , 0.65 , 0 , 0.65 , 165.75 , 0 , 165.75 ) ; new AcadColor ( 213 , 0.65 , 0.325 , 0.65 , 165.75 , 82.875 , 165.75 ) ; new AcadColor ( 214 , 0.5 , 0 , 0.5 , 127.5 , 0 , 127.5 ) ; new AcadColor ( 215 , 0.5 , 0.25 , 0.5 , 127.5 , 63.75 , 127.5 ) ; new AcadColor ( 216 , 0.3 , 0 , 0.3 , 76.5 , 0 , 76.5 ) ; new AcadColor ( 217 , 0.3 , 0.15 , 0.3 , 76.5 , 38.25 , 76.5 ) ; new AcadColor ( 218 , 0.15 , 0 , 0.15 , 38.25 , 0 , 38.25 ) ; new AcadColor ( 219 , 0.15 , 0.075 , 0.15 , 38.25 , 19.125 , 38.25 ) ; new AcadColor ( 220 , 1 , 0 , 0.75 , 255 , 0 , 191.25 ) ; new AcadColor ( 221 , 1 , 0.5 , 0.875 , 255 , 127.5 , 223.125 ) ; new AcadColor ( 222 , 0.65 , 0 , 0.4875 , 165.75 , 0 , 124.3125 ) ; new AcadColor ( 223 , 0.65 , 0.325 , 0.5688 , 165.75 , 82.875 , 145.044 ) ; new AcadColor ( 224 , 0.5 , 0 , 0.375 , 127.5 , 0 , 95.625 ) ; new AcadColor ( 225 , 0.5 , 0.25 , 0.4375 , 127.5 , 63.75 , 111.5625 ) ; new AcadColor ( 226 , 0.3 , 0 , 0.225 , 76.5 , 0 , 57.375 ) ; new AcadColor ( 227 , 0.3 , 0.15 , 0.2625 , 76.5 , 38.25 , 66.9375 ) ; new AcadColor ( 228 , 0.15 , 0 , 0.1125 , 38.25 , 0 , 28.6875 ) ; new AcadColor ( 229 , 0.15 , 0.075 , 0.1313 , 38.25 , 19.125 , 33.4815 ) ; new AcadColor ( 230 , 1 , 0 , 0.5 , 255 , 0 , 127.5 ) ; new AcadColor ( 231 , 1 , 0.5 , 0.75 , 255 , 127.5 , 191.25 ) ; new AcadColor ( 232 , 0.65 , 0 , 0.325 , 165.75 , 0 , 82.875 ) ; new AcadColor ( 233 , 0.65 , 0.325 , 0.4875 , 165.75 , 82.875 , 124.3125 ) ; new AcadColor ( 234 , 0.5 , 0 , 0.25 , 127.5 , 0 , 63.75 ) ; new AcadColor ( 235 , 0.5 , 0.25 , 0.375 , 127.5 , 63.75 , 95.625 ) ; new AcadColor ( 236 , 0.3 , 0 , 0.15 , 76.5 , 0 , 38.25 ) ; new AcadColor ( 237 , 0.3 , 0.15 , 0.225 , 76.5 , 38.25 , 57.375 ) ; new AcadColor ( 238 , 0.15 , 0 , 0.075 , 38.25 , 0 , 19.125 ) ; new AcadColor ( 239 , 0.15 , 0.075 , 0.1125 , 38.25 , 19.125 , 28.6875 ) ; new AcadColor ( 240 , 1 , 0 , 0.25 , 255 , 0 , 63.75 ) ; new AcadColor ( 241 , 1 , 0.5 , 0.625 , 255 , 127.5 , 159.375 ) ; new AcadColor ( 242 , 0.65 , 0 , 0.1625 , 165.75 , 0 , 41.4375 ) ; new AcadColor ( 243 , 0.65 , 0.325 , 0.4063 , 165.75 , 82.875 , 103.6065 ) ; new AcadColor ( 244 , 0.5 , 0 , 0.125 , 127.5 , 0 , 31.875 ) ; new AcadColor ( 245 , 0.5 , 0.25 , 0.3125 , 127.5 , 63.75 , 79.6875 ) ; new AcadColor ( 246 , 0.3 , 0 , 0.075 , 76.5 , 0 , 19.125 ) ; new AcadColor ( 247 , 0.3 , 0.15 , 0.1875 , 76.5 , 38.25 , 47.8125 ) ; new AcadColor ( 248 , 0.15 , 0 , 0.0375 , 38.25 , 0 , 9.5625 ) ; new AcadColor ( 249 , 0.15 , 0.075 , 0.0938 , 38.25 , 19.125 , 23.919 ) ; new AcadColor ( 250 , 0.33 , 0.33 , 0.33 , 84.15 , 84.15 , 84.15 ) ; new AcadColor ( 251 , 0.464 , 0.464 , 0.464 , 118.32 , 118.32 , 118.32 ) ; new AcadColor ( 252 , 0.598 , 0.598 , 0.598 , 152.49 , 152.49 , 152.49 ) ; new AcadColor ( 253 , 0.732 , 0.732 , 0.732 , 186.66 , 186.66 , 186.66 ) ; new AcadColor ( 254 , 0.866 , 0.866 , 0.866 , 220.83 , 220.83 , 220.83 ) ; new AcadColor ( 255 , 1.0 , 1.0 , 1.0 , 255.0 , 255.0 , 255.0 ) ; return AcadColor . colors ; |
public class DDLCompiler { /** * Drop the dr conflicts table if A / A is disabled */
private void dropDRConflictTablesIfNeeded ( StringBuilder sb ) { } } | if ( hasConflictTableInSchema ( m_schema , CatalogUtil . DR_CONFLICTS_PARTITIONED_EXPORT_TABLE ) ) { sb . append ( "DROP STREAM " + CatalogUtil . DR_CONFLICTS_PARTITIONED_EXPORT_TABLE + ";\n" ) ; } if ( hasConflictTableInSchema ( m_schema , CatalogUtil . DR_CONFLICTS_REPLICATED_EXPORT_TABLE ) ) { sb . append ( "DROP STREAM " + CatalogUtil . DR_CONFLICTS_REPLICATED_EXPORT_TABLE + ";\n" ) ; } |
public class VersionFactory { /** * Get a version range */
public IVersionRange getRange ( String vstring ) throws InvalidRangeException { } } | if ( vstring == null || vstring . isEmpty ( ) ) { if ( strict ) { throw new InvalidRangeException ( "Cannot have an empty version" ) ; } else { IVersion version = new NamedVersion ( "" ) ; return new VersionSet ( version ) ; } } try { InputStream stream = new ByteArrayInputStream ( vstring . getBytes ( StandardCharsets . UTF_8 ) ) ; ANTLRInputStream input = new ANTLRInputStream ( stream ) ; VersionErrorListener errorListener = new VersionErrorListener ( ) ; VersionLexer lexer = new VersionLexer ( input ) ; lexer . removeErrorListeners ( ) ; lexer . addErrorListener ( errorListener ) ; CommonTokenStream tokens = new CommonTokenStream ( lexer ) ; VersionParser parser = new VersionParser ( tokens ) ; parser . addErrorListener ( errorListener ) ; RangeContext context = parser . range ( ) ; ParseTreeWalker walker = new ParseTreeWalker ( ) ; VersionListener listener = new VersionListener ( strict ) ; walker . walk ( listener , context ) ; IVersionRange range = listener . getRange ( ) ; if ( errorListener . hasErrors ( ) ) { if ( strict ) { throw new InvalidRangeException ( "Parse errors on " + vstring ) ; } range . setHasErrors ( true ) ; } return range ; } catch ( EmptyStackException e ) { if ( strict ) { throw new InvalidRangeException ( e ) ; } System . err . println ( "ERROR: Could not parse: " + vstring ) ; } catch ( InvalidRangeRuntimeException e ) { // These are always critical . They indicate a fundamental problem with the version range .
throw new InvalidRangeException ( e . getMessage ( ) , e ) ; } catch ( Exception e ) { // Parse errors and wot not will come here
if ( strict ) { throw new InvalidRangeException ( e ) ; } System . err . println ( "ERROR: Could not parse: " + vstring ) ; } // Fall back to a named version
IVersion version = new NamedVersion ( vstring ) ; return new VersionSet ( version ) ; |
public class StandardAnnotationMaps { /** * Gets all the DynamoDB annotations ; method annotations override field
* level annotations which override class / type level annotations . */
static final < T > FieldMap < T > of ( Method getter , String defaultName ) { } } | final Class < T > targetType = ( Class < T > ) getter . getReturnType ( ) ; final String fieldName = StandardBeanProperties . fieldNameOf ( getter ) ; Field declaredField = null ; try { declaredField = getter . getDeclaringClass ( ) . getDeclaredField ( fieldName ) ; } catch ( final SecurityException e ) { throw new DynamoDBMappingException ( "no access to field for " + getter , e ) ; } catch ( final NoSuchFieldException no ) { } if ( defaultName == null ) { defaultName = fieldName ; } final FieldMap < T > annotations = new FieldMap < T > ( targetType , defaultName ) ; annotations . putAll ( targetType ) ; annotations . putAll ( declaredField ) ; annotations . putAll ( getter ) ; return annotations ; |
public class ScanDynamicStoreAdapter { /** * 将一个配置回调item写到map里 */
private static void addOne2InverseMap ( DisconfKey disconfKey , Map < DisconfKey , List < IDisconfUpdate > > inverseMap , IDisconfUpdate iDisconfUpdate ) { } } | // 忽略的key 应该忽略掉
if ( DisClientConfig . getInstance ( ) . getIgnoreDisconfKeySet ( ) . contains ( disconfKey . getKey ( ) ) ) { return ; } List < IDisconfUpdate > serviceList ; if ( inverseMap . containsKey ( disconfKey ) ) { inverseMap . get ( disconfKey ) . add ( iDisconfUpdate ) ; } else { serviceList = new ArrayList < IDisconfUpdate > ( ) ; serviceList . add ( iDisconfUpdate ) ; inverseMap . put ( disconfKey , serviceList ) ; } |
public class ItemAPI { /** * Returns all the values for an item , with the additional data provided by
* the get item operation .
* @ param itemId
* The id of the item
* @ return The values on the item */
public List < FieldValuesView > getItemValues ( int itemId ) { } } | return getResourceFactory ( ) . getApiResource ( "/item/" + itemId + "/value/" ) . get ( new GenericType < List < FieldValuesView > > ( ) { } ) ; |
public class StringUtil { /** * remove all white spaces followed by whitespaces
* @ param str string to translate
* @ return translated string */
public static String suppressWhiteSpace ( String str ) { } } | int len = str . length ( ) ; StringBuilder sb = new StringBuilder ( len ) ; // boolean wasWS = false ;
char c ; char buffer = 0 ; for ( int i = 0 ; i < len ; i ++ ) { c = str . charAt ( i ) ; if ( c == '\n' || c == '\r' ) buffer = '\n' ; else if ( isWhiteSpace ( c ) ) { if ( buffer == 0 ) buffer = c ; } else { if ( buffer != 0 ) { sb . append ( buffer ) ; buffer = 0 ; } sb . append ( c ) ; } // sb . append ( c ) ;
} if ( buffer != 0 ) sb . append ( buffer ) ; return sb . toString ( ) ; |
public class ChainedIOException { /** * Prints this exception ' s stack trace to a print writer .
* If this exception has a root exception ; the stack trace of the
* root exception is printed to the print writer instead .
* @ param pw The non - null print writer to which to print . */
public void printStackTrace ( java . io . PrintWriter pw ) { } } | if ( exception != null ) { String superString = getLocalMessage ( ) ; synchronized ( pw ) { pw . print ( superString ) ; pw . print ( ( superString . endsWith ( "." ) ? " Caused by " : ". Caused by " ) ) ; exception . printStackTrace ( pw ) ; } } else { super . printStackTrace ( pw ) ; } |
public class Base64 { /** * Decodes a byte [ ] containing characters in the Base - N alphabet .
* @ param pArray A byte array containing Base - N character data
* @ return a byte array containing binary data */
public Base64Context decode ( final byte [ ] pArray , Base64Context ctx ) throws FileParsingException { } } | return decode ( pArray , 0 , pArray . length , ctx ) ; |
public class Router { /** * Adds a new route to the router
* @ param route The route to add */
public static void addRoute ( MangooRoute route ) { } } | Objects . requireNonNull ( route , Required . ROUTE . toString ( ) ) ; Preconditions . checkArgument ( routes . size ( ) <= MAX_ROUTES , "Maximum of " + MAX_ROUTES + " routes reached" ) ; routes . add ( route ) ; if ( route instanceof RequestRoute ) { RequestRoute requestRoute = ( RequestRoute ) route ; if ( requestRoute . getControllerClass ( ) != null && StringUtils . isNotBlank ( requestRoute . getControllerMethod ( ) ) ) { reverseRoutes . put ( ( requestRoute . getControllerClass ( ) . getSimpleName ( ) . toLowerCase ( Locale . ENGLISH ) + ":" + requestRoute . getControllerMethod ( ) ) . toLowerCase ( Locale . ENGLISH ) , requestRoute ) ; } } |
public class ApptentiveInternal { /** * region Engagement Manifest Data */
private void storeManifestResponse ( Context context , String manifest ) { } } | try { File file = new File ( ApptentiveLog . getLogsDirectory ( context ) , Constants . FILE_APPTENTIVE_ENGAGEMENT_MANIFEST ) ; Util . writeText ( file , manifest ) ; } catch ( Exception e ) { ApptentiveLog . e ( CONVERSATION , e , "Exception while trying to save engagement manifest data" ) ; logException ( e ) ; } |
public class PathMappingResultBuilder { /** * Adds a decoded path parameter . */
public PathMappingResultBuilder decodedParam ( String name , String value ) { } } | params . put ( requireNonNull ( name , "name" ) , requireNonNull ( value , "value" ) ) ; return this ; |
public class TextArea { /** * Render the TextArea .
* @ throws JspException if a JSP exception has occurred */
public int doEndTag ( ) throws JspException { } } | ServletRequest req = pageContext . getRequest ( ) ; Object textObject = null ; // Get the value of the data source . The object will not be null .
Object val = evaluateDataSource ( ) ; textObject = ( val != null ) ? val : "" ; assert ( textObject != null ) ; // setup the rest of the state .
ByRef ref = new ByRef ( ) ; nameHtmlControl ( _state , ref ) ; _state . disabled = isDisabled ( ) ; // if there were expression errors report them
if ( hasErrors ( ) ) return reportAndExit ( EVAL_PAGE ) ; // if there were format errors then report them
if ( _formatErrors ) { if ( bodyContent != null ) { String value = bodyContent . getString ( ) . trim ( ) ; bodyContent . clearBody ( ) ; write ( value ) ; } } // create the input tag .
WriteRenderAppender writer = new WriteRenderAppender ( pageContext ) ; TagRenderingBase br = TagRenderingBase . Factory . getRendering ( TagRenderingBase . TEXT_AREA_TAG , req ) ; br . doStartTag ( writer , _state ) ; // create the text value which will be found inside the textarea .
if ( ( textObject == null ) || ( textObject . toString ( ) . length ( ) == 0 ) ) { textObject = _defaultValue ; } String text = formatText ( textObject ) ; if ( text != null ) { // make sure leading blank line in the text value is not interpreted
// just as formatting . . . force a new line for formatting
if ( text . startsWith ( "\n" ) || text . startsWith ( "\r" ) ) { writer . append ( "\n" ) ; } HtmlUtils . filter ( text , writer ) ; } // results . append ( text ) ;
br . doEndTag ( writer ) ; // if there are errors report them . . .
if ( hasErrors ( ) ) return reportAndExit ( EVAL_PAGE ) ; // report any script
if ( ! ref . isNull ( ) ) write ( ( String ) ref . getRef ( ) ) ; localRelease ( ) ; return EVAL_PAGE ; |
public class FilterFileSystem { /** * The src file is under FS , and the dst is on the local disk .
* Copy it from FS control to the local dst name .
* delSrc indicates if the src will be removed or not . */
public void copyToLocalFile ( boolean delSrc , Path src , Path dst ) throws IOException { } } | fs . copyToLocalFile ( delSrc , src , dst ) ; |
public class SecretShare { /** * Combine the shares generated by the split to recover the secret .
* @ param usetheseshares shares to use - only the first " K " of size ( ) will be used
* @ return the combine output instance [ which in turn contains the recovered secret ] */
public CombineOutput combine ( final List < ShareInfo > usetheseshares ) { } } | CombineOutput ret = null ; sanityCheckPublicInfos ( publicInfo , usetheseshares ) ; if ( true ) { println ( " SOLVING USING THESE SHARES, mod=" + publicInfo . getPrimeModulus ( ) ) ; for ( ShareInfo si : usetheseshares ) { println ( " " + si . share ) ; } println ( "end SOLVING USING THESE SHARES" ) ; } if ( publicInfo . getK ( ) > usetheseshares . size ( ) ) { throw new SecretShareException ( "Must have " + publicInfo . getK ( ) + " shares to solve. Only provided " + usetheseshares . size ( ) ) ; } checkForDuplicatesOrThrow ( usetheseshares ) ; final int size = publicInfo . getK ( ) ; BigInteger [ ] xarray = new BigInteger [ size ] ; BigInteger [ ] fofxarray = new BigInteger [ size ] ; for ( int i = 0 , n = size ; i < n ; i ++ ) { xarray [ i ] = usetheseshares . get ( i ) . getXasBigInteger ( ) ; fofxarray [ i ] = usetheseshares . get ( i ) . getShare ( ) ; } EasyLinearEquation ele = EasyLinearEquation . createForPolynomial ( xarray , fofxarray ) ; if ( publicInfo . getPrimeModulus ( ) != null ) { ele = ele . createWithPrimeModulus ( publicInfo . getPrimeModulus ( ) ) ; } BigInteger solveSecret = null ; if ( false ) { EasyLinearEquation . EasySolve solve = ele . solve ( ) ; solveSecret = solve . getAnswer ( 1 ) ; } else { BigInteger [ ] [ ] matrix = ele . getMatrix ( ) ; NumberMatrix . print ( "SS.java" , matrix , out ) ; println ( "CVT matrix.height=" + matrix . length + " width=" + matrix [ 0 ] . length ) ; BigRationalMatrix brm = BigRationalMatrix . create ( matrix ) ; NumberMatrix . print ( "SS.java brm" , brm . getArray ( ) , out ) ; NumberSimplex < BigRational > simplex = new NumberSimplex < BigRational > ( brm , 0 ) ; simplex . initForSolve ( out ) ; simplex . solve ( out ) ; BigRational answer = simplex . getAnswer ( 0 ) ; if ( publicInfo . getPrimeModulus ( ) != null ) { solveSecret = answer . computeBigIntegerMod ( publicInfo . getPrimeModulus ( ) ) ; } else { solveSecret = answer . bigIntegerValue ( ) ; } } if ( publicInfo . getPrimeModulus ( ) != null ) { solveSecret = solveSecret . mod ( publicInfo . getPrimeModulus ( ) ) ; } ret = new CombineOutput ( solveSecret ) ; return ret ; |
public class STUN { /** * Check if the server support STUN Service .
* @ param connection the connection
* @ return true if the server support STUN
* @ throws SmackException
* @ throws XMPPException
* @ throws InterruptedException */
public static boolean serviceAvailable ( XMPPConnection connection ) throws XMPPException , SmackException , InterruptedException { } } | if ( ! connection . isConnected ( ) ) { return false ; } LOGGER . fine ( "Service listing" ) ; ServiceDiscoveryManager disco = ServiceDiscoveryManager . getInstanceFor ( connection ) ; DiscoverItems items = disco . discoverItems ( connection . getXMPPServiceDomain ( ) ) ; for ( DiscoverItems . Item item : items . getItems ( ) ) { DiscoverInfo info = disco . discoverInfo ( item . getEntityID ( ) ) ; for ( DiscoverInfo . Identity identity : info . getIdentities ( ) ) { if ( identity . getCategory ( ) . equals ( "proxy" ) && identity . getType ( ) . equals ( "stun" ) ) if ( info . containsFeature ( NAMESPACE ) ) return true ; } LOGGER . fine ( item . getName ( ) + "-" + info . getType ( ) ) ; } return false ; |
public class IntervalTree { /** * Removes an interval from the tree , if it was stored in it . This operation may cause the
* { @ link TreeNode # deleteNode ( TreeNode ) deletion of a node } , which in turn may cause
* rebalancing of the tree and the { @ link TreeNode # assimilateOverlappingIntervals ( TreeNode ) assimilation }
* of intervals from one node to another . This is why this operation may run in { @ code O ( n ) }
* worst - case time , even though on average it should run in { @ code O ( logn ) } due to the
* nature binary trees .
* @ param interval
* @ return */
public boolean remove ( Interval < T > interval ) { } } | if ( interval . isEmpty ( ) || root == null ) return false ; int sizeBeforeOperation = size ; root = TreeNode . removeInterval ( this , root , interval ) ; return size == sizeBeforeOperation ; |
public class GroupCertificateAuthorityPropertiesMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GroupCertificateAuthorityProperties groupCertificateAuthorityProperties , ProtocolMarshaller protocolMarshaller ) { } } | if ( groupCertificateAuthorityProperties == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( groupCertificateAuthorityProperties . getGroupCertificateAuthorityArn ( ) , GROUPCERTIFICATEAUTHORITYARN_BINDING ) ; protocolMarshaller . marshall ( groupCertificateAuthorityProperties . getGroupCertificateAuthorityId ( ) , GROUPCERTIFICATEAUTHORITYID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class PactDslRootValue { /** * Value that must be a boolean
* @ param example example boolean to use for generated bodies */
public static PactDslRootValue booleanType ( Boolean example ) { } } | PactDslRootValue value = new PactDslRootValue ( ) ; value . setValue ( example ) ; value . setMatcher ( TypeMatcher . INSTANCE ) ; return value ; |
public class StackMachine { /** * STATE _ CHECK _ VAL */
protected final boolean stateCheckVal ( int s , int snum ) { } } | if ( stateCheckBuff != null ) { int x = stateCheckPos ( s , snum ) ; return ( stateCheckBuff [ x / 8 ] & ( 1 << ( x % 8 ) ) ) != 0 ; } return false ; |
public class InputMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Input input , ProtocolMarshaller protocolMarshaller ) { } } | if ( input == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( input . getAudioSelectorGroups ( ) , AUDIOSELECTORGROUPS_BINDING ) ; protocolMarshaller . marshall ( input . getAudioSelectors ( ) , AUDIOSELECTORS_BINDING ) ; protocolMarshaller . marshall ( input . getCaptionSelectors ( ) , CAPTIONSELECTORS_BINDING ) ; protocolMarshaller . marshall ( input . getDeblockFilter ( ) , DEBLOCKFILTER_BINDING ) ; protocolMarshaller . marshall ( input . getDecryptionSettings ( ) , DECRYPTIONSETTINGS_BINDING ) ; protocolMarshaller . marshall ( input . getDenoiseFilter ( ) , DENOISEFILTER_BINDING ) ; protocolMarshaller . marshall ( input . getFileInput ( ) , FILEINPUT_BINDING ) ; protocolMarshaller . marshall ( input . getFilterEnable ( ) , FILTERENABLE_BINDING ) ; protocolMarshaller . marshall ( input . getFilterStrength ( ) , FILTERSTRENGTH_BINDING ) ; protocolMarshaller . marshall ( input . getImageInserter ( ) , IMAGEINSERTER_BINDING ) ; protocolMarshaller . marshall ( input . getInputClippings ( ) , INPUTCLIPPINGS_BINDING ) ; protocolMarshaller . marshall ( input . getProgramNumber ( ) , PROGRAMNUMBER_BINDING ) ; protocolMarshaller . marshall ( input . getPsiControl ( ) , PSICONTROL_BINDING ) ; protocolMarshaller . marshall ( input . getSupplementalImps ( ) , SUPPLEMENTALIMPS_BINDING ) ; protocolMarshaller . marshall ( input . getTimecodeSource ( ) , TIMECODESOURCE_BINDING ) ; protocolMarshaller . marshall ( input . getVideoSelector ( ) , VIDEOSELECTOR_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class ForwardingClient { /** * Get the active X11 forwarding channels .
* @ return ActiveTunnel [ ]
* @ throws IOException */
public ActiveTunnel [ ] getX11ForwardingTunnels ( ) throws IOException { } } | if ( incomingtunnels . containsKey ( X11_KEY ) ) { Vector < ActiveTunnel > v = incomingtunnels . get ( X11_KEY ) ; ActiveTunnel [ ] t = new ActiveTunnel [ v . size ( ) ] ; v . copyInto ( t ) ; return t ; } return new ActiveTunnel [ ] { } ; |
public class GetCommentsForComparedCommitRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetCommentsForComparedCommitRequest getCommentsForComparedCommitRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getCommentsForComparedCommitRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getCommentsForComparedCommitRequest . getRepositoryName ( ) , REPOSITORYNAME_BINDING ) ; protocolMarshaller . marshall ( getCommentsForComparedCommitRequest . getBeforeCommitId ( ) , BEFORECOMMITID_BINDING ) ; protocolMarshaller . marshall ( getCommentsForComparedCommitRequest . getAfterCommitId ( ) , AFTERCOMMITID_BINDING ) ; protocolMarshaller . marshall ( getCommentsForComparedCommitRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( getCommentsForComparedCommitRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class CR { /** * Returns the set of concepts associated to the concept in a
* { @ link Context } by role r .
* @ param r
* The role
* @ return The set of concepts associated to the concept in the context . */
public IConceptSet lookupConcept ( int r ) { } } | if ( r >= data . length ) { return IConceptSet . EMPTY_SET ; } if ( null == data [ r ] ) { return IConceptSet . EMPTY_SET ; } else { return new ReadonlyConceptSet ( data [ r ] ) ; } |
public class CharOperation { /** * Answers the result of a char [ ] conversion to lowercase . Answers null if the given chars array is null . < br >
* NOTE : If no conversion was necessary , then answers back the argument one . < br >
* < br >
* For example :
* < ol >
* < li >
* < pre >
* chars = { ' a ' , ' b ' }
* result = & gt ; { ' a ' , ' b ' }
* < / pre >
* < / li >
* < li >
* < pre >
* array = { ' A ' , ' b ' }
* result = & gt ; { ' a ' , ' b ' }
* < / pre >
* < / li >
* < / ol >
* @ param chars
* the chars to convert
* @ return the result of a char [ ] conversion to lowercase */
final static public char [ ] toLowerCase ( char [ ] chars ) { } } | if ( chars == null ) { return null ; } int length = chars . length ; char [ ] lowerChars = null ; for ( int i = 0 ; i < length ; i ++ ) { char c = chars [ i ] ; char lc = Character . toLowerCase ( c ) ; if ( c != lc || lowerChars != null ) { if ( lowerChars == null ) { System . arraycopy ( chars , 0 , lowerChars = new char [ length ] , 0 , i ) ; } lowerChars [ i ] = lc ; } } return lowerChars == null ? chars : lowerChars ; |
public class StringUtil { /** * 将数组中的元素连接成一个字符串 。
* < pre >
* StringUtil . join ( null , * ) = null
* StringUtil . join ( [ ] , * ) = & quot ; & quot ;
* StringUtil . join ( [ null ] , * ) = & quot ; & quot ;
* StringUtil . join ( [ & quot ; a & quot ; , & quot ; b & quot ; , & quot ; c & quot ; ] , ' ; ' ) = & quot ; a ; b ; c & quot ;
* StringUtil . join ( [ & quot ; a & quot ; , & quot ; b & quot ; , & quot ; c & quot ; ] , null ) = & quot ; abc & quot ;
* StringUtil . join ( [ null , & quot ; & quot ; , & quot ; a & quot ; ] , ' ; ' ) = & quot ; ; ; a & quot ;
* < / pre >
* @ param array
* 要连接的数组
* @ param separator
* 分隔符
* @ return 连接后的字符串 , 如果原数组为 < code > null < / code > , 则返回 < code > null < / code > */
public static < T > String join ( T [ ] array , char separator ) { } } | if ( array == null ) { return null ; } int arraySize = array . length ; int bufSize = ( arraySize == 0 ) ? 0 : ( ( ( ( array [ 0 ] == null ) ? 16 : array [ 0 ] . toString ( ) . length ( ) ) + 1 ) * arraySize ) ; StringBuilder buf = new StringBuilder ( bufSize ) ; for ( int i = 0 ; i < arraySize ; i ++ ) { if ( i > 0 ) { buf . append ( separator ) ; } if ( array [ i ] != null ) { buf . append ( array [ i ] ) ; } } return buf . toString ( ) ; |
public class BaseCommandTask { /** * Returns the value at i + 1 , guarding against ArrayOutOfBound exceptions .
* If the next element is not a value but an argument flag ( starts with - )
* return null .
* @ return String value as defined above , or { @ code null } if at end of args . */
protected String getValue ( String arg ) { } } | String [ ] split = arg . split ( "=" ) ; if ( split . length <= 1 ) { return null ; } return split [ 1 ] ; |
public class DBColumnPropertySheet { /** * GEN - LAST : event _ tfJavaFieldNameFocusLost */
private void tfJavaFieldNameActionPerformed ( java . awt . event . ActionEvent evt ) // GEN - FIRST : event _ tfJavaFieldNameActionPerformed
{ } } | // GEN - HEADEREND : event _ tfJavaFieldNameActionPerformed
// Commit value to column object if ENTER is pressed
aColumn . setJavaFieldName ( tfJavaFieldName . getText ( ) ) ; |
public class ApiOvhSupport { /** * List support tickets identifiers for this service
* REST : GET / support / tickets
* @ param serviceName [ required ] Ticket message service name
* @ param subject [ required ] Search by ticket subject
* @ param maxCreationDate [ required ] Maximum creation date
* @ param status [ required ] Status of ticket
* @ param product [ required ] Search by ticket product
* @ param minCreationDate [ required ] Minimum creation date
* @ param ticketNumber [ required ] Search by ticket number
* @ param category [ required ] Search by ticket category
* @ param archived [ required ] Search archived tickets */
public ArrayList < Long > tickets_GET ( Boolean archived , OvhTicketCategoryEnum category , Date maxCreationDate , Date minCreationDate , OvhTicketProductEnum product , String serviceName , OvhTicketStatusEnum status , String subject , String ticketNumber ) throws IOException { } } | String qPath = "/support/tickets" ; StringBuilder sb = path ( qPath ) ; query ( sb , "archived" , archived ) ; query ( sb , "category" , category ) ; query ( sb , "maxCreationDate" , maxCreationDate ) ; query ( sb , "minCreationDate" , minCreationDate ) ; query ( sb , "product" , product ) ; query ( sb , "serviceName" , serviceName ) ; query ( sb , "status" , status ) ; query ( sb , "subject" , subject ) ; query ( sb , "ticketNumber" , ticketNumber ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t2 ) ; |
public class ChannelUrl { /** * Get Resource Url for DeleteChannel
* @ param code User - defined code that uniqely identifies the channel group .
* @ return String Resource Url */
public static MozuUrl deleteChannelUrl ( String code ) { } } | UrlFormatter formatter = new UrlFormatter ( "/api/commerce/channels/{code}" ) ; formatter . formatUrl ( "code" , code ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; |
public class FinalFlags { /** * Return a String with a message indicating why the given path is final .
* @ param path
* Path to check
* @ return String reason why the path is final or null if the path isn ' t
* final */
public String getFinalReason ( Path path ) { } } | StringBuilder sb = new StringBuilder ( path + " cannot be modified; " ) ; StringBuilder finalPath = new StringBuilder ( "/" ) ; // Step through the nodes based on the given path . If any intermediate
// nodes are marked as final , we can just return true .
Node currentNode = root ; for ( Term t : path . getTerms ( ) ) { finalPath . append ( t . toString ( ) ) ; Node nextNode = currentNode . getChild ( t ) ; if ( nextNode == null ) { return null ; } else if ( nextNode . isFinal ( ) ) { sb . append ( finalPath . toString ( ) + " is marked as final" ) ; return sb . toString ( ) ; } finalPath . append ( "/" ) ; currentNode = nextNode ; } // Strip off the last slash . It is not needed .
finalPath . deleteCharAt ( finalPath . length ( ) - 1 ) ; // Either the path itself is final or a descendant .
if ( currentNode . isFinal ( ) ) { sb . append ( finalPath . toString ( ) + " is marked as final" ) ; } else if ( currentNode . hasChild ( ) ) { sb . append ( finalPath . toString ( ) + currentNode . getFinalDescendantPath ( ) + " is marked as final" ) ; return sb . toString ( ) ; } else { return null ; } return null ; |
public class ClientSharedObject { /** * { @ inheritDoc } */
@ Override public void removeAttributes ( ) { } } | // TODO : there must be a direct way to clear the SO on the client side
for ( String key : getAttributeNames ( ) ) { ownerMessage . addEvent ( Type . SERVER_DELETE_ATTRIBUTE , key , null ) ; } notifyModified ( ) ; |
public class UrlResourceMetadataResolver { /** * Fetch metadata http response .
* @ param metadataLocation the metadata location
* @ param criteriaSet the criteria set
* @ return the http response */
protected HttpResponse fetchMetadata ( final String metadataLocation , final CriteriaSet criteriaSet ) { } } | LOGGER . debug ( "Fetching metadata from [{}]" , metadataLocation ) ; return HttpUtils . executeGet ( metadataLocation , new LinkedHashMap < > ( ) ) ; |
public class ProductSortDefinitionUrl { /** * Get Resource Url for AddProductSortDefinition
* @ param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object . This parameter should only be used to retrieve data . Attempting to update data using this parameter may cause data loss .
* @ param useProvidedId If true , the provided Id value will be used as the ProductSortDefinitionId . If omitted or false , the system will generate a ProductSortDefinitionId
* @ return String Resource Url */
public static MozuUrl addProductSortDefinitionUrl ( String responseFields , Boolean useProvidedId ) { } } | UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/productsortdefinitions/?useProvidedId={useProvidedId}&responseFields={responseFields}" ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "useProvidedId" , useProvidedId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; |
public class NetworkAddress { /** * parse a CIDR network block identifier , consisting of an ip4Address / prefixSize , where both ip4Address and netMask are
* presented in dotted quad notation . e . g . 192.0.2.0/24
* @ return
* @ see { http : / / en . wikipedia . org / wiki / Classless _ Inter - Domain _ Routing # IPv4 _ CIDR _ blocks } */
public static NetworkAddress parseBlock ( String networkAddress ) { } } | NetworkAddress address = null ; if ( networkAddress != null ) { String [ ] split = networkAddress . split ( "/" ) ; if ( split . length == 2 ) { byte [ ] network = parseDottedQuad ( split [ 0 ] ) ; byte bits = Byte . parseByte ( split [ 1 ] ) ; address = toNetworkAddress ( network , toNetworkMask ( bits ) ) ; } else { throw new IllegalArgumentException ( "Network address must be ip4Address/prefixSize" ) ; } } return address ; |
public class JSLockedMessageEnumeration { /** * / * ( non - Javadoc )
* @ see com . ibm . wsspi . sib . core . LockedMessageEnumeration # unlockCurrent ( ) */
public void unlockCurrent ( ) throws SISessionUnavailableException , SISessionDroppedException , SIResourceException , SIConnectionLostException , SIIncorrectCallException , SIErrorException , SIMPMessageNotLockedException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPILockedMessageEnumeration . tc . isEntryEnabled ( ) ) SibTr . entry ( CoreSPILockedMessageEnumeration . tc , "unlockCurrent" , new Object [ ] { new Integer ( hashCode ( ) ) , this } ) ; unlockCurrent ( false ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPILockedMessageEnumeration . tc . isEntryEnabled ( ) ) SibTr . exit ( CoreSPILockedMessageEnumeration . tc , "unlockCurrent" , this ) ; |
public class ParameterizedJobMixIn { /** * Standard implementation of { @ link ParameterizedJob # scheduleBuild2 } . */
public final @ CheckForNull QueueTaskFuture < RunT > scheduleBuild2 ( int quietPeriod , Action ... actions ) { } } | Queue . Item i = scheduleBuild2 ( quietPeriod , Arrays . asList ( actions ) ) ; return i != null ? ( QueueTaskFuture ) i . getFuture ( ) : null ; |
public class WriterFactoryImpl { /** * { @ inheritDoc } */
@ Override public MethodWriterImpl getMethodWriter ( ClassWriter classWriter ) { } } | return new MethodWriterImpl ( ( SubWriterHolderWriter ) classWriter , classWriter . getTypeElement ( ) ) ; |
public class JpaRepositoryConfig { /** * Prepares a builder to configure a jpa document for the given entity .
* @ param < E > entity type
* @ param entityClass to directly expose
* @ return builder */
public static < E > JpaRepositoryConfig . Builder < E > builder ( Class < E > entityClass ) { } } | JpaRepositoryConfig . Builder < E > builder = new JpaRepositoryConfig . Builder < > ( ) ; builder . entityClass = entityClass ; builder . resourceClass = entityClass ; return builder ; |
public class JMString { /** * Gets extension .
* @ param fileName the file name
* @ return the extension */
public static String getExtension ( String fileName ) { } } | int dotIndex = fileName . lastIndexOf ( DOT ) ; return dotIndex > 0 ? fileName . substring ( dotIndex ) : EMPTY ; |
public class MathUtil { /** * Compute the zone where the point is against the given rectangular prism
* according to the < a href = " http : / / en . wikipedia . org / wiki / Cohen % E2%80%93Sutherland _ algorithm " > Cohen - Sutherland algorithm < / a > .
* @ param px is the coordinates of the point .
* @ param py is the coordinates of the point .
* @ param pz is the coordinates of the point .
* @ param rxmin is the min of the coordinates of the rectangular prism .
* @ param rymin is the min of the coordinates of the rectangular prism .
* @ param rzmin is the min of the coordinates of the rectangular prism .
* @ param rxmax is the max of the coordinates of the rectangular prism .
* @ param rymax is the max of the coordinates of the rectangular prism .
* @ param rzmax is the max of the coordinates of the rectangular prism .
* @ return the zone */
@ Pure @ SuppressWarnings ( "checkstyle:parameternumber" ) public static int getCohenSutherlandCode3D ( int px , int py , int pz , int rxmin , int rymin , int rzmin , int rxmax , int rymax , int rzmax ) { } } | assert rxmin <= rxmax : AssertMessages . lowerEqualParameters ( 3 , rxmin , 6 , rxmax ) ; assert rymin <= rymax : AssertMessages . lowerEqualParameters ( 4 , rymin , 7 , rymax ) ; assert rzmin <= rzmax : AssertMessages . lowerEqualParameters ( 5 , rzmin , 8 , rzmax ) ; // initialised as being inside of clip window
int code = COHEN_SUTHERLAND_INSIDE ; if ( px < rxmin ) { // to the left of clip window
code |= COHEN_SUTHERLAND_LEFT ; } if ( px > rxmax ) { // to the right of clip window
code |= COHEN_SUTHERLAND_RIGHT ; } if ( py < rymin ) { // to the bottom of clip window
code |= COHEN_SUTHERLAND_BOTTOM ; } if ( py > rymax ) { // to the top of clip window
code |= COHEN_SUTHERLAND_TOP ; } if ( pz < rzmin ) { // to the front of clip window
code |= COHEN_SUTHERLAND_FRONT ; } if ( pz > rzmax ) { // to the back of clip window
code |= COHEN_SUTHERLAND_BACK ; } return code ; |
public class CurrentAddressStructuredTypeImpl { /** * { @ inheritDoc } */
@ Override public void setCvaddressArea ( String cvaddressArea ) { } } | this . cvaddressArea = this . prepareForAssignment ( this . cvaddressArea , this . createXSString ( CvaddressArea . class , cvaddressArea ) ) ; |
public class LruMemoryCache { /** * Remove the eldest entries until the total of remaining entries is at or below the requested size .
* @ param maxSize the maximum size of the cache before returning . May be - 1 to evict even 0 - sized elements . */
private void trimToSize ( int maxSize ) { } } | while ( true ) { String key ; Bitmap value ; synchronized ( this ) { if ( size < 0 || ( map . isEmpty ( ) && size != 0 ) ) { throw new IllegalStateException ( getClass ( ) . getName ( ) + ".sizeOf() is reporting inconsistent results!" ) ; } if ( size <= maxSize || map . isEmpty ( ) ) { break ; } Map . Entry < String , Bitmap > toEvict = map . entrySet ( ) . iterator ( ) . next ( ) ; if ( toEvict == null ) { break ; } key = toEvict . getKey ( ) ; value = toEvict . getValue ( ) ; map . remove ( key ) ; size -= sizeOf ( key , value ) ; } } |
public class ValueList { /** * Appends the given values to this list as a list . */
public ValueList appendList ( Object ... vals ) { } } | super . append ( new ArrayList < Object > ( Arrays . asList ( vals ) ) ) ; return this ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.