signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Parameters { /** * Overrides parameters with new values from specified Parameters and returns a * new Parameters object . * @ param parameters Parameters with parameters to override the current values . * @ param recursive ( optional ) true to perform deep copy , and false for shallow * copy . Defa...
Parameters result = new Parameters ( ) ; if ( recursive ) { RecursiveObjectWriter . copyProperties ( result , this ) ; RecursiveObjectWriter . copyProperties ( result , parameters ) ; } else { ObjectWriter . setProperties ( result , this ) ; ObjectWriter . setProperties ( result , parameters ) ; } return result ;
public class JavaConnector { /** * called when the map extent changed by changing the center or zoom of the map . * @ param latMin * latitude of upper left corner * @ param lonMin * longitude of upper left corner * @ param latMax * latitude of lower right corner * @ param lonMax * longitude of lower rig...
final Extent extent = Extent . forCoordinates ( new Coordinate ( latMin , lonMin ) , new Coordinate ( latMax , lonMax ) ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( "JS reports extend change: {}" , extent ) ; } fireEvent ( new MapViewEvent ( MapViewEvent . MAP_BOUNDING_EXTENT , extent ) ) ;
public class CommerceShippingFixedOptionRelPersistenceImpl { /** * Returns the commerce shipping fixed option rel with the primary key or returns < code > null < / code > if it could not be found . * @ param primaryKey the primary key of the commerce shipping fixed option rel * @ return the commerce shipping fixed ...
Serializable serializable = entityCache . getResult ( CommerceShippingFixedOptionRelModelImpl . ENTITY_CACHE_ENABLED , CommerceShippingFixedOptionRelImpl . class , primaryKey ) ; if ( serializable == nullModel ) { return null ; } CommerceShippingFixedOptionRel commerceShippingFixedOptionRel = ( CommerceShippingFixedOpt...
public class FDBigInteger { /** * @ requires p5 > = 0 & & p2 > = 0; * @ assignable \ nothing ; * @ ensures \ result . value ( ) = = \ old ( UNSIGNED ( value ) * pow52 ( p5 , p2 ) ) ; */ public static FDBigInteger valueOfMulPow52 ( long value , int p5 , int p2 ) { } }
assert p5 >= 0 : p5 ; assert p2 >= 0 : p2 ; int v0 = ( int ) value ; int v1 = ( int ) ( value >>> 32 ) ; int wordcount = p2 >> 5 ; int bitcount = p2 & 0x1f ; if ( p5 != 0 ) { if ( p5 < SMALL_5_POW . length ) { long pow5 = SMALL_5_POW [ p5 ] & LONG_MASK ; long carry = ( v0 & LONG_MASK ) * pow5 ; v0 = ( int ) carry ; car...
public class API { /** * Gets ( and registers ) a new callback URL for the given implementor and site . * @ param impl the implementor that will handle the callback . * @ param site the site that will call the callback . * @ return the callback URL . * @ since 2.0.0 * @ see # removeCallBackUrl ( String ) * ...
String url = site + CALL_BACK_URL + random . nextLong ( ) ; this . callBacks . put ( url , impl ) ; logger . debug ( "Callback " + url + " registered for " + impl . getClass ( ) . getCanonicalName ( ) ) ; return url ;
public class PrioritySerialTaskScheduler { /** * Gets the bookkeeping information for a job . If the specified job has * not been seen , a new < code > JobInfo < / code > is created for it . * @ param jobId The < code > UUID < / code > of the job for which to obtain the * corresponding < code > JobInfo < / code >...
JobInfo job = jobs . get ( jobId ) ; if ( job == null ) { job = new JobInfo ( jobId ) ; jobs . put ( jobId , job ) ; jobQueue . add ( jobId ) ; } return job ;
public class UpdateCustomKeyStoreRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateCustomKeyStoreRequest updateCustomKeyStoreRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateCustomKeyStoreRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateCustomKeyStoreRequest . getCustomKeyStoreId ( ) , CUSTOMKEYSTOREID_BINDING ) ; protocolMarshaller . marshall ( updateCustomKeyStoreRequest . getNewCust...
public class LineDataObjectPositionMigrationImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setTempOrient ( Integer newTempOrient ) { } }
Integer oldTempOrient = tempOrient ; tempOrient = newTempOrient ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . LINE_DATA_OBJECT_POSITION_MIGRATION__TEMP_ORIENT , oldTempOrient , tempOrient ) ) ;
public class Util { /** * Encodes an IPv6 address in canonical form according to RFC 5952. */ private static String inet6AddressToAscii ( byte [ ] address ) { } }
// Go through the address looking for the longest run of 0s . Each group is 2 - bytes . // A run must be longer than one group ( section 4.2.2 ) . // If there are multiple equal runs , the first one must be used ( section 4.2.3 ) . int longestRunOffset = - 1 ; int longestRunLength = 0 ; for ( int i = 0 ; i < address . ...
public class SearchIndexResult { /** * The thing groups that match the search query . * @ param thingGroups * The thing groups that match the search query . */ public void setThingGroups ( java . util . Collection < ThingGroupDocument > thingGroups ) { } }
if ( thingGroups == null ) { this . thingGroups = null ; return ; } this . thingGroups = new java . util . ArrayList < ThingGroupDocument > ( thingGroups ) ;
public class AbstractDirector { /** * Logs a message with an exception . * @ param level the level of the message * @ param msg the message * @ param e the exception causing the message */ void log ( Level level , String msg , Exception e ) { } }
if ( e != null ) logger . log ( level , msg , e ) ;
public class PropertiesUtil { /** * Gets the named property as an integer . * @ param name the name of the property to look up * @ param defaultValue the default value to use if the property is undefined * @ return the parsed integer value of the property or { @ code defaultValue } if it was undefined or could no...
final String prop = getStringProperty ( name ) ; if ( prop != null ) { try { return Integer . parseInt ( prop ) ; } catch ( final Exception ignored ) { return defaultValue ; } } return defaultValue ;
public class BindContentProviderBuilder { /** * Generate get type . * @ param schema * the schema */ private void generateGetType ( SQLiteDatabaseSchema schema ) { } }
MethodSpec . Builder methodBuilder = MethodSpec . methodBuilder ( "getType" ) . addModifiers ( Modifier . PUBLIC ) . addAnnotation ( Override . class ) . returns ( String . class ) ; methodBuilder . addParameter ( Uri . class , "uri" ) ; methodBuilder . beginControlFlow ( "switch (sURIMatcher.match(uri))" ) ; for ( Ent...
public class KeyboardUtils { /** * Hides keypad * @ param context * @ param view View holding keypad control */ public static void hideSoftKeyboard ( Context context , View view ) { } }
InputMethodManager imm = ( InputMethodManager ) context . getSystemService ( Context . INPUT_METHOD_SERVICE ) ; imm . hideSoftInputFromWindow ( view . getWindowToken ( ) , 0 ) ;
public class Vector2i { /** * / * ( non - Javadoc ) * @ see org . joml . Vector2ic # sub ( org . joml . Vector2ic , org . joml . Vector2i ) */ public Vector2i sub ( Vector2ic v , Vector2i dest ) { } }
dest . x = x - v . x ( ) ; dest . y = y - v . y ( ) ; return dest ;
public class FactoryBinding { /** * Matches constructor parameters to method parameters for injection and * records remaining parameters as required keys . */ private String [ ] extractConstructorParameters ( Key < ? > factoryKey , TypeLiteral < ? > implementation , Constructor constructor , List < Key < ? > > method...
// Get parameters with annotations . List < TypeLiteral < ? > > ctorParams = implementation . getParameterTypes ( constructor ) ; Annotation [ ] [ ] ctorParamAnnotations = constructor . getParameterAnnotations ( ) ; int p = 0 ; String [ ] parameterNames = new String [ ctorParams . size ( ) ] ; Set < Key < ? > > keySet ...
public class CmsDomUtil { /** * Returns the first direct child matching the given class name . < p > * @ param element the parent element * @ param className the class name to match * @ return the child element */ public static Element getFirstChildWithClass ( Element element , String className ) { } }
NodeList < Node > children = element . getChildNodes ( ) ; for ( int i = 0 ; i < children . getLength ( ) ; i ++ ) { if ( children . getItem ( i ) . getNodeType ( ) == Node . ELEMENT_NODE ) { Element child = ( Element ) children . getItem ( i ) ; if ( child . hasClassName ( className ) ) { return child ; } } } return n...
public class ReseedingSecureRandom { /** * Creates a pre - configured automatically reseeding SHA1PRNG instance , reseeding itself with 440 bits from the given seeder after generating 2 ^ 30 bytes , * thus satisfying recommendations by < a href = " http : / / dx . doi . org / 10.6028 / NIST . SP . 800-90Ar1 " > NIST ...
try { return new ReseedingSecureRandom ( seeder , SecureRandom . getInstance ( "SHA1PRNG" ) , 1 << 30 , 55 ) ; } catch ( NoSuchAlgorithmException e ) { throw new IllegalStateException ( "SHA1PRNG must exist in every Java platform implementation." , e ) ; }
public class OtpOutputStream { /** * Write the low four bytes of a value to the stream in bif endian order , at * the specified position . If the position specified is beyond the end of * the stream , this method will have no effect . * Normally this method should be used in conjunction with { @ link # size ( ) ...
if ( offset < super . count ) { buf [ offset + 0 ] = ( byte ) ( ( n & 0xff000000 ) >> 24 ) ; buf [ offset + 1 ] = ( byte ) ( ( n & 0xff0000 ) >> 16 ) ; buf [ offset + 2 ] = ( byte ) ( ( n & 0xff00 ) >> 8 ) ; buf [ offset + 3 ] = ( byte ) ( n & 0xff ) ; }
public class RecurrencePickerDialog { /** * TODO Test and update for Right - to - Left */ private void updateIntervalText ( ) { } }
if ( mIntervalResId == - 1 ) { return ; } final String INTERVAL_COUNT_MARKER = "%d" ; String intervalString = mResources . getQuantityString ( mIntervalResId , mModel . interval ) ; int markerStart = intervalString . indexOf ( INTERVAL_COUNT_MARKER ) ; if ( markerStart != - 1 ) { int postTextStart = markerStart + INTER...
public class GetAppReplicationConfigurationRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetAppReplicationConfigurationRequest getAppReplicationConfigurationRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getAppReplicationConfigurationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getAppReplicationConfigurationRequest . getAppId ( ) , APPID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marsha...
public class CSSDataURL { /** * Determine the charset from the passed MIME type . If no charset was found , * return the default charset . * @ param aMimeType * The MIME type to investigate . * @ return Never < code > null < / code > . */ @ Nonnull public static Charset getCharsetFromMimeTypeOrDefault ( @ Nulla...
final Charset ret = MimeTypeHelper . getCharsetFromMimeType ( aMimeType ) ; return ret != null ? ret : CSSDataURLHelper . DEFAULT_CHARSET ;
public class U { /** * Documented , # groupBy */ public static < K , E > Map < K , List < E > > groupBy ( final Iterable < E > iterable , final Function < E , K > func ) { } }
final Map < K , List < E > > retVal = newLinkedHashMap ( ) ; for ( E e : iterable ) { final K key = func . apply ( e ) ; List < E > val ; if ( retVal . containsKey ( key ) ) { val = retVal . get ( key ) ; } else { val = newArrayList ( ) ; } val . add ( e ) ; retVal . put ( key , val ) ; } return retVal ;
public class RuntimeTypeAdapterFactory { /** * Registers { @ code type } identified by its { @ link Class # getSimpleName simple * name } . Labels are case sensitive . * @ throws IllegalArgumentException if either { @ code type } or its simple name * have already been registered on this type adapter . */ public R...
return registerSubtype ( type , type . getSimpleName ( ) ) ;
public class OfferService { /** * Add a block to the pending received / deleted ACKs . * to inform the namenode that we have received a block . */ void notifyNamenodeReceivedBlock ( Block block , String delHint ) { } }
if ( block == null ) { throw new IllegalArgumentException ( "Block is null" ) ; } if ( delHint != null && ! delHint . isEmpty ( ) ) { block = new ReceivedBlockInfo ( block , delHint ) ; } synchronized ( receivedAndDeletedBlockList ) { receivedAndDeletedBlockList . add ( block ) ; pendingReceivedRequests ++ ; if ( ! sho...
public class GuiRenderer { /** * Draws itemStack to the GUI at the specified coordinates with a custom formatted label . < br > * Uses RenderItem . renderItemAndEffectIntoGUI ( ) and RenderItem . renderItemOverlayIntoGUI ( ) * @ param itemStack the item stack * @ param x the x * @ param y the y * @ param labe...
// we want to be able to render itemStack with 0 size , so we can ' t check for isEmpty if ( itemStack == null || itemStack == ItemStack . EMPTY ) return ; float z = itemRenderer . zLevel ; if ( relative && currentComponent != null ) { x += currentComponent . screenPosition ( ) . x ( ) ; y += currentComponent . screenP...
public class CapBasedLoadManager { /** * Determine how many tasks of a given type we want to run on a TaskTracker . * This cap is chosen based on how many tasks of that type are outstanding in * total , so that when the cluster is used below capacity , tasks are spread * out uniformly across the nodes rather than...
double load = maxDiff + ( ( double ) totalRunnableTasks ) / totalSlots ; int cap = ( int ) Math . min ( localMaxTasks , Math . ceil ( load * localMaxTasks ) ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "load:" + load + " maxDiff:" + maxDiff + " totalRunnable:" + totalRunnableTasks + " totalSlots:" + totalSlots +...
public class FactoryProcessor { /** * Lookup { @ link javax . inject . Scope } annotated annotations to provide the name of the scope the { @ code typeElement } belongs to . * The method logs an error if the { @ code typeElement } has multiple scope annotations . * @ param typeElement the element for which a scope ...
String scopeName = null ; for ( AnnotationMirror annotationMirror : typeElement . getAnnotationMirrors ( ) ) { TypeElement annotationTypeElement = ( TypeElement ) annotationMirror . getAnnotationType ( ) . asElement ( ) ; if ( annotationTypeElement . getAnnotation ( Scope . class ) != null ) { checkScopeAnnotationValid...
public class MainActivity { /** * flow for subscription . */ public void onInfiniteGasButtonClicked ( View arg0 ) { } }
if ( setupDone == null ) { complain ( "Billing Setup is not completed yet" ) ; return ; } if ( ! setupDone ) { complain ( "Billing Setup failed" ) ; return ; } if ( ! mHelper . subscriptionsSupported ( ) ) { complain ( "Subscriptions not supported on your device yet. Sorry!" ) ; return ; } /* TODO : for security , gene...
public class Utils { /** * Write a String as a VInt n , followed by n Bytes as in Text format . * @ param out * @ param s * @ throws IOException */ public static void writeString ( DataOutput out , String s ) throws IOException { } }
if ( s != null ) { Text text = new Text ( s ) ; byte [ ] buffer = text . getBytes ( ) ; int len = text . getLength ( ) ; writeVInt ( out , len ) ; out . write ( buffer , 0 , len ) ; } else { writeVInt ( out , - 1 ) ; }
public class TimerWaitActivity { /** * The resume method for this class is handling internal functions related to * events processing in addition to timer expiration , so it is not supposed to be overriden . The method * is therefore declared as final . To customize handling of events , please override * the meth...
if ( isOtherEvent ( event ) ) { String messageString = this . getMessageFromEventMessage ( event ) ; this . setReturnCode ( event . getCompletionCode ( ) ) ; processOtherMessage ( messageString ) ; handleEventCompletionCode ( ) ; return true ; } else { // timer expires int moreToWaitInSeconds = processTimerExpiration (...
public class ListAssociationsRequest { /** * One or more filters . Use a filter to return a more specific list of results . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setAssociationFilterList ( java . util . Collection ) } or * { @ link # withAssociati...
if ( this . associationFilterList == null ) { setAssociationFilterList ( new com . amazonaws . internal . SdkInternalList < AssociationFilter > ( associationFilterList . length ) ) ; } for ( AssociationFilter ele : associationFilterList ) { this . associationFilterList . add ( ele ) ; } return this ;
public class WebhooksInner { /** * Generates a Uri for use in creating a webhook . * @ param resourceGroupName Name of an Azure Resource group . * @ param automationAccountName The name of the automation account . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * ...
return ServiceFuture . fromResponse ( generateUriWithServiceResponseAsync ( resourceGroupName , automationAccountName ) , serviceCallback ) ;
public class CmsSiteManagerImpl { /** * Returns the workplace server . < p > * @ return the workplace server */ public String getWorkplaceServer ( ) { } }
return m_workplaceServers . keySet ( ) . isEmpty ( ) ? null : m_workplaceServers . keySet ( ) . iterator ( ) . next ( ) ;
public class RolloutPlanCompleter { /** * / * ( non - Javadoc ) * @ see org . jboss . as . cli . CommandLineCompleter # complete ( org . jboss . as . cli . CommandContext , java . lang . String , int , java . util . List ) */ @ Override public int complete ( CommandContext ctx , String buffer , int cursor , List < St...
if ( ! ctx . isDomainMode ( ) ) { return - 1 ; } if ( buffer . isEmpty ( ) ) { candidates . add ( "{rollout" ) ; return 0 ; } try { parsedOp . parseOperation ( null , buffer , ctx ) ; } catch ( CommandFormatException e ) { return - 1 ; } if ( parsedOp . isRequestComplete ( ) ) { return - 1 ; } if ( parsedOp . endsOnHea...
public class CertificateUtil { /** * JGLOBUS - 91 */ public static CertPath getCertPath ( X509Certificate [ ] certs ) throws CertificateException { } }
CertificateFactory factory = CertificateFactory . getInstance ( "X.509" ) ; return factory . generateCertPath ( Arrays . asList ( certs ) ) ;
public class BootstrapConnector { /** * Disconnects from an OOo server using the connection string from the * previous connect . * If there has been no previous connect , the disconnects does nothing . * If there has been a previous connect , disconnect tries to terminate * the OOo server and kills the OOo serv...
if ( oooConnectionString == null ) return ; // call office to terminate itself try { // get local context XComponentContext xLocalContext = getLocalContext ( ) ; // create a URL resolver XUnoUrlResolver xUrlResolver = UnoUrlResolver . create ( xLocalContext ) ; // get remote context XComponentContext xRemoteContext = g...
public class MpxjQuery { /** * This method displays the resource assignments for each task . This time * rather than just iterating through the list of all assignments in * the file , we extract the assignments on a task - by - task basis . * @ param file MPX file */ private static void listAssignmentsByTask ( Pr...
for ( Task task : file . getTasks ( ) ) { System . out . println ( "Assignments for task " + task . getName ( ) + ":" ) ; for ( ResourceAssignment assignment : task . getResourceAssignments ( ) ) { Resource resource = assignment . getResource ( ) ; String resourceName ; if ( resource == null ) { resourceName = "(null r...
public class NestedClassWriterImpl { /** * { @ inheritDoc } */ protected Content getDeprecatedLink ( ProgramElementDoc member ) { } }
return writer . getQualifiedClassLink ( LinkInfoImpl . Kind . MEMBER , ( ClassDoc ) member ) ;
public class BurlapSkeleton { /** * Invoke the object with the request from the input stream . * @ param in the Burlap input stream * @ param out the Burlap output stream */ public void invoke ( BurlapInput in , BurlapOutput out ) throws Exception { } }
invoke ( _service , in , out ) ;
public class OpenWatcomCompiler { /** * Get define switch . * @ param buffer * StringBuffer buffer * @ param define * String preprocessor macro * @ param value * String value , may be null . */ @ Override protected final void getDefineSwitch ( final StringBuffer buffer , final String define , final String v...
OpenWatcomProcessor . getDefineSwitch ( buffer , define , value ) ;
public class SibRaConnection { /** * Returns the current container transaction , if any . * @ return the current container transaction * @ throws SIResourceException * if lazy association or lazy enlistment fails */ private SITransaction getContainerTransaction ( ) throws SIResourceException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "getContainerTransaction" ) ; } final SITransaction containerTransaction ; try { // Ensure the connection is associate with a managed connection final SibRaManagedConnection managedConnection = getAssociatedMa...
public class AttributeEditorUtil { /** * creates a single EditorField for the given attribute */ public static AbstractField < ? > createEditorField ( String id , IModel < String > model , final AttributeDefinition attribute , boolean editable ) { } }
if ( attribute . isBoolean ( ) ) { return new CheckboxField ( id , model , attribute , new BooleanFieldValidator ( attribute ) ) ; } StringFieldValidator validator = new StringFieldValidator ( attribute ) ; if ( ! attribute . getOptions ( ) . isEmpty ( ) ) { return new DropdownField ( id , model , attribute , validator...
public class NumberUtils { /** * Returns whether the first { @ link BigInteger } is bigger than or equal * to the second . * @ param big1 The first { @ link BigInteger } to compare . * @ param big2 The second { @ link BigInteger } to compare . * @ return < code > true < / code > if the first { @ link BigInteger...
final int compared = big1 . compareTo ( big2 ) ; if ( compared >= 0 ) { return true ; } return false ;
public class NonBlockingBufferedOutputStream { /** * Writes the specified byte to this buffered output stream . * @ param b * the byte to be written . * @ exception IOException * if an I / O error occurs . */ @ Override public void write ( final int b ) throws IOException { } }
if ( m_nCount >= m_aBuf . length ) _flushBuffer ( ) ; m_aBuf [ m_nCount ++ ] = ( byte ) b ;
public class RetryableResource { /** * Recovers an exchange using the { @ code channelSupplier } . */ void recoverExchange ( String exchangeName , ResourceDeclaration exchangeDeclaration ) throws Exception { } }
try { log . info ( "Recovering exchange {} via {}" , exchangeName , this ) ; exchangeDeclaration . invoke ( getRecoveryChannel ( ) ) ; } catch ( Exception e ) { log . error ( "Failed to recover exchange {} via {}" , exchangeName , this , e ) ; if ( throwOnRecoveryFailure ( ) || Exceptions . isCausedByConnectionClosure ...
public class ExampleTemplateMatching { /** * Demonstrates how to search for matches of a template inside an image * @ param image Image being searched * @ param template Template being looked for * @ param mask Mask which determines the weight of each template pixel in the match score * @ param expectedMatches ...
// create template matcher . TemplateMatching < GrayF32 > matcher = FactoryTemplateMatching . createMatcher ( TemplateScoreType . SUM_DIFF_SQ , GrayF32 . class ) ; // Find the points which match the template the best matcher . setImage ( image ) ; matcher . setTemplate ( template , mask , expectedMatches ) ; matcher . ...
public class ByteRangeRandomizer { /** * Create a new { @ link ByteRangeRandomizer } . * @ param min min value * @ param max max value * @ param seed initial seed * @ return a new { @ link ByteRangeRandomizer } . */ public static ByteRangeRandomizer aNewByteRangeRandomizer ( final Byte min , final Byte max , fi...
return new ByteRangeRandomizer ( min , max , seed ) ;
public class DenseVectorSupportMethods { /** * WARNING : only returns the right answer for vectors of length < MAX _ SMALL _ DOT _ PRODUCT _ LENGTH * @ param a * @ param b * @ param length * @ return */ public static float smallDotProduct_Float ( float [ ] a , float [ ] b , int length ) { } }
float sumA = 0.0f ; float sumB = 0.0f ; switch ( length ) { case 7 : sumA = a [ 6 ] * b [ 6 ] ; case 6 : sumB = a [ 5 ] * b [ 5 ] ; case 5 : sumA += a [ 4 ] * b [ 4 ] ; case 4 : sumB += a [ 3 ] * b [ 3 ] ; case 3 : sumA += a [ 2 ] * b [ 2 ] ; case 2 : sumB += a [ 1 ] * b [ 1 ] ; case 1 : sumA += a [ 0 ] * b [ 0 ] ; cas...
public class DataTableTools { /** * Inserts a flat list as a tree in a TableCollectionManager . It does * insert data in the right order for the creation of the tree ( parents * must be inserted first ) * @ param list * @ param mng * @ param parentIdGetter */ public static < T extends IHasIntegerId > void ins...
HashSet < Integer > inserted = new HashSet < > ( ) ; List < T > toInsert = new ArrayList < > ( list ) ; List < T > postPoned = new ArrayList < > ( ) ; List < T > inOrder = new ArrayList < > ( ) ; int nbInserted ; while ( ! toInsert . isEmpty ( ) ) { nbInserted = 0 ; while ( ! toInsert . isEmpty ( ) ) { T a = toInsert ....
public class HttpClientNIOResourceAdaptor { /** * ( non - Javadoc ) * @ see * javax . slee . resource . ResourceAdaptor # getActivityHandle ( java . lang . Object ) */ public ActivityHandle getActivityHandle ( Object arg0 ) { } }
if ( arg0 instanceof HttpClientNIORequestActivityImpl ) { HttpClientNIORequestActivityHandle handle = new HttpClientNIORequestActivityHandle ( ( ( HttpClientNIORequestActivityImpl ) arg0 ) . getId ( ) ) ; if ( activities . containsKey ( handle ) ) { return handle ; } } return null ;
public class RequestParam { /** * Returns a request parameter as enum value . * @ param < T > Enum type * @ param request Request . * @ param param Parameter name . * @ param enumClass Enum class * @ return Parameter value or null if it is not set or an invalid enum value . */ public static < T extends Enum >...
return getEnum ( request , param , enumClass , null ) ;
public class ReportMaker { /** * Make an html bootstrap tag with our custom css class . */ static void tag ( StringBuilder sb , String color , String text ) { } }
sb . append ( "<span class='label label" ) ; if ( color != null ) { sb . append ( "-" ) . append ( color ) ; } String classText = text . replace ( ' ' , '_' ) ; sb . append ( " l-" ) . append ( classText ) . append ( "'>" ) . append ( text ) . append ( "</span>" ) ;
public class FileUtil { /** * Gets the extension part of the specified file name . * @ param fileName The name of the file to get the extension of . * @ return The extension of the file name . */ public static String getExtension ( String fileName ) { } }
int pos = fileName . lastIndexOf ( '.' ) ; if ( pos < 0 ) { return "" ; } return fileName . substring ( pos + 1 ) ;
public class TextBlock { /** * Creates a canvas image large enough to accommodate this text block and renders the lines into * it . The image will include padding around the edge to ensure that antialiasing has a bit of * extra space to do its work . */ public Canvas toCanvas ( Graphics gfx , Align align , int fill...
float pad = 1 / gfx . scale ( ) . factor ; Canvas canvas = gfx . createCanvas ( bounds . width ( ) + 2 * pad , bounds . height ( ) + 2 * pad ) ; canvas . setFillColor ( fillColor ) ; fill ( canvas , align , pad , pad ) ; return canvas ;
public class TelescopeFileProvider { /** * Calls { @ link # getUriForFile ( Context , String , File ) } using the correct authority for Telescope * screenshots . */ public static Uri getUriForFile ( Context context , File file ) { } }
return getUriForFile ( context , context . getPackageName ( ) + ".telescope.fileprovider" , file ) ;
public class MemoryRemoteTable { /** * Update the current record . * @ param The data to update . * @ exception Exception File exception . */ public void set ( Object data , int iOpenMode ) throws DBException , RemoteException { } }
if ( m_objCurrentKey == null ) throw new DBException ( Constants . INVALID_RECORD ) ; Object key = this . getKey ( data ) ; if ( ! key . equals ( m_objCurrentKey ) ) m_mDataMap . remove ( key ) ; m_mDataMap . put ( key , data ) ; // Replace the data at this position m_objCurrentKey = null ;
public class MigrationResource { /** * < p > migrateView . < / p > * @ param uuid a { @ link java . lang . String } object . * @ return a { @ link javax . ws . rs . core . Response } object . */ @ GET @ Path ( "{uuid}" ) // uuid or dbName public Response migrateView ( @ PathParam ( "uuid" ) String uuid ) { } }
try { MigrationFeature . checkMigrationId ( uuid ) ; } catch ( NotFoundException e ) { Flyway flyway = locator . getService ( Flyway . class , uuid ) ; if ( flyway == null ) throw new NotFoundException ( ) ; return Response . ok ( flyway . info ( ) . all ( ) ) . build ( ) ; } Map < String , Migration > migrations = get...
public class JwtEndpointServices { /** * End OSGi - related fields and methods */ protected void handleEndpointRequest ( HttpServletRequest request , HttpServletResponse response , ServletContext servletContext ) throws IOException { } }
JwtRequest jwtRequest = getJwtRequest ( request , response ) ; if ( jwtRequest == null ) { // Error redirect already taken care of return ; } String jwtConfigId = jwtRequest . getJwtConfigId ( ) ; JwtConfig jwtConfig = getJwtConfig ( response , jwtConfigId ) ; if ( jwtConfig == null ) { // Error redirect already taken ...
public class RestClient { /** * Utility method to get the charset from a url connection ' s content type * @ return The charset name */ public static String getCharset ( final String contentType ) { } }
// Default to UTF - 8 String charset = "UTF-8" ; try { // Content type is in the form : // Content - Type : text / html ; charset = utf - 8 // Where they can be lots of params separated by ; characters if ( contentType != null && ! contentType . isEmpty ( ) ) { if ( contentType . contains ( ";" ) ) { String [ ] params ...
public class RolloutStatusCache { /** * Retrieves cached list of { @ link TotalTargetCountActionStatus } of * { @ link Rollout } s . * @ param rolloutId * to retrieve cache entries for * @ return map of cached entries */ public List < TotalTargetCountActionStatus > getRolloutStatus ( final Long rolloutId ) { } ...
final Cache cache = cacheManager . getCache ( CACHE_RO_NAME ) ; return retrieveFromCache ( rolloutId , cache ) ;
public class Inflater { /** * Uncompresses bytes into specified buffer . Returns actual number * of bytes uncompressed . A return value of 0 indicates that * needsInput ( ) or needsDictionary ( ) should be called in order to * determine if more input data or a preset dictionary is required . * In the latter cas...
if ( b == null ) { throw new NullPointerException ( ) ; } if ( off < 0 || len < 0 || off > b . length - len ) { throw new ArrayIndexOutOfBoundsException ( ) ; } synchronized ( zsRef ) { ensureOpen ( ) ; int thisLen = this . len ; int n = inflateBytes ( zsRef . address ( ) , b , off , len ) ; bytesWritten += n ; bytesRe...
public class CoroutineWriter { /** * Deconstructs a { @ link CoroutineRunner } object to a serializable state . * @ param runner coroutine runner to deconstruct * @ return deconstructed representation of { @ link CoroutineRunner } * @ throws NullPointerException if any argument is { @ code null } * @ throws Ill...
if ( runner == null ) { throw new NullPointerException ( ) ; } Coroutine coroutine = runner . getCoroutine ( ) ; Continuation cn = runner . getContinuation ( ) ; int size = cn . getSize ( ) ; VersionedFrame [ ] frames = new VersionedFrame [ size ] ; MethodState currentMethodState = cn . getSaved ( 0 ) ; int idx = 0 ; w...
public class CSVUtil { /** * Imports the data from CSV to database . * @ param file * @ param offset * @ param count * @ param skipTitle * @ param filter * @ param stmt the column order in the sql must be consistent with the column order in the CSV file . * @ param batchSize * @ param batchInterval * ...
Reader reader = null ; try { reader = new FileReader ( file ) ; return importCSV ( reader , offset , count , skipTitle , filter , stmt , batchSize , batchInterval , columnTypeList ) ; } catch ( IOException e ) { throw new UncheckedIOException ( e ) ; } finally { IOUtil . close ( reader ) ; }
public class Database { public void put_device_attribute_property ( String devname , DbAttribute [ ] attr ) throws DevFailed { } }
databaseDAO . put_device_attribute_property ( this , devname , attr ) ;
public class GrouperEntityGroupStoreFactory { /** * returns the instance of GrouperEntityGroupStore . * @ return The instance . * @ throws GroupsException if there is an error * @ see IEntityGroupStoreFactory # newGroupStore ( ) */ public static synchronized IEntityGroupStore getGroupStore ( ) { } }
if ( groupStore == null ) { groupStore = new GrouperEntityGroupStore ( ) ; } if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "returning IEntityGroupStore: " + groupStore ) ; } return groupStore ;
public class TiffReader { /** * Parses a Tiff File and create an internal model representation . * @ param filename the Tiff filename * @ return Error code ( 0 : successful , - 1 : file not found , - 2 : IO exception ) */ public int readFile ( String filename , boolean validate ) { } }
int result = 0 ; try { if ( Files . exists ( Paths . get ( filename ) ) ) { data = new TiffInputStream ( new File ( filename ) ) ; tiffModel = new TiffDocument ( ) ; validation = new ValidationResult ( validate ) ; tiffModel . setSize ( data . size ( ) ) ; boolean correctHeader = readHeader ( ) ; if ( correctHeader ) {...
import java . util . * ; class SwitchPositions { /** * This method switches the position of every nth value with ( n + 1 ) th value in a given list . * Examples : * switchPositions ( Arrays . asList ( 0 , 1 , 2 , 3 , 4 , 5 ) ) - > [ 1 , 0 , 3 , 2 , 5 , 4] * switchPositions ( Arrays . asList ( 5 , 6 , 7 , 8 , 9 , ...
for ( int i = 0 ; i < elems . size ( ) - 1 ; i += 2 ) { int temp = elems . get ( i ) ; elems . set ( i , elems . get ( i + 1 ) ) ; elems . set ( i + 1 , temp ) ; } return elems ;
public class RequestDesc { /** * calculate the unique key of that request */ private String _getUniqueKey ( ) { } }
StringBuilder b = new StringBuilder ( ) ; b . append ( service ) ; b . append ( "#" ) ; b . append ( method ) ; if ( params != null ) { b . append ( "#" ) ; b . append ( params . toString ( ) ) ; } return b . toString ( ) ;
public class RandomUtils { /** * 获取随机颜色 * @ param opacity 不透明度 * @ return { @ link SimpleColor } */ public static SimpleColor getRandomColor ( double opacity ) { } }
Random ran = new Random ( ) ; int b = ran . nextInt ( 255 ) ; int r = 255 - b ; return new SimpleColor ( b + ran . nextInt ( r ) , b + ran . nextInt ( r ) , b + ran . nextInt ( r ) , opacity ) ;
public class PropPatchResponseEntity { /** * Removes the property . * @ param node node * @ param property property * @ return status */ private String removeProperty ( Node node , HierarchicalProperty property ) { } }
try { node . getProperty ( property . getStringName ( ) ) . remove ( ) ; node . save ( ) ; return WebDavConst . getStatusDescription ( HTTPStatus . OK ) ; } catch ( AccessDeniedException e ) { return WebDavConst . getStatusDescription ( HTTPStatus . FORBIDDEN ) ; } catch ( ItemNotFoundException e ) { return WebDavConst...
public class ColumnBlob { /** * Writes the blob column to the journal . Large blobs are written to the * page store and the reference is written to the journal . */ @ Override void writeJournal ( OutputStream os , byte [ ] buffer , int offset , BlobOutputStream blob ) throws IOException { } }
if ( blob == null ) { BitsUtil . writeInt16 ( os , 0 ) ; return ; } if ( blob . isLargeBlob ( ) ) { blob . flushBlob ( ) ; BitsUtil . writeInt16 ( os , LARGE_BLOB_MASK | 4 ) ; BitsUtil . writeInt ( os , blob . getBlobId ( ) ) ; return ; } int len = blob . getSize ( ) ; if ( len >= 32 * 1024 ) { throw new IllegalStateEx...
public class JsonWriter { /** * Inserts any necessary separators and whitespace before a literal value , * inline array , or inline object . Also adjusts the stack to expect either a * closing bracket or another element . * @ param root true if the value is a new array or object , the two values * permitted as ...
switch ( peek ( ) ) { case EMPTY_DOCUMENT : // first in document if ( ! lenient && ! root ) { throw new IllegalStateException ( "JSON must start with an array or an object." ) ; } replaceTop ( JsonScope . NONEMPTY_DOCUMENT ) ; break ; case EMPTY_ARRAY : // first in array replaceTop ( JsonScope . NONEMPTY_ARRAY ) ; newl...
public class PackratParser { /** * This class reads all hidden and ignored tokens from the text and puts them * into the node as children . * This is the recursive part of the procedure . * Attention : This method is package private for testing purposes ! * @ param node * @ param position * @ return * @ t...
MemoEntry progress = MemoEntry . success ( 0 , 0 , node ) ; MemoEntry newProgress = MemoEntry . success ( 0 , 0 , null ) ; do { for ( TokenDefinition tokenDefinition : hiddenAndIgnoredTokens ) { newProgress = processTokenDefinition ( node , tokenDefinition , position + progress . getDeltaPosition ( ) , line + progress ...
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public FontDescriptorSpecificationFtDsFlags createFontDescriptorSpecificationFtDsFlagsFromString ( EDataType eDataType , String initialValue ) { } }
FontDescriptorSpecificationFtDsFlags result = FontDescriptorSpecificationFtDsFlags . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class PRAcroForm { /** * Given the title ( / T ) of a reference , return the associated reference * @ param name a string containing the path * @ return a reference to the field , or null */ public PRIndirectReference getRefByName ( String name ) { } }
FieldInformation fi = ( FieldInformation ) fieldByName . get ( name ) ; if ( fi == null ) return null ; return fi . getRef ( ) ;
public class ChartConfiguration { /** * Sets the label x . * @ param label * the new label x * @ return ChartConfiguration */ public ChartConfiguration < T > setLabelX ( String label ) { } }
if ( label != null ) { axesInstance ( ) . xAxisInstance ( ) . setLabel ( label ) ; } return this ;
public class Arguments { /** * Sets an argument to the collection of arguments . This guarantees only one value will be assigned to the * argument key . * @ param argument the argument to add */ public void set ( final Argument argument ) { } }
if ( argument != null ) { map . put ( argument . getKey ( ) , Collections . singleton ( argument ) ) ; }
public class ThreeDHashMap { /** * Fetch the outermost Hashmap as a TwoDHashMap . * @ param firstKey * first key * @ return the the innermost hashmap */ public TwoDHashMap < K2 , K3 , V > getAs2d ( final K1 firstKey ) { } }
final HashMap < K2 , HashMap < K3 , V > > innerMap1 = map . get ( firstKey ) ; if ( innerMap1 != null ) { return new TwoDHashMap < K2 , K3 , V > ( innerMap1 ) ; } else { return new TwoDHashMap < K2 , K3 , V > ( ) ; }
public class ParadataManager { /** * Return all submissions using the specified verb from the specified submitter for the resource * @ param submitter * @ param resourceUrl * @ return * @ throws Exception */ public List < ISubmission > getSubmissionsForSubmitter ( ISubmitter submitter , String resourceUrl , Str...
return new SubmitterSubmissionsFilter ( ) . include ( new NormalizingFilter ( IRating . VERB ) . filter ( getSubmissions ( resourceUrl ) ) , submitter ) ;
public class HTODDependencyTable { /** * This removes the specified entry from the specified dependency . * @ param dependency The dependency . * @ param result */ public Result removeEntry ( Object dependency , Object entry ) { } }
Result result = this . htod . getFromResultPool ( ) ; ValueSet valueSet = ( ValueSet ) dependencyToEntryTable . get ( dependency ) ; if ( valueSet == null ) { return result ; } result . bExist = HTODDynacache . EXIST ; valueSet . remove ( entry ) ; dependencyNotUpdatedTable . remove ( dependency ) ; if ( valueSet . isE...
public class ItemsAuxiliary { /** * Assuming that there are n items in the true stream , this asks what * item would appear in position 0 & le ; pos & lt ; n of a hypothetical sorted * version of that stream . * < p > Note that since that since the true stream is unavailable , * we don ' t actually answer the q...
assert 0 <= pos ; assert pos < auxN_ ; final int index = QuantilesHelper . chunkContainingPos ( auxCumWtsArr_ , pos ) ; return ( T ) this . auxSamplesArr_ [ index ] ;
public class BlockPlacementPolicy { /** * Get an instance of the configured Block Placement Policy based on the * value of the configuration paramater dfs . block . replicator . classname . * @ param conf the configuration to be used * @ param stats an object thatis used to retrieve the load on the cluster * @ ...
Class < ? extends BlockPlacementPolicy > replicatorClass = conf . getClass ( "dfs.block.replicator.classname" , BlockPlacementPolicyDefault . class , BlockPlacementPolicy . class ) ; BlockPlacementPolicy replicator = ( BlockPlacementPolicy ) ReflectionUtils . newInstance ( replicatorClass , conf ) ; replicator . initia...
public class RemoteHttpServiceImpl { /** * { @ inheritDoc } */ public String buildGetRequest ( String remoteHost , OperationType operationType , LinkedHashMap < String , String > arguments ) { } }
String moduleName = operationType . getModuleName ( ) ; String operationName = operationType . getOperationName ( ) ; String urlGet = new StringBuffer ( "http://" ) . append ( remoteHost ) . append ( ":" ) . append ( Constants . DAVIDBOX_PORT ) . append ( "/" ) . append ( moduleName ) . append ( "?arg0=" ) . append ( o...
public class ProcessCommonJSModules { /** * UMD modules are often wrapped in an IIFE for cases where they are used as scripts instead of * modules . Remove the wrapper . * @ return Whether an IIFE wrapper was found and removed . */ private boolean removeIIFEWrapper ( Node root ) { } }
checkState ( root . isScript ( ) ) ; Node n = root . getFirstChild ( ) ; // Sometimes scripts start with a semicolon for easy concatenation . // Skip any empty statements from those while ( n != null && n . isEmpty ( ) ) { n = n . getNext ( ) ; } // An IIFE wrapper must be the only non - empty statement in the script ,...
public class Task { /** * Construct a task from { @ code Properties } . This method is used on the * receiving side . That is , it is used to construct a { @ code Task } from an * HttpRequest sent from the App Engine task queue . { @ code properties } must * contain a property named { @ link # TASK _ TYPE _ PARAM...
String taskTypeString = properties . getProperty ( TASK_TYPE_PARAMETER ) ; if ( null == taskTypeString ) { throw new IllegalArgumentException ( TASK_TYPE_PARAMETER + " property is missing: " + properties . toString ( ) ) ; } Type type = Type . valueOf ( taskTypeString ) ; return type . createInstance ( taskName , prope...
public class HelperBase { /** * First character to lower case . */ public String toFirstLower ( String name ) { } }
if ( name . length ( ) == 0 ) { return name ; } else { return name . substring ( 0 , 1 ) . toLowerCase ( ) + name . substring ( 1 ) ; }
public class ACpuClassDefinitionAssistantInterpreter { /** * Will redeploy the object and all object transitive referenced by this to the supplied cpu . Redeploy means that * the transitive reference to and from our creator is no longer needed , and will be removed . This only applies to * this object , as it is on...
updateCPUandChildCPUs ( obj , cpu ) ; // if we are moving to a new CPU , we are no longer a part of the transitive // references from our creator , so let us remove ourself . This will prevent // us from being updated if our creator is migrating in the // future . obj . removeCreator ( ) ;
public class CryptoHash { /** * Calculate a SHA - 1 hash code . * @ param data the byte array to be hashed * @ return the hash code as an array of 5 int ' s */ private static int [ ] calculate ( byte [ ] data ) { } }
int A = 0x67452301 ; int B = 0xEFCDAB89 ; int C = 0x98BADCFE ; int D = 0x10325476 ; int E = 0xC3D2E1F0 ; int [ ] W = new int [ 80 ] ; // working buffer int len = data . length ; int off = 0 ; int X , i , n = len / 4 ; boolean done = false ; boolean padded = false ; while ( ! done ) { // Fill W array for ( i = 0 ; ( i <...
public class Calendar { /** * Sets the time zone with the given time zone value . * @ param value the given time zone . */ public void setTimeZone ( TimeZone value ) { } }
zone = value ; sharedZone = false ; /* Recompute the fields from the time using the new zone . This also * works if isTimeSet is false ( after a call to set ( ) ) . In that case * the time will be computed from the fields using the new zone , then * the fields will get recomputed from that . Consider the sequence...
public class ManagedLinkedList { /** * Returns an array of non null elements from the source array . * @ param tArray the source array * @ return the array */ public T [ ] toArray ( T [ ] tArray ) { } }
List < T > array = new ArrayList < T > ( 100 ) ; for ( Iterator < T > it = iterator ( ) ; it . hasNext ( ) ; ) { T val = it . next ( ) ; if ( val != null ) array . add ( val ) ; } return array . toArray ( tArray ) ;
public class PortletAppTypeImpl { /** * Returns all < code > event - definition < / code > elements * @ return list of < code > event - definition < / code > */ public List < EventDefinitionType < PortletAppType < T > > > getAllEventDefinition ( ) { } }
List < EventDefinitionType < PortletAppType < T > > > list = new ArrayList < EventDefinitionType < PortletAppType < T > > > ( ) ; List < Node > nodeList = childNode . get ( "event-definition" ) ; for ( Node node : nodeList ) { EventDefinitionType < PortletAppType < T > > type = new EventDefinitionTypeImpl < PortletAppT...
public class RequiredRuleNameComputer { /** * Returns true if the given candidate is a group that is filtered due to rule parameters in the current call graph . */ protected boolean isFiltered ( AbstractElement canddiate , Param param ) { } }
if ( canddiate instanceof Group ) { Group group = ( Group ) canddiate ; if ( group . getGuardCondition ( ) != null ) { Set < Parameter > context = param . getAssignedParametes ( ) ; ConditionEvaluator evaluator = new ConditionEvaluator ( context ) ; if ( ! evaluator . evaluate ( group . getGuardCondition ( ) ) ) { retu...
public class StreamEx { /** * Returns a new { @ code StreamEx } which is a concatenation of supplied value * and this stream . * This is a < a href = " package - summary . html # StreamOps " > quasi - intermediate * operation < / a > with < a href = " package - summary . html # TSO " > tail - stream * optimizat...
return new StreamEx < > ( new PrependSpliterator < > ( spliterator ( ) , value ) , context ) ;
public class NodeUtil { /** * Custom update new QName node with source info from another node . * < p > This is very similar to { @ link Node # useSourceInfoIfMissingFromForTree ( Node ) } , but it avoids * overwriting the length field of the nodes . * TODO ( bradfordcsmith ) : Eliminate the need for this custom ...
if ( newQName . getStaticSourceFile ( ) == null ) { newQName . setStaticSourceFileFrom ( basisNode ) ; newQName . setSourceEncodedPosition ( basisNode . getSourcePosition ( ) ) ; } if ( newQName . getOriginalName ( ) == null ) { newQName . putProp ( Node . ORIGINALNAME_PROP , basisNode . getOriginalName ( ) ) ; } for (...
public class ArtistActivity { /** * Used to display crouton toast . * @ param message text to be displayed . */ private void toast ( @ StringRes int message ) { } }
if ( mCrouton != null ) { mCrouton . cancel ( ) ; mCrouton = null ; } mCroutonView = new CroutonView ( this , getString ( message ) ) ; mCrouton = Crouton . make ( this , mCroutonView , R . id . activity_artist_main_container ) ; mCrouton . show ( ) ;
public class MetaDescriptor { /** * Tries to load the first " Implementation - Version " manifest entry it can find in the given * classloader . * @ param classLoader The classloader to load manifests from * @ return a version string * @ throws IOException */ private static String loadVersion ( ClassLoader clas...
try { Enumeration < URL > resources = classLoader . getResources ( "META-INF/MANIFEST.MF" ) ; while ( resources . hasMoreElements ( ) ) { final URL url = resources . nextElement ( ) ; final Manifest manifest = new Manifest ( url . openStream ( ) ) ; final Attributes mainAttributes = manifest . getMainAttributes ( ) ; f...
public class Ladder { /** * Encodes and adds the AMO constraint to the given solver . * @ param s the solver * @ param lits the literals for the constraint */ public void encode ( final MiniSatStyleSolver s , final LNGIntVector lits ) { } }
assert lits . size ( ) != 0 ; if ( lits . size ( ) == 1 ) addUnitClause ( s , lits . get ( 0 ) ) ; else { final LNGIntVector seqAuxiliary = new LNGIntVector ( ) ; for ( int i = 0 ; i < lits . size ( ) - 1 ; i ++ ) { seqAuxiliary . push ( mkLit ( s . nVars ( ) , false ) ) ; MaxSAT . newSATVariable ( s ) ; } for ( int i ...
public class PlaceManager { /** * Called by the place registry after creating this place manager . */ public void init ( PlaceRegistry registry , InvocationManager invmgr , RootDObjectManager omgr , BodyLocator locator , PlaceConfig config ) { } }
_registry = registry ; _invmgr = invmgr ; _omgr = omgr ; _locator = locator ; _config = config ; // initialize our delegates applyToDelegates ( new DelegateOp ( PlaceManagerDelegate . class ) { @ Override public void apply ( PlaceManagerDelegate delegate ) { delegate . init ( PlaceManager . this , _omgr , _invmgr ) ; }...
public class MnoHttpClient { /** * Perform a request to the remote endpoint * @ param < V > * @ param url * the remote endpoint to contact * @ param method * such as ' GET ' , ' PUT ' , ' POST ' or ' DELETE ' * @ param header * values * @ param payload * data to send * @ return response body * @ t...
// Prepare header if ( header == null ) { header = new HashMap < String , String > ( ) ; } // Set method header . put ( "method" , method . toUpperCase ( ) ) ; // Set ' User - Agent ' if ( header . get ( "User-Agent" ) == null || header . get ( "User-Agent" ) . isEmpty ( ) ) { header . put ( "User-Agent" , defaultUserA...