com.healthmarketscience.jackcess
Class UsageMap

java.lang.Object
  extended by com.healthmarketscience.jackcess.UsageMap

public class UsageMap
extends Object

Describes which database pages a particular table uses

Author:
Tim McCune

Nested Class Summary
 class UsageMap.PageCursor
          Utility class to traverse over the pages in the UsageMap.
 
Field Summary
static byte MAP_TYPE_INLINE
          Inline map type
static byte MAP_TYPE_REFERENCE
          Reference map type, for maps that are too large to fit inline
 
Method Summary
 void addPageNumber(int pageNumber)
          Add a page number to this usage map
 boolean containsPageNumber(int pageNumber)
          Determines if the given page number is contained in this map.
 UsageMap.PageCursor cursor()
           
 Database getDatabase()
           
 JetFormat getFormat()
           
 PageChannel getPageChannel()
           
 int getPageCount()
           
static UsageMap read(Database database, ByteBuffer buf, boolean assumeOutOfRangeBitsOn)
           
static UsageMap read(Database database, int pageNum, int rowNum, boolean assumeOutOfRangeBitsOn)
           
 void removePageNumber(int pageNumber)
          Remove a page number from this usage map
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAP_TYPE_INLINE

public static final byte MAP_TYPE_INLINE
Inline map type

See Also:
Constant Field Values

MAP_TYPE_REFERENCE

public static final byte MAP_TYPE_REFERENCE
Reference map type, for maps that are too large to fit inline

See Also:
Constant Field Values
Method Detail

getDatabase

public Database getDatabase()

getFormat

public JetFormat getFormat()

getPageChannel

public PageChannel getPageChannel()

read

public static UsageMap read(Database database,
                            ByteBuffer buf,
                            boolean assumeOutOfRangeBitsOn)
                     throws IOException
Parameters:
database - database that contains this usage map
buf - buffer which contains the usage map row info
Returns:
Either an InlineUsageMap or a ReferenceUsageMap, depending on which type of map is found
Throws:
IOException

read

public static UsageMap read(Database database,
                            int pageNum,
                            int rowNum,
                            boolean assumeOutOfRangeBitsOn)
                     throws IOException
Parameters:
database - database that contains this usage map
pageNum - Page number that this usage map is contained in
rowNum - Number of the row on the page that contains this usage map
Returns:
Either an InlineUsageMap or a ReferenceUsageMap, depending on which type of map is found
Throws:
IOException

cursor

public UsageMap.PageCursor cursor()

getPageCount

public int getPageCount()

containsPageNumber

public boolean containsPageNumber(int pageNumber)
Determines if the given page number is contained in this map.


addPageNumber

public void addPageNumber(int pageNumber)
                   throws IOException
Add a page number to this usage map

Throws:
IOException

removePageNumber

public void removePageNumber(int pageNumber)
                      throws IOException
Remove a page number from this usage map

Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2005-2013 Health Market Science. All Rights Reserved.