Class ReplacementFormatUtil


  • public class ReplacementFormatUtil
    extends java.lang.Object
    This utility takes replacement strings with dollar signs, like "$0q $1h $2w", and replaces each $ index with a value from the array of candidates. $_ is replaced with the underscoreReplacement. Returns the resulting Pattern. Special replacements, like $R or $-B, can be specified in the specialReplacement map. Current known users include ChordProgression, Intervals, and BrokenChordPreprocessor.
    • Constructor Detail

      • ReplacementFormatUtil

        public ReplacementFormatUtil()
    • Method Detail

      • replaceDollarsWithCandidates

        public static Pattern replaceDollarsWithCandidates​(java.lang.String sequence,
                                                           PatternProducer[] candidates,
                                                           PatternProducer underscoreReplacement)
      • replaceDollarsWithCandidates

        public static Pattern replaceDollarsWithCandidates​(java.lang.String sequence,
                                                           PatternProducer[] candidates,
                                                           PatternProducer underscoreReplacement,
                                                           java.util.Map<java.lang.String,​PatternProducer> specialReplacers,
                                                           java.lang.String inputSeparator,
                                                           java.lang.String outputSeparator,
                                                           java.lang.String finalThingToAppend)