test_class.file: runelite-client/src/test/java/net/runelite/client/plugins/timetracking/clocks/ClockPanelTest.java
test_class.identifier: ClockPanelTest
test_case.body: @Test
  	public void properColonSeparatedTimeStringShouldReturnCorrectSeconds()
  	{
  		assertEquals(5, ClockPanel.stringToSeconds("5"));
  		assertEquals(50, ClockPanel.stringToSeconds("50"));
  		assertEquals(120, ClockPanel.stringToSeconds("2:00"));
  		assertEquals(120, ClockPanel.stringToSeconds("0:120"));
  		assertEquals(120, ClockPanel.stringToSeconds("0:0:120"));
  		assertEquals(1200, ClockPanel.stringToSeconds("20:00"));
  
  		assertEquals(50, ClockPanel.stringToSeconds("00:00:50"));
  		assertEquals(121, ClockPanel.stringToSeconds("00:02:01"));
  		assertEquals(3660, ClockPanel.stringToSeconds("01:01:00"));
  		assertEquals(9000, ClockPanel.stringToSeconds("2:30:00"));
  		assertEquals(9033, ClockPanel.stringToSeconds("02:30:33"));
  		assertEquals(82800, ClockPanel.stringToSeconds("23:00:00"));
  		assertEquals(400271, ClockPanel.stringToSeconds("111:11:11"));
  	}
test_case.class_method_signature: ClockPanelTest.properColonSeparatedTimeStringShouldReturnCorrectSeconds()
test_case.full_signature: @Test public void properColonSeparatedTimeStringShouldReturnCorrectSeconds()
test_case.identifier: properColonSeparatedTimeStringShouldReturnCorrectSeconds
test_case.invocations: assertEquals stringToSeconds assertEquals stringToSeconds assertEquals stringToSeconds assertEquals stringToSeconds assertEquals stringToSeconds assertEquals stringToSeconds assertEquals stringToSeconds assertEquals stringToSeconds assertEquals stringToSeconds assertEquals stringToSeconds assertEquals stringToSeconds assertEquals stringToSeconds assertEquals stringToSeconds
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void properColonSeparatedTimeStringShouldReturnCorrectSeconds()
focal_class.declarator: NAME_BOTTOM_BORDER = new CompoundBorder(
  		BorderFactory.createMatteBorder(0, 0, 1, 0, ColorScheme.DARK_GRAY_COLOR),
  		BorderFactory.createLineBorder(ColorScheme.DARKER_GRAY_COLOR))
focal_class.modifier: private static final
focal_class.original_string: private static final Border NAME_BOTTOM_BORDER = new CompoundBorder(
  		BorderFactory.createMatteBorder(0, 0, 1, 0, ColorScheme.DARK_GRAY_COLOR),
  		BorderFactory.createLineBorder(ColorScheme.DARKER_GRAY_COLOR));
focal_class.type: Border
focal_class.var_name: NAME_BOTTOM_BORDER
focal_class.declarator: ACTIVE_CLOCK_COLOR = ColorScheme.LIGHT_GRAY_COLOR.brighter()
focal_class.modifier: private static final
focal_class.original_string: private static final Color ACTIVE_CLOCK_COLOR = ColorScheme.LIGHT_GRAY_COLOR.brighter();
focal_class.type: Color
focal_class.var_name: ACTIVE_CLOCK_COLOR
focal_class.declarator: INACTIVE_CLOCK_COLOR = ColorScheme.LIGHT_GRAY_COLOR.darker()
focal_class.modifier: private static final
focal_class.original_string: private static final Color INACTIVE_CLOCK_COLOR = ColorScheme.LIGHT_GRAY_COLOR.darker();
focal_class.type: Color
focal_class.var_name: INACTIVE_CLOCK_COLOR
focal_class.declarator: INPUT_HMS_REGEX = ".*[hms].*"
focal_class.modifier: private static final
focal_class.original_string: private static final String INPUT_HMS_REGEX = ".*[hms].*";
focal_class.type: String
focal_class.var_name: INPUT_HMS_REGEX
focal_class.declarator: WHITESPACE_REGEX = "\\s+"
focal_class.modifier: private static final
focal_class.original_string: private static final String WHITESPACE_REGEX = "\\s+";
focal_class.type: String
focal_class.var_name: WHITESPACE_REGEX
focal_class.declarator: contentContainer
focal_class.modifier: final
focal_class.original_string: final JPanel contentContainer;
focal_class.type: JPanel
focal_class.var_name: contentContainer
focal_class.declarator: leftActions
focal_class.modifier: final
focal_class.original_string: final JPanel leftActions;
focal_class.type: JPanel
focal_class.var_name: leftActions
focal_class.declarator: rightActions
focal_class.modifier: final
focal_class.original_string: final JPanel rightActions;
focal_class.type: JPanel
focal_class.var_name: rightActions
focal_class.declarator: nameInput
focal_class.modifier: private final
focal_class.original_string: private final FlatTextField nameInput;
focal_class.type: FlatTextField
focal_class.var_name: nameInput
focal_class.declarator: startPauseButton
focal_class.modifier: private final
focal_class.original_string: private final JToggleButton startPauseButton;
focal_class.type: JToggleButton
focal_class.var_name: startPauseButton
focal_class.declarator: displayInput
focal_class.modifier: protected final
focal_class.original_string: protected final FlatTextField displayInput;
focal_class.type: FlatTextField
focal_class.var_name: displayInput
focal_class.declarator: clock
focal_class.modifier: @Getter
  	private final
