moos.ssds.model
Class HeaderDescription

java.lang.Object
  extended bymoos.ssds.model.HeaderDescription
All Implemented Interfaces:
IHeaderDescription, java.io.Serializable, ValueObject

public class HeaderDescription
extends java.lang.Object
implements java.io.Serializable, ValueObject, IHeaderDescription

This class represents a description of header sections in DataFile. It is used for DataFile processing and parsing.


Version:
: $Revision: 1.9 $

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement. This information should not be published or distributed to third parties without specific written permission from MBARI.


Copyright 2002 MBARI.
MBARI Proprietary Information. All rights reserved.



Author:
: $Author: kgomes $
See Also:
CommentTag, ICommentTag, IHeaderDescription, IDataFile, DataFile, Serialized Form

Constructor Summary
HeaderDescription()
          This is the default constructor
 
Method Summary
 void addCommentTag(ICommentTag tag)
          This method takes in a CommentTag and adds it to the ArrayList
 void addCommentTag(java.lang.String tag)
          This method takes in a string and adds a CommentTag to the ArrayList
 java.util.Collection commentTagsAsStrings()
          This method returns a collection of Strings that represent the CommentTag objects in the ArrayList.
 long getByteOffset()
          This method returns the number of bytes that the HeaderDescription is located at in the DataFile
 java.util.Collection getCommentTags()
          This method returns the collection of CommentTagss for this HeaderDescription.
 java.lang.String getDescription()
          This method retrieves the description of the HeaderDescription
 java.lang.Long getId()
          This is the method used to retrieve the unique identifier for the HeaderDescription
 int getNumHeaderLines()
          This method retrieves the number of lines that this HeaderDescription spans.
 boolean hasByteOffset()
          This method indicates whether or not this HeaderDescription has a byteOffset in the DataFile
 boolean hasCommentTags()
          This method returns the result of a check to see if any CommentTags are present in the HeaderDescription.
 boolean hasHeaderLines()
          This returns a boolean that indicates if there are header lines in this HeaderDescription
 java.util.Collection listCommentTags()
          This method returns a collection of Strings that represent the CommentTag objects in the ArrayList.
 void removeCommentTag(ICommentTag tag)
          This method removes a CommentTag from ArrayList.
 void removeCommentTag(java.lang.String tag)
          This method removes a CommentTag from ArrayList.
 void setByteOffset(long byteOffset)
          This method is used to set the number of bytes that the HeaderDescription is offset in the DataFile
 void setByteOffset(java.lang.String byteOffset)
          This method is used to set the number of bytes that the HeaderDescription is offset in the DataFile but takes a string representation of that number as a parameter
 void setDataFile(IDataFile file)
          TODO kgomes: Change this to protected? Only problem is you cannot have protected method defined in an interface.
 void setDescription(java.lang.String description)
          This method is used to set the description of the HeaderDescription
 void setId(java.lang.Long id)
          This method is used to set the unique identifier for the HeaderDescription
 void setNumHeaderLines(int numHeaderLines)
          This method sets the number of lines that the HeaderDescription spans
 void setNumHeaderLines(java.lang.String numHeaderLines)
          This method sets the number of header lines, but takes a string representation of that number as an input
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeaderDescription

public HeaderDescription()
This is the default constructor

Method Detail

getId

public java.lang.Long getId()
This is the method used to retrieve the unique identifier for the HeaderDescription

Specified by:
getId in interface ValueObject
Returns:
The Long that is the unique identifier

setId

public void setId(java.lang.Long id)
This method is used to set the unique identifier for the HeaderDescription

Specified by:
setId in interface ValueObject
Parameters:
id - is the Long that will be the unique identifier

getDescription

public java.lang.String getDescription()
This method retrieves the description of the HeaderDescription

Specified by:
getDescription in interface IHeaderDescription
Returns:
A string that is the description

setDescription

public void setDescription(java.lang.String description)
This method is used to set the description of the HeaderDescription

Specified by:
setDescription in interface IHeaderDescription
Parameters:
description - is the String used to set the description

getByteOffset

public long getByteOffset()
This method returns the number of bytes that the HeaderDescription is located at in the DataFile

Specified by:
getByteOffset in interface IHeaderDescription

setByteOffset

public void setByteOffset(long byteOffset)
This method is used to set the number of bytes that the HeaderDescription is offset in the DataFile

