Hello,
I need some help implementing a collection class. I don't understand some of the methods I need to implement.
I have marked the methods I need help with as such:
??? What do I do here?
Here is what I have:
public class ParamsCollection : System.Collections.CollectionBase
{
public ParamsCollection()
{
}
public new int Count
{
get
{
return List.Count;
}
}
public override bool Equals(object obj)
{
return false;
??? What do I do here?
}
public override int GetHashCode()
{
return 0;
??? What do I do here?
}
public override string ToString()
{
return null;
??? What do I do here?
}
public new void Clear()
{
??? What do I do here? Should this remove all objs from col?
}
public new System.Collections.IEnumerator GetEnumerator()
{
return null;
??? What do I do here?
}
public new System.Type GetType()
{
return null;
??? What do I do here? Should this return the type of object in collection?
}
public new void RemoveAt(int pIndex)
{
List.RemoveAt(pIndex);
}
public void Add(Parameter pParameter)
{
List.Add(pParameter);
}
public Parameter this[int pIndex]
{
get
{
return (Parameter)List[pIndex];
}
set
{
List[pIndex] = value;
}
}
}
I need some help implementing a collection class. I don't understand some of the methods I need to implement.
I have marked the methods I need help with as such:
??? What do I do here?
Here is what I have:
public class ParamsCollection : System.Collections.CollectionBase
{
public ParamsCollection()
{
}
public new int Count
{
get
{
return List.Count;
}
}
public override bool Equals(object obj)
{
return false;
??? What do I do here?
}
public override int GetHashCode()
{
return 0;
??? What do I do here?
}
public override string ToString()
{
return null;
??? What do I do here?
}
public new void Clear()
{
??? What do I do here? Should this remove all objs from col?
}
public new System.Collections.IEnumerator GetEnumerator()
{
return null;
??? What do I do here?
}
public new System.Type GetType()
{
return null;
??? What do I do here? Should this return the type of object in collection?
}
public new void RemoveAt(int pIndex)
{
List.RemoveAt(pIndex);
}
public void Add(Parameter pParameter)
{
List.Add(pParameter);
}
public Parameter this[int pIndex]
{
get
{
return (Parameter)List[pIndex];
}
set
{
List[pIndex] = value;
}
}
}