jSyncManager

org.jSyncManager.API.Protocol.Util.StdApps
Class NotepadAppBlock

java.lang.Object
  |
  +--org.jSyncManager.API.Protocol.Util.DLPBlock
        |
        +--org.jSyncManager.API.Protocol.Util.StdApps.NotepadAppBlock
All Implemented Interfaces:
java.io.Serializable

public class NotepadAppBlock
extends DLPBlock

This class represents a Notepad application block.

Version:
$Revision: 1.5 $
Author:
Brad BARCLAY <bbarclay@jsyncmanager.org>
Last modified by $Author: yaztromo $.
See Also:
Serialized Form

Field Summary
static byte ALPHA_ORDER
          A constant used to denote that the records are sorted alphabetically.
static byte UNSORTED
          A constant used to denote that the records are unsorted.
 
Fields inherited from class org.jSyncManager.API.Protocol.Util.DLPBlock
blockSize, data
 
Constructor Summary
NotepadAppBlock()
          Constructs an empty application block.
NotepadAppBlock(DLPBlock block)
          Constructs an application block based on the block information passed.
 
Method Summary
 int findCategoryInfo(int i)
          Retreives the category index for the category with the specified category ID, if available.
protected  void generateData()
          Takes this classes fields and uses them to generate a byte array representation of the App Block.
 CategoryInfo getCategoryInfo(int i)
          Retreives the category info for the category with the specified index number.
 byte getLastUniqueID()
          Retreives the last unique category ID number.
 int getNumCategories()
          Retreives the number of categories held in this application block.
 byte getSortOrder()
          Retreives the sort order in use by this application block.
protected  void parseFields()
          Parses the data array into a set of class fields.
 void setCategoryInfo(CategoryInfo categoryinfo, int i)
          Sets the category information for the specified category index.
 void setSortOrder(byte so)
          Sets the sort order.
 
Methods inherited from class org.jSyncManager.API.Protocol.Util.DLPBlock
getBlockSize, getData, setData, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNSORTED

public static final byte UNSORTED
A constant used to denote that the records are unsorted.

ALPHA_ORDER

public static final byte ALPHA_ORDER
A constant used to denote that the records are sorted alphabetically.
Constructor Detail

NotepadAppBlock

public NotepadAppBlock()
Constructs an empty application block.

NotepadAppBlock

public NotepadAppBlock(DLPBlock block)
Constructs an application block based on the block information passed.
Parameters:
block - the DLPBlock containing the Notepad application block to parse.
Method Detail

findCategoryInfo

public int findCategoryInfo(int i)
Retreives the category index for the category with the specified category ID, if available.
Parameters:
i - the category ID of the information to retreive.
Returns:
the category index of the category with the specified ID, or -1 if the cotegory is not found.

generateData

protected void generateData()
Takes this classes fields and uses them to generate a byte array representation of the App Block.
Overrides:
generateData in class DLPBlock

getCategoryInfo

public CategoryInfo getCategoryInfo(int i)
Retreives the category info for the category with the specified index number.
Parameters:
i - the index of the category info to retreive.
Returns:
CateroryInfo the requested category information.

getLastUniqueID

public byte getLastUniqueID()
Retreives the last unique category ID number.
Returns:
the last unique category ID number.

getNumCategories

public int getNumCategories()
Retreives the number of categories held in this application block.
Returns:
the number of categories held in this application block.

getSortOrder

public byte getSortOrder()
Retreives the sort order in use by this application block.
Returns:
the sort order in use by this application block.

parseFields

protected void parseFields()
Parses the data array into a set of class fields.
Overrides:
parseFields in class DLPBlock

setCategoryInfo

public void setCategoryInfo(CategoryInfo categoryinfo,
                            int i)
Sets the category information for the specified category index.
Parameters:
CategoryInfo - the category information.
i - the index in which to store this category information.

setSortOrder

public void setSortOrder(byte so)
Sets the sort order.
Parameters:
so - the sort order to bet set.
See Also:
UNSORTED, ALPHA_ORDER

jSyncManager

Copyright (c) 1999 - 2003 Brad BARCLAY and others. All Rights Reserved.