Specified by:
setByteOffset in interface IHeaderDescription

setByteOffset

public void setByteOffset(java.lang.String byteOffset)
This method is used to set the number of bytes that the HeaderDescription is offset in the DataFile but takes a string representation of that number as a parameter

Specified by:
setByteOffset in interface IHeaderDescription
Parameters:
byteOffset - is a string representation of the number of bytes the HeaderDesription is offset

hasByteOffset

public boolean hasByteOffset()
This method indicates whether or not this HeaderDescription has a byteOffset in the DataFile

Specified by:
hasByteOffset in interface IHeaderDescription
Returns:
a boolean that is true if there is a byte offset, false otherwise.

getNumHeaderLines

public int getNumHeaderLines()
This method retrieves the number of lines that this HeaderDescription spans.

Specified by:
getNumHeaderLines in interface IHeaderDescription
Returns:
An integer representing the number of lines the HeaderDescription spans

setNumHeaderLines

public void setNumHeaderLines(int numHeaderLines)
This method sets the number of lines that the HeaderDescription spans

Specified by:
setNumHeaderLines in interface IHeaderDescription
Parameters:
numHeaderLines - is the number of lines the HeaderDescription spans

setNumHeaderLines

public void setNumHeaderLines(java.lang.String numHeaderLines)
This method sets the number of header lines, but takes a string representation of that number as an input

Specified by:
setNumHeaderLines in interface IHeaderDescription
Parameters:
numHeaderLines - a String representation of the number of lines this HeaderDescription spans

hasHeaderLines

public boolean hasHeaderLines()
This returns a boolean that indicates if there are header lines in this HeaderDescription

Specified by:
hasHeaderLines in interface IHeaderDescription
Returns:
a boolean that is true if there are one or more header lines, false otherwise

addCommentTag

public void addCommentTag(ICommentTag tag)
This method takes in a CommentTag and adds it to the ArrayList

Specified by:
addCommentTag in interface IHeaderDescription
Parameters:
tag - is an object that implements the CommentTag interface that is added to the ArrayList

addCommentTag

public void addCommentTag(java.lang.String tag)
This method takes in a string and adds a CommentTag to the ArrayList

Specified by:
addCommentTag in interface IHeaderDescription
Parameters:
tag - is a String that will be the tagString of the CommentTag object that is added to the ArrayList

removeCommentTag

public void removeCommentTag(ICommentTag tag)
This method removes a CommentTag from ArrayList.

Specified by:
removeCommentTag in interface IHeaderDescription
Parameters:
tag - is a CommentTag that has a tagString that is to be removed from the ArrayList

removeCommentTag

public void removeCommentTag(java.lang.String tag)
This method removes a CommentTag from ArrayList.

Specified by:
removeCommentTag in interface IHeaderDescription
Parameters:
tag - is a String that is the tagString of a CommentTag object that is to be removed from the ArrayList

hasCommentTags

public boolean hasCommentTags()
This method returns the result of a check to see if any CommentTags are present in the HeaderDescription.

Specified by:
hasCommentTags in interface IHeaderDescription
Returns:
a boolean that is true if there are CommentTags and false if not

listCommentTags

public java.util.Collection listCommentTags()
This method returns a collection of Strings that represent the CommentTag objects in the ArrayList.

Specified by:
listCommentTags in interface IHeaderDescription
Returns:
A collection of Strings that are the tagStrings from the CommentTag objects in the arrayList

commentTagsAsStrings

public java.util.Collection commentTagsAsStrings()
This method returns a collection of Strings that represent the CommentTag objects in the ArrayList.

Specified by:
commentTagsAsStrings in interface IHeaderDescription
Returns:
A collection of Strings that are the tagStrings from the CommentTag objects in the arrayList

getCommentTags

public java.util.Collection getCommentTags()
This method returns the collection of CommentTagss for this HeaderDescription. This method is protected because it should only be used by members of the model classes (specifically this class).

Specified by:
getCommentTags in interface IHeaderDescription
Returns:
A collection of the CommentTags

setDataFile

public void setDataFile(IDataFile file)
TODO kgomes: Change this to protected? Only problem is you cannot have protected method defined in an interface. It may be OK if we are only working inside the application server and/or handing out value objects. This should NOT be public. ONly called by DataFile.setHeaderDescription()

Specified by:
setDataFile in interface IHeaderDescription
Parameters:
file -