The Mozilla
Organization
Our Mission
Who We Are
Getting Involved
Community
Editorials
What's New
Newsbot
Development
Roadmap
Module Owners
Blue Sky
Projects
Status
Tools
Products
Source Code
Binaries
Documentation
License Terms
Bug Reports
Quality
Search
Feedback


Class grendel.storage.ByteStringTable

All Packages  This Package  Class Hierarchy  Class Search  Index

Class grendel.storage.ByteStringTable

java.lang.Object
   |
   +----grendel.storage.Obarray
           |
           +----grendel.storage.ByteStringTable

This is a mechanism for uniqueifying header strings (ByteString objects.) To save memory, we want all `equal' strings to also be `=='. This table is how we accomplish that. See intern().

See Also: ByteString, MessageIDTable


class  ByteStringTable
     extends grendel.storage.Obarray
{
          // Fields 1
     protected DummyByteString dummy;

          // Constructors 2
     ByteStringTable();
     ByteStringTable(int);

          // Methods 2
     protected synchronized Object checkHash(byte[], int, int);
     protected Object newInternable(byte[], int, int);
}



Fields


dummy

   protected DummyByteString dummy

This is the way we check to see if an object is in the table, or rather, if an object constructed from that sequence of bytes would be in the table. This is a kludge to get around the lack of function pointers...



Constructors


ByteStringTable

   ByteStringTable(int default_size) 


ByteStringTable

   ByteStringTable() 



Methods


checkHash

   protected synchronized Object checkHash(byte[] bytes, 
                                           int start, 
                                           int length) 

Check whether there is a ByteString representing the given subsequence of bytes in the table already. Returns null, or an object from the table (an Integer object.)

Overrides:
checkHash in class Obarray


newInternable

   protected Object newInternable(byte[] bytes, 
                                  int start, 
                                  int length) 

Creates a new ByteString object (which will then be interned.)

Overrides:
newInternable in class Obarray


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.4



Copyright © 1998 The Mozilla Organization.