test_class.file: app/src/test/java/org/hwyl/sexytopo/control/util/TextToolsTest.java
test_class.identifier: TextToolsTest
test_case.body: @Test
      public void testAdvanceLastNumber4() {
          String advanced = TextTools.advanceLastNumber("foo");
          Assert.assertEquals("foo1", advanced);
      }
test_case.class_method_signature: TextToolsTest.testAdvanceLastNumber4()
test_case.full_signature: @Test public void testAdvanceLastNumber4()
test_case.identifier: testAdvanceLastNumber4
test_case.invocations: advanceLastNumber assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAdvanceLastNumber4()
focal_class.declarator: dp0WithCommaFormatter = new DecimalFormat("#,##0")
focal_class.modifier: final static
focal_class.original_string: final static DecimalFormat dp0WithCommaFormatter = new DecimalFormat("#,##0");
focal_class.type: DecimalFormat
focal_class.var_name: dp0WithCommaFormatter
focal_class.declarator: dp2WithCommaFormatter = new DecimalFormat("#,##0.00")
focal_class.modifier: final static
focal_class.original_string: final static DecimalFormat dp2WithCommaFormatter = new DecimalFormat("#,##0.00");
focal_class.type: DecimalFormat
focal_class.var_name: dp2WithCommaFormatter
focal_class.declarator: dp2WithoutCommaFormatter = new DecimalFormat("##0.00")
focal_class.modifier: final static
focal_class.original_string: final static DecimalFormat dp2WithoutCommaFormatter = new DecimalFormat("##0.00");
focal_class.type: DecimalFormat
focal_class.var_name: dp2WithoutCommaFormatter
focal_class.declarator: dp2WithoutCommaFormatterUk =
          new DecimalFormat("##0.00", new DecimalFormatSymbols(Locale.UK))
focal_class.modifier: final static
focal_class.original_string: final static DecimalFormat dp2WithoutCommaFormatterUk =
          new DecimalFormat("##0.00", new DecimalFormatSymbols(Locale.UK));
focal_class.type: DecimalFormat
focal_class.var_name: dp2WithoutCommaFormatterUk
focal_class.declarator: ISO_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd")
focal_class.modifier: public final static
focal_class.original_string: public final static DateFormat ISO_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
focal_class.type: DateFormat
focal_class.var_name: ISO_DATE_FORMAT
focal_class.file: app/src/main/java/org/hwyl/sexytopo/control/util/TextTools.java
focal_class.identifier: TextTools
focal_class.class_method_signature: TextTools.pluralise(int n, String noun)
focal_class.full_signature: public static String pluralise(int n, String noun)
focal_class.identifier: pluralise
focal_class.modifiers: public static
focal_class.parameters: (int n, String noun)
focal_class.return: String
focal_class.signature: String pluralise(int n, String noun)
focal_class.class_method_signature: TextTools.joinAll(String joiner, Object ... list)
focal_class.full_signature: public static String joinAll(String joiner, Object ... list)
focal_class.identifier: joinAll
focal_class.modifiers: public static
focal_class.parameters: (String joiner, Object ... list)
focal_class.return: String
focal_class.signature: String joinAll(String joiner, Object ... list)
focal_class.class_method_signature: TextTools.join(String joiner, Object ... items)
focal_class.full_signature: public static String join(String joiner, Object ... items)
focal_class.identifier: join
focal_class.modifiers: public static
focal_class.parameters: (String joiner, Object ... items)
focal_class.return: String
focal_class.signature: String join(String joiner, Object ... items)
focal_class.class_method_signature: TextTools.join(String joiner, List<?> list)
focal_class.full_signature: public static String join(String joiner, List<?> list)
focal_class.identifier: join
focal_class.modifiers: public static
focal_class.parameters: (String joiner, List<?> list)
focal_class.return: String
focal_class.signature: String join(String joiner, List<?> list)
focal_class.class_method_signature: TextTools.formatWithComma(Integer number)
focal_class.full_signature: public static String formatWithComma(Integer number)
focal_class.identifier: formatWithComma
focal_class.modifiers: public static
focal_class.parameters: (Integer number)
focal_class.return: String
focal_class.signature: String formatWithComma(Integer number)
focal_class.class_method_signature: TextTools.formatTo2dpWithComma(Number number)
focal_class.full_signature: public static String formatTo2dpWithComma(Number number)
focal_class.identifier: formatTo2dpWithComma
focal_class.modifiers: public static
focal_class.parameters: (Number number)
focal_class.return: String
focal_class.signature: String formatTo2dpWithComma(Number number)
focal_class.class_method_signature: TextTools.formatTo2dp(Number number)
focal_class.full_signature: public static String formatTo2dp(Number number)
focal_class.identifier: formatTo2dp
focal_class.modifiers: public static
focal_class.parameters: (Number number)
focal_class.return: String
focal_class.signature: String formatTo2dp(Number number)
focal_class.class_method_signature: TextTools.formatTo2dpWithDot(Number number)
focal_class.full_signature: public static String formatTo2dpWithDot(Number number)
focal_class.identifier: formatTo2dpWithDot
focal_class.modifiers: public static
focal_class.parameters: (Number number)
focal_class.return: String
focal_class.signature: String formatTo2dpWithDot(Number number)
focal_class.class_method_signature: TextTools.formatTo0dpWithComma(Number number)
focal_class.full_signature: public static String formatTo0dpWithComma(Number number)
focal_class.identifier: formatTo0dpWithComma
focal_class.modifiers: public static
focal_class.parameters: (Number number)
focal_class.return: String
focal_class.signature: String formatTo0dpWithComma(Number number)
focal_class.class_method_signature: TextTools.advanceLastNumber(String originatingName)
focal_class.full_signature: public static String advanceLastNumber(String originatingName)
focal_class.identifier: advanceLastNumber
focal_class.modifiers: public static
focal_class.parameters: (String originatingName)
focal_class.return: String
focal_class.signature: String advanceLastNumber(String originatingName)
focal_class.class_method_signature: TextTools.toArrayOfLines(String text)
focal_class.full_signature: public static String[] toArrayOfLines(String text)
focal_class.identifier: toArrayOfLines
focal_class.modifiers: public static
focal_class.parameters: (String text)
focal_class.return: String[]
focal_class.signature: String[] toArrayOfLines(String text)
focal_class.class_method_signature: TextTools.toIsoDate(Date date)
focal_class.full_signature: public static String toIsoDate(Date date)
focal_class.identifier: toIsoDate
focal_class.modifiers: public static
focal_class.parameters: (Date date)
focal_class.return: String
focal_class.signature: String toIsoDate(Date date)
focal_method.body: public static String advanceLastNumber(String originatingName) {
  
  
          if (originatingName.length() == 0) {
              return "1";
          }
  
          int lastDigitChar = -1;
          int firstDigitChar = -1;
  
          for (int i = originatingName.length() - 1; i >= 0; i--) {
              char c = originatingName.charAt(i);
  
  
              if (lastDigitChar == -1 && Character.isDigit(c)) {
                  lastDigitChar = i;
              }
  
              if (Character.isDigit(c)) {
                  firstDigitChar = i;
              }
  
              if (! Character.isDigit(c) && firstDigitChar > -1) {
                  break;
              }
          }
  
          if (lastDigitChar == -1) {
              return originatingName + "1";
          } else {
              String oldDigitString = originatingName.substring(firstDigitChar, lastDigitChar + 1);
              Integer oldValue = Integer.parseInt(oldDigitString);
              Integer newValue = oldValue + 1;
              String newDigitString = newValue.toString();
              int lengthDifference = oldDigitString.length() - newDigitString.length();
              if (lengthDifference > 0) {
                  String zeroPadding = new String(new char[lengthDifference]).replace("\0", "0");
                  newDigitString = zeroPadding + newDigitString;
              }
              String firstPart = originatingName.substring(0, firstDigitChar);
              String lastPart = originatingName.substring(lastDigitChar + 1);
              return firstPart + newDigitString + lastPart;
          }
      }
focal_method.class_method_signature: TextTools.advanceLastNumber(String originatingName)
focal_method.full_signature: public static String advanceLastNumber(String originatingName)
focal_method.identifier: advanceLastNumber
focal_method.invocations: length length charAt isDigit isDigit isDigit substring parseInt toString length length replace substring substring
focal_method.modifiers: public static
focal_method.parameters: (String originatingName)
focal_method.return: String
focal_method.signature: String advanceLastNumber(String originatingName)