public CreatePageWindow typeName  ( String name ) { nameField . setValue ( name ) ; return this ; }


public boolean contains  ( T dataSet ) { for ( int i = 0 ; i < mDataSets . size ( ) ; i ++ ) { T set = mDataSets . get ( i ) ; if ( set . equals ( dataSet ) ) { return true ; } } return false ; }

Comprueba si este objeto de datos contiene el conjunto de datos especificado.Devuelve VERDADERO si es así, falso si no.


public boolean equals  ( Object obj ) { if ( this == obj ) { return true ; } else if ( ! ( obj instanceof MethodDesc ) ) { return false ; } MethodDesc od = ( MethodDesc ) obj ; return ( ( name == null ? od . name == null : name . equals ( od . name ) ) && Arrays . equals ( types , od . types ) && ( constraints == null ? od . constraints == null : constraints . equals ( od . constraints ) ) ) ; }

Dos instancias de esta clase son iguales si tienen el mismo nombre, los mismos tipos de parámetros y las mismas restricciones.


private static int decodeIntElement  ( Document document , Node child ) { return Integer . valueOf ( child . getTextContent ( ) ) . intValue ( ) ; }


public PhotosGetByIdQuery ( VkApiClient client , UserActor actor , String ... photos ) { super ( client , "photos.getById" , Utils . buildParametrizedType ( List . class , Photo . class ) ) ; accessToken ( actor . getAccessToken ( ) ) ; photos ( photos ) ; }

Crea una instancia abstractQueryBuilder que se puede usar para construir una solicitud API con varios parámetros


public boolean onBackPressed  ( ) { if ( drawer . isDrawerOpen ( GravityCompat . START ) ) { drawer . closeDrawer ( GravityCompat . START ) ; return true ; } else { drawer . removeDrawerListener ( toggle ) ; return false ; } }

En la llave de espalda presionada, debe llamarse en la actividad de la actividad de su padre


public boolean isValidInet6Address  ( String inet6Address ) { boolean containsCompressedZeroes = inet6Address . indexOf ( "::" ) > - 1 ; if ( containsCompressedZeroes && ( inet6Address . indexOf ( "::" ) != inet6Address . lastIndexOf ( "::" ) ) ) { return false ; } if ( ( inet6Address . startsWith ( ":" ) && ! inet6Address . startsWith ( "::" ) ) || ( inet6Address . endsWith ( ":" ) && ! inet6Address . endsWith ( "::" ) ) ) { return false ; } Object [ ] octets = inet6Address . split ( ":" ) ; if ( containsCompressedZeroes ) { List octetList = new ArrayList ( Arrays . asList ( octets ) ) ; if ( inet6Address . endsWith ( "::" ) ) { octetList . add ( "" ) ; } else if ( inet6Address . startsWith ( "::" ) && ! octetList . isEmpty ( ) ) { octetList . remove ( 0 ) ; } octets = octetList . toArray ( ) ; } if ( octets . length > 8 ) { return false ; } int validOctets = 0 ; int emptyOctets = 0 ; for ( int index = 0 ; index < octets . length ; index ++ ) { String octet = ( String ) octets [ index ] ; if ( octet . length ( ) == 0 ) { emptyOctets ++ ; if ( emptyOctets > 1 ) { return false ; } } else { emptyOctets = 0 ; if ( octet . indexOf ( "." ) > - 1 ) { if ( ! inet6Address . endsWith ( octet ) ) { return false ; } if ( index > octets . length - 1 || index > 6 ) { return false ; } if ( ! isValidInet4Address ( octet ) ) { return false ; } validOctets += 2 ; continue ; } if ( octet . length ( ) > 4 ) { return false ; } int octetInt = 0 ; try { octetInt = Integer . valueOf ( octet , 16 ) . intValue ( ) ; } catch ( NumberFormatException e ) { return false ; } if ( octetInt < 0 || octetInt > 0xffff ) { return false ; } } validOctets ++ ; } if ( validOctets < 8 && ! containsCompressedZeroes ) { return false ; } return true ; }

Valida una dirección IPv6.Devuelve verdadero si es válido.


synchronized public int writeBulk  ( List < LogRecord > records ) throws IOException { int numRecords = 0 ; for ( LogRecord r : records ) { write ( r ) ; numRecords ++ ; } return numRecords ; }

Escribe a granel de registros.(TODO: Movió este método para registrar nivel de escritor)


public static void checkNotNull  ( @ Nullable Object o ) { if ( o == null ) { throw new NullPointerException ( "Object must not be null" ) ; } }

Afirma que el objeto no es nulo.Arroja una excepción de puntero nulo si es nulo.


void addPath  ( ViterbiPoint point , ViterbiPath newPath ) { if ( point . statePaths [ newPath . state ] == null ) { point . statePaths [ newPath . state ] = newPath ; } else if ( isBetterThan ( newPath . score , point . statePaths [ newPath . state ] . score ) ) { point . statePaths [ newPath . state ] = newPath ; } else { } }

Agregue la nueva ruta a la ruta del estado si es mejor que la ruta actual.En esto, el estado significa la posición del candidato asociado con este camino en la cola candidata para el elemento del segmento correspondiente.En otras palabras, este método utiliza a NewPath como un camino que conduce al candidato newpath.candidate, si tiene una mejor puntaje que el mejor camino anterior que conduce a ese candidato.


public static SM_SYSTEM_MESSAGE STR_GIVE_ITEM_OPTION_SUCCEED  ( DescriptionId descriptionId ) { return new SM_SYSTEM_MESSAGE ( 1300462 , descriptionId ) ; }

Has logrado en el sodado de manastona de% 0.


@ ObjectiveCName ( "addRecordEventsListener:" ) public List addRecordEventsListener  ( RecordEventsListener recordEventsListener ) { this . record . addRecordEventsListener ( recordEventsListener ) ; return this ; }

Agrega un oyente que le notificará si ocurre un evento de descarte, eliminación o error.


public static SM_SYSTEM_MESSAGE STR_CANT_USE_WORN_ITEM_OUT_OF_USABLE_COUNT  ( String value0 ) { return new SM_SYSTEM_MESSAGE ( 1300395 , value0 ) ; }

No puede usar% 0 al conteo de uso máximo, ya que el artículo está equipado actualmente.


public boolean entails  ( AccessPath a2 ) { if ( this . isEmpty ( ) || a2 . isEmpty ( ) ) return false ; if ( ( this . value != null && a2 . value == null ) || ( this . value == null && a2 . value != null ) ) return false ; if ( this . value != null && ! this . value . equals ( a2 . value ) ) return false ; if ( this . fields != null && a2 . fields != null ) { if ( this . fields . length > a2 . fields . length ) return false ; for ( int i = 0 ; i < this . fields . length ; i ++ ) if ( ! this . fields [ i ] . equals ( a2 . fields [ i ] ) ) return false ; } return true ; }

Comprueba si esta ruta de acceso implica la única, es decir, se refiere a todos los objetos, también se refiere a la otra ruta de acceso.


public void renderHyperlinkTitle  ( Appendable writer , Map < String , Object > context , ModelFormField modelFormField , String titleText ) throws IOException { if ( UtilValidate . isNotEmpty ( modelFormField . getHeaderLink ( ) ) ) { StringBuilder targetBuffer = new StringBuilder ( ) ; FlexibleStringExpander target = FlexibleStringExpander . getInstance ( modelFormField . getHeaderLink ( ) ) ; String fullTarget = target . expandString ( context ) ; targetBuffer . append ( fullTarget ) ; String targetType = CommonWidgetModels . Link . DEFAULT_URL_MODE ; if ( UtilValidate . isNotEmpty ( targetBuffer . toString ( ) ) && targetBuffer . toString ( ) . toLowerCase ( ) . startsWith ( "javascript:" ) ) { targetType = "plain" ; } WidgetWorker . makeHyperlinkString ( writer , modelFormField . getHeaderLinkStyle ( ) , targetType , targetBuffer . toString ( ) , null , titleText , null , modelFormField , this . request , this . response , null , null ) ; } else if ( modelFormField . isSortField ( ) ) { renderSortField ( writer , context , modelFormField , titleText ) ; } else if ( modelFormField . isRowSubmit ( ) ) { if ( UtilValidate . isNotEmpty ( titleText ) ) writer . append ( titleText ) . append ( "<br/>" ) ; writer . append ( "<input type=\"checkbox\" name=\"selectAll\" value=\"Y\" onclick=\"javascript:toggleAll(this, '" ) ; writer . append ( modelFormField . getModelForm ( ) . getName ( ) ) ; writer . append ( "');\"/>" ) ; } else { writer . append ( titleText ) ; } }

Hace un enlace para los campos de encabezado de la columna cuando hay un encabezado-enlace = "" especificado en la etiqueta <field>, usando estilo de encabezado-link-style = "".También hace que una casilla de verificación SelectAll en multifunción.


public static final void outlineShapes  ( GL2 gl , SandboxBody body , float w , float [ ] color , double scale ) { float lw = RenderUtilities . setLineWidth ( gl , w ) ; if ( color != null ) gl . glColor4fv ( color , 0 ) ; double we = w * 0.5 / scale ; int fSize = body . getFixtureCount ( ) ; for ( int i = 0 ; i < fSize ; i ++ ) { BodyFixture bf = body . getFixture ( i ) ; Shape s = bf . getShape ( ) ; if ( s instanceof Circle ) { Circle c = ( Circle ) s ; Vector2 ct = c . getCenter ( ) ; RenderUtilities . fillCircleFromCenter ( gl , c . getRadius ( ) + we , ct . x , ct . y ) ; } else { Wound wo = ( Wound ) s ; Vector2 [ ] vs = wo . getVertices ( ) ; gl . glBegin ( GL . GL_LINE_LOOP ) ; for ( int j = 0 ; j < vs . length ; j ++ ) { Vector2 v = vs [ j ] ; gl . glVertex2d ( v . x , v . y ) ; } gl . glEnd ( ) ; for ( int j = 0 ; j < vs . length ; j ++ ) { Vector2 v = vs [ j ] ; RenderUtilities . fillCircleFromCenter ( gl , we , v . x , v . y ) ; } } } RenderUtilities . setLineWidth ( gl , lw ) ; }

Esquema cada accesorio del cuerpo.<p /> Este método hace <b> no </ b> Aplique la transformación del cuerpo antes de representar.


public void callback  ( final String instanceId , final String callback , final Map < String , Object > data ) { callback ( instanceId , callback , data , false ) ; }

Invocar la devolución de llamada de JavaScript


public static UByte valueOf  ( byte value ) { return valueOfUnchecked ( ( short ) ( value & MAX_VALUE ) ) ; }

Obtenga una instancia de un byte sin firmar </ code> mediante enmascararlo con <code> 0xff </ code> es decir <code> (byte) -1 </ code> se convierte en <código> (UBYTE) 255 </ CODE>


public void testMissingRequiredProjects  ( ) throws IOException  { VirtualFile project2 = createGradleProjectToImport ( dir , module ( 2 ) , module ( 1 ) ) ; assert project2 != null : "Something wrong with the setup" ; configureTopLevelProject ( dir , Arrays . asList ( module ( 1 ) , module ( 2 ) ) , Collections . < String > emptySet ( ) ) ; Map < String , VirtualFile > projects = moduleListToMap ( GradleModuleImporter . getRelatedProjects ( project2 , getProject ( ) ) ) ; assertEquals ( 2 , projects . size ( ) ) ; assertModuleRequiredButNotFound ( module ( 1 ) , projects ) ; assertEquals ( project2 , projects . get ( pathToGradleName ( module ( 2 ) ) ) ) ; }

Prueba de importación de un proyecto tiene dependencia de origen, pero cuando falta ese directorio de dependencia


public boolean gotoNext  ( ) { if ( isCurrentSet ( ) ) { current . set1 ( current . get1 ( ) + 1 ) ; if ( current . get1 ( ) >= table . getGrid ( ) . getRowCount ( ) ) { current . set1 ( 0 ) ; current . set2 ( current . get2 ( ) + 1 ) ; } } else gotoFirst ( ) ; return isCurrentSet ( ) ; }


public < T extends  Event > void register ( Class < T > clazz , Consumer < T > handler )  { ConcurrentLinkedQueue < Consumer < ? > > handlers = map . get ( clazz ) ; if ( handlers == null ) { handlers = new ConcurrentLinkedQueue < > ( ) ; map . put ( clazz , handlers ) ; } handlers . add ( handler ) ; }

Registra un manejador para el tipo de evento dado.


public Author toEntity  ( AuthorDTO dto , int depth ) { if ( dto == null ) { return null ; } Author author = new Author ( ) ; author . setId ( dto . id ) ; author . setCivility ( dto . civility ) ; author . setFirstName ( dto . firstName ) ; author . setLastName ( dto . lastName ) ; author . setEmail ( dto . email ) ; author . setBirthDate ( dto . birthDate ) ; author . setBirthDateTime ( dto . birthDateTime ) ; if ( depth -- > 0 ) { author . setFavoriteAuthor ( toEntity ( dto . favoriteAuthor , depth ) ) ; } return author ; }

Convierte a la DTO pasada a un autor.Conveniente para la consulta por ejemplo.


public CreateRouteRequest ( MediaSource source , MediaSink sink , String routeId , String origin , int tabId , int requestId , RouteDelegate delegate ) { assert source != null ; assert sink != null ; mSource = source ; mSink = sink ; mRouteId = routeId ; mOrigin = origin ; mTabId = tabId ; mRequestId = requestId ; mDelegate = delegate ; }


public int annotationDirectoryOffsetFromClassDefIndex  ( int classDefIndex ) { checkBounds ( classDefIndex , tableOfContents . classDefs . size ) ; int position = tableOfContents . classDefs . off + ( SizeOf . CLASS_DEF_ITEM * classDefIndex ) ; position += SizeOf . UINT ; position += SizeOf . UINT ; position += SizeOf . UINT ; position += SizeOf . UINT ; position += SizeOf . UINT ; return data . getInt ( position ) ; }

Busque un desplazamiento de un directorio de anotación de un índice de clase DEF.


