idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
3,200 | private CharSequence getHelperText ( final float score ) { if ( ! helperTexts . isEmpty ( ) ) { float interval = 1.0f / helperTexts . size ( ) ; int index = ( int ) Math . floor ( score / interval ) - 1 ; index = Math . max ( index , 0 ) ; index = Math . min ( index , helperTexts . size ( ) - 1 ) ; return helperTexts .... | Returns the helper text which corresponds to a specific password strength . |
3,201 | private int getHelperTextColor ( final float score ) { if ( ! helperTextColors . isEmpty ( ) ) { float interval = 1.0f / helperTextColors . size ( ) ; int index = ( int ) Math . floor ( score / interval ) - 1 ; index = Math . max ( index , 0 ) ; index = Math . min ( index , helperTextColors . size ( ) - 1 ) ; return he... | Returns the color of the helper text which corresponds to a specific password strength . |
3,202 | public final void addConstraint ( final Constraint < CharSequence > constraint ) { Condition . INSTANCE . ensureNotNull ( constraint , "The constraint may not be null" ) ; if ( ! constraints . contains ( constraint ) ) { constraints . add ( constraint ) ; verifyPasswordStrength ( ) ; } } | Adds a new constraint which should be used to verify the password strength . |
3,203 | public final void addAllConstraints ( final Collection < Constraint < CharSequence > > constraints ) { Condition . INSTANCE . ensureNotNull ( constraints , "The collection may not be null" ) ; for ( Constraint < CharSequence > constraint : constraints ) { addConstraint ( constraint ) ; } } | Adds all constraints which are contained by a specific collection . |
3,204 | public final void removeConstraint ( final Constraint < CharSequence > constraint ) { Condition . INSTANCE . ensureNotNull ( constraint , "The constraint may not be null" ) ; constraints . remove ( constraint ) ; verifyPasswordStrength ( ) ; } | Removes a specific constraint which should not be used to verify the password strength anymore . |
3,205 | public final void removeAllConstraints ( final Collection < Constraint < CharSequence > > constraints ) { Condition . INSTANCE . ensureNotNull ( constraints , "The collection may not be null" ) ; for ( Constraint < CharSequence > constraint : constraints ) { removeConstraint ( constraint ) ; } } | Removes all constraints which are contained by a specific collection . |
3,206 | public final void removeAllConstraints ( final Constraint < CharSequence > ... constraints ) { Condition . INSTANCE . ensureNotNull ( constraints , "The array may not be null" ) ; removeAllConstraints ( Arrays . asList ( constraints ) ) ; } | Removes all constraints which are contained by a specific array . |
3,207 | public final void addHelperText ( final CharSequence helperText ) { Condition . INSTANCE . ensureNotNull ( helperText , "The helper text may not be null" ) ; Condition . INSTANCE . ensureNotEmpty ( helperText , "The helper text may not be empty" ) ; if ( ! helperTexts . contains ( helperText ) ) { helperTexts . add ( h... | Adds a new helper text which should be shown depending on the password strength . Helper texts which have been added later than others are supposed to indicate a higher password strength . |
3,208 | public final void addAllHelperTexts ( final Collection < CharSequence > helperTexts ) { Condition . INSTANCE . ensureNotNull ( helperTexts , "The collection may not be null" ) ; for ( CharSequence helperText : helperTexts ) { addHelperText ( helperText ) ; } } | Adds all helper texts which are contained by a specific collection . The helper texts are added in the given order . |
3,209 | public final void removeHelperText ( final CharSequence helperText ) { Condition . INSTANCE . ensureNotNull ( helperText , "The helper text may not be null" ) ; Condition . INSTANCE . ensureNotEmpty ( helperText , "The helper text may not be empty" ) ; helperTexts . remove ( helperText ) ; verifyPasswordStrength ( ) ; ... | Removes a specific helper text which should not be shown depending on the password strength anymore . |
3,210 | public final void addHelperTextColor ( final int color ) { if ( ! helperTextColors . contains ( color ) ) { helperTextColors . add ( color ) ; verifyPasswordStrength ( ) ; } } | Adds a new helper text color which should be used to highlight the helper text which indicates the password strength . |
3,211 | public final void removeHelperTextColor ( final int color ) { int index = helperTextColors . indexOf ( color ) ; if ( index != - 1 ) { helperTextColors . remove ( index ) ; verifyPasswordStrength ( ) ; } } | Removes a specific helper text color which should not be used to highlight the helper text which indicates the password strength anymore . |
3,212 | private boolean isAlwaysInserted ( JDBCStorableProperty < ? > property ) { return property . isVersion ( ) ? ( mVersioning == Versioning . AUTO ) : ! property . isAutomatic ( ) ; } | Returns true if property value is always part of insert statement . |
3,213 | private Map < JDBCStorableProperty < S > , Integer > findLobs ( ) { Map < JDBCStorableProperty < S > , Integer > lobIndexMap = new IdentityHashMap < JDBCStorableProperty < S > , Integer > ( ) ; int lobIndex = 0 ; for ( JDBCStorableProperty < S > property : mAllProperties . values ( ) ) { if ( isLobType ( property ) ) {... | Finds all Lob properties and maps them to a zero - based index . This information is used to update large Lobs after an insert or update . |
3,214 | private LocalVariable getJDBCSupport ( CodeBuilder b ) { pushJDBCSupport ( b ) ; LocalVariable supportVar = b . createLocalVariable ( "support" , TypeDesc . forClass ( JDBCSupport . class ) ) ; b . storeLocal ( supportVar ) ; return supportVar ; } | Generates code to get the JDBCSupport instance and store it in a local variable . |
3,215 | private void pushJDBCSupport ( CodeBuilder b ) { b . loadThis ( ) ; b . loadField ( StorableGenerator . SUPPORT_FIELD_NAME , TypeDesc . forClass ( TriggerSupport . class ) ) ; b . checkCast ( TypeDesc . forClass ( JDBCSupport . class ) ) ; } | Generates code to push the JDBCSupport instance on the stack . |
3,216 | private LocalVariable getConnection ( CodeBuilder b , LocalVariable capVar ) { b . loadLocal ( capVar ) ; b . invokeInterface ( TypeDesc . forClass ( JDBCConnectionCapability . class ) , "getConnection" , TypeDesc . forClass ( Connection . class ) , null ) ; LocalVariable conVar = b . createLocalVariable ( "con" , Type... | Generates code to get connection from JDBCConnectionCapability and store it in a local variable . |
3,217 | private void branchIfDirty ( CodeBuilder b , int propNumber , Label target , boolean branchIfDirty ) { String stateFieldName = StorableGenerator . PROPERTY_STATE_FIELD_NAME + ( propNumber >> 4 ) ; b . loadThis ( ) ; b . loadField ( stateFieldName , TypeDesc . INT ) ; int shift = ( propNumber & 0xf ) * 2 ; b . loadConst... | Generates code to branch if a property is dirty . |
3,218 | public QueryExecutor < S > executor ( Filter < S > filter , OrderingList < S > ordering , QueryHints hints ) throws RepositoryException { final Key < S > key = new Key < S > ( filter , ordering , hints ) ; synchronized ( mPrimaryCache ) { QueryExecutor < S > executor = mPrimaryCache . get ( key ) ; if ( executor != nul... | Returns an executor from the cache . |
3,219 | public < S extends Storable > IndexInfo [ ] getIndexInfo ( Class < S > storableType ) throws RepositoryException { if ( Unindexed . class . isAssignableFrom ( storableType ) ) { return new IndexInfo [ 0 ] ; } Storage < S > masterStorage = mRepository . storageFor ( storableType ) ; IndexAnalysis < S > analysis = mIndex... | Required by IndexInfoCapability . |
3,220 | public < S extends Storable > IndexEntryAccessor < S > [ ] getIndexEntryAccessors ( Class < S > storableType ) throws RepositoryException { if ( Unindexed . class . isAssignableFrom ( storableType ) ) { return new IndexEntryAccessor [ 0 ] ; } Storage < S > masterStorage = mRepository . storageFor ( storableType ) ; Ind... | Required by IndexEntryAccessCapability . |
3,221 | public String getMessage ( ) { String message = super . getMessage ( ) ; if ( mType != null ) { message = mType . getName ( ) + ": " + message ; } return message ; } | Returns first message prefixed with the malformed type . |
3,222 | public QueryExecutor < S > executor ( Filter < S > filter , OrderingList < S > ordering , QueryHints hints ) throws RepositoryException { return analyze ( filter , ordering , hints ) . createExecutor ( ) ; } | Returns an executor that handles the given query specification . |
3,223 | private List < Set < ChainedProperty < S > > > getKeys ( ) throws SupportException , RepositoryException { StorableInfo < S > info = StorableIntrospector . examine ( mIndexAnalyzer . getStorableType ( ) ) ; List < Set < ChainedProperty < S > > > keys = new ArrayList < Set < ChainedProperty < S > > > ( ) ; keys . add ( ... | Returns a list of all primary and alternate keys stripped of ordering . |
3,224 | private boolean pruneKeys ( List < Set < ChainedProperty < S > > > keys , ChainedProperty < S > property ) { boolean result = false ; for ( Set < ChainedProperty < S > > key : keys ) { key . remove ( property ) ; if ( key . size ( ) == 0 ) { result = true ; continue ; } } return result ; } | Removes the given property from all keys returning true if any key has zero properties as a result . |
3,225 | private List < IndexedQueryAnalyzer < S > . Result > splitIntoSubResults ( Filter < S > filter , OrderingList < S > ordering , QueryHints hints ) throws SupportException , RepositoryException { Filter < S > dnfFilter = filter . disjunctiveNormalForm ( ) ; Splitter splitter = new Splitter ( ordering , hints ) ; Reposito... | Splits the filter into sub - results and possibly merges them . |
3,226 | public Layout layoutFor ( Class < ? extends Storable > type , int generation ) throws FetchException , FetchNoneException { StoredLayout storedLayout = mLayoutStorage . query ( "storableTypeName = ? & generation = ?" ) . with ( type . getName ( ) ) . with ( generation ) . loadOne ( ) ; return new Layout ( this , stored... | Returns the layout for a particular generation of the given type . |
3,227 | private static int annHashCode ( Annotation ann ) { int hash = 0 ; Method [ ] methods = ann . getClass ( ) . getDeclaredMethods ( ) ; for ( Method m : methods ) { if ( m . getReturnType ( ) == null || m . getReturnType ( ) == void . class ) { continue ; } if ( m . getParameterTypes ( ) . length != 0 ) { continue ; } St... | Returns an annotation hash code using a algorithm similar to the default . The difference is in the handling of class and enum values . The name is chosen for the hash code component instead of the instance because it is stable between invocations of the JVM . |
3,228 | public List < String > getMessages ( ) { if ( mMessages == null || mMessages . size ( ) == 0 ) { mMessages = Collections . singletonList ( super . getMessage ( ) ) ; } return mMessages ; } | Multiple error messages may be embedded in a MismatchException . |
3,229 | static < S extends Storable > ClobReplicationTrigger < S > create ( Storage < S > masterStorage ) { Map < String , ? extends StorableProperty < S > > properties = StorableIntrospector . examine ( masterStorage . getStorableType ( ) ) . getDataProperties ( ) ; List < String > clobNames = new ArrayList < String > ( 2 ) ;... | Returns null if no Clobs need to be replicated . |
3,230 | protected boolean definePropertyBeanMethods ( ClassFile cf , SyntheticProperty property ) { TypeDesc propertyType = TypeDesc . forClass ( property . getType ( ) ) ; final MethodInfo mi = cf . addMethod ( Modifiers . PUBLIC_ABSTRACT , property . getReadMethodName ( ) , propertyType , null ) ; if ( property . getName ( )... | Add the get & set methods for this property |
3,231 | public static void assertParameterNotNull ( CodeBuilder b , int paramIndex ) { b . loadLocal ( b . getParameter ( paramIndex ) ) ; Label notNull = b . createLabel ( ) ; b . ifNullBranch ( notNull , false ) ; throwException ( b , IllegalArgumentException . class , null ) ; notNull . setLocation ( ) ; } | Generate code to throw an exception if a parameter is null |
3,232 | public static LocalVariable uneraseGenericParameter ( CodeBuilder b , TypeDesc paramType , final int paramIndex ) { b . loadLocal ( b . getParameter ( paramIndex ) ) ; b . checkCast ( paramType ) ; LocalVariable result = b . createLocalVariable ( null , paramType ) ; b . storeLocal ( result ) ; return result ; } | Generate code to create a local variable containing the specified parameter coerced to the specified type . This is useful for re - interpreting erased generics into the more specific genericized type . |
3,233 | public static void throwException ( CodeBuilder b , Class type , String message ) { TypeDesc desc = TypeDesc . forClass ( type ) ; b . newObject ( desc ) ; b . dup ( ) ; if ( message == null ) { b . invokeConstructor ( desc , null ) ; } else { b . loadConstant ( message ) ; b . invokeConstructor ( desc , new TypeDesc [... | Generate code to throw an exception with an optional message . |
3,234 | public static void throwConcatException ( CodeBuilder b , Class type , String ... messages ) { if ( messages == null || messages . length == 0 ) { throwException ( b , type , null ) ; return ; } if ( messages . length == 1 ) { throwException ( b , type , messages [ 0 ] ) ; return ; } TypeDesc desc = TypeDesc . forClass... | Generate code to throw an exception with a message concatenated at runtime . |
3,235 | private static void definePrepareBridge ( ClassFile cf , Class leaf , Class returnClass ) { TypeDesc returnType = TypeDesc . forClass ( returnClass ) ; if ( isPublicMethodFinal ( leaf , PREPARE_METHOD_NAME , returnType , null ) ) { return ; } MethodInfo mi = cf . addMethod ( Modifiers . PUBLIC . toBridge ( true ) , PRE... | Add a prepare bridge method to the classfile for the given type . |
3,236 | public static boolean isPublicMethodFinal ( Class clazz , String name , TypeDesc retType , TypeDesc [ ] params ) { if ( ! clazz . isInterface ( ) ) { Class [ ] paramClasses ; if ( params == null || params . length == 0 ) { paramClasses = null ; } else { paramClasses = new Class [ params . length ] ; for ( int i = 0 ; i... | Returns true if a public final method exists which matches the given specification . |
3,237 | public static void addValueHashCodeCall ( CodeBuilder b , TypeDesc valueType , boolean testForNull , boolean mixIn ) { LocalVariable value = null ; if ( mixIn ) { value = b . createLocalVariable ( null , valueType ) ; b . storeLocal ( value ) ; b . loadConstant ( 31 ) ; b . math ( Opcode . IMUL ) ; b . loadLocal ( valu... | Generates code to compute a hashcode for a value on the stack consuming the value . After the code executes the stack contains an int hashcode . |
3,238 | public static void addEqualsCall ( CodeBuilder b , String fieldName , TypeDesc fieldType , boolean testForNull , Label fail , LocalVariable other ) { b . loadThis ( ) ; b . loadField ( fieldName , fieldType ) ; b . loadLocal ( other ) ; b . loadField ( fieldName , fieldType ) ; addValuesEqualCall ( b , fieldType , test... | Generates code to compare a field in this object against the same one in a different instance . Branch to the provided Label if they are not equal . |
3,239 | public static void addValuesEqualCall ( final CodeBuilder b , final TypeDesc valueType , final boolean testForNull , final Label label , final boolean choice ) { if ( valueType . getTypeCode ( ) != TypeDesc . OBJECT_CODE ) { if ( valueType . getTypeCode ( ) == TypeDesc . FLOAT_CODE ) { b . invokeStatic ( TypeDesc . FLO... | Generates code to compare two values on the stack and branch to the provided Label if they are not equal . Both values must be of the same type . If they are floating point values NaN is considered equal to NaN which is inconsistent with the usual treatment for NaN . |
3,240 | public static void initialVersion ( CodeBuilder b , TypeDesc type , int value ) throws SupportException { adjustVersion ( b , type , value , false ) ; } | Generates code to push an initial version property value on the stack . |
3,241 | public static void incrementVersion ( CodeBuilder b , TypeDesc type ) throws SupportException { adjustVersion ( b , type , 0 , true ) ; } | Generates code to increment a version property value already on the stack . |
3,242 | public static void blankValue ( CodeBuilder b , TypeDesc type ) { switch ( type . getTypeCode ( ) ) { default : b . loadNull ( ) ; break ; case TypeDesc . BYTE_CODE : case TypeDesc . CHAR_CODE : case TypeDesc . SHORT_CODE : case TypeDesc . INT_CODE : b . loadConstant ( 0 ) ; break ; case TypeDesc . BOOLEAN_CODE : b . l... | Generates code to push a blank value to the stack . For objects it is null and for primitive types it is zero or false . |
3,243 | public static TypeDesc bindQueryParam ( Class clazz ) { if ( clazz . isPrimitive ( ) ) { TypeDesc type = TypeDesc . forClass ( clazz ) ; switch ( type . getTypeCode ( ) ) { case TypeDesc . INT_CODE : case TypeDesc . LONG_CODE : case TypeDesc . FLOAT_CODE : case TypeDesc . DOUBLE_CODE : case TypeDesc . BOOLEAN_CODE : ca... | Determines which overloaded with method on Query should be bound to . |
3,244 | public static void callStringBuilderAppendString ( CodeBuilder b ) { TypeDesc stringBuilder = TypeDesc . forClass ( StringBuilder . class ) ; b . invokeVirtual ( stringBuilder , "append" , stringBuilder , new TypeDesc [ ] { TypeDesc . STRING } ) ; } | Appends a String to a StringBuilder . A StringBuilder and String must be on the stack and a StringBuilder is left on the stack after the call . |
3,245 | public static void callStringBuilderAppendChar ( CodeBuilder b ) { TypeDesc stringBuilder = TypeDesc . forClass ( StringBuilder . class ) ; b . invokeVirtual ( stringBuilder , "append" , stringBuilder , new TypeDesc [ ] { TypeDesc . CHAR } ) ; } | Appends a char to a StringBuilder . A StringBuilder and char must be on the stack and a StringBuilder is left on the stack after the call . |
3,246 | public static void callStringBuilderLength ( CodeBuilder b ) { TypeDesc stringBuilder = TypeDesc . forClass ( StringBuilder . class ) ; b . invokeVirtual ( stringBuilder , "length" , TypeDesc . INT , null ) ; } | Calls length on a StringBuilder on the stack leaving an int on the stack . |
3,247 | public static void callStringBuilderToString ( CodeBuilder b ) { TypeDesc stringBuilder = TypeDesc . forClass ( StringBuilder . class ) ; b . invokeVirtual ( stringBuilder , "toString" , TypeDesc . STRING , null ) ; } | Calls toString on a StringBuilder . A StringBuilder must be on the stack and a String is left on the stack after the call . |
3,248 | public static < Type > DisjunctiveConstraint < Type > create ( final Constraint < Type > [ ] constraints ) { return new DisjunctiveConstraint < > ( constraints ) ; } | Creates and returns a constraint which allows to combine multiple constraints in a disjunctive manner . |
3,249 | public final void setConstraints ( final Constraint < Type > [ ] constraints ) { Condition . INSTANCE . ensureNotNull ( constraints , "The constraints may not be null" ) ; Condition . INSTANCE . ensureAtLeast ( constraints . length , 1 , "The constraints may not be empty" ) ; this . constraints = constraints ; } | Sets the single constraints the constraint should consist of . |
3,250 | public boolean HasAlgorithmID ( AlgorithmID algorithmId ) { CBORObject thisObj = get ( KeyKeys . Algorithm ) ; CBORObject thatObj = ( algorithmId == null ? null : algorithmId . AsCBOR ( ) ) ; boolean result ; if ( thatObj == null ) { result = ( thisObj == null ) ; } else { result = thatObj . equals ( thisObj ) ; } retu... | Compares the key s assigned algorithm with the provided value indicating if the values are the same . |
3,251 | public boolean HasKeyID ( String id ) { CBORObject thatObj = ( id == null ) ? null : CBORObject . FromObject ( id ) ; CBORObject thisObj = get ( KeyKeys . KeyId ) ; boolean result ; if ( thatObj == null ) { result = ( thisObj == null ) ; } else { result = thatObj . equals ( thisObj ) ; } return result ; } | Compares the key s assigned identifier with the provided value indicating if the values are the same . |
3,252 | public boolean HasKeyType ( CBORObject keyTypeObj ) { CBORObject thatObj = keyTypeObj ; CBORObject thisObj = get ( KeyKeys . KeyType ) ; boolean result ; if ( thatObj == null ) { result = ( thisObj == null ) ; } else { result = thatObj . equals ( thisObj ) ; } return result ; } | Compares the key s assigned key type with the provided value indicating if the values are the same . |
3,253 | public boolean HasKeyOp ( Integer that ) { CBORObject thisObj = get ( KeyKeys . Key_Ops ) ; boolean result ; if ( that == null ) { result = ( thisObj == null ) ; } else { result = false ; if ( thisObj . getType ( ) == CBORType . Number ) { if ( thisObj . AsInt32 ( ) == that ) { result = true ; } } else if ( thisObj . g... | Compares the key s assigned key operations with the provided value indicating if the provided value was found in the key operation values assigned to the key . |
3,254 | public OneKey PublicKey ( ) { OneKey newKey = new OneKey ( ) ; CBORObject val = this . get ( KeyKeys . KeyType ) ; if ( val . equals ( KeyKeys . KeyType_Octet ) ) { return null ; } else if ( val . equals ( KeyKeys . KeyType_EC2 ) ) { newKey . add ( KeyKeys . EC2_Curve , get ( KeyKeys . EC2_Curve ) ) ; newKey . add ( Ke... | Create a OneKey object with only the public fields . Filters out the private key fields but leaves all positive number labels and text labels along with negative number labels that are public fields . |
3,255 | public static < S extends Storable > OrderingList < S > get ( Class < S > type , String property ) { OrderingList < S > list = emptyList ( ) ; if ( property != null ) { list = list . concat ( type , property ) ; } return list ; } | Returns a canonical instance composed of the given ordering . |
3,256 | public OrderingList < S > concat ( OrderingList < S > other ) { if ( size ( ) == 0 ) { return other ; } OrderingList < S > newList = this ; if ( other . size ( ) > 0 ) { for ( OrderedProperty < S > property : other ) { newList = newList . concat ( property ) ; } } return newList ; } | Returns a list which concatenates this one with the other one . |
3,257 | public OrderingList < S > reduce ( ) { if ( size ( ) == 0 ) { return this ; } Set < ChainedProperty < S > > seen = new HashSet < ChainedProperty < S > > ( ) ; OrderingList < S > newList = emptyList ( ) ; for ( OrderedProperty < S > property : this ) { ChainedProperty < S > chained = property . getChainedProperty ( ) ; ... | Eliminates redundant ordering properties . |
3,258 | public OrderingList < S > reverseDirections ( ) { if ( size ( ) == 0 ) { return this ; } OrderingList < S > reversedList = emptyList ( ) ; for ( int i = 0 ; i < size ( ) ; i ++ ) { reversedList = reversedList . concat ( get ( i ) . reverse ( ) ) ; } return reversedList ; } | Returns this list with all orderings in reverse . |
3,259 | public OrderingList < S > replace ( int index , OrderedProperty < S > property ) { int size = size ( ) ; if ( index < 0 || index >= size ) { throw new IndexOutOfBoundsException ( ) ; } OrderingList < S > newList = emptyList ( ) ; for ( int i = 0 ; i < size ; i ++ ) { newList = newList . concat ( i == index ? property :... | Returns a list with the given element replaced . |
3,260 | OrderedProperty < S > [ ] asArray ( ) { if ( mOrderings == null ) { OrderedProperty < S > [ ] orderings = new OrderedProperty [ mSize ] ; OrderingList < S > node = this ; for ( int i = mSize ; -- i >= 0 ; ) { orderings [ i ] = node . mProperty ; node = node . mParent ; } mOrderings = orderings ; } return mOrderings ; } | This method is not public because the array is not a clone . |
3,261 | String [ ] asStringArray ( ) { if ( mOrderingStrings == null ) { String [ ] orderings = new String [ mSize ] ; OrderingList < S > node = this ; for ( int i = mSize ; -- i >= 0 ; ) { orderings [ i ] = node . mProperty . toString ( ) ; node = node . mParent ; } mOrderingStrings = orderings ; } return mOrderingStrings ; } | Returns the orderings as qualified string property names . Each is prefixed with a + or - . |
3,262 | public SyntheticStorableReferenceAccess < S > getReferenceAccess ( ) { if ( mReferenceAccess == null ) { Class < ? extends Storable > referenceClass = mBuilder . getStorableClass ( ) ; mReferenceAccess = new SyntheticStorableReferenceAccess < S > ( mMasterStorableClass , referenceClass , this ) ; } return mReferenceAcc... | Build and return access to the generated storable reference class . |
3,263 | public SyntheticProperty addKeyProperty ( String name , Direction direction ) { StorableProperty < S > prop = mMasterStorableInfo . getAllProperties ( ) . get ( name ) ; if ( prop == null ) { throw new IllegalArgumentException ( name + " is not a property of " + mMasterStorableInfo . getName ( ) ) ; } mPrimaryKey . add... | Add a property to the primary key which is a member of the Storable type being referenced by this one . |
3,264 | public void copyToMasterPrimaryKey ( Storable indexEntry , S master ) throws FetchException { getReferenceAccess ( ) . copyToMasterPrimaryKey ( indexEntry , master ) ; } | Sets all the primary key properties of the given master using the applicable properties of the given index entry . |
3,265 | public void copyFromMaster ( Storable indexEntry , S master ) throws FetchException { getReferenceAccess ( ) . copyFromMaster ( indexEntry , master ) ; } | Sets all the properties of the given index entry using the applicable properties of the given master . |
3,266 | public boolean isConsistent ( Storable indexEntry , S master ) throws FetchException { return getReferenceAccess ( ) . isConsistent ( indexEntry , master ) ; } | Returns true if the properties of the given index entry match those contained in the master excluding any version property . This will always return true after a call to copyFromMaster . |
3,267 | private void addSpecialMethods ( ClassFile cf ) throws SupportException { { mCopyToMasterPkMethodName = generateSafeMethodName ( mMasterStorableInfo , COPY_TO_MASTER_PK_PREFIX ) ; mCopyFromMasterMethodName = generateSafeMethodName ( mMasterStorableInfo , COPY_FROM_MASTER_PREFIX ) ; mIsConsistentMethodName = generateSaf... | Create methods for copying properties and testing properties . |
3,268 | private String generateSafeMethodName ( StorableInfo info , String prefix ) { Class type = info . getStorableType ( ) ; int value = 0 ; for ( int i = 0 ; i < 100 ; i ++ ) { String name = prefix + value ; if ( ! methodExists ( type , name ) ) { return name ; } value = name . hashCode ( ) ; } throw new InternalError ( "U... | Generates a property name which doesn t clash with any already defined . |
3,269 | private boolean methodExists ( Class clazz , String name ) { Method [ ] methods = clazz . getDeclaredMethods ( ) ; for ( int i = 0 ; i < methods . length ; i ++ ) { if ( methods [ i ] . getName ( ) . equals ( name ) ) { return true ; } } if ( clazz . getSuperclass ( ) != null && methodExists ( clazz . getSuperclass ( )... | Look for conflicting method names |
3,270 | public V remove ( Object key ) { clean ( ) ; ValueRef < K , V > valueRef = mValues . remove ( key ) ; V value ; if ( valueRef != null && ( value = valueRef . get ( ) ) != null ) { valueRef . clear ( ) ; return value ; } return null ; } | Manually remove a value returning the old value . |
3,271 | public Query < S > withValues ( Object ... values ) { if ( values == null || values . length == 0 ) { return this ; } throw error ( ) ; } | Throws an IllegalStateException unless no values passed in . |
3,272 | public Query < S > not ( ) throws FetchException { return mFactory . query ( null , null , mOrdering , null ) ; } | Returns a query that fetches everything possibly in a specified order . |
3,273 | public final void setValidators ( final Validator < Type > ... validators ) { Condition . INSTANCE . ensureNotNull ( validators , "The validators may not be null" ) ; Condition . INSTANCE . ensureAtLeast ( validators . length , 1 , "The validators may not be empty" ) ; this . validators = validators ; } | Sets the single validators the validator should consist of . |
3,274 | private int selectTypes ( Trigger < ? super S > trigger ) { Class < ? extends Trigger > triggerClass = trigger . getClass ( ) ; int types = 0 ; if ( overridesOneMethod ( triggerClass , INSERT_METHODS ) ) { types |= FOR_INSERT ; } if ( overridesOneMethod ( triggerClass , UPDATE_METHODS ) ) { types |= FOR_UPDATE ; } if (... | Determines which operations the given trigger overrides . |
3,275 | public static < T extends Storable > QueryExecutor < T > build ( RepositoryAccess repoAccess , ChainedProperty < T > targetToSourceProperty , Filter < T > targetFilter , OrderingList < T > targetOrdering , QueryHints hints ) throws RepositoryException { if ( targetOrdering == null ) { targetOrdering = OrderingList . em... | Builds and returns a complex joined excutor against a chained property supporting multi - way joins . Filtering and ordering may also be supplied in order to better distribute work throughout the join . |
3,276 | private static < T extends Storable > OrderingList mostOrdering ( StorableProperty < T > primeTarget , OrderingList < T > targetOrdering ) { OrderingList handledOrdering = OrderingList . emptyList ( ) ; for ( OrderedProperty < T > targetProp : targetOrdering ) { ChainedProperty < T > chainedProp = targetProp . getChain... | Given a list of chained ordering properties returns the properties stripped of the matching chain prefix for the targetToSourceProperty . As the target ordering is scanned left - to - right if any property is found which doesn t match the targetToSourceProperty the building of the new list stops . In other words it ret... |
3,277 | private static < T extends Storable > OrderingList < T > expectedOrdering ( StorageAccess < T > access , Filter < T > filter , OrderingList < T > ordering ) { List < Filter < T > > split ; if ( filter == null ) { split = Filter . getOpenFilter ( access . getStorableType ( ) ) . disjunctiveNormalFormSplit ( ) ; } else {... | Examines the given ordering against available indexes returning the ordering that the best index can provide for free . |
3,278 | private static < T extends Storable > int commonOrderingCount ( OrderingList < T > orderingA , OrderingList < T > orderingB ) { int commonCount = Math . min ( orderingA . size ( ) , orderingB . size ( ) ) ; for ( int i = 0 ; i < commonCount ; i ++ ) { if ( ! orderingA . get ( i ) . equals ( orderingB . get ( i ) ) ) { ... | Returns the count of exactly matching properties from the two orderings . The match must be consecutive and start at the first property . |
3,279 | public FilterValues < S > with ( char value ) { PropertyFilterList < S > current = currentProperty ( ) ; Object obj ; try { obj = current . getPropertyFilter ( ) . adaptValue ( value ) ; } catch ( IllegalArgumentException e ) { throw mismatch ( e ) ; } return with ( current , obj ) ; } | Returns a new FilterValues instance with the next blank parameter filled in . |
3,280 | public FilterValues < S > withValues ( Object ... values ) { if ( values == null ) { return this ; } if ( values . length > getBlankParameterCount ( ) ) { throw new IllegalStateException ( "Too many values supplied" ) ; } FilterValues < S > filterValues = this ; for ( Object value : values ) { filterValues = filterValu... | Returns a new FilterValues instance with the next blank parameters filled in . |
3,281 | public boolean isAssigned ( PropertyFilter < S > propFilter ) { if ( propFilter . isConstant ( ) ) { return true ; } Map < PropertyFilter < S > , Object > map = mValueMap ; if ( map == null ) { FilterValues < S > prevValues = mPrevValues ; if ( prevValues == null ) { return false ; } if ( prevValues . mCurrentProperty ... | Returns true if a value is assigned to the given PropertyFilter . |
3,282 | public Object [ ] getSuppliedValues ( ) { FilterValues < S > prevValues = mPrevValues ; if ( prevValues == null ) { return NO_VALUES ; } int i = prevValues . mCurrentProperty . getBlankCount ( ) ; if ( i == 0 ) { return NO_VALUES ; } Object [ ] values = new Object [ i ] ; FilterValues filterValues = this ; while ( true... | Returns all supplied values in this object . Constant filter values are not included . |
3,283 | public Object [ ] getValuesFor ( Filter < S > filter ) throws IllegalStateException { PropertyFilterList < S > list = filter . getTailPropertyFilterList ( ) ; if ( list == null ) { return NO_VALUES ; } int i = list . getPreviousRemaining ( ) + 1 ; Object [ ] values = new Object [ i ] ; FilterValues filterValues = this ... | Returns all values in this object as required by the given Filter . The given Filter must be composed only of the same PropertyFilter instances as used to construct this object . An IllegalStateException will result otherwise . |
3,284 | public Object [ ] getSuppliedValuesFor ( Filter < S > filter ) throws IllegalStateException { PropertyFilterList < S > list = filter . getTailPropertyFilterList ( ) ; if ( list == null ) { return NO_VALUES ; } FilterValues < S > prevValues = mPrevValues ; if ( prevValues == null ) { return NO_VALUES ; } int i = list . ... | Returns all supplied values in this object as required by the given Filter . Constant filter values are not included . The given Filter must be composed only of the same PropertyFilter instances as used to construct this object . An IllegalStateException will result otherwise . |
3,285 | public final void setCaseSensitivity ( final Case caseSensitivty ) { Condition . INSTANCE . ensureNotNull ( caseSensitivty , "The case sensitivity may not be null" ) ; this . caseSensitivity = caseSensitivty ; } | Sets the case sensitivity which should be used by the validator . |
3,286 | private View inflateHintView ( final ViewGroup parent ) { TextView view = ( TextView ) LayoutInflater . from ( context ) . inflate ( hintViewId , parent , false ) ; view . setText ( hint ) ; if ( hintColor != null ) { view . setTextColor ( hintColor ) ; } return view ; } | Inflates and returns the view which is used to display the hint . |
3,287 | public < S extends Storable > Storage < S > getStorage ( Class < S > type ) throws MalformedTypeException , SupportException , RepositoryException { return ( Storage < S > ) super . get ( type ) ; } | Returns a Storage instance for the given Storable type which is lazily created and pooled . If multiple threads are requesting upon the same type concurrently at most one thread attempts to lazily create the Storage . The others wait for it to become available . |
3,288 | public void captureOrderings ( OrderingList < ? > ordering ) { try { if ( ordering != null ) { for ( OrderedProperty < ? > orderedProperty : ordering ) { ChainedProperty < ? > chained = orderedProperty . getChainedProperty ( ) ; if ( ! chained . isDerived ( ) ) { mRootJoinNode . addJoin ( mRepository , chained , mAlias... | Processes the given property orderings and ensures that they are part of the JoinNode tree . |
3,289 | public V get ( K key ) throws E { V value = mValues . get ( key ) ; if ( value != null ) { return value ; } Lock lock = mLockPool . get ( key ) ; lock . lock ( ) ; try { value = mValues . get ( key ) ; if ( value == null ) { try { value = create ( key ) ; mValues . put ( key , value ) ; } catch ( Exception e ) { org . ... | Returns a value for the given key which is lazily created and pooled . If multiple threads are requesting upon the same key concurrently at most one thread attempts to lazily create the value . The others wait for it to become available . |
3,290 | public CBORObject EncodeToCBORObject ( ) throws CoseException { CBORObject obj ; obj = EncodeCBORObject ( ) ; if ( emitTag ) { obj = CBORObject . FromObjectAndTag ( obj , messageTag . value ) ; } return obj ; } | Encode the COSE message object to a CBORObject tree . This function call will force cryptographic operations to be executed as needed . |
3,291 | public static final < Type > NegateConstraint < Type > create ( final Constraint < Type > constraint ) { return new NegateConstraint < > ( constraint ) ; } | Creates and returns a constraint which allows to negate the result of an other constraint . |
3,292 | public final void setConstraint ( final Constraint < Type > constraint ) { Condition . INSTANCE . ensureNotNull ( constraint , "The constraint may not be null" ) ; this . constraint = constraint ; } | Sets the constraint whose result should be negated . |
3,293 | public LocalVariable buildKeyEncoding ( CodeAssembler assembler , OrderedProperty < S > [ ] properties , LocalVariable instanceVar , Class < ? > adapterInstanceClass , boolean useReadMethods , LocalVariable partialStartVar , LocalVariable partialEndVar ) throws SupportException { properties = ensureKeyProperties ( prop... | Generates bytecode instructions to encode properties . The encoding is suitable for key encoding which means it is correctly comparable . |
3,294 | public LocalVariable buildDataEncoding ( CodeAssembler assembler , StorableProperty < S > [ ] properties , LocalVariable instanceVar , Class < ? > adapterInstanceClass , boolean useReadMethods , int generation ) throws SupportException { properties = ensureDataProperties ( properties ) ; return buildEncoding ( Mode . D... | Generates bytecode instructions to encode properties . The encoding is suitable for data encoding which means it is not correctly comparable but it is more efficient than key encoding . Partial encoding is not supported . |
3,295 | public LocalVariable buildSerialEncoding ( CodeAssembler assembler , StorableProperty < S > [ ] properties ) throws SupportException { properties = ensureAllProperties ( properties ) ; return buildEncoding ( Mode . SERIAL , assembler , properties , null , null , null , false , - 1 , null , null ) ; } | Generates bytecode instructions to encode properties and their states . This encoding is suitable for short - term serialization only . |
3,296 | public void buildSerialDecoding ( CodeAssembler assembler , StorableProperty < S > [ ] properties , LocalVariable encodedVar ) throws SupportException { properties = ensureAllProperties ( properties ) ; buildDecoding ( Mode . SERIAL , assembler , properties , null , null , null , false , - 1 , null , encodedVar ) ; } | Generates bytecode instructions to decode properties and their states . A CorruptEncodingException may be thrown from generated code . |
3,297 | public boolean isSupported ( TypeDesc propertyType ) { if ( propertyType . toPrimitiveType ( ) != null ) { return true ; } if ( propertyType == TypeDesc . STRING || propertyType == TypeDesc . forClass ( byte [ ] . class ) ) { return true ; } Class clazz = propertyType . toClass ( ) ; if ( clazz != null ) { return Lob .... | Returns true if the type of the given property type is supported . The types currently supported are primitives primitive wrapper objects Strings byte arrays and Lobs . |
3,298 | @ SuppressWarnings ( "unchecked" ) protected StorableProperty < S > [ ] gatherAllDataProperties ( ) { Map < String , ? extends StorableProperty < S > > map = StorableIntrospector . examine ( mType ) . getDataProperties ( ) ; List < StorableProperty < S > > list = new ArrayList < StorableProperty < S > > ( map . size ( ... | Returns all non - derived data properties for storable . |
3,299 | @ SuppressWarnings ( "unchecked" ) protected StorableProperty < S > [ ] gatherAllProperties ( ) { Map < String , ? extends StorableProperty < S > > map = StorableIntrospector . examine ( mType ) . getAllProperties ( ) ; List < StorableProperty < S > > list = new ArrayList < StorableProperty < S > > ( map . size ( ) ) ;... | Returns all non - join non - derived properties for storable . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.