The Mozilla
Organization
At A Glance
Feedback
Get Involved
Newsgroups
License Terms
Newsbot
Developer Docs
Roadmap
Projects
Ports
Module Owners
Hacking
Get the Source
Build It
Testing
Download
Bugzilla
Bug Writing
Tools
View Source
Tree Status
New Checkins
Submit A Bug
FAQ
Search
Class grendel.storage.MessageIDTable
All Packages  This Package  Class Hierarchy  Class Search  Index

Class grendel.storage.MessageIDTable

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

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

See Also: MessageID, ByteStringTable


class  MessageIDTable
     extends grendel.storage.Obarray
{
          // Fields 1
     protected MessageID dummy;

          // Constructors 2
     MessageIDTable();
     MessageIDTable(int);

          // Methods 3
     protected synchronized Object checkHash(byte[], int, int);
     public int intern(MessageID);
     protected Object newInternable(byte[], int, int);
}



Fields


dummy

   protected MessageID 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


MessageIDTable

   MessageIDTable(int default_size) 


MessageIDTable

   MessageIDTable() 



Methods


checkHash

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

Check whether there is a MessageID 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 MessageID object (which will then be interned.)

Overrides:
newInternable in class Obarray


intern

   public int intern(MessageID id) 

Ensures that an equivalent MessageID is present in the table, adding it if necessary. Returns the index in the table of that object. The given MessageID object may be stored in the table, without being copied.



All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.4
Copyright © 1998-1999 The Mozilla Organization.
Last modified December 25, 1998.