public Vector3f scaleAdd  ( float scalar , Vector3f mult , Vector3f add ) { this . x = mult . x * scalar + add . x ; this . y = mult . y * scalar + add . y ; this . z = mult . z * scalar + add . z ; return this ; }

<CÓDIGO> SAILAADD </ CODE> multiplica el vector dado por un escalar luego agrega el vector dado.


public boolean hasVisited  ( SimpleMethod method ) { return simpleMethodNameSet . contains ( method . getLocationAndName ( ) ) ; }

Devuelve <CÓDIGO> Verdadero </ código> Si este contexto ha visitado <Código> Método </ código>.


public void conjunctWith  ( Term t ) { terms . add ( t ) ; }

Modifica el predicado para ser la conjunción de sí misma y el término especificado.


static public ResolveType resolveThrownExceptions  ( @ NotNull final Method method , @ NotNull HashSet < PhpClass > declaredExceptions ) { PhpPsiElement previous = method . getPrevPsiSibling ( ) ; if ( ! ( previous instanceof PhpDocCommentImpl ) ) { return ResolveType . NOT_RESOLVED ; } Collection < PhpDocReturnTag > returns = PsiTreeUtil . findChildrenOfType ( previous , PhpDocReturnTag . class ) ; if ( returns . size ( ) > 0 ) { for ( PhpDocReturnTag returnOrThrow : returns ) { if ( returnOrThrow . getName ( ) . equals ( "@throws" ) ) { Collection < PhpDocTypeImpl > exceptions = PsiTreeUtil . findChildrenOfType ( returnOrThrow , PhpDocTypeImpl . class ) ; if ( exceptions . size ( ) > 0 ) { for ( PhpDocTypeImpl type : exceptions ) { PsiElement typeResolved = type . resolve ( ) ; if ( typeResolved instanceof PhpClass ) { declaredExceptions . add ( ( PhpClass ) typeResolved ) ; } } exceptions . clear ( ) ; } } } returns . clear ( ) ; } Collection < PhpDocTagImpl > tags = PsiTreeUtil . findChildrenOfType ( previous , PhpDocTagImpl . class ) ; if ( tags . size ( ) > 0 ) { for ( PhpDocTagImpl tag : tags ) { if ( tag . getName ( ) . toLowerCase ( ) . equals ( "@inheritdoc" ) ) { resolveInheritDoc ( method , declaredExceptions ) ; return ResolveType . RESOLVED_INHERIT_DOC ; } } tags . clear ( ) ; } return ResolveType . RESOLVED ; }

Devuelve falso si el bloque de documentos no está definido


public Observable < FirebaseChildEvent > observeChildAdded  ( final Query firebaseRef ) { return observeChildEvent ( firebaseRef ) . filter ( filterChildEvent ( EventType . ADDED ) ) ; }

Crea un observable solo para el método cambiado del niño.


protected void paintComponent  ( Graphics context ) { Graphics2D gr2d ; int i , k ; FontRenderContext render ; gr2d = ( Graphics2D ) context ; render = gr2d . getFontRenderContext ( ) ; gr2d . setColor ( PANEL_COLOUR ) ; gr2d . fillRect ( 0 , 0 , this . getWidth ( ) , this . getHeight ( ) ) ; boolean redoHeight = false ; boolean redoWidth = false ; if ( charMap4 . getDisplayFont ( ) == null ) { return ; } else if ( charMap4 . getDisplayFont ( ) . equals ( panelFont ) == false ) { clickIndex = hoverIndex = NO_MOUSE ; cornerIndex = 0 ; panelFont = charMap4 . getDisplayFont ( ) ; redoHeight = redoWidth = true ; fontData = gr2d . getFontMetrics ( panelFont ) ; lineAscent = fontData . getAscent ( ) ; lineHeight = fontData . getHeight ( ) ; maxWidth = Math . max ( 10 , fontData . getMaxAdvance ( ) ) ; horizStep = maxWidth + ( 2 * TEXT_MARGIN ) + GRID_WIDTH ; vertiStep = lineHeight + ( 2 * TEXT_MARGIN ) + GRID_WIDTH ; charCount = 0 ; int [ ] charTemp = new int [ CharMap4 . getMaxUnicode ( ) + 1 ] ; for ( i = 0 ; i < charTemp . length ; i ++ ) { charTemp [ i ] = - 1 ; } glyphCount = Math . max ( 0 , panelFont . getNumGlyphs ( ) ) ; int glymissing = panelFont . getMissingGlyphCode ( ) ; glyphChar = new int [ glyphCount ] ; glyphGlyph = new int [ glyphCount ] ; for ( i = 0 ; i < glyphCount ; i ++ ) { glyphChar [ i ] = - 1 ; glyphGlyph [ i ] = i ; } for ( i = CharMap4 . getMinUnicode ( ) ; i <= CharMap4 . getMaxUnicode ( ) ; i ++ ) { if ( panelFont . canDisplay ( i ) == false ) continue ; String charToString = CharMap4 . charToString ( i ) ; GlyphVector glyvector = panelFont . createGlyphVector ( render , charToString ) ; int glycount = glyvector . getNumGlyphs ( ) ; for ( k = 0 ; k < glycount ; k ++ ) { int glyph = glyvector . getGlyphCode ( k ) ; if ( ( glyph >= 0 ) && ( glyph < glyphCount ) && ( glyph != glymissing ) ) { if ( charTemp [ i ] < 0 ) { charTemp [ i ] = glyph ; } if ( glyphChar [ glyph ] < 0 ) { glyphChar [ glyph ] = i ; } } } if ( charTemp [ i ] >= 0 ) { charCount ++ ; } } charChar = new int [ charCount ] ; charGlyph = new int [ charCount ] ; k = 0 ; for ( i = CharMap4 . getMinUnicode ( ) ; i <= CharMap4 . getMaxUnicode ( ) ; i ++ ) { int glyph = charTemp [ i ] ; if ( glyph >= 0 ) { charChar [ k ] = i ; charGlyph [ k ] = glyph ; k ++ ; } } charTemp = null ; charMap4 . setStatusText ( CharMap4 . getFormatComma ( ) . format ( charCount ) + " characters with " + CharMap4 . getFormatComma ( ) . format ( glyphCount ) + " glyphs" ) ; if ( ( charCount <= 0 ) || ( glyphCount <= 0 ) ) { panelFont = null ; return ; } } if ( CharMap4 . isGlyphFlag ( ) ) { cellChar = glyphChar ; cellCount = glyphCount ; cellGlyph = glyphGlyph ; } else { cellChar = charChar ; cellCount = charCount ; cellGlyph = charGlyph ; } if ( redoWidth || ( this . getWidth ( ) != panelWidth ) ) { panelWidth = this . getWidth ( ) ; redoWidth = true ; panelColumns = Math . max ( 1 , ( ( panelWidth - ( 2 * PANEL_MARGIN ) - GRID_WIDTH ) / horizStep ) ) ; } if ( redoHeight || ( this . getHeight ( ) != panelHeight ) ) { panelHeight = this . getHeight ( ) ; redoHeight = true ; panelRows = Math . max ( 1 , ( ( panelHeight - ( 2 * PANEL_MARGIN ) - GRID_WIDTH ) / vertiStep ) ) ; } if ( ( cellCount != panelCount ) || redoHeight || redoWidth ) { panelCount = cellCount ; int row = cornerIndex / panelColumns ; row = Math . max ( 0 , Math . min ( row , ( ( cellCount / panelColumns ) - panelRows + 1 ) ) ) ; charMap4 . getGridScroll ( ) . setValues ( row , panelRows , 0 , ( ( cellCount + panelColumns - 1 ) / panelColumns ) ) ; cornerIndex = charMap4 . getGridScroll ( ) . getValue ( ) * panelColumns ; charMap4 . getGridScroll ( ) . setBlockIncrement ( Math . max ( 1 , ( panelRows - 1 ) ) ) ; charMap4 . getGridScroll ( ) . setUnitIncrement ( 1 ) ; } if ( pendingUpdates ) { pendingUpdates = false ; for ( int index = 0 ; index < cellChar . length ; index ++ ) { if ( cellChar [ index ] == pendingCharacter ) { selectedChar = index ; break ; } } } int end = cornerIndex + ( panelColumns * ( panelRows + 1 ) ) - 1 ; for ( i = cornerIndex ; i <= end ; i ++ ) { paintGridCell ( gr2d , render , i ) ; } }

MÉTODO DE PACKCOMPONENTE () Este es el método de "pintura" para un componente de swing de Java.Tenemos que preocuparnos por el cambio de tamaño de la ventana, las nuevas opciones elegidas por el usuario, etc. Hay muchas variables temporales en este método, porque algunos cálculos son difíciles y declarar que todas las variables al principio serían peores que las declararlas cuando sean primero.usado.


private void readObject  ( ObjectInputStream in ) throws IOException , ClassNotFoundException { in . defaultReadObject ( ) ; ConstrainableProxyUtil . verifyConsistentConstraints ( constraints , server , methodMappings ) ; }

Verifica que las restricciones del cliente para este proxy sean consistentes con las establecidas en el servidor subyacente Ref.