focal_class.original_string: @Getter
  	private final Clock clock;
focal_class.type: Clock
focal_class.var_name: clock
focal_class.declarator: clockType
focal_class.modifier: private final
focal_class.original_string: private final String clockType;
focal_class.type: String
focal_class.var_name: clockType
focal_class.declarator: editable
focal_class.modifier: private final
focal_class.original_string: private final boolean editable;
focal_class.type: boolean
focal_class.var_name: editable
focal_class.file: runelite-client/src/main/java/net/runelite/client/plugins/timetracking/clocks/ClockPanel.java
focal_class.identifier: ClockPanel
focal_class.class_method_signature: ClockPanel.ClockPanel(ClockManager clockManager, Clock clock, String clockType, boolean editable)
focal_class.full_signature:   ClockPanel(ClockManager clockManager, Clock clock, String clockType, boolean editable)
focal_class.identifier: ClockPanel
focal_class.parameters: (ClockManager clockManager, Clock clock, String clockType, boolean editable)
focal_class.signature:  ClockPanel(ClockManager clockManager, Clock clock, String clockType, boolean editable)
focal_class.class_method_signature: ClockPanel.reset()
focal_class.full_signature:  void reset()
focal_class.identifier: reset
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void reset()
focal_class.class_method_signature: ClockPanel.updateDisplayInput()
focal_class.full_signature:  void updateDisplayInput()
focal_class.identifier: updateDisplayInput
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void updateDisplayInput()
focal_class.class_method_signature: ClockPanel.updateActivityStatus()
focal_class.full_signature:  void updateActivityStatus()
focal_class.identifier: updateActivityStatus
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void updateActivityStatus()
focal_class.class_method_signature: ClockPanel.getColor()
focal_class.full_signature: protected Color getColor()
focal_class.identifier: getColor
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: Color
focal_class.signature: Color getColor()
focal_class.class_method_signature: ClockPanel.getFormattedDuration(long duration)
focal_class.full_signature: static String getFormattedDuration(long duration)
focal_class.identifier: getFormattedDuration
focal_class.modifiers: static
focal_class.parameters: (long duration)
focal_class.return: String
focal_class.signature: String getFormattedDuration(long duration)
focal_class.class_method_signature: ClockPanel.stringToSeconds(String time)
focal_class.full_signature: static long stringToSeconds(String time)
focal_class.identifier: stringToSeconds
focal_class.modifiers: static
focal_class.parameters: (String time)
focal_class.return: long
focal_class.signature: long stringToSeconds(String time)
focal_class.superclass: extends JPanel
focal_method.body: static long stringToSeconds(String time) throws NumberFormatException, DateTimeParseException
  	{
  		long duration = 0;
  
  		if (time.matches(INPUT_HMS_REGEX))
  		{
  			String textWithoutWhitespaces = time.replaceAll(WHITESPACE_REGEX, "");
  			//parse input using ISO-8601 Duration format (e.g. 'PT1h30m10s')
  			duration = Duration.parse("PT" + textWithoutWhitespaces).toMillis() / 1000;
  		}
  		else
  		{
  			String[] parts = time.split(":");
  			// parse from back to front, so as to accept hour:min:sec, min:sec, and sec formats
  			for (int i = parts.length - 1, multiplier = 1; i >= 0 && multiplier <= 3600; i--, multiplier *= 60)
  			{
  				duration += Integer.parseInt(parts[i].trim()) * multiplier;
  			}
  		}
  
  		return duration;
  	}
focal_method.class_method_signature: ClockPanel.stringToSeconds(String time)
focal_method.full_signature: static long stringToSeconds(String time)
focal_method.identifier: stringToSeconds
focal_method.invocations: matches replaceAll toMillis parse split parseInt trim
focal_method.modifiers: static
focal_method.parameters: (String time)
focal_method.return: long
focal_method.signature: long stringToSeconds(String time)