*/
public String getTextAsString() {
StringBuffer ret = new StringBuffer();
- Vector textV = getTextAsVector();
- for(int i=0; i<textV.size(); i++) {
- String text = (String)textV.get(i);
+ Vector<String> textV = getTextAsVector();
+ for(String text : textV) {
ret.append(text);
if(! text.endsWith("\n")) {
ret.append('\n');
* Fetches the ALL the text of the powerpoint file, in a vector of
* strings, one per text record
*/
- public Vector getTextAsVector() {
- Vector textV = new Vector();
+ public Vector<String> getTextAsVector() {
+ Vector<String> textV = new Vector<String>();
// Set to the start of the file
int walkPos = 0;
* If it is a text record, grabs out the text. Whatever happens, returns
* the position of the next record, or -1 if no more.
*/
- public int findTextRecords(int startPos, Vector textV) {
+ public int findTextRecords(int startPos, Vector<String> textV) {
// Grab the length, and the first option byte
// Note that the length doesn't include the 8 byte atom header
int len = (int)LittleEndian.getUInt(pptContents,startPos+4);
* You always need to check the most recent PersistPtrHolder
* that knows about a given slide to find the right location
*/
- private Hashtable _slideLocations;
+ private Hashtable<Integer,Integer> _slideLocations;
/**
* Holds the lookup from slide id to where their offset is
* held inside _ptrData. Used when writing out, and updating
* the positions of the slides
*/
- private Hashtable _slideOffsetDataLocation;
+ private Hashtable<Integer,Integer> _slideOffsetDataLocation;
/**
* Get the list of slides that this PersistPtrHolder knows about.
*/
public int[] getKnownSlideIDs() {
int[] ids = new int[_slideLocations.size()];
- Enumeration e = _slideLocations.keys();
+ Enumeration<Integer> e = _slideLocations.keys();
for(int i=0; i<ids.length; i++) {
- Integer id = (Integer)e.nextElement();
+ Integer id = e.nextElement();
ids[i] = id.intValue();
}
return ids;
* Get the lookup from slide numbers to byte offsets, for the slides
* known about by this PersistPtrHolder.
*/
- public Hashtable getSlideLocationsLookup() {
+ public Hashtable<Integer,Integer> getSlideLocationsLookup() {
return _slideLocations;
}
/**
* Get the lookup from slide numbers to their offsets inside
* _ptrData, used when adding or moving slides.
*/
- public Hashtable getSlideOffsetDataLocationsLookup() {
+ public Hashtable<Integer,Integer> getSlideOffsetDataLocationsLookup() {
return _slideOffsetDataLocation;
}
// base number for these entries
// count * 32 bit offsets
// Repeat as many times as you have data
- _slideLocations = new Hashtable();
- _slideOffsetDataLocation = new Hashtable();
+ _slideLocations = new Hashtable<Integer,Integer>();
+ _slideOffsetDataLocation = new Hashtable<Integer,Integer>();
_ptrData = new byte[len-8];
System.arraycopy(source,start+8,_ptrData,0,_ptrData.length);
* At write-out time, update the references to the sheets to their
* new positions
*/
- public void updateOtherRecordReferences(Hashtable oldToNewReferencesLookup) {
+ public void updateOtherRecordReferences(Hashtable<Integer,Integer> oldToNewReferencesLookup) {
int[] slideIDs = getKnownSlideIDs();
// Loop over all the slides we know about