package lab1.resources;
public class SetOfPatterns
{
private java.util.ArrayList<Pattern> patterns = new java.util.ArrayList<Pattern>();
public final int getCount()
{
return patterns.size();
}
public final Pattern getItem(int index)
{
if (0 <= index && index < patterns.size())
{
return patterns.get(index);
}
else
{
throw new IndexOutOfBoundsException(String.format("Invalid index %1$s in range %2$s:%3$s", index, 0, patterns.size() - 1));
}
}
public final void Add(Pattern x)
{
 patterns.add(x);
}
 public final void RemoveAt(int index)
 {
if (0 <= index && index < patterns.size())
{
 patterns.remove(index);
}
 }
}