> I am getting an exception at runtime when I try to cast a class of type
> that i created to an ArrayList:
[quoted text clipped - 16 lines]
>
> thx
Please provide the source for PropertyFileSectionData, although it would
suggest that the getSectionName method is not returning a String.
da_rod_father - 12 Feb 2006 14:58 GMT
I created an interface with abstract methods.
public interface PropertyFileSectionData
{
public abstract String getSectionName();
public abstract void setSectionName(String sectionName);
public abstract String getSectionComment();
public abstract void setSectionComment(String sectionComment);
public abstract PropertyFilePropAndValuePairsData
getPropertyAndValuePairs();
public abstract void
setPropertyAndValuePairs(PropertyFilePropAndValuePairsData
propAndVauePairs);
}
I also create an implementation class to actually do the work.
public class PropertyFileSectionDataImpl implements
PropertyFileSectionData
{
protected String _sectionName;
protected String _sectionComment;
protected SPPropertyFilePropAndValuePairsData _propAndValuePairs;
public PropertyFilePropAndValuePairsData
getPropertyAndValuePairs() {
return _propAndValuePairs;
}
public void
setPropertyAndValuePairs(PropertyFilePropAndValuePairsData
andValuePairs) {
_propAndValuePairs = andValuePairs;
}
public String getSectionComment() {
return _sectionComment;
}
public void setSectionComment(String comment) {
_sectionComment = comment;
}
public String getSectionName() {
return _sectionName;
}
public void setSectionName(String name) {
_sectionName = name;
}
}
da_rod_father - 12 Feb 2006 17:51 GMT
I am wondering if I am modeling this wrong? Are there any good
examples on how to correctly implement interfaces?