Class SSTDictionary
Dictionary is used for grouping strings used by Excel in order to prevent doubling of data. Dictionary stores information as key string and value.
Inheritance
Namespace: Syncfusion.XlsIO.Implementation
Assembly: Syncfusion.XlsIO.Base.dll
Syntax
public class SSTDictionary : Object, IParseable, IDisposable
Constructors
SSTDictionary(WorkbookImpl)
Default constructor. Reserves space for strings.
Declaration
public SSTDictionary(WorkbookImpl book)
Parameters
Type | Name | Description |
---|---|---|
WorkbookImpl | book |
Fields
DEF_EMPTY_STRING_INDEX
Index of the empty string.
Declaration
public const int DEF_EMPTY_STRING_INDEX = -1
Field Value
Type |
---|
System.Int32 |
Properties
ActiveCount
Returns number of strings without removed items. Read-only.
Declaration
public int ActiveCount { get; }
Property Value
Type |
---|
System.Int32 |
Count
Gets quantity of unique strings.
Declaration
public int Count { get; }
Property Value
Type |
---|
System.Int32 |
Item[TextWithFormat]
Gets references count to specified string.
Declaration
public int this[TextWithFormat key] { get; }
Parameters
Type | Name | Description |
---|---|---|
TextWithFormat | key |
Property Value
Type |
---|
System.Int32 |
Item[Int32]
Gets text with format.
Declaration
public TextWithFormat this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Property Value
Type |
---|
TextWithFormat |
Keys
Gets list of strings.
Declaration
public object[] Keys { get; }
Property Value
Type |
---|
System.Object[] |
OriginalSST
Gets / sets original SSTRecord.
Declaration
public SSTRecord OriginalSST { get; set; }
Property Value
Type |
---|
SSTRecord |
UseHashForSearching
Declaration
public bool UseHashForSearching { get; set; }
Property Value
Type |
---|
System.Boolean |
Workbook
Returns parent workbook. Read-only.
Declaration
public WorkbookImpl Workbook { get; }
Property Value
Type |
---|
WorkbookImpl |
Methods
AddCopy(Int32, SSTDictionary, Dictionary<Int32, Int32>)
Adds copy of the string from another collection.
Declaration
public int AddCopy(int index, SSTDictionary sourceSST, Dictionary<int, int> dicFontIndexes)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index of the string to add. |
SSTDictionary | sourceSST | Source string table. |
System.Collections.Generic.Dictionary<System.Int32, System.Int32> | dicFontIndexes | Dictionary with font indexes. |
Returns
Type | Description |
---|---|
System.Int32 | Index of the added string. |
AddIncrease(Int32)
Adds string into dictionary. If the string exists in dictionary, add reference count. Method can influence on SST Indexes.
Declaration
public void AddIncrease(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index to the string. |
AddIncrease(Object)
Adds string into dictionary. If the string exists in dictionary, add reference count. Method can influence on SST Indexes.
Declaration
public int AddIncrease(object key)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | String to add |
Returns
Type | Description |
---|---|
System.Int32 | Index of the added string. |
AddIncrease(Object, Boolean)
Adds string into dictionary. If the string exists in dictionary, add reference count. Method can influence on SST Indexes.
Declaration
public int AddIncrease(object key, bool bIncrease)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | String to add |
System.Boolean | bIncrease | Reference count for new entries. |
Returns
Type | Description |
---|---|
System.Int32 | Index of the added string. |
Clear()
Clears the list.
Declaration
public void Clear()
Clone(WorkbookImpl)
Creates copy of the current instance.
Declaration
public object Clone(WorkbookImpl book)
Parameters
Type | Name | Description |
---|---|---|
WorkbookImpl | book |
Returns
Type | Description |
---|---|
System.Object | Copy of the current instance. |
Contains(Object)
Method checks if the dictionary contains the specified string.
Declaration
public bool Contains(object key)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | String which must be checked. |
Returns
Type | Description |
---|---|
System.Boolean | True - string exists in dictionary, otherwise False. |
DecreaseOnly(Int32)
Method decreases reference count of string without removing it.
Declaration
public void DecreaseOnly(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index of the string to decrease reference. |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Finalize()
Declaration
protected override void Finalize()
GetSSTContentByIndex(Int32)
Returns SST content.
Declaration
public object GetSSTContentByIndex(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index of the target string. |
Returns
Type | Description |
---|---|
System.Object | SST content object. |
GetStringByIndex(Int32)
Returns RTF string by its index in the dictionary.
Declaration
public TextWithFormat GetStringByIndex(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index of the target string. |
Returns
Type | Description |
---|---|
TextWithFormat | RTF string. |
GetStringCount(Int32)
Returns number of strings in the dictionary.
Declaration
public int GetStringCount(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index of the target string. |
Returns
Type |
---|
System.Int32 |
GetStringIndexes(String)
Searches for all strings with specified text.
Declaration
public Dictionary<int, object> GetStringIndexes(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | String to search. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.Int32, System.Object> | Dictionary, key - string index, value - null. |
Parse()
Here we have to parse our SST record
Declaration
public void Parse()
RemoveDecrease(Int32)
Remove reference of string. When reference count reaches zero, string will be removed from dictionary. Method can influence the SST indexes.
Declaration
public void RemoveDecrease(int iIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iIndex | String index to remove. |
RemoveDecrease(Object)
Remove reference of string. When reference count reaches zero, string will be removed from dictionary. Method can influence the SST indexes.
Declaration
public void RemoveDecrease(object key)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | String whose reference must be removed. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | When SST table does not contain the specified string. |
RemoveUnnecessaryStrings()
This methods looks through all row storages to find out used strings. And removes all unnecessary strings after that.
Declaration
public void RemoveUnnecessaryStrings()
Serialize(OffsetArrayList)
Serialize dictionary.
Declaration
public void Serialize(OffsetArrayList records)
Parameters
Type | Name | Description |
---|---|---|
OffsetArrayList | records | Records where writes serialized data. |
StartWith(String)
Searches for all strings that starts with specified string.
Declaration
public List<int> StartWith(string strStart)
Parameters
Type | Name | Description |
---|---|---|
System.String | strStart | String prefix to search. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.Int32> | List with all string indexes that starts with specified string, in ascending order. |
UpdateRefCounts()
Updates internal array that stores reference count.
Declaration
public void UpdateRefCounts()