org.apache.poi.hssf.record
Class NameRecord

java.lang.Object
  extended byorg.apache.poi.hssf.record.Record
      extended byorg.apache.poi.hssf.record.NameRecord

public class NameRecord
extends Record

Title: Name Record (aka Named Range)

Description: Defines a named range within a workbook.

REFERENCE:

Version:
1.0-pre
Author:
Libin Roman (Vista Portal LDT. Developer), Sergei Kozello (sergeikozello at mail.ru), Glen Stampoultzis (glens at apache.org)

Field Summary
static short sid
           
 
Constructor Summary
NameRecord()
          Creates new NameRecord
NameRecord(short id, short size, byte[] data)
          Constructs a Name record and sets its fields appropriately.
NameRecord(short id, short size, byte[] data, int offset)
          Constructs a Name record and sets its fields appropriately.
 
Method Summary
protected  void fillFields(byte[] data, short size, int offset)
          called by the constructor, should set class level fields.
 java.lang.String getAreaReference(SheetReferences refs)
          gets the reference , the area only (range)
 byte getCompressedUnicodeFlag()
          gets the name compressed Unicode flag
 byte getCustomMenuLength()
          gets the custom menu length
 java.lang.String getCustomMenuText()
          get the custom menu text
 short getDefinitionTextLength()
          get the definition length
 java.lang.String getDescriptionText()
          gets the description text
 byte getDescriptionTextLength()
          gets the description text length
 short getEqualsToIndexToSheet()
           
 short getExternSheetNumber()
          gets the extern sheet number
 byte getHelpTopicLength()
          gets the help topic length
 java.lang.String getHelpTopicText()
          get the help topic text
 byte getKeyboardShortcut()
          returns the keyboard shortcut
 java.util.List getNameDefinition()
          gets the definition, reference (Formula)
 java.lang.String getNameText()
          gets the name
 byte getNameTextLength()
          gets the name length
 short getOptionFlag()
          gets the option flag
 int getRecordSize()
          returns the record size
 short getSid()
          return the non static version of the id for this record.
 byte getStatusBarLength()
          get the status bar text length
 java.lang.String getStatusBarText()
          gets the status bar text
 int getTextsLength()
          gets the length of all texts
 short getUnused()
          gets the index to extern sheet
 int serialize(int offset, byte[] data)
          called by the class that is responsible for writing this sucker.
 void setAreaReference(java.lang.String ref)
          sets the reference , the area only (range)
 void setCompressedUnicodeFlag(byte flag)
          sets the compressed unicode flag
 void setCustomMenuLength(byte length)
          sets the custom menu length
 void setCustomMenuText(java.lang.String text)
          sets the custom menu text
 void setDefinitionTextLength(short length)
          sets the definition (reference - formula) length
 void setDescriptionText(java.lang.String text)
          sets the description text
 void setDescriptionTextLength(byte length)
          sets the length of named range description
 void setEqualsToIndexToSheet(short value)
           
 void setExternSheetNumber(short externSheetNumber)
          sets the extern sheet number
 void setHelpTopicLength(byte length)
          sets the help topic length
 void setHelpTopicText(java.lang.String text)
          sets the help topic text
 void setKeyboardShortcut(byte shortcut)
          sets the keyboard shortcut
 void setNameDefinition(java.util.Stack nameDefinition)
           
 void setNameText(java.lang.String name)
          sets the name of the named range
 void setNameTextLength(byte length)
          sets the name of the named range length
 void setOptionFlag(short flag)
          sets the option flag for the named range
 void setStatusBarLength(byte length)
          sets the length of the status bar text
 void setStatusBarText(java.lang.String text)
          sets the status bar text
 void setUnused(short index)
          sets the index number to the extern sheet (thats is what writen in documentation but as i saw , it works differently)
 java.lang.String toString()
          get a string representation of the record (for biffview/debugging)
protected  void validateSid(short id)
          called by constructor, should throw runtime exception in the event of a record passed with a differing ID.
 
Methods inherited from class org.apache.poi.hssf.record.Record
clone, fillFields, isInValueSection, isValue, processContinueRecord, serialize
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sid

public static final short sid
See Also:
Constant Field Values
Constructor Detail

NameRecord

public NameRecord()
Creates new NameRecord


NameRecord

public NameRecord(short id,
                  short size,
                  byte[] data)
Constructs a Name record and sets its fields appropriately.

Parameters:
id - id must be 0x18 or an exception will be throw upon validation
size - the size of the data area of the record
data - data of the record (should not contain sid/len)

NameRecord

public NameRecord(short id,
                  short size,
                  byte[] data,
                  int offset)
Constructs a Name record and sets its fields appropriately.

Parameters:
id - id must be 0x18 or an exception will be throw upon validation
size - the size of the data area of the record
data - data of the record (should not contain sid/len)
offset - of the record's data
Method Detail

setOptionFlag

public void setOptionFlag(short flag)
sets the option flag for the named range

Parameters:
flag - option flag

setKeyboardShortcut

public void setKeyboardShortcut(byte shortcut)
sets the keyboard shortcut

Parameters:
shortcut - keyboard shortcut

setNameTextLength

public void setNameTextLength(byte length)
sets the name of the named range length

Parameters:
length - name length

setDefinitionTextLength

public void setDefinitionTextLength(short length)
sets the definition (reference - formula) length

