<p>Rechnet die angegebene Anzahl der zu reservierenden Zeichen
hinzu. </p>

@param   reserved    count of chars to be reserved
@return  updated format step
556978
FormatStep reserve(int reserved) {

        return new FormatStep(
            this.processor,
            this.level,
            this.section,
            this.sectionalAttrs,
            null, // called before build of formatter
            this.reserved + reserved,
            this.padLeft,
            this.padRight,
            this.orMarker,
            this.lastOrBlockIndex
        );

    }
251902
Format getFormat() {
    final int ordinal;
    final Flavor f = getFlavor();
    if ((f == Flavor.HYBRID) || (f == Flavor.SPARSE)) {
      ordinal = 2 | ( mergeFlag ? 0 : 1 ); //Hybrid is serialized as SPARSE
    } else {
      ordinal = ((slidingWindow != null) ? 4 : 0)
               | (((pairTable != null) && (pairTable.getNumPairs() > 0)) ? 2 : 0)
               | ( mergeFlag ? 0 : 1 );
    }
    return Format.ordinalToFormat(ordinal);
  }
356326
public CustomFormatter create(final String pattern) {
        
        final CustomFormatTokenizer tokenizer = new CustomFormatTokenizer();
        final TokenStore allStore = tokenizer.parse(pattern);
        if(allStore.getTokens().isEmpty()) {
            // 標準のフォーマッタ
            return CustomFormatter.DEFAULT_FORMATTER;
            
        } else if(pattern.equalsIgnoreCase("General")) {
            return CustomFormatter.DEFAULT_FORMATTER;
        }
        
        // セクション単位に分割し、処理していく。
        final List<TokenStore> sections = allStore.split(Token.SYMBOL_SEMI_COLON);
        if(sections.size() > 4) {
            throw new CustomFormatterParseException(pattern,
                    String.format("section size over 4. but '%s' number of %d secitions.", pattern, sections.size()));
        }
        
        final CustomFormatter formatter = new CustomFormatter(pattern);
        boolean containsTextFormatter = false;
        for(TokenStore section : sections) {
            
            final ConditionFormatter conditionFormatter;
            if(textFormatterFactory.isTextPattern(section)) {
                conditionFormatter = textFormatterFactory.create(section);
                containsTextFormatter = true;
                
            } else if(dateFormatterFactory.isDatePattern(section)) {
                conditionFormatter = dateFormatterFactory.create(section);
                
            } else if(numberFormatterFactory.isNumberPattern(section)) {
                conditionFormatter = numberFormatterFactory.create(section);
                
            } else {
                conditionFormatter = numberFormatterFactory.create(section);
                
            }
            
            formatter.addConditionFormatter(conditionFormatter);
            
        }
        
        // 条件式の設定
        int sectionSize = sections.size();
        if(containsTextFormatter) {
            // 文字列の書式を含む場合は、個数から除外する。
            sectionSize--;
        }
        
        // 1番目の書式がデフォルトの条件の場合
        boolean hasConditionFirst = false;
        
        for(int i=0; i < sectionSize; i++) {
            
            final ConditionFormatter conditionFormatter = formatter.getConditionFormatters().get(i);
            if(conditionFormatter.getOperator() != null) {
                if(i == 0) {
                    hasConditionFirst = true;
                }
                continue;
            }
            
            if(sectionSize <= 1) {
                // 書式が1つしかない場合
                conditionFormatter.setOperator(ConditionOperator.ALL);
                
            } else if(sectionSize == 2) {
                if(i==0) {
                    // ゼロ以上の数の書式
                    conditionFormatter.setOperator(ConditionOperator.NON_NEGATIVE);
                    
                } else if(i==1) {
                    // その他の書式
                    if(hasConditionFirst) {
                        conditionFormatter.setOperator(ConditionOperator.ALL);
                    } else {
                        conditionFormatter.setOperator(ConditionOperator.NEGATIVE);
                    }
                }
                
            } else if(sectionSize == 3) {
                if(i==0) {
                    // 正の書式
                    conditionFormatter.setOperator(ConditionOperator.POSITIVE);
                    
                } else if(i==1) {
                    // 負の数の書式
                    conditionFormatter.setOperator(ConditionOperator.NEGATIVE);
                    
                } else {
                    // その他の書式
                    conditionFormatter.setOperator(ConditionOperator.ALL);
                    
                }
                
            } else if(sectionSize == 4) {
                if(i==0) {
                    // 正の書式
                    conditionFormatter.setOperator(ConditionOperator.POSITIVE);
                    
                } else if(i==1) {
                    // 負の数の書式
                    conditionFormatter.setOperator(ConditionOperator.NEGATIVE);
                    
                } else if(i==2) {
                    // ゼロの書式
                    conditionFormatter.setOperator(ConditionOperator.ZERO);
                    
                } else {
                    // その他の書式
                    conditionFormatter.setOperator(ConditionOperator.ALL);
                    
                }
                
            } else {
                throw new CustomFormatterParseException(pattern,
                        String.format("section size over 4. but '%s' number of %d secitions.", pattern, sections.size()));
            }
            
        }
        
        return formatter;
    }
