Encodes an incremental cardinality constraint and returns its encoding.
@param cc the cardinality constraint
@return the encoding of the constraint and the incremental data
10554
public Pair<ImmutableFormulaList, CCIncrementalData> encodeIncremental(final PBConstraint cc) {
    final EncodingResult result = EncodingResult.resultForFormula(f);
    final CCIncrementalData incData = this.encodeIncremental(cc, result);
    return new Pair<>(new ImmutableFormulaList(FType.AND, result.result()), incData);
  }
769535
protected String getCNonce(){
      Double d = Math.floor(Math.random()*16777215);
      return Long.toHexString(Double.doubleToRawLongBits( d ));
  }
539520
protected char[] nextCJKSentence( int c ) throws IOException 
    {
        isb.clear();
        int ch;
        isb.append((char)c);
        
        //reset the CE check mask.
        ctrlMask &= ~ISegment.CHECK_CE_MASk;
        
        while ( (ch = readNext()) != -1 ) {
            if ( StringUtil.isWhitespace(ch) ) {
                pushBack(ch);
                break;
            }
            
            if ( ! StringUtil.isCJKChar(ch) ) {
                pushBack(ch);
                /*check Chinese English mixed word*/
                if ( StringUtil.isEnLetter(ch) 
                        || StringUtil.isEnNumeric(ch) ) {
                    ctrlMask |= ISegment.CHECK_CE_MASk;
                }
                break;
            } 
            
            isb.append((char)ch);
        }
        
        return isb.toString().toCharArray();
    }
413891
public String getRawDecomposition(int c) {
        // We do not loop in this method because an algorithmic mapping itself
        // becomes a final result rather than having to be decomposed recursively.
        int norm16;
        if(c<minDecompNoCP || isDecompYes(norm16=getNorm16(c))) {
            // c does not decompose
            return null;
        } else if(isHangul(norm16)) {
            // Hangul syllable: decompose algorithmically
            StringBuilder buffer=new StringBuilder();
            Hangul.getRawDecomposition(c, buffer);
            return buffer.toString();
        } else if(isDecompNoAlgorithmic(norm16)) {
            return UTF16.valueOf(mapAlgorithmic(c, norm16));
        } else {
            // c decomposes, get everything from the variable-length extra data
            int firstUnit=extraData.charAt(norm16);
            int mLength=firstUnit&MAPPING_LENGTH_MASK;  // length of normal mapping
            if((firstUnit&MAPPING_HAS_RAW_MAPPING)!=0) {
                // Read the raw mapping from before the firstUnit and before the optional ccc/lccc word.
                // Bit 7=MAPPING_HAS_CCC_LCCC_WORD
                int rawMapping=norm16-((firstUnit>>7)&1)-1;
                char rm0=extraData.charAt(rawMapping);
                if(rm0<=MAPPING_LENGTH_MASK) {
                    return extraData.substring(rawMapping-rm0, rawMapping);
                } else {
                    // Copy the normal mapping and replace its first two code units with rm0.
                    StringBuilder buffer=new StringBuilder(mLength-1).append(rm0);
                    norm16+=1+2;  // skip over the firstUnit and the first two mapping code units
                    return buffer.append(extraData, norm16, norm16+mLength-2).toString();
                }
            } else {
                norm16+=1;  // skip over the firstUnit
                return extraData.substring(norm16, norm16+mLength);
            }
        }
    }
1336160
private Iterator<Map.Entry<DeltaClusteringKey, Compaction>> decodeCompactionsFromCql(final Iterator<Row> iter) {
        return new AbstractIterator<Map.Entry<DeltaClusteringKey, Compaction>>() {
            @Override
            protected Map.Entry<DeltaClusteringKey, Compaction> computeNext() {
                while (iter.hasNext()) {
                    Row row = iter.next();
                    Compaction compaction = _changeEncoder.decodeCompaction(getValue(row));
                    if (compaction != null) {
                        return Maps.immutableEntry(new DeltaClusteringKey(getChangeId(row), _daoUtils.getNumDeltaBlocks(getValue(row))), compaction);
                    }
                }
                return endOfData();
            }
        };
    }
1109334
public static byte[] getEncodedInternal(X509CRL crl) throws CRLException {
        if (crl instanceof X509CRLImpl) {
            return ((X509CRLImpl)crl).getEncodedInternal();
        } else {
            return crl.getEncoded();
        }
    }
966317
public String getEncoding() {
    if (SourceFile_Type.featOkTst && ((SourceFile_Type)jcasType).casFeat_encoding == null)
      jcasType.jcas.throwFeatMissing("encoding", "de.julielab.jules.types.ace.SourceFile");
    return jcasType.ll_cas.ll_getStringValue(addr, ((SourceFile_Type)jcasType).casFeatCode_encoding);}
192159
private String getSourceMultiplicity(final Cardinality cardinality) {

		switch (cardinality) {

			case OneToOne:
			case OneToMany:
				return "1";

			case ManyToOne:
			case ManyToMany:
				return "*";
		}

		return null;
	}