Parameters:
length - defenition length

setUnused

public void setUnused(short index)
sets the index number to the extern sheet (thats is what writen in documentation but as i saw , it works differently)

Parameters:
index - extern sheet index

getEqualsToIndexToSheet

public short getEqualsToIndexToSheet()

setEqualsToIndexToSheet

public void setEqualsToIndexToSheet(short value)

setCustomMenuLength

public void setCustomMenuLength(byte length)
sets the custom menu length

Parameters:
length - custom menu length

setDescriptionTextLength

public void setDescriptionTextLength(byte length)
sets the length of named range description

Parameters:
length - description length

setHelpTopicLength

public void setHelpTopicLength(byte length)
sets the help topic length

Parameters:
length - help topic length

setStatusBarLength

public void setStatusBarLength(byte length)
sets the length of the status bar text

Parameters:
length - status bar text length

setCompressedUnicodeFlag

public void setCompressedUnicodeFlag(byte flag)
sets the compressed unicode flag

Parameters:
flag - unicode flag

setNameText

public void setNameText(java.lang.String name)
sets the name of the named range

Parameters:
name - named range name

setCustomMenuText

public void setCustomMenuText(java.lang.String text)
sets the custom menu text

Parameters:
text - custom menu text

setDescriptionText

public void setDescriptionText(java.lang.String text)
sets the description text

Parameters:
text - the description text

setHelpTopicText

public void setHelpTopicText(java.lang.String text)
sets the help topic text

Parameters:
text - help topix text

setStatusBarText

public void setStatusBarText(java.lang.String text)
sets the status bar text

Parameters:
text - status bar text

getOptionFlag

public short getOptionFlag()
gets the option flag

Returns:
option flag

getKeyboardShortcut

public byte getKeyboardShortcut()
returns the keyboard shortcut

Returns:
keyboard shortcut

getNameTextLength

public byte getNameTextLength()
gets the name length

Returns:
name length

getDefinitionTextLength

public short getDefinitionTextLength()
get the definition length

Returns:
definition length

getUnused

public short getUnused()
gets the index to extern sheet

Returns:
index to extern sheet

getCustomMenuLength

public byte getCustomMenuLength()
gets the custom menu length

Returns:
custom menu length

getDescriptionTextLength

public byte getDescriptionTextLength()
gets the description text length

Returns:
description text length

getHelpTopicLength

public byte getHelpTopicLength()
gets the help topic length

Returns:
help topic length

getStatusBarLength

public byte getStatusBarLength()
get the status bar text length

Returns:
satus bar length

getCompressedUnicodeFlag

public byte getCompressedUnicodeFlag()
gets the name compressed Unicode flag

Returns:
compressed unicode flag

getNameText

public java.lang.String getNameText()
gets the name

Returns:
name

getNameDefinition

public java.util.List getNameDefinition()
gets the definition, reference (Formula)

Returns:
definition -- can be null if we cant parse ptgs

setNameDefinition

public void setNameDefinition(java.util.Stack nameDefinition)

getCustomMenuText

public java.lang.String getCustomMenuText()
get the custom menu text

Returns:
custom menu text

getDescriptionText

public java.lang.String getDescriptionText()
gets the description text

Returns:
description text

getHelpTopicText

public java.lang.String getHelpTopicText()
get the help topic text

Returns:
gelp topic text

getStatusBarText

public java.lang.String getStatusBarText()
gets the status bar text

Returns:
status bar text

validateSid

protected void validateSid(short id)
called by constructor, should throw runtime exception in the event of a record passed with a differing ID.

Specified by:
validateSid in class Record
Parameters:
id - alleged id for this record

serialize

public int serialize(int offset,
                     byte[] data)
called by the class that is responsible for writing this sucker. Subclasses should implement this so that their data is passed back in a byte array.

Specified by:
serialize in class Record
Parameters:
offset - to begin writing at
data - byte array containing instance data
Returns:
number of bytes written

getTextsLength

public int getTextsLength()
gets the length of all texts

Returns:
total length

getRecordSize

public int getRecordSize()
returns the record size

Overrides:
getRecordSize in class Record

getExternSheetNumber

public short getExternSheetNumber()
gets the extern sheet number

Returns:
extern sheet index

setExternSheetNumber

public void setExternSheetNumber(short externSheetNumber)
sets the extern sheet number

Parameters:
externSheetNumber - extern sheet number

getAreaReference

public java.lang.String getAreaReference(SheetReferences refs)
gets the reference , the area only (range)

Returns:
area reference

setAreaReference

public void setAreaReference(java.lang.String ref)
sets the reference , the area only (range)

Parameters:
ref - area reference

fillFields

protected void fillFields(byte[] data,
                          short size,
                          int offset)
called by the constructor, should set class level fields. Should throw runtime exception for bad/icomplete data.

Specified by:
fillFields in class Record
Parameters:
data - raw data
size - size of data
offset - of the record's data (provided a big array of the file)

getSid

public short getSid()
return the non static version of the id for this record.

Specified by:
getSid in class Record

toString

public java.lang.String toString()
Description copied from class: Record
get a string representation of the record (for biffview/debugging)

Overrides:
toString in class Record
See Also:
Object.toString()

jakarta-poi 1.10.0-dev

Copyright © 2004 Apache jakarta-poi project. All Rights Reserved.