983788
public String getFormatedSequence(final int width) {
	if (sequence == null) {
		return "";
	}

	assert width >= 0 : "Wrong width parameter ";

	final StringBuilder sb = new StringBuilder(sequence);
	int nchunks = sequence.length() / width;
	// add up inserted new line chars
	nchunks = (nchunks + sequence.length()) / width;
	int nlineCharcounter = 0;
	for (int i = 1; i <= nchunks; i++) {
		final int insPos = width * i + nlineCharcounter;
		// to prevent inserting new line in the very end of a sequence then
		// it would have failed.
		// Also covers the case when the sequences shorter than width
		if (sb.length() <= insPos) {
		break;
		}
		sb.insert(insPos, "\n");
		nlineCharcounter++;
	}
	return sb.toString();
	}
547214
public static CmsHistoryVersion fromString(String s) {

        List<String> l = CmsStringUtil.splitAsList(s, ":");
        if (l.size() == 2) {

            Integer ver = null;
            try {
                ver = Integer.valueOf(l.get(0));
            } catch (Exception e) {
                //
            }
            OfflineOnline onlineStatus = "null".equals("" + l.get(1)) ? null : OfflineOnline.valueOf(l.get(1));
            return new CmsHistoryVersion(ver, onlineStatus);
        }
        return null;

    }
232056
public CharSequence format(Formatter formatter) {
    CharSequence input = format();
    return formatter.format(String.valueOf(input));
  }
484743
public final void reserve(int deltaSize, boolean paced)
                    throws ObjectManagerException
    {
        final String methodName = "reserve";
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this,
                        cclass,
                        methodName,
                        new Object[] { new Integer(deltaSize), new Boolean(paced) });

        long newReservedSize = reservedSize.addAndGet(deltaSize);

        if (newReservedSize > reservationCheckpointThreshold) {
            numberOfReservationCheckpointsTriggered++;
            objectManagerState.requestCheckpoint(persistent);

            // Pacing: slow paced requests.
            // ----------------------------   
            if (paced) {
                synchronized (reservationPacingLock) {

                    // TODO not during restart!
                    // TODO Need to release all waiters at shutdown.
                    while (newReservedSize > reservationCheckpointThreshold
                           && reservationPacing
                           && paced) {
                        if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled())
                            trace.debug(this, cclass, methodName, new Object[] { "wait:728",
                                                                                new Long(newReservedSize),
                                                                                new Long(reservationCheckpointThreshold),
                                                                                new Long(reservationThreshold),
                                                                                new Boolean(reservationPacing) });
                        try {
                            newReservedSize = reservedSize.addAndGet(-deltaSize);
                            reservationPacingLock.wait();

                        } catch (InterruptedException exception) {
                            // No FFDC Code Needed.
                            ObjectManager.ffdc.processException(this, cclass, methodName, exception, "1:739:1.57");
                            if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                                trace.exit(this, cclass, methodName, exception);
                            throw new UnexpectedExceptionException(this, exception);

                        } finally {
                            newReservedSize = reservedSize.addAndGet(deltaSize);
                        } // try...
                    } // while (newReservedSize > reservationCheckpointThreshold...

                    // If we have a big enough backlog of reserved space in the store, 
                    // make subsequent paced requests also wait, 
                    // except during restart or shutdown.
                    if (newReservedSize > reservationCheckpointThreshold
                        && (objectManagerState.state == ObjectManagerState.stateColdStarted
                        || objectManagerState.state == ObjectManagerState.stateWarmStarted)) {
                        reservationPacing = true;
                    } else {
                        // Allow at least one more waiter to proceed.
                        reservationPacing = false;
                        reservationPacingLock.notify();
                    } // if (newReservedSize...
                } // synchronized (reservationPacingLock).

            } // if (paced)..

            // Expand the file size if necessary.
            // ----------------------------------

            if (newReservedSize > reservationThreshold) {
                synchronized (this) {
                    // Try extending the file.
                    // TODO setAllocationAllowed() will release another paced reservation.
                    setAllocationAllowed();

                    if (newReservedSize > (storeFileSizeAllocated - storeFileSizeUsed - directoryReservedSize)) {
                        // Suppress storeFull exceptions during recovery.
                        // Also suppress the exception if we are releasing space by using a negative delta size.
                        // During commit surplus space is released into the store. If the directory depth has
                        // increased meanwhile this may mean that there is still insufficient space in the store to allow
                        // further reservation requests, but we still allow negative requests.
                        if (objectManagerState.getObjectManagerStateState() == ObjectManagerState.stateReplayingLog
                            || deltaSize <= 0) {
                            if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled())
                                trace.debug(this, cclass, methodName, new Object[] { "Objectstorefull exception supressed:783",
                                                                                    new Long(newReservedSize) });
                        } else {
                            // We can't make the reservation so take it back.
                            reservedSize.addAndGet(-deltaSize);

                            if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                                trace.exit(this, cclass, methodName, new Object[] { new Long(newReservedSize) });
                            throw new ObjectStoreFullException(this, null); // TODO objectToStore
                        } // if (objectManagerState...
                    } // if (reservedSize > (storeFileSizeAllocated - storeFileSizeUsed)).
                } // synchronized (this).

            } // if (newReservedSize > reservationThreshold).

        } else if (reservationPacing) {
            // We are below the limit so release any paced reservations.
            synchronized (reservationPacingLock) {
                pacedReservationsReleased++;
                reservationPacing = false;
                reservationPacingLock.notify();
            } // synchronized (reservationPacingLock).

        } // if (newReservedSize > reservationCheckpointThreshold).

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass, methodName);
    }
