package pl.helion.j2mepp.czytnikrss;

public class Dane 
{
	public Dane(String[] org, String[] pl)
	{
		STALE_PL = pl;
		STALE_ORG = org;
		dane = new String[pl.length];
	}
	public int sprawdz(String tekst)
	{
		for (int i=0;i<STALE_ORG.length;i++)
		{
			if (STALE_ORG[i].equals(tekst))
				return i;
		}
		return -1;
	}
	public void ustawElement(String tekst, int indeks)
	{
		dane[indeks] = tekst;
	}
	public String pobierzElement(String indeks)
	{
		int k = this.sprawdz(indeks);
		if (k>-1)
			return this.pobierzElement(k);
		else
			return "";
	}
	public String pobierzElement(int indeks)
	{
		return dane[indeks];
	}
	public String pobierzNazwe(int indeks)
	{
		return STALE_PL[indeks];
	}
	public int ilosc()
	{
		return dane.length;
	}
	private String[] dane;
	private String[] STALE_PL;
	private String[] STALE_ORG;
}