private void internalOpenFile  ( File f , List < SLDDataInterface > list ) { if ( f . isFile ( ) && FileSystemUtils . isFileExtensionSupported ( f , getFileExtensionList ( ) ) ) { try { String contents = readFile ( f , Charset . defaultCharset ( ) ) ; StyledLayerDescriptor sld = Ysld . parse ( contents ) ; if ( sldWriter == null ) { sldWriter = SLDWriterFactory . createWriter ( SLDOutputFormatEnum . SLD ) ; } String sldContents = sldWriter . encodeSLD ( null , sld ) ; SLDDataInterface sldData = new SLDData ( new StyleWrapper ( f . getName ( ) ) , sldContents ) ; sldData . setSLDFile ( f ) ; sldData . setReadOnly ( false ) ; sldData . setOriginalFormat ( SLDOutputFormatEnum . YSLD ) ; list . add ( sldData ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } }


private void photoGalleryIntent  ( ) { Intent intent = new Intent ( ) ; intent . setType ( "image/*" ) ; intent . setAction ( Intent . ACTION_GET_CONTENT ) ; startActivityForResult ( Intent . createChooser ( intent , getString ( R . string . select_picture_title ) ) , IMAGE_GALLERY_REQUEST ) ; }


private boolean filterout  ( DataTag dataTag , SourceDataTagValue sourceDataTagValue ) { Timestamp dataTagTimestamp , sourceTagTimestamp ; if ( dataTag . getDaqTimestamp ( ) != null && sourceDataTagValue . getDaqTimestamp ( ) != null ) { dataTagTimestamp = dataTag . getDaqTimestamp ( ) ; sourceTagTimestamp = sourceDataTagValue . getDaqTimestamp ( ) ; } else if ( dataTag . getSourceTimestamp ( ) != null && sourceDataTagValue . getTimestamp ( ) != null ) { dataTagTimestamp = dataTag . getSourceTimestamp ( ) ; sourceTagTimestamp = sourceDataTagValue . getTimestamp ( ) ; } else { return false ; } if ( sourceTagTimestamp . before ( dataTagTimestamp ) ) { if ( dataTag . getDataTagQuality ( ) == null || dataTag . getDataTagQuality ( ) . isAccessible ( ) ) { LOGGER . debug ( "update() : older timestamp and not inaccessible -> reject update" ) ; return true ; } else { LOGGER . debug ( "update() : older timestamp but tag currently inaccessible -> update with older timestamp" ) ; } } if ( sourceTagTimestamp . equals ( dataTagTimestamp ) && dataTag . getValue ( ) != null && sourceDataTagValue . getValue ( ) . equals ( dataTag . getValue ( ) ) && dataTag . getDataTagQuality ( ) . isValid ( ) && sourceDataTagValue . getQuality ( ) != null && sourceDataTagValue . getQuality ( ) . isValid ( ) ) { LOGGER . debug ( "update() : values and timestamps are equal, so nothing to update -> reject update" ) ; return true ; } return false ; }

Método que contiene toda la lógica para filtrar las actualizaciones de DataTag entrantes antes de que se introduzcan actualizaciones.Llamada dentro del bloque sincronizado.


protected double tTest  ( final double m1 , final double m2 , final double v1 , final double v2 , final double n1 , final double n2 ) throws MathIllegalArgumentException , MathIllegalStateException { final double t = FastMath . abs ( t ( m1 , m2 , v1 , v2 , n1 , n2 ) ) ; final double degreesOfFreedom = df ( v1 , v2 , n1 , n2 ) ; final TDistribution distribution = new TDistribution ( degreesOfFreedom ) ; return 2.0 * distribution . cumulativeProbability ( - t ) ; }

Calcule el valor P para 2 lados, prueba T de 2 muestra.<p> no asume que las variaciones de subpoblación son iguales.Los grados de libertad se estiman a partir de los datos. </ P>


private DeepstreamFactory ( ) { this . clients = new HashMap ( ) ; }

DeepStreamFactory es un mapa de todas las conexiones de URL creadas


public SwitchPreference ( Context context , AttributeSet attrs , int defStyleAttr , int defStyleRes ) { super ( context , attrs , defStyleAttr , defStyleRes ) ; TypedArray a = context . obtainStyledAttributes ( attrs , R . styleable . SwitchPreference , defStyleAttr , defStyleRes ) ; setSummaryOn ( TypedArrayUtils . getString ( a , R . styleable . SwitchPreference_summaryOn , R . styleable . SwitchPreference_android_summaryOn ) ) ; setSummaryOff ( TypedArrayUtils . getString ( a , R . styleable . SwitchPreference_summaryOff , R . styleable . SwitchPreference_android_summaryOff ) ) ; setSwitchTextOn ( TypedArrayUtils . getString ( a , R . styleable . SwitchPreference_switchTextOn , R . styleable . SwitchPreference_android_switchTextOn ) ) ; setSwitchTextOff ( TypedArrayUtils . getString ( a , R . styleable . SwitchPreference_switchTextOff , R . styleable . SwitchPreference_android_switchTextOff ) ) ; setDisableDependentsState ( TypedArrayUtils . getBoolean ( a , R . styleable . SwitchPreference_disableDependentsState , R . styleable . SwitchPreference_android_disableDependentsState , false ) ) ; a . recycle ( ) ; }

Construya una nueva pantalla de interrupciones con las opciones de estilo dadas.


static Class [ ] reduce  ( Class [ ] classes , boolean keepSupers ) { return reduce0 ( classes . clone ( ) , keepSupers ) ; }

Verifica que hay al menos un elemento, y devuelve una nueva matriz de los elementos, en orden arbitraria, con clases redundantes eliminadas de la siguiente manera.Para cualquiera de las dos clases C1 y C2, si C1.EsassignableFROM (C2) es verdadero, luego se elimina C2 si los mantenimientos son verdaderos, de lo contrario se elimina C1.


protected MarketDeleteCommentQuery ownerId  ( int value ) { return unsafeParam ( "owner_id" , value ) ; }

Identificador de una comunidad de propietario de un artículo Tenga en cuenta que la identificación de la comunidad en el parámetro 'propietario_id' debe ser un número negativo.Por ejemplo, 'propietario_id' = - 1 coincide con la comunidad [vk.com/apiclub|vk api]


private void walk  ( File directory , int depth , Collection < T > results ) throws IOException { checkIfCancelled ( directory , depth , results ) ; if ( handleDirectory ( directory , depth , results ) ) { handleDirectoryStart ( directory , depth , results ) ; int childDepth = depth + 1 ; if ( depthLimit < 0 || childDepth <= depthLimit ) { checkIfCancelled ( directory , depth , results ) ; File [ ] childFiles = filter == null ? directory . listFiles ( ) : directory . listFiles ( filter ) ; childFiles = filterDirectoryContents ( directory , depth , childFiles ) ; if ( childFiles == null ) { handleRestricted ( directory , childDepth , results ) ; } else { for ( File childFile : childFiles ) { if ( childFile . isDirectory ( ) ) { walk ( childFile , childDepth , results ) ; } else { checkIfCancelled ( childFile , childDepth , results ) ; handleFile ( childFile , childDepth , results ) ; checkIfCancelled ( childFile , childDepth , results ) ; } } } } handleDirectoryEnd ( directory , depth , results ) ; } checkIfCancelled ( directory , depth , results ) ; }

Método principal recursivo para examinar la jerarquía de directorios.


public final boolean canSet  ( String field , Class type ) { return m_table . canSet ( field , type ) ; }

Compruebe si el método <código> Configure </ codice> para el campo de datos dado puede aceptar valores de un tipo de destino dado.


private void moveSizeWithFreeAspectRatio  ( RectF rect , float x , float y , RectF bounds , int viewWidth , int viewHeight , float snapMargin ) { switch ( mType ) { case TOP_LEFT : adjustTop ( rect , y , bounds , snapMargin , 0 , false , false ) ; adjustLeft ( rect , x , bounds , snapMargin , 0 , false , false ) ; break ; case TOP_RIGHT : adjustTop ( rect , y , bounds , snapMargin , 0 , false , false ) ; adjustRight ( rect , x , bounds , viewWidth , snapMargin , 0 , false , false ) ; break ; case BOTTOM_LEFT : adjustBottom ( rect , y , bounds , viewHeight , snapMargin , 0 , false , false ) ; adjustLeft ( rect , x , bounds , snapMargin , 0 , false , false ) ; break ; case BOTTOM_RIGHT : adjustBottom ( rect , y , bounds , viewHeight , snapMargin , 0 , false , false ) ; adjustRight ( rect , x , bounds , viewWidth , snapMargin , 0 , false , false ) ; break ; case LEFT : adjustLeft ( rect , x , bounds , snapMargin , 0 , false , false ) ; break ; case TOP : adjustTop ( rect , y , bounds , snapMargin , 0 , false , false ) ; break ; case RIGHT : adjustRight ( rect , x , bounds , viewWidth , snapMargin , 0 , false , false ) ; break ; case BOTTOM : adjustBottom ( rect , y , bounds , viewHeight , snapMargin , 0 , false , false ) ; break ; default : break ; } }

Cambie el tamaño de la ventana del recorte en el borde requerido (o bordes para el movimiento del tamaño de la esquina) sin afectar los bordes "secundarios". <br> Sólo los bordes primarios se fijan para permanecer dentro de los límites.


public static boolean hasRole  ( String roleName ) { for ( String role : getRoles ( ) ) { if ( role . equalsIgnoreCase ( roleName ) ) { return true ; } } return false ; }

¿Decir si se establece el papel aprobado?


public static void startLocalZkServer  ( final int port ) { startLocalZkServer ( port , org . apache . commons . io . FileUtils . getTempDirectoryPath ( ) + File . separator + "test-" + System . currentTimeMillis ( ) ) ; }

Inicia una instancia de ZK local con un directorio de datos vacío generado


public DefaultHibernateSpaceDataSourceConfigurer augmentInitialLoadEntries  ( boolean augmentInitialLoadEntries ) { this . augmentInitialLoadEntries = augmentInitialLoadEntries ; return this ; }

Interruptor de características para la carga de carga inicial Aumento (creación de la consulta específica de la partición para las entradas) por defecto en <Code> True </ Code>.


@ Override public void apply  ( NexusStreamParser np ) throws Exception { np . matchIgnoreCase ( "set fontSize=" ) ; String input = np . getWordRespectCase ( ) ; np . matchIgnoreCase ( ";" ) ; int newSize = 0 ; boolean increase = false ; boolean decrease = false ; if ( Basic . isInteger ( input ) && Integer . parseInt ( input ) >= 0 ) newSize = Integer . parseInt ( input ) ; else if ( input . equalsIgnoreCase ( "increase" ) ) increase = true ; else if ( input . equalsIgnoreCase ( "decrease" ) ) decrease = true ; else throw new IOException ( "Illegal font size: " + input ) ; boolean changed = false ; GraphView viewer ; if ( getViewer ( ) instanceof ClusterViewer ) viewer = ( ( ClusterViewer ) getViewer ( ) ) . getGraphView ( ) ; else if ( getViewer ( ) instanceof GraphView ) viewer = ( GraphView ) getViewer ( ) ; else return ; Set < Node > nodes = new HashSet < > ( ) ; if ( viewer . getSelectedNodes ( ) . size ( ) == 0 && viewer . getSelectedEdges ( ) . size ( ) == 0 ) { for ( Node v = viewer . getGraph ( ) . getFirstNode ( ) ; v != null ; v = v . getNext ( ) ) nodes . add ( v ) ; } else nodes . addAll ( viewer . getSelectedNodes ( ) ) ; for ( Node v : nodes ) { if ( viewer . getLabel ( v ) != null ) { Font font = viewer . getFont ( v ) ; int size = font . getSize ( ) ; if ( increase ) { size = Math . max ( size + 1 , ( int ) ( size * 1.1 ) ) ; } else if ( decrease ) { if ( size >= 2 ) size = Math . max ( 1 , Math . min ( size - 1 , ( int ) ( size / 1.1 ) ) ) ; } else { size = newSize ; } if ( size != font . getSize ( ) ) { font = new Font ( font . getFamily ( ) , font . getStyle ( ) , size ) ; viewer . setFont ( v , font ) ; ProgramProperties . put ( ProgramProperties . DEFAULT_FONT , font . getFamily ( ) , font . getStyle ( ) , size > 0 ? size : 6 ) ; changed = true ; } } } for ( Edge e : viewer . getSelectedEdges ( ) ) { if ( viewer . getLabel ( e ) != null ) { Font font = viewer . getFont ( e ) ; int size = font . getSize ( ) ; if ( increase ) { size = Math . max ( size + 1 , ( int ) ( size * 1.2 ) ) ; } else if ( decrease ) { if ( size >= 2 ) size = Math . max ( 1 , Math . min ( size - 1 , ( int ) ( size / 1.1 ) ) ) ; } else { size = newSize ; } if ( size != font . getSize ( ) ) { font = new Font ( font . getFamily ( ) , font . getStyle ( ) , size ) ; viewer . setFont ( e , font ) ; ProgramProperties . put ( ProgramProperties . DEFAULT_FONT , font . getFamily ( ) , font . getStyle ( ) , size > 0 ? size : 6 ) ; changed = true ; } } } if ( changed ) viewer . repaint ( ) ; }


public void close  ( ) { if ( this . masterPage == null ) { return ; } if ( this . durable ) { this . masterPage . flush ( ) ; } List < Long > toRemove = new ArrayList < Long > ( ) ; Set < Long > vPageNums = null ; List < Page > toFlush = new ArrayList < Page > ( ) ; synchronized ( PageAllocator . class ) { vPageNums = pageLRU . keySet ( ) ; } for ( Long l : vPageNums ) { if ( translateAllocator ( l ) == this . allocID ) { toRemove . add ( l ) ; } } synchronized ( PageAllocator . class ) { for ( Long vPageNum : toRemove ) { if ( pageLRU . containsKey ( vPageNum ) ) { toFlush . add ( pageLRU . get ( vPageNum ) ) ; pageLRU . remove ( vPageNum ) ; } } } if ( this . durable ) { for ( Page p : toFlush ) { p . flush ( ) ; } } this . masterPage = null ; try { this . fc . close ( ) ; } catch ( IOException e ) { throw new PageException ( "Could not close Page Alloc " + e . getMessage ( ) ) ; } }


public static String toString  ( final byte byteValue ) { final int tmp = byteValue << 8 ; char [ ] retstr = new char [ ] { HEX [ ( tmp >> 12 ) & 0x0F ] , HEX [ ( tmp >> 8 ) & 0x0F ] } ; return String . valueOf ( retstr ) ; }

Convierte un byte en una cadena hexadecimal.


@ Override public int nodeSize  ( ) { return this . numberOfKeys ; }

Método para obtener el siguiente bloque Esto se puede usar al escanear cuando el iterador de esta clase se puede usar iterar sobre bloques


public DataInputBuffer ( ) { this  ( new Buffer ( ) ) ; }


void registerAsIdle  ( ) { if ( timeToIdlePolicy . isPresent ( ) ) { timeToIdlePolicy . get ( ) . add ( resourceKey ) ; if ( resourceKey . getStatus ( ) != Status . IDLE ) { timeToIdlePolicy . get ( ) . invalidate ( resourceKey ) ; } } }

Agregue el recurso al caché inactivo si está presente.Si se eliminó el recurso por cualquier otra razón mientras se agrega, entonces debe ser descartado después


@ Override protected ModelAndView doResolveException  ( final HttpServletRequest request , final HttpServletResponse response , final Object handler , final Exception exception ) { LOGGER . debug ( "In DASTExceptionHandler" ) ; response . setStatus ( HttpStatus . SC_INTERNAL_SERVER_ERROR ) ; AppScanUtils . sendErrorMail ( exception ) ; if ( exception instanceof DASTProxyException ) { if ( AppScanUtils . isNotNull ( ( ( DASTProxyException ) exception ) . getErrorCode ( ) ) ) { return new ModelAndView ( view , AppScanConstants . JSON_RESPONSE_ERROR_IDENTIFIER , ( ( DASTProxyException ) exception ) . getErrorCode ( ) ) ; } else { LOGGER . error ( exception ) ; return new ModelAndView ( view , AppScanConstants . JSON_RESPONSE_ERROR_IDENTIFIER , ( ( DASTProxyException ) exception ) . getErrorMessage ( ) ) ; } } return new ModelAndView ( view , "error" , "Exception has occured. Please contact the site administrator" ) ; }

Este es el método real que intercepta todas las excepciones lanzadas dentro del proyecto.Aquí, hay un cheque para ver si hay detalles sobre el error.En caso de que se haya interceptado la excepción de la excepción personalizada, el mensaje que lleva se envía al cliente.En caso de que sea algún otro error, luego se registra el mensaje y se envía un mensaje de error genérico al cliente.


public JCustomTooltip ( JComponent src , JComponent content ) { this ( src , content , false ) ; }


public void incrementSelectedRuleIndex  ( ) { this . selectedRuleIndex ++ ; }

Incremento del índice de regla seleccionado.


@ Override public void modelChanged  ( @ NotNull NlModel model ) { if ( myDesignSurface != null ) { updateDeviceConfiguration ( myDesignSurface . getConfiguration ( ) ) ; updateComponents ( model . getComponents ( ) ) ; updateScreenNumber ( myDesignSurface ) ; myMiniMap . repaint ( ) ; } }

Se produjo un cambio dentro del objeto modelo.


public static final List bubbleSortVerticesByStringLength  ( List l ) { boolean bChanged = true ; while ( bChanged ) { bChanged = false ; for ( int iCnt = 0 ; iCnt < l . size ( ) - 1 ; iCnt ++ ) { if ( ( l . get ( iCnt + 1 ) . toString ( ) ) . length ( ) > ( l . get ( iCnt ) . toString ( ) ) . length ( ) ) { VertexImpl vTmp = ( VertexImpl ) ( l . get ( iCnt + 1 ) ) ; l . set ( iCnt + 1 , l . get ( iCnt ) ) ; l . set ( iCnt , vTmp ) ; bChanged = true ; } } } return l ; }

Burbuja ordena las cuerdas en una lista de cadenas dada, donde la cadena más larga es la primera revisión.


public static String editUnitToTimecode  ( BigInteger eu , BigFraction unitsInSec ) { BigFraction editUnits = new BigFraction ( eu ) ; BigFraction unitsInMin = unitsInSec . multiply ( new BigFraction ( 60 ) ) ; BigFraction unitsInHour = unitsInSec . multiply ( new BigFraction ( 60 * 60 ) ) ; int hours = editUnits . divide ( unitsInHour ) . intValue ( ) ; int minutes = editUnits . subtract ( unitsInHour . multiply ( hours ) ) . divide ( unitsInMin ) . intValue ( ) ; int seconds = editUnits . subtract ( unitsInHour . multiply ( hours ) ) . subtract ( unitsInMin . multiply ( minutes ) ) . divide ( unitsInSec ) . intValue ( ) ; BigFraction units = editUnits . subtract ( unitsInHour . multiply ( hours ) ) . subtract ( unitsInMin . multiply ( minutes ) ) . subtract ( unitsInSec . multiply ( seconds ) ) ; int milliseconds = new BigFraction ( 1000 ) . divide ( unitsInSec ) . multiply ( units ) . intValue ( ) ; return String . format ( "%02d:%02d:%02d.%03d" , hours , minutes , seconds , milliseconds ) ; }

Transforma las unidades de edición a un código de tiempo de acuerdo con la tarifa de la unidad de edición dada.<ul> <li> Un ejemplo de las unidades de edición es un marco. </ li> <li> El código de tiempo de salida tiene el siguiente formato 'HH: MM: SS.XXX', donde XXX es milisegundos. </ li> </ul>


@ Override public String onProcessConfiguration  ( final ProcessConfigurationRequest processConfigurationRequest ) { ProcessConfigurationResponse processConfigurationResponse = new ProcessConfigurationResponse ( ) ; if ( processConfigurationRequest == null ) { LOGGER . error ( "onProcessConfiguration(null) called - rejecting the request." ) ; processConfigurationResponse . setConfigurationXML ( ProcessConfigurationResponse . CONF_REJECTED ) ; return this . xmlConverter . toXml ( processConfigurationResponse ) ; } processConfigurationResponse . setProcessName ( processConfigurationRequest . getProcessName ( ) ) ; if ( LOGGER . isDebugEnabled ( ) ) { StringBuilder str = new StringBuilder ( "onProcessConfiguration([" ) ; str . append ( processConfigurationRequest . getProcessName ( ) ) ; str . append ( ", " ) ; str . append ( processConfigurationRequest . getProcessPIK ( ) ) ; str . append ( "]) called." ) ; LOGGER . debug ( str . toString ( ) ) ; } try { Long processId = processCache . getProcessId ( processConfigurationRequest . getProcessName ( ) ) ; Process processCopy = processCache . getCopy ( processId ) ; LOGGER . info ( "onProcessConfiguration - Configuration request for DAQ " + processCopy . getName ( ) + " authorized." ) ; if ( processConfigurationRequest . getProcessPIK ( ) . equals ( processCopy . getProcessPIK ( ) ) ) { LOGGER . info ( "onProcessConfiguration - SERVER_CONFIG" ) ; this . processFacade . setLocalConfig ( processId , LocalConfig . N ) ; } processConfigurationResponse . setConfigurationXML ( processXMLProvider . getProcessConfigXML ( processCopy ) ) ; LOGGER . info ( "onProcessConfiguration - Returning configuration XML to DAQ " + processCopy . getName ( ) ) ; } catch ( CacheElementNotFoundException cacheEx ) { LOGGER . warn ( "onProcessConfiguration - process not found in cache (name = " + processConfigurationRequest . getProcessName ( ) + ") - unable to accept connection request." , cacheEx ) ; processConfigurationResponse . setConfigurationXML ( ProcessConfigurationResponse . CONF_REJECTED ) ; } catch ( Exception e ) { LOGGER . error ( new StringBuffer ( "onProcessConfiguration - An unexpected Exception occurred." ) . toString ( ) , e ) ; processConfigurationResponse . setConfigurationXML ( ProcessConfigurationResponse . CONF_REJECTED ) ; } return this . xmlConverter . toXml ( processConfigurationResponse ) ; }

Sincronizado en el objeto de caché de proceso.Coge todas las excepciones.No es necesario enviar el proceso PIK para obtener el archivo de configuración (el modo de prueba puede acceder a ella entonces)


private void logSlowRequests  ( long requestLifetime , Request < ? > request , byte [ ] responseContents , StatusLine statusLine ) { if ( DEBUG || requestLifetime > SLOW_REQUEST_THRESHOLD_MS ) { VolleyLog . d ( "HTTP response for request=<%s> [lifetime=%d], [size=%s], " + "[rc=%d], [retryCount=%s]" , request , requestLifetime , responseContents != null ? responseContents . length : "null" , statusLine . getStatusCode ( ) , request . getRetryPolicy ( ) . getCurrentRetryCount ( ) ) ; } }

Las solicitudes de registros que se hicieron cargo de Slow_Request_Threshold_MS para completar.


public FriendsGetOnlineQueryWithMobile offset  ( Integer value ) { return unsafeParam ( "offset" , value ) ; }

Compensación necesaria para devolver un subconjunto específico de amigos.


public boolean isNavBarTintEnabled  ( ) { return mNavBarTintEnabled ; }

¿Está habilitado el teñido para la barra de navegación del sistema?


public List < GenericValue > makeAllOrderItemSurveyResponses  ( ) { List < GenericValue > allInfos = new LinkedList < GenericValue > ( ) ; for ( ShoppingCartItem item : this ) { List < String > responses = UtilGenerics . checkList ( item . getAttribute ( "surveyResponses" ) ) ; GenericValue response = null ; if ( responses != null ) { for ( String responseId : responses ) { try { response = this . getDelegator ( ) . findOne ( "SurveyResponse" , UtilMisc . toMap ( "surveyResponseId" , responseId ) , false ) ; } catch ( GenericEntityException e ) { Debug . logError ( e , "Unable to obtain SurveyResponse record for ID : " + responseId , module ) ; } } } else { String surveyResponseId = ( String ) item . getAttribute ( "surveyResponseId" ) ; try { response = this . getDelegator ( ) . findOne ( "SurveyResponse" , UtilMisc . toMap ( "surveyResponseId" , surveyResponseId ) , false ) ; } catch ( GenericEntityException e ) { Debug . logError ( e , "Unable to obtain SurveyResponse record for ID : " + surveyResponseId , module ) ; } } if ( response != null ) { response . set ( "orderItemSeqId" , item . getOrderItemSeqId ( ) ) ; allInfos . add ( response ) ; } } return allInfos ; }

Haga una lista de objetos de SurveyResponse para actualizar con el conjunto de información de pedido


@ SuppressLint ( "NewApi" ) public void sendText  ( Context context ) throws ActivityNotFoundException  { if ( Utils . hasKitKat ( ) ) { String defaultSmsPackageName = Telephony . Sms . getDefaultSmsPackage ( context ) ; Intent sendIntent = new Intent ( Intent . ACTION_SENDTO , Uri . parse ( "smsto:" + Uri . encode ( getNumber ( ) ) ) ) ; if ( defaultSmsPackageName != null ) { sendIntent . setPackage ( defaultSmsPackageName ) ; } context . startActivity ( sendIntent ) ; } else { Intent textIntent = new Intent ( ) ; textIntent . setAction ( Intent . ACTION_VIEW ) ; textIntent . setData ( Uri . fromParts ( "sms" , getNumber ( ) , null ) ) ; context . startActivity ( textIntent ) ; } }

Enciende una intención con la solicitud para enviar un SMS al MSISDN que de este teléfono


@ POST @ Path ( "{experimentID}/buckets" ) @ Consumes ( APPLICATION_JSON ) @ Produces ( APPLICATION_JSON ) @ ApiOperation ( value = "Modify a bucket for an experiment" , notes = "Can only modify buckets for an experiment that is in DRAFT state." , response = Bucket . class ) @ Timed public Response postBucket  ( @ PathParam ( "experimentID" ) @ ApiParam ( value = "Experiment ID" ) final Experiment . ID experimentID , @ ApiParam ( required = true , defaultValue = DEFAULT_MODBUCK ) final Bucket newBucketEntity , @ HeaderParam ( AUTHORIZATION ) @ ApiParam ( value = EXAMPLE_AUTHORIZATION_HEADER , required = true ) final String authorizationHeader ) { Username userName = authorization . getUser ( authorizationHeader ) ; Experiment experiment = experiments . getExperiment ( experimentID ) ; if ( experiment == null ) { throw new ExperimentNotFoundException ( experimentID ) ; } authorization . checkUserPermissions ( userName , experiment . getApplicationName ( ) , CREATE ) ; Bucket newBucket = Bucket . from ( newBucketEntity ) . withExperimentID ( experimentID ) . build ( ) ; LOGGER . warn ( "Bucket edited: user " + userName . toString ( ) + " is adding bucket " + newBucket . toString ( ) + " to experiment " + experimentID . toString ( ) ) ; UserInfo user = authorization . getUserInfo ( userName ) ; Bucket bucket = buckets . createBucket ( experimentID , newBucket , user ) ; assert bucket != null : "Created bucket was null" ; return httpHeader . headers ( CREATED ) . entity ( bucket ) . build ( ) ; }

Crea un nuevo cubo para el experimento especificado, inicializando sus datos especificados en el cuerpo JSON de la solicitud.


public void saveFrame  ( File file ) throws IOException { if ( ! eglCore . isCurrent ( eGLSurface ) ) { throw new RuntimeException ( "Expected EGL context/surface is not current" ) ; } String filename = file . toString ( ) ; int width = getWidth ( ) ; int height = getHeight ( ) ; ByteBuffer buf = ByteBuffer . allocateDirect ( width * height * 4 ) ; buf . order ( ByteOrder . LITTLE_ENDIAN ) ; GLES20 . glReadPixels ( 0 , 0 , width , height , GLES20 . GL_RGBA , GLES20 . GL_UNSIGNED_BYTE , buf ) ; GlUtil . checkGlError ( "glReadPixels" ) ; buf . rewind ( ) ; BufferedOutputStream bos = null ; try { bos = new BufferedOutputStream ( new FileOutputStream ( filename ) ) ; Bitmap bmp = Bitmap . createBitmap ( width , height , Bitmap . Config . ARGB_8888 ) ; bmp . copyPixelsFromBuffer ( buf ) ; bmp . compress ( Bitmap . CompressFormat . PNG , 90 , bos ) ; bmp . recycle ( ) ; } finally { if ( bos != null ) bos . close ( ) ; } Log . i ( TAG , "Saved " + width + "x" + height + " frame as '" + filename + "'" ) ; }

Guarda la superficie EGL a un archivo.<P /> espera que la superficie EGL de este objeto esté actualizada.


public void addValidationRuleGroup  ( ValidationRuleGroup validationRuleGroup ) { groups . add ( validationRuleGroup ) ; validationRuleGroup . getMembers ( ) . add ( this ) ; }

Se une a un grupo de reglas de validación.


@ Override public Object clone  ( ) { return GenericValue . create ( this ) ; }

Clones este genericvalor, este es un clon poco profundo y utiliza el clon de hosthmap poco profundo por defecto


public boolean isFull  ( ) { return hi ( ) - lo ( ) == 2 * S2 . M_PI ; }

Devuelve verdadero si el intervalo contiene todos los puntos en el círculo de la unidad.


protected final void applyTheme  ( AppTheme theme ) { preferences . persistSelectedTheme ( theme ) ; restartActivity ( ) ; int enterAnimation = android . R . anim . fade_in ; int exitAnimation = android . R . anim . fade_out ; overridePendingTransition ( enterAnimation , exitAnimation ) ; }

Persiste el tema que pasa y reinicia la actividad de la actividad al nuevo tema.


private static boolean isInCornerTargetZone  ( float x , float y , float handleX , float handleY , float targetRadius ) { if ( Math . abs ( x - handleX ) <= targetRadius && Math . abs ( y - handleY ) <= targetRadius ) { return true ; } return false ; }

Determina si la coordenada especificada está en la zona táctil de destino para un asa de esquina.


public static byte [ ] generateKey  ( ) { byte [ ] keyData = new byte [ KEY_LENGTH ] ; secureRandom . nextBytes ( keyData ) ; byte [ ] ivData = new byte [ IV_LENGTH ] ; secureRandom . nextBytes ( ivData ) ; byte [ ] key = new byte [ IV_LENGTH + KEY_LENGTH ] ; System . arraycopy ( ivData , 0 , key , 0 , IV_LENGTH ) ; System . arraycopy ( keyData , 0 , key , IV_LENGTH , KEY_LENGTH ) ; return key ; }

Genera una nueva clave de cifrado simétrica.


@ Override public boolean isCellEditable  ( int rowIndex , int columnIndex ) { return true ; }

Los controles si está editable de la célula.


public OffscreenSurface ( EglCore eglCore , int width , int height ) { super ( eglCore ) ; createOffscreenSurface ( width , height ) ; }

Crea una superficie fuera de pantalla con el ancho y la altura especificados.


public int addNodeRow  ( ) { return getNodeTable ( ) . addRow ( ) ; }

Agregue la fila a la tabla de nodos, agregando así un nodo al gráfico.


public static SM_SYSTEM_MESSAGE STR_SKILL_SUCC_AlwaysHit_ME_TO_SELF  ( String skillname ) { return new SM_SYSTEM_MESSAGE ( 1200327 , skillname ) ; }

Impulsó su precisión usando [% SkillName].


private MulticastAnnouncement decodeMulticastAnnouncement  ( final DatagramPacket pkt ) throws IOException { int pv ; try { pv = ByteBuffer . wrap ( pkt . getData ( ) , pkt . getOffset ( ) , pkt . getLength ( ) ) . getInt ( ) ; } catch ( BufferUnderflowException e ) { throw new DiscoveryProtocolException ( null , e ) ; } multicastAnnouncementConstraints . checkProtocolVersion ( pv ) ; final Discovery disco = getDiscovery ( pv ) ; return disco . decodeMulticastAnnouncement ( pkt , multicastAnnouncementConstraints . getUnfulfilledConstraints ( ) , true ) ; }

Decodaciones recibieron paquete de anuncios de multidifusión.La verificación de restricciones se retrasa.


public ComparableWeakReference ( T referent , ReferenceQueue < ? super T > q ) { super ( referent , q ) ; }

Crea una nueva instancia de una referencia comparable que se refiere al objeto dado y está registrado con la cola dada.


private Paillier deserializePaillier  ( JsonObject paillier ) { BigInteger p = new BigInteger ( paillier . get ( "p" ) . getAsString ( ) ) ; BigInteger q = new BigInteger ( paillier . get ( "q" ) . getAsString ( ) ) ; int bitLength = paillier . get ( "bitLength" ) . getAsInt ( ) ; return new Paillier ( p , q , bitLength ) ; }


@ SpaceDataEvent public Data processData  ( Data data ) { try { Thread . sleep ( workDuration ) ; } catch ( InterruptedException e ) { } data . setProcessed ( true ) ; data . setData ( "PROCESSED : " + data . getRawData ( ) ) ; log . info ( " ------ PROCESSED : " + data ) ; return data ; }

Procese el objeto de datos dado y devuelva los datos procesados.Se puede invocar utilizando eventos de OpenSpaces cuando ocurre un evento coincidente.


private boolean casHead  ( HeadIndex < K , V > cmp , HeadIndex < K , V > val ) { return UNSAFE . compareAndSwapObject ( this , headOffset , cmp , val ) ; }


protected void addJob  ( BundleContext context , Class < ? extends Job > clazz , String cronExpression ) { String jobName = clazz . getName ( ) ; String jobGroup = FrameworkUtil . getBundle ( clazz ) . getSymbolicName ( ) ; JobDetail job = new JobDetail ( jobName , jobGroup , clazz ) ; job . setDurability ( false ) ; job . setVolatility ( true ) ; job . setDescription ( jobName ) ; try { CronTrigger trigger = new CronTrigger ( jobName , jobGroup , cronExpression ) ; if ( scheduler == null ) { if ( schedulerProperties == null ) { schedulerProperties = getDefaultSchedulerProperties ( ) ; } scheduler = new StdSchedulerFactory ( schedulerProperties ) . getScheduler ( ) ; scheduler . start ( ) ; } Date date = scheduler . scheduleJob ( job , trigger ) ; Logger . info ( this , "Scheduled job " + jobName + ", next trigger is on " + date ) ; } catch ( ParseException e ) { Logger . error ( this , "Cron expression '" + cronExpression + "' has an exception. Throwing IllegalArgumentException" , e ) ; throw new IllegalArgumentException ( e ) ; } catch ( SchedulerException e ) { Logger . error ( this , "Unable to schedule job " + jobName , e ) ; } }

Agrega un trabajo, y comienza a un programador cuando aún no se ha iniciado ninguno


private void refresh  ( ) { isLoadingData = true ; isLoadingMoreData = true ; mOnRefreshListener . onRefresh ( ) ; }

Actualizar no permitir que la actualización y la carga sean juntos


protected AudioFacade ( @ NonNull Context context ) { this ( new Media ( context ) , new Playlist ( context ) , new Album ( context ) , new Genre ( context ) , new Artist ( context ) ) ; }

Inicializa la fachada con el contexto de la aplicación.No llame a este método directamente.


public BasenameList subList  ( int fromIndex , int toIndex ) { Vector subVec = new Vector ( toIndex - fromIndex , DEFAULT_INCREMENT ) ; for ( int i = fromIndex ; i < toIndex ; i ++ ) subVec . add ( this . getName ( i ) ) ; return ( new BasenameList ( this . fromDir , this . fromExt , subVec ) ) ; }

Devuelve un sublista autónomo entre Fromindex, Inclusive y Toindex, exclusivo.


@ Override public void createSomething  ( Object newKey ) { }


public PhotosGetQuery feedType  ( String value ) { return unsafeParam ( "feed_type" , value ) ; }

Tipo de alimento obtenido en el campo "Feed" del método.


void boxes  ( ValueBox ... boxes ) { this . boxes = boxes ; }

Establece las casillas de valor correspondientes a los operandos utilizados por este marco.


public void callTakePicture  ( int returnType , int encodingType ) { boolean saveAlbumPermission = PermissionHelper . hasPermission ( this , Manifest . permission . READ_EXTERNAL_STORAGE ) ; boolean takePicturePermission = PermissionHelper . hasPermission ( this , Manifest . permission . CAMERA ) ; if ( ! takePicturePermission ) { takePicturePermission = true ; try { PackageManager packageManager = this . cordova . getActivity ( ) . getPackageManager ( ) ; String [ ] permissionsInPackage = packageManager . getPackageInfo ( this . cordova . getActivity ( ) . getPackageName ( ) , PackageManager . GET_PERMISSIONS ) . requestedPermissions ; if ( permissionsInPackage != null ) { for ( String permission : permissionsInPackage ) { if ( permission . equals ( Manifest . permission . CAMERA ) ) { takePicturePermission = false ; break ; } } } } catch ( NameNotFoundException e ) { } } if ( takePicturePermission && saveAlbumPermission ) { takePicture ( returnType , encodingType ) ; } else if ( saveAlbumPermission && ! takePicturePermission ) { PermissionHelper . requestPermission ( this , TAKE_PIC_SEC , Manifest . permission . CAMERA ) ; } else if ( ! saveAlbumPermission && takePicturePermission ) { PermissionHelper . requestPermission ( this , TAKE_PIC_SEC , Manifest . permission . READ_EXTERNAL_STORAGE ) ; } else { PermissionHelper . requestPermissions ( this , TAKE_PIC_SEC , permissions ) ; } }

Toma una foto con la cámara.Cuando se captura una imagen o la vista de la cámara se cancela, el resultado se devuelve en el cordovaactividad. ASACTIVATIVORESULTURSULT, que envía el resultado a este resultado.La imagen puede devolverse como una cadena base64 o un URI que apunta al archivo.Para mostrar la cadena BASE64 en una etiqueta IMG, configure la fuente a: img.src = "DATOS: Imagen / JPEG; BASE64," + resultado;o para mostrar URI en una etiqueta IMG img.src = resultado;


static void checkParameterArrayIsNotNull  ( final String parameterName , final int [ ] parameterValues ) { checkParameterIsNotNull ( parameterName , parameterValues ) ; if ( parameterValues . length == 0 ) { throw new IllegalArgumentException ( parameterName + " cannot be empty." ) ; } }

Comprueba que una matriz no contiene una referencia nula.


public static void init  ( PLogConfig config ) { safelySetConfig ( config ) ; }

PLOG DE INTER utilizando la configuración personalizada.


public static boolean isEmpty  ( CharSequence str ) { return TextUtils . isEmpty ( str ) ; }


public static ExpirationDatePickerDialogFragment newInstance  ( OCFile file , long chosenDateInMillis ) { Bundle arguments = new Bundle ( ) ; arguments . putParcelable ( ARG_FILE , file ) ; arguments . putLong ( ARG_CHOSEN_DATE_IN_MILLIS , chosenDateInMillis ) ; ExpirationDatePickerDialogFragment dialog = new ExpirationDatePickerDialogFragment ( ) ; dialog . setArguments ( arguments ) ; return dialog ; }

Método de fábrica para crear nuevas instancias.


Obtenga el código de color para los valores rojos, verdes, azules y alfa dados como números de puntos flotantes en el rango 0-1.0.


public boolean interiorIntersects  ( S2LatLngRect other ) { return ( lat . interiorIntersects ( other . lat ) && lng . interiorIntersects ( other . lng ) ) ; }

Devuelva verdadero si y solo si el interior de este rectángulo se cruza cualquier punto (incluido el límite) del otro rectángulo dado.


private void instantiate  ( ) { managers = new AbstractAnnotationManager [ ] { new AnnotationContextManager ( androidUnitTest ) , new AnnotationActivityManager ( androidUnitTest ) , new AnnotationFragmentManager ( androidUnitTest ) , new AnnotationViewManager ( androidUnitTest ) } ; activityManager = ( AnnotationActivityManager ) managers [ 1 ] ; fragmentManager = ( AnnotationFragmentManager ) managers [ 2 ] ; }

Instancia de la lista de los gerentes de anotación abstracta.


private BSPTree < Sphere1D > previousInternalNode  ( BSPTree < Sphere1D > node ) { if ( childBefore ( node ) . getCut ( ) != null ) { return leafBefore ( node ) . getParent ( ) ; } while ( isBeforeParent ( node ) ) { node = node . getParent ( ) ; } return node . getParent ( ) ; }


@ SuppressWarnings ( "rawtypes" ) private boolean sameType  ( Object flowSet ) { return ( flowSet instanceof ArrayPackedSet && ( ( ArrayPackedSet ) flowSet ) . map == map ) ; }

Devuelve VERDADERO si Flowset es el mismo tipo de flujo establecido en este caso.


public void startRecording  ( String file ) { switch ( this . mode ) { case PLAY : Log . d ( LOG_TAG , "AudioPlayer Error: Can't record in play mode." ) ; sendErrorStatus ( MEDIA_ERR_ABORTED ) ; break ; case NONE : this . audioFile = file ; this . recorder . setAudioSource ( MediaRecorder . AudioSource . MIC ) ; this . recorder . setOutputFormat ( MediaRecorder . OutputFormat . DEFAULT ) ; this . recorder . setAudioEncoder ( MediaRecorder . AudioEncoder . DEFAULT ) ; this . recorder . setOutputFile ( this . tempFile ) ; try { this . recorder . prepare ( ) ; this . recorder . start ( ) ; this . setState ( STATE . MEDIA_RUNNING ) ; return ; } catch ( IllegalStateException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } sendErrorStatus ( MEDIA_ERR_ABORTED ) ; break ; case RECORD : Log . d ( LOG_TAG , "AudioPlayer Error: Already recording." ) ; sendErrorStatus ( MEDIA_ERR_ABORTED ) ; } }

Comience a grabar el archivo especificado.


public void join  ( TransactionParticipant part , long crashCount ) throws UnknownTransactionException , CannotJoinException , CrashCountException , RemoteException { if ( crashCount == EMBEDDED_CRASH_COUNT ) mgr . join ( id , part , crashCount , this ) ; else mgr . join ( id , part , crashCount ) ; }

Únete a la transacción.El <código> Crashcount </ code> marca el estado del almacenamiento utilizado por el participante para las transacciones.Si el participante intenta unirse a una transacción más de una vez, los recuentos de bloqueo deben ser los mismos.Cada bloqueo del sistema u otro evento que destruye el estado del almacenamiento de transacciones sin preparación del participante debe hacer que el conteo de bloqueo aumente al menos uno.


@ Override public boolean markSupported  ( ) { return false ; }

Informe si este flujo admite la operación de Mark ().


public static int compareTo  ( double x , double y , double eps ) { if ( equals ( x , y , eps ) ) { return 0 ; } else if ( x < y ) { return - 1 ; } return 1 ; }

Compara dos números dada alguna cantidad de error permitido.


public boolean isApplicable  ( ) { return true ; }

¿El comando es actualmente aplicable?Utilizado para establecer habilitar el estado de comando


public final void goToLastProcessedLine  ( final int lastCommited ) throws DataFallbackException { fFileController . closeFallbackInputStream ( ) ; int readLines = fFileController . getReadBackLines ( ) ; fFileController . goToLine ( readLines + lastCommited ) ; }

Coloca el descriptor de archivo en la línea indicada como parámetro


@ Override public int hashCode  ( ) { return 37 * ( 37 * 17 + numerator . hashCode ( ) ) + denominator . hashCode ( ) ; }


public DatabaseGetSchoolClassesQuery countryId  ( Integer value ) { return unsafeParam ( "country_id" , value ) ; }


public static MultilayerPerceptronClassificationModel load  ( JavaSparkContext jsc , String classifierFileName ) { Object object = jsc . objectFile ( classifierFileName ) . first ( ) ; return ( ( MultilayerPerceptronClassificationModel ) object ) ; }

Carga un clasificador de transición de MLP de un archivo, que está pre-entrenado.


private int recalculate  ( String method , WeaponTypeWrapper weapon , int attackSpeed , int time ) { int finalTime = 0 ; TreeMap < WeaponType , float [ ] > list = new TreeMap < WeaponType , float [ ] > ( ) ; float dagger [ ] = { 600f , 1200f } ; list . put ( WeaponType . DAGGER_1H , dagger ) ; float mace [ ] = { 750f , 1500f } ; list . put ( WeaponType . MACE_1H , mace ) ; list . put ( WeaponType . GUN_1H , mace ) ; list . put ( WeaponType . TOOLHOE_1H , mace ) ; float sword1h [ ] = { 700f , 1400f } ; list . put ( WeaponType . SWORD_1H , sword1h ) ; float bookorb [ ] = { 1100f , 2200f } ; list . put ( WeaponType . BOOK_2H , bookorb ) ; list . put ( WeaponType . ORB_2H , bookorb ) ; float polearm [ ] = { 1400f , 2800f } ; list . put ( WeaponType . POLEARM_2H , polearm ) ; list . put ( WeaponType . TOOLPICK_2H , polearm ) ; list . put ( WeaponType . TOOLROD_2H , polearm ) ; list . put ( WeaponType . CANNON_2H , polearm ) ; list . put ( WeaponType . GUN_2H , polearm ) ; list . put ( WeaponType . KEYBLADE_2H , polearm ) ; list . put ( WeaponType . KEYHAMMER_2H , polearm ) ; float staff [ ] = { 1000f , 2000f } ; list . put ( WeaponType . STAFF_2H , staff ) ; list . put ( WeaponType . HARP_2H , staff ) ; float swordbow [ ] = { 1200f , 2400f } ; list . put ( WeaponType . SWORD_2H , swordbow ) ; list . put ( WeaponType . BOW , swordbow ) ; float speed = 0 ; if ( method . equalsIgnoreCase ( "base" ) ) { speed = list . get ( weapon . getMainHand ( ) ) [ 1 ] ; if ( weapon . getOffHand ( ) != null ) { speed += ( list . get ( weapon . getOffHand ( ) ) [ 1 ] * 0.25 ) ; } } else if ( method . equalsIgnoreCase ( "cap" ) ) { speed = list . get ( weapon . getMainHand ( ) ) [ 0 ] ; if ( weapon . getOffHand ( ) != null ) { speed += ( list . get ( weapon . getOffHand ( ) ) [ 0 ] * 0.25 ) ; } } else { try { speed = Float . parseFloat ( method ) ; } catch ( Exception e ) { } } finalTime = Math . round ( ( float ) time / ( float ) attackSpeed * speed ) ; return finalTime ; }

Método utilizado para calcular el tiempo para la base, la tapa o da la velocidad de ataque


public static ValueAnimator animateDummy  ( int duration ) { ValueAnimator a = ValueAnimator . ofFloat ( 0 , 1 ) ; a . setDuration ( duration ) ; a . start ( ) ; return a ; }

Usa el animador para hacer un "Settimeout"


public void takeHeapDump  ( Application application , boolean openView ) { heapDumpProvider . createHeapDump ( application , openView ) ; }

Toma el volcado de montón de la aplicación.


public boolean isOrQuery  ( ) { return hasQuery ( ) ; }

Indica si esto es una lógica o una consulta, lo que significa que se especifica una cadena de consulta y las instancias que coinciden en la que coinciden con esta consulta en uno o más atributos deben incluirse en la respuesta.Lo contrario es una consulta específica del artículo, donde se deben incluir las instancias que coinciden con los atributos específicos.


public static Matrix read  ( BufferedReader input ) throws java . io . IOException { StreamTokenizer tokenizer = new StreamTokenizer ( input ) ; tokenizer . resetSyntax ( ) ; tokenizer . wordChars ( 0 , 255 ) ; tokenizer . whitespaceChars ( 0 , ' ' ) ; tokenizer . eolIsSignificant ( true ) ; java . util . Vector v = new java . util . Vector ( ) ; while ( tokenizer . nextToken ( ) == StreamTokenizer . TT_EOL ) ; if ( tokenizer . ttype == StreamTokenizer . TT_EOF ) throw new java . io . IOException ( "Unexpected EOF on matrix read." ) ; do { v . addElement ( Double . valueOf ( tokenizer . sval ) ) ; } while ( tokenizer . nextToken ( ) == StreamTokenizer . TT_WORD ) ; int n = v . size ( ) ; double row [ ] = new double [ n ] ; for ( int j = 0 ; j < n ; j ++ ) row [ j ] = ( ( Double ) v . elementAt ( j ) ) . doubleValue ( ) ; v . removeAllElements ( ) ; v . addElement ( row ) ; while ( tokenizer . nextToken ( ) == StreamTokenizer . TT_WORD ) { v . addElement ( row = new double [ n ] ) ; int j = 0 ; do { if ( j >= n ) throw new java . io . IOException ( "Row " + v . size ( ) + " is too long." ) ; row [ j ++ ] = Double . valueOf ( tokenizer . sval ) . doubleValue ( ) ; } while ( tokenizer . nextToken ( ) == StreamTokenizer . TT_WORD ) ; if ( j < n ) throw new java . io . IOException ( "Row " + v . size ( ) + " is too short." ) ; } int m = v . size ( ) ; double [ ] [ ] A = new double [ m ] [ ] ; v . copyInto ( A ) ; return new Matrix ( A ) ; }

Lea una matriz de un arroyo.El formato es el mismo método de impresión, por lo que las matrices impresas se pueden leer nuevamente (siempre que se imprimen con la configuración regional de EE. UU.).Los elementos están separados por espacios en blanco, todos los elementos para cada fila aparecen en una sola línea, la última fila es seguida por una línea en blanco.


public Vector3f mult  ( Vector3f vec ) { return mult ( vec , null ) ; }

<CÓDIGO> MULT </ CODE> multiplica un vector sobre una matriz de rotación.El vector resultante se devuelve como un nuevo vector3f.


public boolean dynomiteCheck  ( ) { logger . info ( "Dynomite check with Redis Ping" ) ; if ( ! dynomiteRedisCheck ( ) ) { try { logger . error ( "Dynomite was down" ) ; this . dynProcess . stop ( ) ; sleeper . sleepQuietly ( 1000 ) ; return false ; } catch ( IOException e ) { logger . error ( "Dynomite cannot be restarted --> Requires manual restart" + e . getMessage ( ) ) ; } } return true ; }

Revisión de salud de Dynomite realizada a través del comando REDIS PING.Si el control de la salud falla, detenemos a la dynomita para evitar un proceso de dynomita zombie (es decir, una situación en la que se está ejecutando la dinómica, pero se detiene a Redis).


public static String parseCharset  ( Map < String , String > headers , String defaultCharset ) { String contentType = headers . get ( HTTP . CONTENT_TYPE ) ; if ( contentType != null ) { String [ ] params = contentType . split ( ";" ) ; for ( int i = 1 ; i < params . length ; i ++ ) { String [ ] pair = params [ i ] . trim ( ) . split ( "=" ) ; if ( pair . length == 2 ) { if ( pair [ 0 ] . equals ( "charset" ) ) { return pair [ 1 ] ; } } } } return defaultCharset ; }


public StartRecord ( BasicLogRecord rec ) { txNum = ( Long ) rec . nextVal ( BIGINT ) . asJavaVal ( ) ; lsn = rec . getLSN ( ) ; }

Crea un registro de registro leyendo otro valor del registro.


public TopNMapperRequestHandler ( DataRequestHandler next ) { this . next = next ; }

Construir un controlador de solicitud TOPN.


public static double toDouble  ( Object v , double defaultValue ) { if ( v != null ) { if ( v instanceof Integer ) { return ( Integer ) v ; } if ( v instanceof Float ) { return ( Float ) v ; } if ( v instanceof Double ) { return ( ( Double ) v ) . doubleValue ( ) ; } String s = v . toString ( ) . trim ( ) ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { char c = s . charAt ( i ) ; if ( c >= '0' && c <= '9' ) { sb . append ( c ) ; } else if ( c == '-' && sb . length ( ) == 0 ) { sb . append ( c ) ; } else if ( c == '.' ) { if ( sb . indexOf ( "." ) > - 1 ) { break ; } else { sb . append ( c ) ; } } else if ( sb . length ( ) > 0 ) { break ; } } s = sb . toString ( ) ; try { return Double . parseDouble ( s ) ; } catch ( Exception e ) { log . error ( e ) ; } } return defaultValue ; }


private void postropheToWords  ( String tokenVal ) { int index = tokenVal . indexOf ( '\'' ) ; String bbb = tokenVal . substring ( index ) . toLowerCase ( ) ; if ( inStringArray ( bbb , postrophes ) ) { String aaa = tokenVal . substring ( 0 , index ) ; tokenToWords ( aaa ) ; wordRelation . addWord ( bbb ) ; } else if ( bbb . equals ( "'tve" ) ) { String aaa = tokenVal . substring ( 0 , index - 2 ) ; tokenToWords ( aaa ) ; wordRelation . addWord ( "'ve" ) ; } else { StringBuffer buffer = new StringBuffer ( tokenVal ) ; buffer . deleteCharAt ( index ) ; tokenToWords ( buffer . toString ( ) ) ; } }

Convierta la palabra apostrofedada en (palabra) elementos en la relación de la palabra.


protected void decorateTextLabel  ( ISVNLocalResource svnResource , LocalResourceStatus status , IDecoration decoration , boolean isDirty ) { Map bindings = new HashMap ( 6 ) ; if ( svnResource . getIResource ( ) . getLocation ( ) == null ) { return ; } if ( status . isUnversioned ( ) ) return ; IDecoratorComponent [ ] [ ] format ; int type = svnResource . getIResource ( ) . getType ( ) ; if ( type == IResource . FOLDER ) { format = folderDecoratorFormat ; } else if ( type == IResource . PROJECT ) { format = projectDecoratorFormat ; } else { format = fileDecoratorFormat ; } if ( isDirty & ! status . isAdded ( ) ) { bindings . put ( SVNDecoratorConfiguration . DIRTY_FLAG , dirtyFlag ) ; } if ( status . getUrlString ( ) != null ) { String label = null ; ISVNRepositoryLocation repository = status . getRepository ( ) ; if ( repository != null ) { label = status . getRepository ( ) . getLabel ( ) ; } bindings . put ( SVNDecoratorConfiguration . RESOURCE_LABEL , label == null ? status . getUrlString ( ) : label ) ; bindings . put ( SVNDecoratorConfiguration . RESOURCE_URL , Util . unescape ( status . getUrlString ( ) ) ) ; SVNUrl repositoryRoot = null ; if ( repository != null ) { repositoryRoot = repository . getRepositoryRoot ( ) ; } if ( repositoryRoot != null ) { int urlLen = status . getUrlString ( ) . length ( ) ; int rootLen = repositoryRoot . toString ( ) . length ( ) + 1 ; String shortUrl ; if ( urlLen > rootLen ) shortUrl = status . getUrlString ( ) . substring ( rootLen ) ; else shortUrl = status . getUrlString ( ) ; bindings . put ( SVNDecoratorConfiguration . RESOURCE_URL_SHORT , Util . unescape ( shortUrl ) ) ; } } if ( status . isAdded ( ) ) { bindings . put ( SVNDecoratorConfiguration . ADDED_FLAG , addedFlag ) ; } else if ( SVNStatusKind . EXTERNAL . equals ( status . getTextStatus ( ) ) ) { bindings . put ( SVNDecoratorConfiguration . EXTERNAL_FLAG , externalFlag ) ; } else { if ( ( status . getTextStatus ( ) != SVNStatusKind . UNVERSIONED ) && ( status . getTextStatus ( ) != SVNStatusKind . ADDED ) ) { if ( status . getLastChangedRevision ( ) != null ) { bindings . put ( SVNDecoratorConfiguration . RESOURCE_REVISION , status . getLastChangedRevision ( ) . toString ( ) ) ; } if ( status . getLastCommitAuthor ( ) != null ) { bindings . put ( SVNDecoratorConfiguration . RESOURCE_AUTHOR , status . getLastCommitAuthor ( ) ) ; } } if ( status . getLastChangedDate ( ) != null ) { bindings . put ( SVNDecoratorConfiguration . RESOURCE_DATE , dateFormat . format ( status . getLastChangedDate ( ) ) ) ; } } SVNDecoratorConfiguration . decorate ( decoration , format , bindings ) ; }

Decore la etiqueta de texto del recurso dado.Este método asume que solo un hilo se accederá a él a la vez.


public static byte [ ] fromHex  ( String hex ) { try { return Hex . decodeHex ( hex . toCharArray ( ) ) ; } catch ( DecoderException e ) { return null ; } }

recrear una matriz de bytes de hexadecimal


private void clustering  ( int tagetClusterSize ) { clustering ( tagetClusterSize , "Average" ) ; }

Clustering con el tipo de enlace predeterminado utiliza el enfoque de agrupamiento de enlace 'promedio' como predeterminado


public WidgetsGetCommentsQuery ( VkApiClient client ) { super ( client , "widgets.getComments" , GetCommentsResponse . class ) ; }

Crea una instancia abstractQueryBuilder que se puede usar para construir una solicitud API con varios parámetros


public static int toDecimal  ( String binary ) { long num = Long . parseLong ( binary ) ; long rem ; while ( num > 0 ) { rem = num % 10 ; num = num / 10 ; if ( rem != 0 && rem != 1 ) { System . out . println ( "This is not a binary number." ) ; System . out . println ( "Please try once again." ) ; return - 1 ; } } return Integer . parseInt ( binary , 2 ) ; }

Esto convertirá la cadena binaria dada a un entero basado en decimal


public View findViewById  ( int id ) { View v ; if ( mSlidingMenu != null ) { v = mSlidingMenu . findViewById ( id ) ; if ( v != null ) return v ; } return null ; }

Encuentra una vista que se identificó por el atributo ID del XML que se procesó en OnCreate (paquete).


public static void writeLines  ( File file , String encoding , Collection < ? > lines , String lineEnding , boolean append ) throws IOException { FileOutputStream out = null ; try { out = openOutputStream ( file , append ) ; final BufferedOutputStream buffer = new BufferedOutputStream ( out ) ; IOUtils . writeLines ( lines , lineEnding , buffer , encoding ) ; buffer . flush ( ) ; out . close ( ) ; } finally { IOUtils . closeQuietly ( out ) ; } }

Escribe el valor <código> TOSTRING () </ CODE> de cada elemento en una colección en el archivo <código> especificado </ código> línea por línea.Se utilizará la codificación de carácter especificada y se utilizará la finalización de la línea.


public boolean isPure  ( ) { if ( ! mutated . get ( PurityGlobalNode . node ) . isEmpty ( ) ) return false ; Set < PurityNode > A = new HashSet < PurityNode > ( ) ; Set < PurityNode > B = new HashSet < PurityNode > ( ) ; internalPassNodes ( paramNodes , A , false ) ; internalPassNodes ( globEscape , B , true ) ; internalPassNode ( PurityGlobalNode . node , B , true ) ; Iterator < PurityNode > it = A . iterator ( ) ; while ( it . hasNext ( ) ) { PurityNode n = it . next ( ) ; if ( B . contains ( n ) || ! mutated . get ( n ) . isEmpty ( ) ) return false ; } return true ; }

Llame a esto en la fusión de gráficos en todos los puntos de devolución de un método para saber si el método es puro.


public WallGetCommentsQuery ownerId  ( Integer value ) { return unsafeParam ( "owner_id" , value ) ; }

ID de usuario o ID de la comunidad.Use un valor negativo para designar un ID de comunidad.


public static double ssReg  ( double [ ] residuals , double [ ] targetAttribute ) { double mean = sum ( targetAttribute ) / targetAttribute . length ; double ret = 0 ; for ( int i = 0 ; i < residuals . length ; i ++ ) { ret += Math . pow ( residuals [ i ] - mean , 2 ) ; } return ret ; }

¿Cuánto de la varianza se explica por la regresión?


public static InputStream toInputStream  ( CharSequence input , Charset encoding ) { return toInputStream ( input . toString ( ) , encoding ) ; }

Convierta la carletencia especificada a un flujo de entrada, codificado como bytes usando la codificación de caracteres especificada.


public double addElementRolling  ( double value ) { double discarded = internalArray [ startIndex ] ; if ( ( startIndex + ( numElements + 1 ) ) > internalArray . length ) { expand ( ) ; } startIndex += 1 ; internalArray [ startIndex + ( numElements - 1 ) ] = value ; if ( shouldContract ( ) ) { contract ( ) ; } return discarded ; }

Agrega un elemento al final de la matriz y elimina el primer elemento en la matriz.Devuelve el primer elemento desechado.<p> El efecto es similar a una operación de empuje en una cola FIFO.<p> Ejemplo: Si la matriz contiene los elementos 1, 2, 3, 4 (en ese orden) y se invoca el dominio (5), el resultado es una matriz que contiene las entradas 2, 3, 4, 5 y el valor devuelto.es 1.


public static boolean checkNetwork  ( Context context ) { ConnectivityManager connectivityManager = ( ConnectivityManager ) context . getSystemService ( Context . CONNECTIVITY_SERVICE ) ; NetworkInfo networkInfo = connectivityManager == null ? null : connectivityManager . getActiveNetworkInfo ( ) ; return networkInfo != null && networkInfo . isConnected ( ) ; }


public static SM_SYSTEM_MESSAGE STR_MSG_TOWER_DEFENCE_INVITED_HIM  ( String value0 ) { return new SM_SYSTEM_MESSAGE ( 1400952 , value0 ) ; }

Has invitado a% 0 para unirse al mini juego.


public static boolean isAccountClassClass  ( GenericValue glAccountClass , String parentGlAccountClassId ) throws GenericEntityException { if ( glAccountClass == null ) return false ; if ( parentGlAccountClassId . equals ( glAccountClass . get ( "glAccountClassId" ) ) ) { return true ; } String parentClassId = glAccountClass . getString ( "parentClassId" ) ; if ( parentClassId == null ) { return false ; } if ( parentClassId . equals ( parentGlAccountClassId ) ) { return true ; } return isAccountClassClass ( glAccountClass . getRelatedOne ( "ParentGlAccountClass" , true ) , parentGlAccountClassId ) ; }

Determina si una glaccountsclass es de un niño de un cierto padre Glaccountsclass.


public void sort  ( ) { Arrays . sort ( _data , 0 , _pos ) ; }

Ordene los valores en la lista (ascendente) utilizando la implementación de Sun QuickSort.


public void processNewData  ( int off , int len ) { for ( int i = off ; i < off + len ; i ++ ) { buf [ i ] = buf [ i ] * buf [ i ] ; assert buf [ i ] >= 0 ; } }

Para cada muestra de la señal, calcule la energía de la señal como el cuadrado de la muestra de la señal.


public boolean isSharedBroker  ( String host ) { for ( NamespaceIsolationData policyData : this . policies . values ( ) ) { NamespaceIsolationPolicyImpl policy = new NamespaceIsolationPolicyImpl ( policyData ) ; if ( policy . isPrimaryBroker ( host ) ) { return false ; } } return true ; }

Compruebe si un corredor está en el grupo de corredores compartidos o no


public synchronized void stopPreview  ( ) { if ( autoFocusManager != null ) { autoFocusManager . stop ( ) ; autoFocusManager = null ; } if ( camera != null && previewing ) { camera . getCamera ( ) . stopPreview ( ) ; previewCallback . setHandler ( null , 0 ) ; previewing = false ; } }

Le dice a la cámara que deje de dibujar marcos de vista previa.


public FilenameUtils ( ) { super ( ) ; }

Las instancias no deben construirse en la programación estándar.


public RequestHandle head  ( String url , RequestParams params , ResponseHandlerInterface responseHandler ) { return head ( null , url , params , responseHandler ) ; }

Realice una solicitud de cabeza HTTP con parámetros.


public void userButton  ( ActionEvent event ) { Object source = event . getSource ( ) ; if ( source == nameDialog ) { setFontName ( ( String ) nameDialog . getSelectedItem ( ) ) ; } else if ( source == sizeDialog ) { setPointSize ( ( String ) sizeDialog . getSelectedItem ( ) ) ; } else { System . err . println ( "Error in userButton(): unknown ActionEvent: " + event ) ; } }

Botón de usuario.Este método es llamado por nuestro escucha de acción ActionPerformed () para procesar los botones, en el contexto de la clase principal de Charmap4.


public MessagesGetChatUsersQueryWithChatIdsFields ( VkApiClient client , UserActor actor , List < Integer > chatIds , List < UserField > fields ) { super ( client , "messages.getChatUsers" , GetChatUsersChatIdsFieldsResponse . class ) ; accessToken ( actor . getAccessToken ( ) ) ; chatIds ( chatIds ) ; fields ( fields ) ; }

Crea una instancia abstractQueryBuilder que se puede usar para construir una solicitud API con varios parámetros


public Configuration ( ) { this  ( true ) ; }


public static final int daysBetween  ( Calendar early , Calendar late ) { return ( int ) ( toJulian ( late ) - toJulian ( early ) ) ; }

Devuelve los días entre dos fechas.Los valores positivos indican que la segunda fecha es después del primero, y los valores negativos indican, bueno, lo contrario.


public void addSpawnPoints  ( Collection < SpawnPoint > spawnPoints ) { if ( spawnPoints == null || spawnPoints . isEmpty ( ) ) { return ; } complete = true ; this . spawnPoints . addAll ( spawnPoints ) ; }


public void dumpBinary  ( String path ) { try { FileOutputStream fos = new FileOutputStream ( path ) ; DataOutputStream os = new DataOutputStream ( fos ) ; int written ; os . writeInt ( MAGIC ) ; os . writeInt ( VERSION ) ; os . writeInt ( sampleRate ) ; os . writeInt ( numChannels ) ; os . writeFloat ( lpcMin ) ; os . writeFloat ( lpcRange ) ; os . writeInt ( diphoneMap . size ( ) ) ; for ( Iterator i = diphoneMap . values ( ) . iterator ( ) ; i . hasNext ( ) ; ) { Diphone diphone = ( Diphone ) i . next ( ) ; diphone . dumpBinary ( os ) ; } os . flush ( ) ; fos . close ( ) ; } catch ( FileNotFoundException fe ) { throw new Error ( "Can't dump binary database " + fe . getMessage ( ) ) ; } catch ( IOException ioe ) { throw new Error ( "Can't write binary database " + ioe . getMessage ( ) ) ; } }

Vuelca una forma binaria de la base de datos.


private void modifySkipCountForDeletedImage  ( int index ) { int skipCount = 0 ; for ( int i = 0 , n = mSkipListSize ; i < n ; i ++ ) { long v = mSkipList [ i ] ; int offset = ( int ) ( v & 0xFFFFFFFF ) ; if ( skipCount + offset > index ) { mSkipList [ i ] = v - 1 ; break ; } skipCount += offset ; } }

Modifique la lista Omitir cuando se elimine una imagen al encontrar la entrada correspondiente en MSKIPLIST y decrementar el contador.Esto es simple porque la eliminación nunca puede causar cambiar el orden de las imágenes.


< T > T onFind ( Class < T > modelClass , long id , boolean isEager ) { List < T > dataList = query ( modelClass , null , "id = ?" , new String [ ] { String . valueOf ( id ) } , null , null , null , null , getForeignKeyAssociations ( modelClass . getName ( ) , isEager ) ) ; if ( dataList . size ( ) > 0 ) { return dataList . get ( 0 ) ; } return null ; }

La interfaz abierta para otras clases en el paquete CRUD para consultar un registro basado en ID.Si el conjunto de resultados está vacío, le devuelve Null.


private String convertStreamToString  ( final InputStream input ) { if ( input == null ) return null ; final BufferedReader reader = new BufferedReader ( new InputStreamReader ( input ) ) ; final StringBuilder sBuf = new StringBuilder ( ) ; String line ; try { while ( ( line = reader . readLine ( ) ) != null ) { sBuf . append ( line ) ; } } catch ( IOException e ) { Log . e ( "Places Error" , e . getMessage ( ) ) ; } finally { try { input . close ( ) ; reader . close ( ) ; } catch ( IOException e ) { Log . e ( "Places Error" , e . getMessage ( ) ) ; } } return sBuf . toString ( ) ; }

Convertir una entrada de entrada a una cadena.


public JsonObject add  ( String name , double value ) { add ( name , Json . value ( value ) ) ; return this ; }

Anexa a un nuevo miembro hasta el final de este objeto, con el nombre especificado y la representación de JSON del valor de doble </ código de código> especificado.<P> Este método <strong> no impide nombres duplicados </ strong>.Llamar a este método con un nombre que ya existe en el objeto agregará a otro miembro con el mismo nombre.Para reemplazar a los miembros existentes, use el método <código> set (nombre, valor) </ código> en su lugar.Sin embargo, <strong> <em> agregue </ em> es mucho más rápido que <em> establecido </ em> </ strong> (porque no necesita buscar miembros existentes).Por lo tanto, se debe preferir agregar </ em> cuando se construyen nuevos objetos.</ p>


public boolean isHighlightWithInvisibleEdge  ( ) { return highlightWithInvisibleEdge ; }

Indica si los nodos vecinos con bordes actualmente no son visibles aún resaltados.


public ContentSettingException ( int type , String pattern , ContentSetting setting , String source ) { mContentSettingType = type ; mPattern = pattern ; mContentSetting = setting ; mSource = source ; }


@ Override public Long predictedDataNeeded  ( final double rate , final double allocation_percent_1 , final double allocation_percent_2 , final double effect_size ) { if ( rate < 0.0 || rate > 1.0 ) { throw new IllegalArgumentException ( "Action rate must be in the interval [0, 1]." ) ; } if ( allocation_percent_1 <= 0.0 || allocation_percent_1 >= 1.0 ) { throw new IllegalArgumentException ( "Allocation percent must be in the interval (0, 1)." ) ; } if ( allocation_percent_2 <= 0.0 || allocation_percent_2 >= 1.0 ) { throw new IllegalArgumentException ( "Allocation percent must be in the interval (0, 1)." ) ; } if ( effect_size < - 1.0 || effect_size > 1.0 ) { throw new IllegalArgumentException ( "Effect size must be in the interval [-1, 1]." ) ; } if ( Double . doubleToRawLongBits ( effect_size ) == 0L ) { throw new IllegalArgumentException ( "Effect size must not equal 0" ) ; } double zval = DecisionAdjuster . scaledZ ( confidenceLevel , maxDecisions ) ; return Math . round ( rate * ( 1 - rate ) * ( 1.0 / allocation_percent_1 + 1.0 / allocation_percent_2 ) * zval * zval / effect_size / effect_size ) ; }

Para una tasa de acción prevista y el tamaño del efecto, calcula la cantidad estimada de datos necesarios.Utiliza la tasa de acción agrupada para dos cubos, que se calcula como: Pooled_Rate = (number_actions_1 + number_actions_2) / (number_impressions_1 + number_impressions_2).Para tamaños de efectos pequeños, la tasa de acción agrupada es aproximadamente igual a la velocidad de acción para cualquiera de los cubo.Para porcentajes de asignación similares, la tasa de acción agrupada es aproximadamente igual al promedio de las tasas de acción.


public static < S , K , M  extends Map < K , S >> Collector < S , ? , M > toDictionary  ( Function < ? super S , ? extends K > keyMapper , Supplier < M > mapSupplier ) { return Collectors . toMap ( keyMapper , Function . identity ( ) , StreamUtils . throwingMerger ( ) , mapSupplier ) ; }

Devuelva un coleccionista que crea un diccionario utilizando la función clave dada y el proveedor de mapas dado.Este coleccionista asume que los elementos que se recolectan son distintos.


public CountClearEntriesSpaceOperationRequest ( ) { }


public int size  ( ) { return fDepth ; }


public static void align  ( Scout . Arrange type , ArrayList < ConstraintWidget > widgetList , boolean applyConstraints ) { int margin = Scout . getMargin ( ) ; ConstraintWidget [ ] widgets = new ConstraintWidget [ widgetList . size ( ) ] ; widgets = widgetList . toArray ( widgets ) ; switch ( type ) { case AlignHorizontallyCenter : case AlignHorizontallyLeft : case AlignHorizontallyRight : Arrays . sort ( widgets , sSortY ) ; if ( rootDistance ( widgets [ 0 ] ) > rootDistance ( widgets [ widgets . length - 1 ] ) ) { reverse ( widgets ) ; } break ; case DistributeVertically : Arrays . sort ( widgets , sSortY ) ; break ; case AlignVerticallyTop : case AlignVerticallyMiddle : case AlignBaseline : case AlignVerticallyBottom : Arrays . sort ( widgets , sSortX ) ; if ( rootDistance ( widgets [ 0 ] ) > rootDistance ( widgets [ widgets . length - 1 ] ) ) { reverse ( widgets ) ; } break ; case DistributeHorizontally : Arrays . sort ( widgets , sSortX ) ; break ; } switch ( type ) { case CenterHorizontally : { Rectangle rectangle = new Rectangle ( ) ; WidgetContainer parent = ( WidgetContainer ) widgets [ 0 ] . getParent ( ) ; ConstraintWidget [ ] pears = new ConstraintWidget [ parent . getChildren ( ) . size ( ) ] ; pears = parent . getChildren ( ) . toArray ( pears ) ; for ( ConstraintWidget widget : widgets ) { rectangle . x = widget . getX ( ) ; rectangle . y = widget . getY ( ) ; rectangle . width = widget . getWidth ( ) ; rectangle . height = widget . getHeight ( ) ; int westDistance = gap ( Direction . WEST , rectangle , pears ) ; int eastDistance = gap ( Direction . EAST , rectangle , pears ) ; int x = widget . getX ( ) ; if ( applyConstraints ) { ConstraintWidget westConnect = gapWidget ( Direction . WEST , rectangle , pears ) ; ConstraintWidget eastConnect = gapWidget ( Direction . EAST , rectangle , pears ) ; ConstraintAnchor . Type dir = ConstraintAnchor . Type . RIGHT ; if ( westConnect == parent ) { dir = ConstraintAnchor . Type . LEFT ; } widget . connect ( ConstraintAnchor . Type . LEFT , westConnect , dir , 0 ) ; dir = ConstraintAnchor . Type . LEFT ; if ( eastConnect == parent ) { dir = ConstraintAnchor . Type . RIGHT ; } widget . connect ( ConstraintAnchor . Type . RIGHT , eastConnect , dir , 0 ) ; widget . setHorizontalBiasPercent ( .5f ) ; } else { widget . setX ( x + ( eastDistance - westDistance ) / 2 ) ; } } } break ; case CenterVertically : { Rectangle rectangle = new Rectangle ( ) ; WidgetContainer parent = ( WidgetContainer ) widgets [ 0 ] . getParent ( ) ; ConstraintWidget [ ] pears = new ConstraintWidget [ parent . getChildren ( ) . size ( ) ] ; pears = parent . getChildren ( ) . toArray ( pears ) ; for ( ConstraintWidget widget : widgets ) { rectangle . x = widget . getX ( ) ; rectangle . y = widget . getY ( ) ; rectangle . width = widget . getWidth ( ) ; rectangle . height = widget . getHeight ( ) ; int northDistance = gap ( Direction . NORTH , rectangle , pears ) ; int southDistance = gap ( Direction . SOUTH , rectangle , pears ) ; int Y = widget . getY ( ) ; if ( applyConstraints ) { ConstraintWidget northConnect = gapWidget ( Direction . NORTH , rectangle , pears ) ; ConstraintWidget southConnect = gapWidget ( Direction . SOUTH , rectangle , pears ) ; ConstraintAnchor . Type dir = ConstraintAnchor . Type . BOTTOM ; if ( northConnect == parent ) { dir = ConstraintAnchor . Type . TOP ; } widget . connect ( ConstraintAnchor . Type . TOP , northConnect , dir , 0 ) ; dir = ConstraintAnchor . Type . TOP ; if ( southConnect == parent ) { dir = ConstraintAnchor . Type . BOTTOM ; } widget . connect ( ConstraintAnchor . Type . BOTTOM , southConnect , dir , 0 ) ; widget . setVerticalBiasPercent ( .5f ) ; } else { widget . setY ( Y + ( southDistance - northDistance ) / 2 ) ; } } } break ; case CenterHorizontallyInParent : { for ( ConstraintWidget widget : widgets ) { int parentWidth = widget . getParent ( ) . getWidth ( ) ; int width = widget . getWidth ( ) ; widget . setX ( ( parentWidth - width ) / 2 ) ; if ( applyConstraints ) { widget . connect ( ConstraintAnchor . Type . CENTER_X , widget . getParent ( ) , ConstraintAnchor . Type . CENTER_X , 0 ) ; widget . setHorizontalBiasPercent ( .5f ) ; } } } break ; case CenterVerticallyInParent : { for ( ConstraintWidget widget : widgets ) { int parentHeight = widget . getParent ( ) . getHeight ( ) ; int height = widget . getHeight ( ) ; widget . setY ( ( parentHeight - height ) / 2 ) ; if ( applyConstraints ) { widget . connect ( ConstraintAnchor . Type . CENTER_Y , widget . getParent ( ) , ConstraintAnchor . Type . CENTER_Y , 0 ) ; widget . setVerticalBiasPercent ( .5f ) ; } } } break ; case AlignHorizontallyCenter : { int count = 0 ; float avg = 0 ; for ( ConstraintWidget widget : widgets ) { avg += widget . getX ( ) + widget . getWidth ( ) / 2.0f ; count ++ ; } avg /= count ; ConstraintWidget previousWidget = null ; for ( ConstraintWidget widget : widgets ) { float current = widget . getWidth ( ) / 2.0f ; widget . setX ( ( int ) ( avg - current ) ) ; if ( applyConstraints ) { if ( previousWidget != null ) { widget . connect ( ConstraintAnchor . Type . CENTER_X , previousWidget , ConstraintAnchor . Type . CENTER_X , 0 ) ; } } previousWidget = widget ; } } break ; case AlignHorizontallyLeft : { int min = Integer . MAX_VALUE ; for ( ConstraintWidget widget : widgets ) { min = Math . min ( min , widget . getX ( ) ) ; } ConstraintWidget previousWidget = null ; for ( ConstraintWidget widget : widgets ) { widget . setX ( min ) ; if ( applyConstraints ) { if ( previousWidget != null ) { widget . resetAnchor ( widget . getAnchor ( ConstraintAnchor . Type . RIGHT ) ) ; widget . connect ( ConstraintAnchor . Type . LEFT , previousWidget , ConstraintAnchor . Type . LEFT , 0 ) ; } } previousWidget = widget ; } } break ; case AlignHorizontallyRight : { int max = Integer . MIN_VALUE ; for ( ConstraintWidget widget : widgets ) { max = Math . max ( max , widget . getX ( ) + widget . getWidth ( ) ) ; } ConstraintWidget previousWidget = null ; for ( ConstraintWidget widget : widgets ) { float current = widget . getWidth ( ) ; widget . setX ( ( int ) ( max - current ) ) ; if ( applyConstraints ) { if ( previousWidget != null ) { widget . resetAnchor ( widget . getAnchor ( ConstraintAnchor . Type . LEFT ) ) ; widget . connect ( ConstraintAnchor . Type . RIGHT , previousWidget , ConstraintAnchor . Type . RIGHT , 0 ) ; } } previousWidget = widget ; } } break ; case AlignVerticallyTop : { int min = Integer . MAX_VALUE ; for ( ConstraintWidget widget : widgets ) { min = Math . min ( min , widget . getY ( ) ) ; } ConstraintWidget previousWidget = null ; for ( ConstraintWidget widget : widgets ) { widget . setY ( min ) ; if ( applyConstraints ) { if ( previousWidget != null ) { widget . resetAnchor ( widget . getAnchor ( ConstraintAnchor . Type . BOTTOM ) ) ; widget . connect ( ConstraintAnchor . Type . TOP , previousWidget , ConstraintAnchor . Type . TOP , 0 ) ; } } previousWidget = widget ; } } break ; case AlignVerticallyMiddle : { int count = 0 ; float avg = 0 ; for ( ConstraintWidget widget : widgets ) { avg += widget . getY ( ) + widget . getHeight ( ) / 2.0f ; count ++ ; } avg /= count ; ConstraintWidget previousWidget = null ; for ( ConstraintWidget widget : widgets ) { float current = widget . getHeight ( ) / 2.0f ; widget . setY ( ( int ) ( avg - current ) ) ; if ( applyConstraints ) { if ( previousWidget != null ) { widget . connect ( ConstraintAnchor . Type . CENTER_Y , previousWidget , ConstraintAnchor . Type . CENTER_Y , 0 ) ; } } previousWidget = widget ; } } break ; case AlignBaseline : { int count = 0 ; float avg = 0 ; int number_of_constrained = 0 ; ConstraintWidget fixedWidget = null ; for ( ConstraintWidget widget : widgets ) { if ( isVerticallyConstrained ( widget ) ) { number_of_constrained ++ ; fixedWidget = widget ; } avg += widget . getY ( ) + widget . getBaselineDistance ( ) ; count ++ ; } avg /= count ; if ( number_of_constrained == 1 ) { avg = fixedWidget . getY ( ) + fixedWidget . getBaselineDistance ( ) ; } ConstraintWidget previousWidget = null ; if ( ! applyConstraints || number_of_constrained == 0 ) { for ( ConstraintWidget widget : widgets ) { float baseline = widget . getBaselineDistance ( ) ; widget . setY ( ( int ) ( avg - baseline ) ) ; if ( applyConstraints ) { if ( previousWidget != null ) { widget . connect ( ConstraintAnchor . Type . BASELINE , previousWidget , ConstraintAnchor . Type . BASELINE , 0 ) ; } } previousWidget = widget ; } } else { ArrayList < ConstraintWidget > unconstrained = new ArrayList < > ( ) ; ArrayList < ConstraintWidget > constrained = new ArrayList < > ( ) ; for ( ConstraintWidget widget : widgets ) { if ( isVerticallyConstrained ( widget ) ) { constrained . add ( widget ) ; } else { unconstrained . add ( widget ) ; } } while ( ! unconstrained . isEmpty ( ) ) { ConstraintWidget to = null ; ConstraintWidget from = null ; int min = Integer . MAX_VALUE ; for ( ConstraintWidget fromCandidate : unconstrained ) { for ( ConstraintWidget toCandidate : constrained ) { int fromLeft = fromCandidate . getX ( ) ; int fromRight = fromLeft + fromCandidate . getWidth ( ) ; int toLeft = toCandidate . getX ( ) ; int toRight = toLeft + toCandidate . getWidth ( ) ; int dist = Math . abs ( toLeft - fromLeft ) ; dist = Math . min ( dist , Math . abs ( toLeft - fromRight ) ) ; dist = Math . min ( dist , Math . abs ( toRight - fromRight ) ) ; dist = Math . min ( dist , Math . abs ( toRight - fromLeft ) ) ; if ( dist < min ) { min = dist ; to = toCandidate ; from = fromCandidate ; } } } from . connect ( ConstraintAnchor . Type . BASELINE , to , ConstraintAnchor . Type . BASELINE , 0 ) ; constrained . add ( from ) ; unconstrained . remove ( from ) ; } } } break ; case AlignVerticallyBottom : { int max = Integer . MIN_VALUE ; for ( ConstraintWidget widget : widgets ) { max = Math . max ( max , widget . getY ( ) + widget . getHeight ( ) ) ; } ConstraintWidget previousWidget = null ; for ( ConstraintWidget widget : widgets ) { float current = widget . getHeight ( ) ; widget . setY ( ( int ) ( max - current ) ) ; if ( applyConstraints ) { if ( previousWidget != null ) { widget . resetAnchor ( widget . getAnchor ( ConstraintAnchor . Type . TOP ) ) ; widget . connect ( ConstraintAnchor . Type . BOTTOM , previousWidget , ConstraintAnchor . Type . BOTTOM , 0 ) ; } } previousWidget = widget ; } } break ; case DistributeVertically : { int count = 0 ; int sum = 0 ; int min = widgetList . get ( 0 ) . getY ( ) ; int max = widgetList . get ( 0 ) . getY ( ) + widgetList . get ( 0 ) . getHeight ( ) ; for ( ConstraintWidget widget : widgets ) { int start = widget . getY ( ) ; int size = widget . getHeight ( ) ; int end = start + size ; sum += size ; min = Math . min ( min , start ) ; max = Math . max ( max , end ) ; count ++ ; } int gaps = count - 1 ; int totalGap = max - min - sum ; int lastY = min ; boolean reverse = rootDistanceY ( widgets [ 0 ] ) > rootDistanceY ( widgets [ widgets . length - 1 ] ) ; for ( int i = 0 ; i < count ; i ++ ) { if ( i > 0 ) { int size = widgets [ i - 1 ] . getHeight ( ) ; min += size ; int pos = min + ( totalGap * i ) / gaps ; widgets [ i ] . setY ( pos ) ; if ( applyConstraints ) { if ( reverse ) { widgets [ i - 1 ] . connect ( ConstraintAnchor . Type . BOTTOM , widgets [ i ] , ConstraintAnchor . Type . TOP , pos - lastY - size ) ; } else { widgets [ i ] . connect ( ConstraintAnchor . Type . TOP , widgets [ i - 1 ] , ConstraintAnchor . Type . BOTTOM , pos - lastY - size ) ; } lastY = pos ; } } } } break ; case DistributeHorizontally : { int count = 0 ; int sum = 0 ; int min = widgetList . get ( 0 ) . getX ( ) ; int max = widgetList . get ( 0 ) . getX ( ) + widgetList . get ( 0 ) . getHeight ( ) ; for ( ConstraintWidget widget : widgets ) { int start = widget . getX ( ) ; int size = widget . getWidth ( ) ; int end = start + size ; sum += size ; min = Math . min ( min , start ) ; max = Math . max ( max , end ) ; count ++ ; } int gaps = count - 1 ; int totalGap = max - min - sum ; int lastX = min ; boolean reverse = rootDistanceX ( widgets [ 0 ] ) > rootDistanceX ( widgets [ widgets . length - 1 ] ) ; for ( int i = 0 ; i < count ; i ++ ) { if ( i > 0 ) { int size = widgets [ i - 1 ] . getWidth ( ) ; min += size ; int pos = min + ( totalGap * i ) / gaps ; widgets [ i ] . setX ( pos ) ; if ( applyConstraints ) { if ( reverse ) { widgets [ i - 1 ] . connect ( ConstraintAnchor . Type . RIGHT , widgets [ i ] , ConstraintAnchor . Type . LEFT , pos - lastX - size ) ; } else { widgets [ i ] . connect ( ConstraintAnchor . Type . LEFT , widgets [ i - 1 ] , ConstraintAnchor . Type . RIGHT , pos - lastX - size ) ; } lastX = pos ; } } } } break ; case VerticalPack : { Rectangle original = getBoundingBox ( widgetList ) ; ConstraintWidget [ ] wArray = new ConstraintWidget [ widgetList . size ( ) ] ; wArray = widgetList . toArray ( wArray ) ; Arrays . sort ( wArray , null ) ; ScoutWidget [ ] list = ScoutWidget . getWidgetArray ( ( WidgetContainer ) widgetList . get ( 0 ) . getParent ( ) ) ; for ( ConstraintWidget cw : wArray ) { for ( ScoutWidget scoutWidget : list ) { if ( scoutWidget . mConstraintWidget == cw ) { int gapN = scoutWidget . gap ( Direction . NORTH , list ) ; int newY = margin + scoutWidget . mConstraintWidget . getY ( ) - gapN ; newY = Math . max ( newY , original . y ) ; scoutWidget . setY ( newY ) ; } } } } break ; case HorizontalPack : { Rectangle original = getBoundingBox ( widgetList ) ; ConstraintWidget [ ] wArray = new ConstraintWidget [ widgetList . size ( ) ] ; wArray = widgetList . toArray ( wArray ) ; Arrays . sort ( wArray , null ) ; ScoutWidget [ ] list = ScoutWidget . getWidgetArray ( ( WidgetContainer ) widgetList . get ( 0 ) . getParent ( ) ) ; for ( ConstraintWidget cw : wArray ) { for ( ScoutWidget scoutWidget : list ) { if ( scoutWidget . mConstraintWidget == cw ) { int gapW = scoutWidget . gap ( Direction . WEST , list ) ; int newX = margin + scoutWidget . mConstraintWidget . getX ( ) - gapW ; newX = Math . max ( newX , original . x ) ; scoutWidget . setX ( newX ) ; } } } } break ; case ExpandVertically : { expandVertically ( widgetList , margin ) ; } break ; case ExpandHorizontally : { expandHorizontally ( widgetList , margin ) ; } break ; } }

Realizar varios tipos de arreglos en una selección de widgets.


public SM_BLOCK_RESPONSE ( int code , String playerName ) { this . code = code ; this . playerName = playerName ; }

Construye un nuevo paquete de respuesta de solicitud de bloque


public boolean remove  ( final int location , final T object ) { final boolean removed = this . data . remove ( object ) ; this . notifyItemRangeRemoved ( location , this . data . size ( ) ) ; return removed ; }

Elimina la primera aparición del objeto especificado de los datos.