1166715
public static String encodePercentage(char c) {
    if (isAlphanumeric(c)) return ("" + c);
    if (c < 16) return ("%0" + Integer.toHexString(c).toUpperCase());
    if (c < 128) return ("%" + Integer.toHexString(c).toUpperCase());
    String s = encodeUTF8(c);
    String result = "";
    for (int i = 0; i < s.length(); i++) {
      result += "%" + Integer.toHexString(s.charAt(i)).toUpperCase();
    }
    return (result);
  }
523059
protected TypeCodec<?> createCodec(DataType cqlType) {
    if (cqlType instanceof ListType) {
      DataType elementType = ((ListType) cqlType).getElementType();
      TypeCodec<Object> elementCodec = codecFor(elementType);
      return TypeCodecs.listOf(elementCodec);
    } else if (cqlType instanceof SetType) {
      DataType elementType = ((SetType) cqlType).getElementType();
      TypeCodec<Object> elementCodec = codecFor(elementType);
      return TypeCodecs.setOf(elementCodec);
    } else if (cqlType instanceof MapType) {
      DataType keyType = ((MapType) cqlType).getKeyType();
      DataType valueType = ((MapType) cqlType).getValueType();
      TypeCodec<Object> keyCodec = codecFor(keyType);
      TypeCodec<Object> valueCodec = codecFor(valueType);
      return TypeCodecs.mapOf(keyCodec, valueCodec);
    } else if (cqlType instanceof TupleType) {
      return TypeCodecs.tupleOf((TupleType) cqlType);
    } else if (cqlType instanceof UserDefinedType) {
      return TypeCodecs.udtOf((UserDefinedType) cqlType);
    } else if (cqlType instanceof CustomType) {
      return TypeCodecs.custom(cqlType);
    }
    throw new CodecNotFoundException(cqlType, null);
  }
727454
private Producer<CloseableReference<CloseableImage>> newBitmapCacheGetToDecodeSequence(
      Producer<EncodedImage> inputProducer) {
    if (FrescoSystrace.isTracing()) {
      FrescoSystrace.beginSection("ProducerSequenceFactory#newBitmapCacheGetToDecodeSequence");
    }
    DecodeProducer decodeProducer = mProducerFactory.newDecodeProducer(inputProducer);
    Producer<CloseableReference<CloseableImage>> result =
        newBitmapCacheGetToBitmapCacheSequence(decodeProducer);
    if (FrescoSystrace.isTracing()) {
      FrescoSystrace.endSection();
    }
    return result;
  }
217135
private Producer<EncodedImage> newEncodedCacheMultiplexToTranscodeSequence(
      Producer<EncodedImage> inputProducer) {
    if (WebpSupportStatus.sIsWebpSupportRequired &&
        (!mWebpSupportEnabled || WebpSupportStatus.sWebpBitmapFactory == null)) {
      inputProducer = mProducerFactory.newWebpTranscodeProducer(inputProducer);
    }
    if (mDiskCacheEnabled) {
      inputProducer = newDiskCacheSequence(inputProducer);
    }
    EncodedMemoryCacheProducer encodedMemoryCacheProducer =
        mProducerFactory.newEncodedMemoryCacheProducer(inputProducer);
    return mProducerFactory.newEncodedCacheKeyMultiplexProducer(encodedMemoryCacheProducer);
  }
205884
public function encode()
    {
        return \pack('CCnnCx', 1, $this->getType()->value(), $this->getRequestId(), $this->getLength(), $this->getPaddingLength());
    }
133062
public int cardinality() {
		int answer = 0;
		for (int k = 0; k < this.buffer.size(); k += 2) {
			answer += Integer.bitCount(this.buffer.get(k + 1));
		}
		return answer;
	}
1251980
protected static Class mapTypeahead(Class c) {
    if(c != null) {
      if( PCAModel.class.isAssignableFrom(c) )
        return TypeaheadPCAModelKeyRequest.class;
      if( NBModel.class.isAssignableFrom(c) )
        return TypeaheadNBModelKeyRequest.class;
      if( Model.class.isAssignableFrom(c))
        return TypeaheadModelKeyRequest.class;
      if( Frame.class.isAssignableFrom(c) )
        return TypeaheadHexKeyRequest.class;
    }
    return TypeaheadKeysRequest.class;
  }
796425
public long cardinality() {
        switch(type) {
            case EMPTY:
                return 0/*by definition*/;
            case EXPLICIT:
                return explicitStorage.size();
            case SPARSE:
                return (long)Math.ceil(sparseProbabilisticAlgorithmCardinality());
            case FULL:
                return (long)Math.ceil(fullProbabilisticAlgorithmCardinality());
            default:
                throw new RuntimeException("Unsupported HLL type " + type);
        }
    }
1172201
public static synchronized X509CertificatePair generateCertificatePair
            (byte[] encoded) throws CertificateException {
        Object key = new Cache.EqualByteArray(encoded);
        X509CertificatePair pair = cache.get(key);
        if (pair != null) {
            return pair;
        }
        pair = new X509CertificatePair(encoded);
        key = new Cache.EqualByteArray(pair.encoded);
        cache.put(key, pair);
        return pair;
    }