@classmethod
def from_string(cls, time_str):
    """Populate time components from time string of the format HH[:MM[:SS[.microseconds]]]"""
    parts = time_str.split(':')
    obj = cls()
    if len(parts) > 0:
        obj.hour = int(parts[0])
    if len(parts) > 1:
        obj.minute = int(parts[1])
    if len(parts) > 2:
        if '.' in parts[2]:
            second_parts = parts[2].split('.')
            obj.second = int(second_parts[0])
            obj.microsecond = int(second_parts[1])
        else:
            obj.second = int(parts[2])
    return obj
