signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class QuickSort { /** * Sort the elements in the specified List according to the reverse ordering imposed by the * specified Comparator . */ public static < T > void rsort ( List < T > a , Comparator < ? super T > comp ) { } }
sort ( a , Collections . reverseOrder ( comp ) ) ;
public class DevicesInner { /** * Updates the security settings on a data box edge / gateway device . * @ param deviceName The device name . * @ param resourceGroupName The resource group name . * @ param deviceAdminPassword Device administrator password as an encrypted string ( encrypted using RSA PKCS # 1 ) is ...
return createOrUpdateSecuritySettingsWithServiceResponseAsync ( deviceName , resourceGroupName , deviceAdminPassword ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class Polynomial { /** * Prunes zero coefficients from the end of a sequence . A coefficient is zero if its absolute value * is less than or equal to tolerance . * @ param tol Tolerance for zero . Try 1e - 15 */ public void truncateZeros ( double tol ) { } }
// double max = 0; // for ( int i = 0 ; i < size ; i + + ) { // double d = Math . abs ( c [ i ] ) ; // if ( d > max ) // max = d ; // tol * = max ; int i = size - 1 ; for ( ; i >= 0 ; i -- ) { if ( Math . abs ( c [ i ] ) > tol ) break ; } size = i + 1 ;
public class ApiOvhTelephony { /** * Create a new menu * REST : POST / telephony / { billingAccount } / ovhPabx / { serviceName } / menu * @ param greetSound [ required ] The id of the OvhPabxSound played to greet * @ param invalidSound [ required ] The id of the OvhPabxSound played when the caller uses an invali...
String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/menu" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "greetSound" , greetSound ) ; addBody ( o , "greetSoundTts" , greetSoundTts ) ; addBody ( o , "...
public class ExqlCompiler { /** * 从当前位置查找匹配的 : { . . . } 并编译出 : ExqlUnit 对象 。 * 如果有匹配的 : { . . . } , 编译后 , 当前位置指向匹配的右括号后一个字符 。 * @ return ExqlUnit , 如果没有 : { . . . } 匹配 , 返回 < code > null < / code > . */ private ExqlUnit compileBlock ( ) { } }
// 查找匹配的 { . . . } String group = findBrace ( BLOCK_LEFT , BLOCK_RIGHT ) ; if ( group != null ) { // 编译 { . . . } 内部的子句 ExqlCompiler compiler = new ExqlCompiler ( group ) ; return compiler . compileUnit ( ) ; } return null ; // 没有 { . . . } 匹配
public class DdosProtectionPlansInner { /** * Creates or updates a DDoS protection plan . * @ param resourceGroupName The name of the resource group . * @ param ddosProtectionPlanName The name of the DDoS protection plan . * @ param parameters Parameters supplied to the create or update operation . * @ throws I...
return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , ddosProtectionPlanName , parameters ) . map ( new Func1 < ServiceResponse < DdosProtectionPlanInner > , DdosProtectionPlanInner > ( ) { @ Override public DdosProtectionPlanInner call ( ServiceResponse < DdosProtectionPlanInner > response ) { retur...
public class ScriptWriterBinary { /** * RowInput / OutputBinary : row ( column values ) */ protected void writeRow ( Session session , Table t , Object [ ] data ) throws IOException { } }
rowOut . reset ( ) ; rowOut . writeRow ( data , t . getColumnTypes ( ) ) ; fileStreamOut . write ( rowOut . getOutputStream ( ) . getBuffer ( ) , 0 , rowOut . size ( ) ) ; tableRowCount ++ ;
public class Query { /** * < pre > * { array : < array > , elemMatch : < x > } * < / pre > */ public static Query arrayMatch ( String array , Query x ) { } }
Query q = new Query ( false ) ; q . add ( "array" , array ) . add ( "elemMatch" , x . toJson ( ) ) ; return q ;
public class Client { /** * Take an IOException and the address we were trying to connect to * and return an IOException with the input exception as the cause . * The new exception provides the stack trace of the place where * the exception is thrown and some extra diagnostics information . * If the exception i...
if ( exception instanceof ConnectException ) { // connection refused ; include the host : port in the error return ( ConnectException ) new ConnectException ( "Call to " + addr + " failed on connection exception: " + exception ) . initCause ( exception ) ; } else if ( exception instanceof SocketTimeoutException ) { ret...
public class DestinationManager { /** * Indicates whether the async deletion thread should be startable or not . * @ param isStartable */ private void setIsAsyncDeletionThreadStartable ( boolean isStartable ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setIsAsyncDeletionThreadStartable" , new Boolean ( isStartable ) ) ; synchronized ( deletionThreadLock ) { _isAsyncDeletionThreadStartable = isStartable ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabl...
public class CmsExplorerTypeSettings { /** * Sets the key name of the explorer type setting . < p > * @ param key the key name of the explorer type setting */ public void setKey ( String key ) { } }
m_key = key ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_SET_KEY_1 , key ) ) ; }
public class ArgumentUnitUtils { /** * Sets the property * @ param argumentUnit argument component * @ param propertyName property name * @ param propertyValue property value * @ return the previous value of the specified key in this property * list , or { @ code null } if it did not have one . */ public stat...
Properties properties = ArgumentUnitUtils . getProperties ( argumentUnit ) ; String result = ( String ) properties . setProperty ( propertyName , propertyValue ) ; ArgumentUnitUtils . setProperties ( argumentUnit , properties ) ; return result ;
public class TagFactory { /** * Will add values from params map except the exceptions . * @ param params map with values . Key used as an attribute name , value as value . * @ param exceptions list of excepted keys . */ public void addAttributesExcept ( Map params , String ... exceptions ) { } }
List exceptionList = Arrays . asList ( exceptions ) ; for ( Object key : params . keySet ( ) ) { if ( ! exceptionList . contains ( key ) ) { attribute ( key . toString ( ) , params . get ( key ) . toString ( ) ) ; } }
public class JSONWriter { /** * / * Other internal methods */ private void _badType ( int type , Object value ) { } }
if ( type < 0 ) { throw new IllegalStateException ( String . format ( "Internal error: missing BeanDefinition for id %d (class %s)" , type , value . getClass ( ) . getName ( ) ) ) ; } String typeDesc = ( value == null ) ? "NULL" : value . getClass ( ) . getName ( ) ; throw new IllegalStateException ( String . format ( ...
public class N { /** * Returns a new array with removes all the occurrences of specified elements from < code > a < / code > * @ param a * @ param elements * @ return * @ see Collection # removeAll ( Collection ) */ @ SafeVarargs public static char [ ] removeAll ( final char [ ] a , final char ... elements ) { ...
if ( N . isNullOrEmpty ( a ) ) { return N . EMPTY_CHAR_ARRAY ; } else if ( N . isNullOrEmpty ( elements ) ) { return a . clone ( ) ; } else if ( elements . length == 1 ) { return removeAllOccurrences ( a , elements [ 0 ] ) ; } final CharList list = CharList . of ( a . clone ( ) ) ; list . removeAll ( CharList . of ( el...
public class SARLValidator { /** * Check if all the fields are initialized in a SARL behavior . * @ param behavior the behavior . */ @ Check public void checkFinalFieldInitialization ( SarlBehavior behavior ) { } }
final JvmGenericType inferredType = this . associations . getInferredType ( behavior ) ; if ( inferredType != null ) { checkFinalFieldInitialization ( inferredType ) ; }
public class CommerceTaxFixedRateAddressRelPersistenceImpl { /** * Returns the last commerce tax fixed rate address rel in the ordered set where CPTaxCategoryId = & # 63 ; . * @ param CPTaxCategoryId the cp tax category ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < /...
CommerceTaxFixedRateAddressRel commerceTaxFixedRateAddressRel = fetchByCPTaxCategoryId_Last ( CPTaxCategoryId , orderByComparator ) ; if ( commerceTaxFixedRateAddressRel != null ) { return commerceTaxFixedRateAddressRel ; } StringBundler msg = new StringBundler ( 4 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . ...
public class ValidatedInputView { /** * Validates the input data and updates the icon . DataType must be set . * @ param validateEmptyFields if an empty input should be considered invalid . * @ return whether the data is valid or not . */ protected boolean validate ( boolean validateEmptyFields ) { } }
boolean isValid = false ; String value = dataType == PASSWORD ? getText ( ) : getText ( ) . trim ( ) ; if ( ! validateEmptyFields && value . isEmpty ( ) ) { return true ; } switch ( dataType ) { case TEXT_NAME : case NUMBER : case PASSWORD : case NON_EMPTY_USERNAME : isValid = ! value . isEmpty ( ) ; break ; case EMAIL...
public class AbstractAmazonDynamoDBAsync { /** * Simplified method form for invoking the ListTables operation . * @ see # listTablesAsync ( ListTablesRequest ) */ @ Override public java . util . concurrent . Future < ListTablesResult > listTablesAsync ( Integer limit ) { } }
return listTablesAsync ( new ListTablesRequest ( ) . withLimit ( limit ) ) ;
public class Screen { /** * Get the command string that will restore this screen . * @ return The URL for this screen . */ public String getScreenURL ( ) { } }
String strURL = super . getScreenURL ( ) ; if ( this . getClass ( ) . getName ( ) . equals ( Screen . class . getName ( ) ) ) { strURL = this . addURLParam ( strURL , DBParams . RECORD , this . getMainRecord ( ) . getClass ( ) . getName ( ) ) ; strURL = this . addURLParam ( strURL , DBParams . COMMAND , ThinMenuConstan...
public class TypeConver { /** * 根据类型描述获取对应的Class * @ param type 类型描述 * @ return 对应的Class * @ throws ClassNotFoundException 无法找到对应的类 */ @ SuppressWarnings ( "rawtypes" ) public static Class getTypeClass ( String type ) throws ClassNotFoundException { } }
Class clazz = null ; if ( type . equals ( "int" ) ) { clazz = int . class ; } else if ( type . equals ( "boolean" ) ) { clazz = boolean . class ; } else if ( type . equals ( "float" ) ) { clazz = float . class ; } else if ( type . equals ( "double" ) ) { clazz = double . class ; } else if ( type . equals ( "short" ) ) ...
public class LinkFieldUpdater { /** * Delete all possible term rows that might exist for our sharded link . */ private void deleteShardedLinkTermRows ( ) { } }
// When link is shard , its sharded extent table is also sharded . Set < Integer > shardNums = SpiderService . instance ( ) . getShards ( m_invTableDef ) . keySet ( ) ; for ( Integer shardNumber : shardNums ) { m_dbTran . deleteShardedLinkRow ( m_linkDef , m_dbObj . getObjectID ( ) , shardNumber ) ; }
public class UIRepeat { /** * PI45044 start */ @ Override public void restoreState ( FacesContext context , Object state ) { } }
if ( _saveUIDataRowState ) { if ( state == null ) { return ; } Object values [ ] = ( Object [ ] ) state ; super . restoreState ( context , values [ 0 ] ) ; // Object restoredRowStates = UIComponentBase . restoreAttachedState ( context , values [ 1 ] ) ; /* if ( restoredRowStates = = null ) if ( ! _ rowDeltaStates . i...
public class LowercaseEnumTypeAdapterFactory { /** * Transforms the given enum constant to lower case . If a { @ code SerializedName } annotation is present , the default * adapter result is returned . * @ param enumConstant the enumeration constant * @ param delegateAdapter the default adapter of the given type ...
try { final String enumValue = ( ( Enum ) enumConstant ) . name ( ) ; final boolean hasSerializedNameAnnotation = enumConstant . getClass ( ) . getField ( enumValue ) . isAnnotationPresent ( SerializedName . class ) ; return hasSerializedNameAnnotation ? delegateAdapter . toJsonTree ( enumConstant ) . getAsString ( ) :...
public class Iterables { /** * Removes and returns the first matching element , or returns { @ code null } if there is none . */ @ Nullable static < T > T removeFirstMatching ( Iterable < T > removeFrom , Predicate < ? super T > predicate ) { } }
checkNotNull ( predicate ) ; Iterator < T > iterator = removeFrom . iterator ( ) ; while ( iterator . hasNext ( ) ) { T next = iterator . next ( ) ; if ( predicate . apply ( next ) ) { iterator . remove ( ) ; return next ; } } return null ;
public class DiscreteFourierTransformOps { /** * Performs element - wise complex multiplication between two complex images . * @ param complexA ( Input ) Complex image * @ param complexB ( Input ) Complex image * @ param complexC ( Output ) Complex image */ public static void multiplyComplex ( InterleavedF32 comp...
InputSanityCheck . checkSameShape ( complexA , complexB , complexC ) ; for ( int y = 0 ; y < complexA . height ; y ++ ) { int indexA = complexA . startIndex + y * complexA . stride ; int indexB = complexB . startIndex + y * complexB . stride ; int indexC = complexC . startIndex + y * complexC . stride ; for ( int x = 0...
public class AbstractReliefComponentType { /** * Gets the value of the genericApplicationPropertyOfReliefComponent property . * This accessor method returns a reference to the live list , * not a snapshot . Therefore any modification you make to the * returned list will be present inside the JAXB object . * Thi...
if ( _GenericApplicationPropertyOfReliefComponent == null ) { _GenericApplicationPropertyOfReliefComponent = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfReliefComponent ;
public class AutoMlClient { /** * Deploys a model . If a model is already deployed , deploying it with the same parameters has no * effect . Deploying with different parametrs ( as e . g . changing * < p > [ node _ number ] [ google . cloud . automl . v1beta1 . ImageObjectDetectionModelDeploymentMetadata . node _ n...
DeployModelRequest request = DeployModelRequest . newBuilder ( ) . setName ( name == null ? null : name . toString ( ) ) . build ( ) ; return deployModelAsync ( request ) ;
public class NodeMessageExchange { /** * Process message * @ param operation * @ param data * @ return */ protected Object process ( String operation , Object data ) { } }
Closure < Object , Object > cl = operations . get ( operation ) ; if ( cl != null ) { return cl . call ( data ) ; } return true ;
public class ExtractUtil { /** * Return the response descriptions as String from a JavaDoc comment block . * @ param jdoc The javadoc block comment . * @ return the response descriptions as String */ public static List < String > extractResponseDescription ( JavadocComment jdoc ) { } }
List < String > list = new ArrayList < > ( ) ; list . addAll ( extractDocAnnotation ( DOC_RESPONSE_DESCRIPTION , jdoc ) ) ; return list ;
public class MapListenerAdaptors { /** * Creates a { @ link ListenerAdapter } for a specific { @ link com . hazelcast . core . EntryEventType } . * @ param eventType an { @ link com . hazelcast . core . EntryEventType } . * @ param mapListener a { @ link com . hazelcast . map . listener . MapListener } instance . ...
final ConstructorFunction < MapListener , ListenerAdapter > constructorFunction = CONSTRUCTORS . get ( eventType ) ; if ( constructorFunction == null ) { throw new IllegalArgumentException ( "First, define a ListenerAdapter for the event EntryEventType." + eventType ) ; } return constructorFunction . createNew ( mapLis...
public class CmdInformationBatch { /** * Clear error state , used for clear exception after first batch query , when fall back to * per - query execution . */ @ Override public void reset ( ) { } }
insertIds . clear ( ) ; updateCounts . clear ( ) ; insertIdNumber = 0 ; hasException = false ; rewritten = false ;
public class DestructuringGlobalNameExtractor { /** * Given an lvalue in a destructuring pattern , and a detached subtree , rewrites the AST to assign * the lvalue to the subtree instead of its previous value , while preserving the rest of the * destructuring pattern * < p > For example : given stringKey : ' y ' ...
Node pattern = stringKey . getParent ( ) ; Node assignmentType = pattern . getParent ( ) ; checkState ( assignmentType . isAssign ( ) || assignmentType . isDestructuringLhs ( ) , assignmentType ) ; Node originalRvalue = pattern . getNext ( ) ; // e . g . ` original ` checkState ( originalRvalue . isQualifiedName ( ) ) ...
public class DependencyFinder { /** * Gets the file of the dependency with the given artifact id from the project dependencies and if not found from * the plugin dependencies . This method also check the extension . * @ param mojo the mojo * @ param artifactId the name of the artifact to find * @ param type the...
File file = getArtifactFileFromProjectDependencies ( mojo , artifactId , type ) ; if ( file == null ) { file = getArtifactFileFromPluginDependencies ( mojo , artifactId , type ) ; } return file ;
public class UserTransactionProviderImpl { /** * Set the user transaction registry * @ param v The value */ public void setTransactionRegistry ( org . jboss . tm . usertx . UserTransactionRegistry v ) { } }
( ( org . jboss . tm . usertx . UserTransactionProvider ) utp ) . setTransactionRegistry ( v ) ;
public class Instrumentation { /** * < code > optional string report _ defined = 1 ; < / code > * < pre > * name of function ( ID = & lt ; numeric function id & gt ; ) ; * used to inform the harness about the contents of a module * < / pre > */ public com . google . protobuf . ByteString getReportDefinedBytes (...
java . lang . Object ref = reportDefined_ ; if ( ref instanceof java . lang . String ) { com . google . protobuf . ByteString b = com . google . protobuf . ByteString . copyFromUtf8 ( ( java . lang . String ) ref ) ; reportDefined_ = b ; return b ; } else { return ( com . google . protobuf . ByteString ) ref ; }
public class Parser { /** * called for inner parses for list items and blockquotes */ public RootNode parseInternal ( StringBuilderVar block ) { } }
char [ ] chars = block . getChars ( ) ; int [ ] ixMap = new int [ chars . length + 1 ] ; // map of cleaned indices to original indices // strip out CROSSED _ OUT characters and build index map StringBuilder clean = new StringBuilder ( ) ; for ( int i = 0 ; i < chars . length ; i ++ ) { char c = chars [ i ] ; if ( c != ...
public class ObjectWritable { /** * Read a { @ link Writable } , { @ link String } , primitive type , or an array of * the preceding . */ public static Object readObject ( DataInput in , Configuration conf ) throws IOException { } }
return readObject ( in , null , conf ) ;
public class Invariants { /** * An { @ code int } specialized version of { @ link # checkInvariant ( Object , * ContractConditionType ) } . * @ param value The value * @ param predicate The predicate * @ param describer The describer for the predicate * @ return value * @ throws InvariantViolationException ...
final boolean ok ; try { ok = predicate . test ( value ) ; } catch ( final Throwable e ) { final Violations violations = singleViolation ( failedPredicate ( e ) ) ; throw new InvariantViolationException ( failedMessage ( Integer . valueOf ( value ) , violations ) , e , violations . count ( ) ) ; } return innerCheckInva...
public class MixinParentNode { /** * Replaces the child at the given index with the given new child . * @ param index The index of the child to replace . * @ param newChild The new child . */ public void replaceChild ( int index , N newChild ) { } }
checkNotNull ( newChild ) ; tryRemoveFromOldParent ( newChild ) ; N oldChild = children . set ( index , newChild ) ; oldChild . setParent ( null ) ; newChild . setParent ( master ) ;
public class KieServerHttpRequest { /** * Encode the given URL as an ASCII { @ link String } * This method ensures the path and query segments of the URL are properly encoded such as ' ' characters being encoded to ' % 20' * or any UTF - 8 characters that are non - ASCII . No encoding of URLs is done by default by ...
URL parsed ; try { parsed = new URL ( url . toString ( ) ) ; } catch ( IOException ioe ) { throw new KieServerHttpRequestException ( "Unable to encode url '" + url . toString ( ) + "'" , ioe ) ; } String host = parsed . getHost ( ) ; int port = parsed . getPort ( ) ; if ( port != - 1 ) host = host + ':' + Integer . toS...
public class CharOperation { /** * Answers true if the array contains an occurrence of one of the characters , false otherwise . < br > * < br > * For example : * < ol > * < li > * < pre > * characters = { ' c ' , ' d ' } * array = { ' a ' , ' b ' } * result = & gt ; false * < / pre > * < / li > *...
for ( int i = array . length ; -- i >= 0 ; ) { for ( int j = characters . length ; -- j >= 0 ; ) { if ( array [ i ] == characters [ j ] ) { return true ; } } } return false ;
public class AWSStorageGatewayClient { /** * Resets all cache disks that have encountered a error and makes the disks available for reconfiguration as cache * storage . If your cache disk encounters a error , the gateway prevents read and write operations on virtual tapes * in the gateway . For example , an error c...
request = beforeClientExecution ( request ) ; return executeResetCache ( request ) ;
public class MOEADSTM { /** * Select the next parent population , based on the stable matching criteria */ public void stmSelection ( ) { } }
int [ ] idx = new int [ populationSize ] ; double [ ] nicheCount = new double [ populationSize ] ; int [ ] [ ] solPref = new int [ jointPopulation . size ( ) ] [ ] ; double [ ] [ ] solMatrix = new double [ jointPopulation . size ( ) ] [ ] ; double [ ] [ ] distMatrix = new double [ jointPopulation . size ( ) ] [ ] ; dou...
public class AbstractEndpointComponent { /** * Sets properties on endpoint configuration using method reflection . * @ param endpointConfiguration * @ param parameters * @ param context */ protected void enrichEndpointConfiguration ( EndpointConfiguration endpointConfiguration , Map < String , String > parameters...
for ( Map . Entry < String , String > parameterEntry : parameters . entrySet ( ) ) { Field field = ReflectionUtils . findField ( endpointConfiguration . getClass ( ) , parameterEntry . getKey ( ) ) ; if ( field == null ) { throw new CitrusRuntimeException ( String . format ( "Unable to find parameter field on endpoint ...
public class PhoneNumber { /** * The phone number associations . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setAssociations ( java . util . Collection ) } or { @ link # withAssociations ( java . util . Collection ) } if you want to * override the exist...
if ( this . associations == null ) { setAssociations ( new java . util . ArrayList < PhoneNumberAssociation > ( associations . length ) ) ; } for ( PhoneNumberAssociation ele : associations ) { this . associations . add ( ele ) ; } return this ;
public class HttpClientResourceAdaptor { /** * ( non - Javadoc ) * @ see javax . slee . resource . ResourceAdaptor # raActive ( ) */ public void raActive ( ) { } }
activities = new ConcurrentHashMap < HttpClientActivityHandle , HttpClientActivity > ( ) ; executorService = Executors . newCachedThreadPool ( ) ; if ( httpClientFactory != null ) { httpclient = httpClientFactory . newHttpClient ( ) ; } else { HttpParams params = new SyncBasicHttpParams ( ) ; SchemeRegistry schemeRegis...
public class Line { /** * Set the LineColor property * The color with which the line will be drawn . * To update the line on the map use { @ link LineManager # update ( Annotation ) } . * @ param color value for String */ public void setLineColor ( @ ColorInt int color ) { } }
jsonObject . addProperty ( LineOptions . PROPERTY_LINE_COLOR , ColorUtils . colorToRgbaString ( color ) ) ;
public class ReporterBase { /** * Initialize the properties . * @ param name The instance name . * @ param props The properties . */ protected void init ( final String name , final Properties props ) { } }
init = new InitUtil ( "" , props , false ) ; this . name = name ;
public class F4 { /** * Returns a composed function from this function and the specified function that takes the * result of this function . When applying the composed function , this function is applied * first to given parameter and then the specified function is applied to the result of * this function . * @...
E . NPE ( f ) ; final Func4 < P1 , P2 , P3 , P4 , R > me = this ; return new F4 < P1 , P2 , P3 , P4 , T > ( ) { @ Override public T apply ( P1 p1 , P2 p2 , P3 p3 , P4 p4 ) { R r = me . apply ( p1 , p2 , p3 , p4 ) ; return f . apply ( r ) ; } } ;
public class SDMath { /** * Compute the 2d confusion matrix of size [ numClasses , numClasses ] from a pair of labels and predictions , both of * which are represented as integer values . This version assumes the number of classes is 1 + max ( max ( labels ) , max ( pred ) ) < br > * For example , if labels = [ 0 ,...
validateInteger ( "confusionMatrix" , "labels" , labels ) ; validateInteger ( "confusionMatrix" , "prediction" , pred ) ; SDVariable result = f ( ) . confusionMatrix ( labels , pred , dataType ) ; return updateVariableNameAndReference ( result , name ) ;
public class CmsGalleryField { /** * Sets the widget value . < p > * @ param value the value to set * @ param fireEvent if the change event should be fired */ protected void setValue ( String value , boolean fireEvent ) { } }
m_textbox . setValue ( value ) ; updateUploadTarget ( CmsResource . getFolderPath ( value ) ) ; updateResourceInfo ( value ) ; m_previousValue = value ; if ( fireEvent ) { fireChange ( true ) ; }
public class TimePickerSettings { /** * zApplyMinimumToggleTimeMenuButtonWidthInPixels , This applies the specified setting to the * time picker . */ void zApplyMinimumToggleTimeMenuButtonWidthInPixels ( ) { } }
if ( parent == null ) { return ; } Dimension menuButtonPreferredSize = parent . getComponentToggleTimeMenuButton ( ) . getPreferredSize ( ) ; int width = menuButtonPreferredSize . width ; int height = menuButtonPreferredSize . height ; int minimumWidth = minimumToggleTimeMenuButtonWidthInPixels ; width = ( width < mini...
public class DialogRootView { /** * Adds the areas , which are contained by the dialog , to the root view . */ private void addAreas ( ) { } }
if ( areas != null ) { removeAllViews ( ) ; scrollView = null ; topDivider = null ; bottomDivider = null ; Area previousArea = null ; boolean canAddTopDivider = false ; for ( Map . Entry < Area , View > entry : areas . entrySet ( ) ) { Area area = entry . getKey ( ) ; View view = entry . getValue ( ) ; if ( scrollableA...
public class VEvent { /** * Sets whether an event is visible to free / busy time searches . * @ param transparent true to hide the event , false to make it visible it , * or null to remove the property * @ return the property that was created * @ see < a href = " http : / / tools . ietf . org / html / rfc5545 #...
Transparency prop = null ; if ( transparent != null ) { prop = transparent ? Transparency . transparent ( ) : Transparency . opaque ( ) ; } setTransparency ( prop ) ; return prop ;
public class CircuitBreakerBuilder { /** * Adds a { @ link CircuitBreakerListener } . */ public CircuitBreakerBuilder listener ( CircuitBreakerListener listener ) { } }
requireNonNull ( listener , "listener" ) ; if ( listeners . isEmpty ( ) ) { listeners = new ArrayList < > ( 3 ) ; } listeners . add ( listener ) ; return this ;
public class PeerGroup { /** * Creates a version message to send , constructs a Peer object and attempts to connect it . Returns the peer on * success or null on failure . * @ param address Remote network address * @ param incrementMaxConnections Whether to consider this connection an attempt to fill our quota , ...
checkState ( lock . isHeldByCurrentThread ( ) ) ; VersionMessage ver = getVersionMessage ( ) . duplicate ( ) ; ver . bestHeight = chain == null ? 0 : chain . getBestChainHeight ( ) ; ver . time = Utils . currentTimeSeconds ( ) ; ver . receivingAddr = address ; ver . receivingAddr . setParent ( ver ) ; Peer peer = creat...
public class BucketFlusher { /** * Flush the bucket and make sure flush is complete before completing the observable . * @ param core the core reference . * @ param bucket the bucket to flush . * @ param username the user authorized for the bucket . * @ param password the password of the user . * @ return an ...
return createMarkerDocuments ( core , bucket ) . flatMap ( new Func1 < List < String > , Observable < Boolean > > ( ) { @ Override public Observable < Boolean > call ( List < String > strings ) { return initiateFlush ( core , bucket , username , password ) ; } } ) . flatMap ( new Func1 < Boolean , Observable < Boolean ...
public class RubyIO { /** * Writes a line in the file . * @ param words * to write a line * @ throws IllegalStateException * if file is not writable */ public void puts ( String words ) { } }
if ( mode . isWritable ( ) == false ) throw new IllegalStateException ( "IOError: not opened for writing" ) ; try { raFile . write ( words . getBytes ( ) ) ; raFile . writeBytes ( System . getProperty ( "line.separator" ) ) ; } catch ( IOException e ) { logger . log ( Level . SEVERE , null , e ) ; throw new RuntimeExce...
public class RegExUtil { /** * get all allowed characters which can be part of a String which matches a given regular * expression . TODO : this is a first feature incomplete implementation , has to be improved . * @ param pregEx string contains a regular expression pattern * @ return string with all characters t...
if ( StringUtils . isEmpty ( pregEx ) ) { return null ; } final StringBuilder regExCheck = new StringBuilder ( ) ; final StringBuilder regExCheckOut = new StringBuilder ( ) ; boolean inSequence = false ; boolean isNegativeSequence = false ; boolean inSize = false ; boolean isMasked = false ; regExCheck . append ( "([" ...
public class ContractsApi { /** * Get contract items Lists items of a particular contract - - - This route is * cached for up to 3600 seconds SSO Scope : * esi - contracts . read _ corporation _ contracts . v1 SSO Scope : * esi - contracts . read _ character _ contracts . v1 * @ param characterId * An EVE cha...
ApiResponse < List < CharacterContractsItemsResponse > > resp = getCharactersCharacterIdContractsContractIdItemsWithHttpInfo ( characterId , contractId , datasource , ifNoneMatch , token ) ; return resp . getData ( ) ;
public class PGbytea { /** * Converts a java byte [ ] into a PG bytea string ( i . e . the text representation of the bytea data * type ) */ public static String toPGString ( byte [ ] buf ) { } }
if ( buf == null ) { return null ; } StringBuilder stringBuilder = new StringBuilder ( 2 * buf . length ) ; for ( byte element : buf ) { int elementAsInt = ( int ) element ; if ( elementAsInt < 0 ) { elementAsInt = 256 + elementAsInt ; } // we escape the same non - printable characters as the backend // we must escape ...
public class InheritanceHelper { /** * Replies if the type candidate is a subtype of the given super type . * @ param candidate the type to test . * @ param jvmSuperType the expected JVM super - type . * @ param sarlSuperType the expected SARL super - type . * @ return < code > true < / code > if the candidate ...
if ( candidate . isSubtypeOf ( jvmSuperType ) ) { return true ; } if ( sarlSuperType != null ) { final JvmType type = candidate . getType ( ) ; if ( type instanceof JvmGenericType ) { final JvmGenericType genType = ( JvmGenericType ) type ; if ( genType . getSuperTypes ( ) . isEmpty ( ) ) { for ( final EObject sarlObje...
public class PriceLevel { /** * Match order if possible . * @ param orderId the incoming order id * @ param side the incoming order side * @ param size incoming order quantity * @ param matchEmmiter an emitter to be notified for matches { @ link Processor # onNext ( Object ) } * @ return the remaining quantit...
long quantity = size ; while ( quantity > 0 && ! orders . isEmpty ( ) ) { Order order = orders . get ( 0 ) ; long orderQuantity = order . size ( ) ; if ( orderQuantity > quantity ) { order . reduce ( quantity ) ; matchEmmiter . onNext ( new MatchOrder ( order . id ( ) , orderId , side , price , quantity , order . size ...
public class MultiUserChatLight { /** * Change the MUC Light affiliations . * @ param affiliations * @ throws NoResponseException * @ throws XMPPErrorException * @ throws NotConnectedException * @ throws InterruptedException */ public void changeAffiliations ( HashMap < Jid , MUCLightAffiliation > affiliation...
MUCLightChangeAffiliationsIQ changeAffiliationsIQ = new MUCLightChangeAffiliationsIQ ( room , affiliations ) ; connection . createStanzaCollectorAndSend ( changeAffiliationsIQ ) . nextResultOrThrow ( ) ;
public class ConnectionDataGroup { /** * Close a conversation on the specified connection . The connection must be part of this * group . If the connection has no more conversations left using it , then it is added * to the idle pool . * @ param connection The connection to close a conversation on . */ protected ...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "close" , connection ) ; // Paranoia : Check that this connection believes that it belongs in this group . if ( connection . getConnectionData ( ) . getConnectionDataGroup ( ) != this ) { if ( TraceComponent . isAnyTr...
public class BasicAnnotationProcessor { /** * Processes the valid elements , including those previously deferred by each step . */ private void process ( ImmutableSetMultimap < Class < ? extends Annotation > , Element > validElements ) { } }
for ( ProcessingStep step : steps ) { ImmutableSetMultimap < Class < ? extends Annotation > , Element > stepElements = new ImmutableSetMultimap . Builder < Class < ? extends Annotation > , Element > ( ) . putAll ( indexByAnnotation ( elementsDeferredBySteps . get ( step ) , step . annotations ( ) ) ) . putAll ( filterK...
public class ArrayBasedStrategy { /** * - - - GET LOCAL OR REMOTE ENDPOINT - - - */ @ SuppressWarnings ( "unchecked" ) @ Override public T getEndpoint ( String nodeID ) { } }
Endpoint [ ] array ; if ( nodeID == null && preferLocal ) { array = getEndpointsByNodeID ( this . nodeID ) ; if ( array . length == 0 ) { array = endpoints ; } } else { array = getEndpointsByNodeID ( nodeID ) ; } if ( array . length == 0 ) { return null ; } if ( array . length == 1 ) { return ( T ) array [ 0 ] ; } retu...
public class CommunicationRegistry { /** * 注册一个事件对应的处理对象 * @ param eventType * @ param action */ public static void regist ( EventType eventType , Object action ) { } }
if ( logger . isInfoEnabled ( ) ) { logger . info ( " Regist " + action + " For " + eventType ) ; } if ( table . containsKey ( eventType ) ) { if ( logger . isWarnEnabled ( ) ) { logger . warn ( " EventType " + eventType + " is already exist!" ) ; } } table . put ( eventType , action ) ;
public class ConfigurationBuilder { /** * returns the metadata adapter . * if javassist library exists in the classpath , this method returns { @ link JavassistAdapter } otherwise defaults to { @ link JavaReflectionAdapter } . * < p > the { @ link JavassistAdapter } is preferred in terms of performance and class lo...
if ( metadataAdapter != null ) return metadataAdapter ; else { try { return ( metadataAdapter = new JavassistAdapter ( ) ) ; } catch ( Throwable e ) { if ( Reflections . log != null ) Reflections . log . warn ( "could not create JavassistAdapter, using JavaReflectionAdapter" , e ) ; return ( metadataAdapter = new JavaR...
public class PdfAction { /** * Creates a GoToE action to an embedded file . * @ param filenamethe root document of the target ( null if the target is in the same document ) * @ param dest the named destination * @ param isName if true sets the destination as a name , if false sets it as a String * @ return a Go...
if ( isName ) return gotoEmbedded ( filename , target , new PdfName ( dest ) , newWindow ) ; else return gotoEmbedded ( filename , target , new PdfString ( dest , null ) , newWindow ) ;
public class AbstractIntegerAttr { /** * Utility method to parse a { @ code String } into an { @ code Integer } , * converting any possible { @ code NumberFormatException } thrown into * a { @ code BOSHException } . * @ param str string to parse * @ return integer value * @ throws BOSHException on { @ code Nu...
try { return Integer . parseInt ( str ) ; } catch ( NumberFormatException nfx ) { throw ( new BOSHException ( "Could not parse an integer from the value provided: " + str , nfx ) ) ; }
public class BlockTemplate { /** * Returns a { @ code String } representation of a statement , including semicolon . */ private static String printStatement ( Context context , JCStatement statement ) { } }
StringWriter writer = new StringWriter ( ) ; try { pretty ( context , writer ) . printStat ( statement ) ; } catch ( IOException e ) { throw new AssertionError ( "StringWriter cannot throw IOExceptions" ) ; } return writer . toString ( ) ;
public class TreeParser { /** * Parses the given parentheses tree string * @ since 4.3 * @ param < B > the tree node value type * @ param value the parentheses tree string * @ param mapper the mapper which converts the serialized string value to * the desired type * @ return the parsed tree object * @ thr...
requireNonNull ( value ) ; requireNonNull ( mapper ) ; final TreeNode < B > root = TreeNode . of ( ) ; final Deque < TreeNode < B > > parents = new ArrayDeque < > ( ) ; TreeNode < B > current = root ; for ( Token token : tokenize ( value . trim ( ) ) ) { switch ( token . seq ) { case "(" : if ( current == null ) { thro...
public class Validator { /** * Validate a given jPDL process definition against the applicable definition language ' s schema . * @ param def * The process definition , in { @ link String } format . * @ param language * The process definition language for which the given definition is to be validated . * @ re...
return XmlUtils . validate ( new StreamSource ( new StringReader ( def ) ) , language . getSchemaSources ( ) ) ;
public class Strings { /** * Substitute sub - strings in side of a string . * @ param string String to subst mappings in * @ param map Map of from - > to strings * @ param beginToken Beginning token * @ param endToken Ending token * @ return Substituted string */ public static String subst ( final String stri...
return subst ( new StringBuffer ( ) , string , map , beginToken , endToken ) ;
public class DefaultGroovyMethods { /** * A variant of collectEntries for Iterable objects using the identity closure as the transform . * The source Iterable should contain a list of < code > [ key , value ] < / code > tuples or < code > Map . Entry < / code > objects . * < pre class = " groovyTestCase " > * def...
return collectEntries ( self . iterator ( ) ) ;
public class JCellCheckBox { /** * Get the editor for this location in the table . * From the TableCellEditor interface . * Sets the value of this control and returns this . * @ return this . */ public Component getTableCellEditorComponent ( JTable table , Object value , boolean isSelected , int row , int column ...
this . setControlValue ( value ) ; return this ;
public class LengthCheckInputStream { /** * { @ inheritDoc } * @ throws SdkClientException * if the data length read has exceeded the expected total , or * if the total data length is not the same as the expected * total . */ @ Override public int read ( ) throws IOException { } }
final int c = super . read ( ) ; if ( c >= 0 ) dataLength ++ ; checkLength ( c == - 1 ) ; return c ;
public class SibRaActivationSpecImpl { /** * ( non - Javadoc ) * @ see com . ibm . wsspi . sib . ra . SibRaActivationSpec # setMaxConcurrency ( java . lang . String ) */ public void setMaxConcurrency ( final String maxConcurrency ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "MaxConcurrency" , maxConcurrency ) ; } _maxConcurrency = ( maxConcurrency == null ? null : Integer . valueOf ( maxConcurrency ) ) ;
public class TaskSummary { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false otherwise */ public boolean isSet ( _Fields field ) { } }
if ( field == null ) { throw new IllegalArgumentException ( ) ; } switch ( field ) { case TASK_ID : return is_set_taskId ( ) ; case UPTIME : return is_set_uptime ( ) ; case STATUS : return is_set_status ( ) ; case HOST : return is_set_host ( ) ; case PORT : return is_set_port ( ) ; case ERRORS : return is_set_errors ( ...
public class OctalToDecimal { /** * This method is used to convert an octal number to a decimal number . * Examples : * octal _ to _ decimal ( 25 ) - > 21 * octal _ to _ decimal ( 30 ) - > 24 * octal _ to _ decimal ( 40 ) - > 32 * Args : * octal _ value : an integer representing an octal number * Returns ...
int temporaryOctal = octalValue ; int decimalValue = 0 ; int multiplier = 1 ; while ( temporaryOctal != 0 ) { int digit = ( temporaryOctal % 10 ) ; temporaryOctal = ( temporaryOctal / 10 ) ; decimalValue += ( digit * multiplier ) ; multiplier *= 8 ; } return decimalValue ;
public class StepFunctionBuilder { /** * Binary condition for String equality comparison . * @ param variable The JSONPath expression that determines which piece of the input document is used for the comparison . * @ param expectedValue The expected value for this condition . * @ see < a href = " https : / / stat...
return StringEqualsCondition . builder ( ) . variable ( variable ) . expectedValue ( expectedValue ) ;
public class PageFlowUtils { /** * Tell whether a web application resource requires a secure transport protocol . This is * determined from web . xml ; for example , the following block specifies that all resources under * / login require a secure transport protocol . * < pre > * & lt ; security - constraint & ...
return AdapterManager . getServletContainerAdapter ( servletContext ) . getSecurityProtocol ( uri , request ) ;
public class Strings { /** * 返回一个新的逗号相隔字符串 , 实现其中的单词a - b的功能 * @ param first a { @ link java . lang . String } object . * @ param second a { @ link java . lang . String } object . * @ param delimiter a { @ link java . lang . String } object . * @ return a { @ link java . lang . String } object . */ public stati...
if ( isEmpty ( first ) || isEmpty ( second ) ) { return "" ; } List < String > firstSeq = Arrays . asList ( split ( first , ',' ) ) ; List < String > secondSeq = Arrays . asList ( split ( second , ',' ) ) ; Collection < String > rs = CollectUtils . intersection ( firstSeq , secondSeq ) ; StringBuilder buf = new StringB...
public class KAMCatalogDao { /** * Retrieves the { @ link KamInfo } objects from the KAM catalog database . * If the < tt > kam < / tt > doesn ' t exist then a null { @ link KamInfo } is returned . * @ return { @ link KamInfo } , the kam info object from the * kam catalog database or null if the kam name cannot b...
List < KamInfo > list = new ArrayList < KamInfo > ( ) ; ResultSet rset = null ; try { PreparedStatement ps = getPreparedStatement ( SELECT_KAM_CATALOG_SQL ) ; rset = ps . executeQuery ( ) ; while ( rset . next ( ) ) { list . add ( getKamInfo ( rset ) ) ; } } catch ( SQLException ex ) { throw ex ; } finally { close ( rs...
public class MomentInterval { /** * / * [ deutsch ] * < p > Konvertiert ein beliebiges Intervall zu einem Intervall dieses Typs . < / p > * @ param interval any kind of moment interval * @ return MomentInterval * @ since 3.34/4.29 */ public static MomentInterval from ( ChronoInterval < Moment > interval ) { } }
if ( interval instanceof MomentInterval ) { return MomentInterval . class . cast ( interval ) ; } else { return new MomentInterval ( interval . getStart ( ) , interval . getEnd ( ) ) ; }
public class Aggregations { /** * Returns an aggregation to find the integer minimum of all supplied values . < br / > * This aggregation is similar to : < pre > SELECT MIN ( value ) FROM x < / pre > * @ param < Key > the input key type * @ param < Value > the supplied value type * @ return the minimum value ov...
return new AggregationAdapter ( new IntegerMinAggregation < Key , Value > ( ) ) ;
public class ManagementLocksInner { /** * Delete a management lock by scope . * @ param scope The scope for the lock . * @ param lockName The name of lock . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceResponse } object if successful . */ public Obs...
return deleteByScopeWithServiceResponseAsync ( scope , lockName ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class TrueTypeFont { /** * Reads a < CODE > String < / CODE > from the font file as bytes using the Cp1252 * encoding . * @ param length the length of bytes to read * @ return the < CODE > String < / CODE > read * @ throws IOException the font file could not be read */ protected String readStandardString...
byte buf [ ] = new byte [ length ] ; rf . readFully ( buf ) ; try { return new String ( buf , WINANSI ) ; } catch ( Exception e ) { throw new ExceptionConverter ( e ) ; }
public class JsonPathAssert { /** * Extracts a JSON boolean using a JsonPath expression and wrap it in an { @ link BooleanAssert } * @ param path JsonPath to extract the number * @ return an instance of { @ link BooleanAssert } */ public AbstractBooleanAssert < ? > jsonPathAsBoolean ( String path ) { } }
return Assertions . assertThat ( actual . read ( path , Boolean . class ) ) ;
public class ExportRecordsScreen { /** * CopyProcessParams Method . */ public String copyProcessParams ( ) { } }
String strProcess = null ; strProcess = Utility . addURLParam ( strProcess , DBParams . LOCAL , this . getProperty ( DBParams . LOCAL ) ) ; strProcess = Utility . addURLParam ( strProcess , DBParams . REMOTE , this . getProperty ( DBParams . REMOTE ) ) ; strProcess = Utility . addURLParam ( strProcess , DBParams . TABL...
public class MatrixVectorMult_DSCC { /** * c = a < sup > T < / sup > * B * @ param a ( Input ) vector * @ param offsetA Input ) first index in vector a * @ param B ( Input ) Matrix * @ param c ( Output ) vector * @ param offsetC ( Output ) first index in vector c */ public static void mult ( double a [ ] , in...
if ( a . length - offsetA < B . numRows ) throw new IllegalArgumentException ( "Length of 'a' isn't long enough" ) ; if ( c . length - offsetC < B . numCols ) throw new IllegalArgumentException ( "Length of 'c' isn't long enough" ) ; for ( int k = 0 ; k < B . numCols ; k ++ ) { int idx0 = B . col_idx [ k ] ; int idx1 =...
public class Types { /** * Creates a new instance of the given class by invoking its default constructor . * < p > The given class must be public and must have a public default constructor , and must not be * an array or an interface or be abstract . If an enclosing class , it must be static . */ public static < T ...
// TODO ( yanivi ) : investigate " sneaky " options for allocating the class that GSON uses , like // setting the constructor to be accessible , or possibly provide a factory method of a special // name try { return clazz . newInstance ( ) ; } catch ( IllegalAccessException e ) { throw handleExceptionForNewInstance ( e...
public class Utils { /** * get column list from the user provided query to build schema with the respective columns * @ param input query * @ return list of columns */ public static List < String > getColumnListFromQuery ( String query ) { } }
if ( Strings . isNullOrEmpty ( query ) ) { return null ; } String queryLowerCase = query . toLowerCase ( ) ; int startIndex = queryLowerCase . indexOf ( "select " ) + 7 ; int endIndex = queryLowerCase . indexOf ( " from " ) ; if ( startIndex < 0 || endIndex < 0 ) { return null ; } String [ ] inputQueryColumns = query ....
public class Timer { /** * Times and records the duration of an event . * @ param event a { @ link Runnable } whose { @ link Runnable # run ( ) } method implements a process * whose duration should be timed */ public void time ( Runnable event ) { } }
long startTime = this . clock . getTick ( ) ; try { event . run ( ) ; } finally { update ( this . clock . getTick ( ) - startTime ) ; }
public class QueryMethodTypeImpl { /** * If not already created , a new < code > method - params < / code > element with the given value will be created . * Otherwise , the existing < code > method - params < / code > element will be returned . * @ return a new or existing instance of < code > MethodParamsType < Qu...
Node node = childNode . getOrCreate ( "method-params" ) ; MethodParamsType < QueryMethodType < T > > methodParams = new MethodParamsTypeImpl < QueryMethodType < T > > ( this , "method-params" , childNode , node ) ; return methodParams ;
public class ClassEnvy { /** * add the current line number to a set of line numbers * @ param lineNumbers * the current set of line numbers */ private void addLineNumber ( BitSet lineNumbers ) { } }
LineNumberTable lnt = getCode ( ) . getLineNumberTable ( ) ; if ( lnt == null ) { lineNumbers . set ( 0 ) ; } else { int line = lnt . getSourceLine ( getPC ( ) ) ; if ( line < 0 ) { lineNumbers . set ( lineNumbers . size ( ) ) ; } else { lineNumbers . set ( line ) ; } }
public class ProxySettings { /** * Set the proxy server by a URI . The parameters are updated as * described below . * < blockquote > * < dl > * < dt > Secure < / dt > * < dd > < p > * If the URI contains the scheme part and its value is * either { @ code " http " } or { @ code " https " } ( case - insens...
if ( uri == null ) { return this ; } String scheme = uri . getScheme ( ) ; String userInfo = uri . getUserInfo ( ) ; String host = uri . getHost ( ) ; int port = uri . getPort ( ) ; return setServer ( scheme , userInfo , host , port ) ;
public class Humanize { /** * Converts a number to its ordinal as a string . * E . g . 1 becomes ' 1st ' , 2 becomes ' 2nd ' , 3 becomes ' 3rd ' , etc . * @ param value * The number to convert * @ return String representing the number as ordinal */ public static String ordinal ( Number value ) { } }
int v = value . intValue ( ) ; int vc = v % 100 ; if ( vc > 10 && vc < 14 ) return String . format ( ORDINAL_FMT , v , context . get ( ) . ordinalSuffix ( 0 ) ) ; return String . format ( ORDINAL_FMT , v , context . get ( ) . ordinalSuffix ( v % 10 ) ) ;