mirror of https://github.com/apache/poi.git
add generics
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1178106 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
72c869d8dc
commit
5351f594ef
|
@ -185,15 +185,14 @@ public class PropertySet
|
||||||
/**
|
/**
|
||||||
* <p>The sections in this {@link PropertySet}.</p>
|
* <p>The sections in this {@link PropertySet}.</p>
|
||||||
*/
|
*/
|
||||||
protected List sections;
|
protected List<Section> sections;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Returns the {@link Section}s in the property set.</p>
|
* <p>Returns the {@link Section}s in the property set.</p>
|
||||||
*
|
*
|
||||||
* @return The {@link Section}s in the property set.
|
* @return The {@link Section}s in the property set.
|
||||||
*/
|
*/
|
||||||
public List getSections()
|
public List<Section> getSections()
|
||||||
{
|
{
|
||||||
return sections;
|
return sections;
|
||||||
}
|
}
|
||||||
|
@ -440,7 +439,7 @@ public class PropertySet
|
||||||
* Summary Information stream has 2. Everything else is a rare
|
* Summary Information stream has 2. Everything else is a rare
|
||||||
* exception and is no longer fostered by Microsoft.
|
* exception and is no longer fostered by Microsoft.
|
||||||
*/
|
*/
|
||||||
sections = new ArrayList(sectionCount);
|
sections = new ArrayList<Section>( sectionCount );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Loop over the section descriptor array. Each descriptor
|
* Loop over the section descriptor array. Each descriptor
|
||||||
|
@ -468,7 +467,7 @@ public class PropertySet
|
||||||
{
|
{
|
||||||
if (sections.size() <= 0)
|
if (sections.size() <= 0)
|
||||||
return false;
|
return false;
|
||||||
return Util.equal(((Section) sections.get(0)).getFormatID().getBytes(),
|
return Util.equal(sections.get(0).getFormatID().getBytes(),
|
||||||
SectionIDMap.SUMMARY_INFORMATION_ID);
|
SectionIDMap.SUMMARY_INFORMATION_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -485,7 +484,7 @@ public class PropertySet
|
||||||
{
|
{
|
||||||
if (sections.size() <= 0)
|
if (sections.size() <= 0)
|
||||||
return false;
|
return false;
|
||||||
return Util.equal(((Section) sections.get(0)).getFormatID().getBytes(),
|
return Util.equal(sections.get(0).getFormatID().getBytes(),
|
||||||
SectionIDMap.DOCUMENT_SUMMARY_INFORMATION_ID[0]);
|
SectionIDMap.DOCUMENT_SUMMARY_INFORMATION_ID[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -601,7 +600,7 @@ public class PropertySet
|
||||||
{
|
{
|
||||||
if (getSectionCount() < 1)
|
if (getSectionCount() < 1)
|
||||||
throw new MissingSectionException("Property set does not contain any sections.");
|
throw new MissingSectionException("Property set does not contain any sections.");
|
||||||
return ((Section) sections.get(0));
|
return sections.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -618,7 +617,7 @@ public class PropertySet
|
||||||
if (sectionCount != 1)
|
if (sectionCount != 1)
|
||||||
throw new NoSingleSectionException
|
throw new NoSingleSectionException
|
||||||
("Property set contains " + sectionCount + " sections.");
|
("Property set contains " + sectionCount + " sections.");
|
||||||
return ((Section) sections.get(0));
|
return sections.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -690,9 +689,8 @@ public class PropertySet
|
||||||
b.append(", sectionCount: ");
|
b.append(", sectionCount: ");
|
||||||
b.append(sectionCount);
|
b.append(sectionCount);
|
||||||
b.append(", sections: [\n");
|
b.append(", sections: [\n");
|
||||||
final List sections = getSections();
|
for (Section section: getSections())
|
||||||
for (int i = 0; i < sectionCount; i++)
|
b.append(section);
|
||||||
b.append(((Section) sections.get(i)).toString());
|
|
||||||
b.append(']');
|
b.append(']');
|
||||||
b.append(']');
|
b.append(']');
|
||||||
return b.toString();
|
return b.toString();
|
||||||
|
|
Loading…
Reference in New Issue