Imports System
Imports System.ComponentModel
Imports System.Collections
Imports System.Globalization

Public Class Swimmer
  Private ssex As String
  Private sage As Integer
  Private stime As Single
  Private sclub As String
  Private sfrname, slname As String
  '-----
  Public Sub New(ByVal nm As String)
    MyBase.New()
    Dim i As Integer
    Dim s As String
    Dim t As Single
    Dim tok As StringTokenizer

    Dim x As NumberFormatInfo
    x = New NumberFormatInfo()
    x.NumberDecimalSeparator = "."
    tok = New StringTokenizer(nm, ",")
    nm = tok.nextToken
    i = nm.IndexOf(" ")
    If i > 0 Then       'Podziel na imię i nazwisko
      sfrname = nm.Substring(0, i)
      slname = nm.Substring(i + 1)

    Else
      sfrname = ""
      slname = nm       'Jeśli tylko jedno
    End If
    s = tok.nextToken

    sage = Int16.Parse(s)     'Pobierz wiek
    sclub = tok.nextToken   'Pobierz nazwę klubu
    s = tok.nextToken
    stime = Single.Parse(s, x)  'Pobierz wynik
    ssex = tok.nextToken     'Pobierz płeć
  End Sub
  '-----
  Public Function getTime() As Single
    getTime = stime
  End Function
  '-----
  Public Function getSex() As String
    getSex = ssex
  End Function
  '-----
  Public Function getName() As String
    getName = sfrname + " " + slname
  End Function
  '-----
  Public Function getClub() As String
    getClub = sclub
  End Function
  '-----
  Public Function getAge() As Integer
    getAge = sage
  End Function

End Class
