Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Private Attributes
StringTable Struct Reference

Provides a GC-able table of interned strings. More...

import "readstrings.h";

Collaboration diagram for StringTable:
Collaboration graph
[legend]

List of all members.

Public Member Functions

String intern (String str)
String internAs (String key, String value)

Public Attributes

char title [MAX_TEXT_LEN]
char info [MAX_TEXT_LEN]

Private Attributes

Hashtable strings = new Hashtable()

Detailed Description

Provides a GC-able table of interned strings.

Definition at line 42 of file StringTable.java.


Member Function Documentation

String StringTable.intern ( String  str) [inline]

Definition at line 45 of file StringTable.java.

                                     {
        String result = (String) strings.get(str);
        if (result == null) {
            // copy the string, to trim to minimum size.
            result = str = new String(str);
            strings.put(str, str);
        }
        return result;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

String StringTable.internAs ( String  key,
String  value 
) [inline]

Definition at line 55 of file StringTable.java.

                                                     {
        value = new String(value);
        strings.put(key, value);
        return value;
    }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 46 of file readstrings.h.

Hashtable StringTable.strings = new Hashtable() [private]

Definition at line 43 of file StringTable.java.

Definition at line 45 of file readstrings.h.


The documentation for this struct was generated from the following files: