jSyncManager

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

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

public class MemoAppBlock
extends DLPBlock

This class parses and generates the application block information for the MemoPad application.

Version:
$Revision: 1.10 $
Author:
Brad BARCLAY <bbarclay@jsyncmanager.org>
Last modified by: $Author: dingodave $ on $Date: 2003/06/27 04:00:44 $.
See Also:
Serialized Form

Field Summary
static byte ALPHA_ORDER
          A constant denoting that the records should be alphabetical.
static byte UNSORTED
          A constant denoting that the records should be unsorted.
 
Fields inherited from class org.jSyncManager.API.Protocol.Util.DLPBlock
blockSize, data
 
Constructor Summary
MemoAppBlock()
          Constructs an empty Memo application block.
MemoAppBlock(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[] getCategories()
          Return an array of the category info blocks.
 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 denoting that the records should be unsorted.

ALPHA_ORDER

public static final byte ALPHA_ORDER
A constant denoting that the records should be alphabetical.
Constructor Detail

MemoAppBlock

public MemoAppBlock()
Constructs an empty Memo application block.

MemoAppBlock

public MemoAppBlock(DLPBlock block)
Constructs an application block based on the block information passed.
Parameters:
block - the DLPBlock containing the MemoPad 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 number of the category 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.

getCategories

public CategoryInfo[] getCategories()
Return an array of the category info blocks.
Returns:
an array of the category info blocks.

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.