jxl.write.biff
Class SharedStrings

java.lang.Object
  |
  +--jxl.write.biff.SharedStrings

class SharedStrings
extends java.lang.Object

The list of available shared strings. This class contains the labels used for the entire spreadsheet


Field Summary
private  java.util.ArrayList stringList
          Contains the same strings, held in a list
private  java.util.HashMap strings
          All the strings in the spreadsheet, keyed on the string itself
private  int totalOccurrences
          The total occurrence of strings in the workbook
 
Constructor Summary
SharedStrings()
          Constructor
 
Method Summary
private  SSTContinueRecord createContinueRecord(java.lang.String curString, int charsLeft, File outputFile)
          Creates and returns a continue record using the left over bits and pieces
 java.lang.String get(int i)
          Gets the string at the specified index
 int getIndex(java.lang.String s)
          Gets the index for the string passed in.
 void write(File outputFile)
          Writes out the shared string table
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

strings

private java.util.HashMap strings
All the strings in the spreadsheet, keyed on the string itself

stringList

private java.util.ArrayList stringList
Contains the same strings, held in a list

totalOccurrences

private int totalOccurrences
The total occurrence of strings in the workbook
Constructor Detail

SharedStrings

public SharedStrings()
Constructor
Method Detail

getIndex

public int getIndex(java.lang.String s)
Gets the index for the string passed in. If the string is already present, then returns the index of that string, otherwise creates a new key-index mapping
Parameters:
s - the string whose index we want
Returns:
the index of the string

get

public java.lang.String get(int i)
Gets the string at the specified index
Parameters:
i - the index of the string
Returns:
the string at the specified index

write

public void write(File outputFile)
           throws java.io.IOException
Writes out the shared string table
Parameters:
outputFile - the binary output file
Throws:
java.io.IOException -  

createContinueRecord

private SSTContinueRecord createContinueRecord(java.lang.String curString,
                                               int charsLeft,
                                               File outputFile)
                                        throws java.io.IOException
Creates and returns a continue record using the left over bits and pieces