27566
public static String compactRepeatedChars(@NonNull CharSequence sequence) {
      StringBuilder builder = new StringBuilder();
      for (int i = 0; i < sequence.length(); i++) {
         char c = sequence.charAt(i);
         if (builder.length() == 0 || builder.charAt(builder.length() - 1) != c) {
            builder.append(c);
         }
      }
      return builder.toString();
   }
703500
public static String denormalize(final CharSequence self) {
        final String s = self.toString();
        // Don't do this in static initializer because we may never be needed.
        // TODO: Put this lineSeparator property somewhere everyone can use it.
        if (lineSeparator == null) {
            final StringWriter sw = new StringWriter(2);
            try {
                // We use BufferedWriter rather than System.getProperty because
                // it has the security manager rigamarole to deal with the possible exception.
                final BufferedWriter bw = new BufferedWriter(sw);
                bw.newLine();
                bw.flush();
                lineSeparator = sw.toString();
            } catch (IOException ioe) {
                // This shouldn't happen, but this is the same default used by
                // BufferedWriter on a security exception.
                lineSeparator = "\n";
            }
        }

        final int len = s.length();

        if (len < 1) {
            return s;
        }

        final StringBuilder sb = new StringBuilder((110 * len) / 100);

        int i = 0;

        while (i < len) {
            final char ch = s.charAt(i++);

            switch (ch) {
                case '\r':
                    sb.append(lineSeparator);

                    // Eat the following LF if any.
                    if ((i < len) && (s.charAt(i) == '\n')) {
                        ++i;
                    }

                    break;

                case '\n':
                    sb.append(lineSeparator);
                    break;

                default:
                    sb.append(ch);
                    break;
            }
         }

        return sb.toString();
    }
522715
public byte[] bindResp(int commandId, int sequenceNumber, String systemId,
            OptionalParameter... optionalParameters) throws PDUStringException {
        StringValidator.validateString(systemId, StringParameter.SYSTEM_ID);
        PDUByteBuffer buf = new PDUByteBuffer(commandId, 0, sequenceNumber);
        buf.append(systemId);
        buf.appendAll(optionalParameters);
        return buf.toBytes();
    }
111746
FormatStep pad(
        int padLeft,
        int padRight
    ) {

        return new FormatStep(
            this.processor,
            this.level,
            this.section,
            this.sectionalAttrs,
            null, // called before build of formatter
            this.reserved,
            this.padLeft + padLeft,
            this.padRight + padRight,
            this.orMarker,
            this.lastOrBlockIndex
        );

    }
796592
public HttpMediaType setSubType(String subType) {
    Preconditions.checkArgument(
        TYPE_REGEX.matcher(subType).matches(), "Subtype contains reserved characters");
    this.subType = subType;
    cachedBuildResult = null;
    return this;
  }
1128276
public java.util.List<String> getReservedInstancesOfferingIds() {
        if (reservedInstancesOfferingIds == null) {
            reservedInstancesOfferingIds = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return reservedInstancesOfferingIds;
    }
212088
public CharSequence format() {
    if (pieces.isEmpty()) {
      return input;
    }

    String target;

    for (Piece piece : pieces) {
      target = BRACE_START + piece.getKey() + BRACE_END;
      input = input.replace(target, String.valueOf(piece.getValue()));
    }

    return input;
  }
575531
@SuppressWarnings("squid:S3655")
    public String getNummerFormatted() {
        if (!this.getNummer().isPresent()) {
            throw new IllegalStateException("no number present");
        }
        BigInteger hundert = BigInteger.valueOf(100);
        StringBuilder formatted = new StringBuilder();
        for (BigInteger i = this.getNummer().get(); i.compareTo(BigInteger.ONE) > 0; i = i.divide(hundert)) {
            formatted.insert(0, " " + i.remainder(hundert));
        }
        return formatted.toString().trim();
    }
563606
public long getRepeatDelay (char ch)
    {
        KeyRecord krec = _charCommands.get(ch);
        return (krec == null) ? DEFAULT_REPEAT_DELAY : krec.repeatDelay;
    }
860268
public final CharSequence getEntry() {
        int index = indexOf(value);
        return index >= 0 && getEntries() != null ? getEntries()[index] : null;
    }