Package loci.poi.hssf.record
Class NameRecord
- java.lang.Object
-
- loci.poi.hssf.record.Record
-
- loci.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
Fields Modifier and Type Field Description static byteBUILTIN_AUTO_ACTIVATEIncluded for completeness sake, not implementedstatic byteBUILTIN_AUTO_CLOSEIncluded for completeness sake, not implementedstatic byteBUILTIN_AUTO_DEACTIVATEIncluded for completeness sake, not implementedstatic byteBUILTIN_AUTO_OPENIncluded for completeness sake, not implementedstatic byteBUILTIN_CONSOLIDATE_AREAIncluded for completeness sake, not implementedstatic byteBUILTIN_CRITERIAIncluded for completeness sake, not implementedstatic byteBUILTIN_DATA_FORMIncluded for completeness sake, not implementedstatic byteBUILTIN_DATABASEIncluded for completeness sake, not implementedstatic byteBUILTIN_PRINT_AREAstatic byteBUILTIN_PRINT_TITLEstatic byteBUILTIN_RECORDERIncluded for completeness sake, not implementedstatic byteBUILTIN_SHEET_TITLEIncluded for completeness sake, not implementedstatic shortOPT_BINDATAstatic shortOPT_BUILTINstatic shortOPT_COMMAND_NAMEstatic shortOPT_COMPLEXstatic shortOPT_FUNCTION_NAMEstatic shortOPT_HIDDEN_NAMEstatic shortOPT_MACROstatic shortsid
-
Constructor Summary
Constructors Constructor Description NameRecord()Creates new NameRecordNameRecord(byte builtin, short index)Constructor to create a built-in named regionNameRecord(RecordInputStream in)Constructs a Name record and sets its fields appropriately.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfillFields(RecordInputStream in)called by the constructor, should set class level fields.java.lang.StringgetAreaReference(Workbook book)gets the reference , the area only (range)bytegetBuiltInName()Gets the Built In NamebytegetCompressedUnicodeFlag()gets the name compressed Unicode flagbytegetCustomMenuLength()gets the custom menu lengthjava.lang.StringgetCustomMenuText()get the custom menu textshortgetDefinitionLength()get the definition lengthjava.lang.StringgetDescriptionText()gets the description textbytegetDescriptionTextLength()gets the description text lengthshortgetEqualsToIndexToSheet()shortgetExternSheetNumber()gets the extern sheet numberbytegetFnGroup()bytegetHelpTopicLength()gets the help topic lengthjava.lang.StringgetHelpTopicText()get the help topic textshortgetIndexToSheet()Convenience method to retrieve the index the name refers to.bytegetKeyboardShortcut()returns the keyboard shortcutjava.util.ListgetNameDefinition()gets the definition, reference (Formula)java.lang.StringgetNameText()gets the namebytegetNameTextLength()gets the name lengthshortgetOptionFlag()gets the option flagintgetRecordSize()returns the record sizeshortgetSid()return the non static version of the id for this record.bytegetStatusBarLength()get the status bar text lengthjava.lang.StringgetStatusBarText()gets the status bar textintgetTextsLength()gets the length of all textsshortgetUnused()gets the index to extern sheetbooleanisBuiltInName()Convenience Function to determine if the name is a built-in namebooleanisCommandName()booleanisComplexFunction()booleanisFunctionName()booleanisHiddenName()booleanisMacro()intserialize(int offset, byte[] data)called by the class that is responsible for writing this sucker.voidsetAreaReference(java.lang.String ref)sets the reference , the area only (range)voidsetCompressedUnicodeFlag(byte flag)sets the compressed unicode flagvoidsetCustomMenuLength(byte length)sets the custom menu lengthvoidsetCustomMenuText(java.lang.String text)sets the custom menu textvoidsetDefinitionTextLength(short length)sets the definition (reference - formula) lengthvoidsetDescriptionText(java.lang.String text)sets the description textvoidsetDescriptionTextLength(byte length)sets the length of named range descriptionvoidsetEqualsToIndexToSheet(short value)voidsetExternSheetNumber(short externSheetNumber)sets the extern sheet numbervoidsetHelpTopicLength(byte length)sets the help topic lengthvoidsetHelpTopicText(java.lang.String text)sets the help topic textvoidsetKeyboardShortcut(byte shortcut)sets the keyboard shortcutvoidsetNameDefinition(java.util.Stack nameDefinition)voidsetNameText(java.lang.String name)sets the name of the named rangevoidsetNameTextLength(byte length)sets the name of the named range lengthvoidsetOptionFlag(short flag)sets the option flag for the named rangevoidsetStatusBarLength(byte length)sets the length of the status bar textvoidsetStatusBarText(java.lang.String text)sets the status bar textvoidsetUnused(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.StringtoString()get a string representation of the record (for biffview/debugging)protected java.lang.StringtranslateBuiltInName(byte name)Creates a human readable name for built in typesprotected voidvalidateSid(short id)called by constructor, should throw runtime exception in the event of a record passed with a differing ID.-
Methods inherited from class loci.poi.hssf.record.Record
clone, isInValueSection, isValue, serialize
-
-
-
-
Field Detail
-
sid
public static final short sid
- See Also:
- Constant Field Values
-
BUILTIN_CONSOLIDATE_AREA
public static final byte BUILTIN_CONSOLIDATE_AREA
Included for completeness sake, not implemented- See Also:
- Constant Field Values
-
BUILTIN_AUTO_OPEN
public static final byte BUILTIN_AUTO_OPEN
Included for completeness sake, not implemented- See Also:
- Constant Field Values
-
BUILTIN_AUTO_CLOSE
public static final byte BUILTIN_AUTO_CLOSE
Included for completeness sake, not implemented- See Also:
- Constant Field Values
-
BUILTIN_DATABASE
public static final byte BUILTIN_DATABASE
Included for completeness sake, not implemented- See Also:
- Constant Field Values
-
BUILTIN_CRITERIA
public static final byte BUILTIN_CRITERIA
Included for completeness sake, not implemented- See Also:
- Constant Field Values
-
BUILTIN_PRINT_AREA
public static final byte BUILTIN_PRINT_AREA
- See Also:
- Constant Field Values
-
BUILTIN_PRINT_TITLE
public static final byte BUILTIN_PRINT_TITLE
- See Also:
- Constant Field Values
-
BUILTIN_RECORDER
public static final byte BUILTIN_RECORDER
Included for completeness sake, not implemented- See Also:
- Constant Field Values
-
BUILTIN_DATA_FORM
public static final byte BUILTIN_DATA_FORM
Included for completeness sake, not implemented- See Also:
- Constant Field Values
-
BUILTIN_AUTO_ACTIVATE
public static final byte BUILTIN_AUTO_ACTIVATE
Included for completeness sake, not implemented- See Also:
- Constant Field Values
-
BUILTIN_AUTO_DEACTIVATE
public static final byte BUILTIN_AUTO_DEACTIVATE
Included for completeness sake, not implemented- See Also:
- Constant Field Values
-
BUILTIN_SHEET_TITLE
public static final byte BUILTIN_SHEET_TITLE
Included for completeness sake, not implemented- See Also:
- Constant Field Values
-
OPT_HIDDEN_NAME
public static final short OPT_HIDDEN_NAME
- See Also:
- Constant Field Values
-
OPT_FUNCTION_NAME
public static final short OPT_FUNCTION_NAME
- See Also:
- Constant Field Values
-
OPT_COMMAND_NAME
public static final short OPT_COMMAND_NAME
- See Also:
- Constant Field Values
-
OPT_MACRO
public static final short OPT_MACRO
- See Also:
- Constant Field Values
-
OPT_COMPLEX
public static final short OPT_COMPLEX
- See Also:
- Constant Field Values
-
OPT_BUILTIN
public static final short OPT_BUILTIN
- See Also:
- Constant Field Values
-
OPT_BINDATA
public static final short OPT_BINDATA
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NameRecord
public NameRecord()
Creates new NameRecord
-
NameRecord
public NameRecord(RecordInputStream in)
Constructs a Name record and sets its fields appropriately.- Parameters:
in- the RecordInputstream to read the record from
-
NameRecord
public NameRecord(byte builtin, short index)Constructor to create a built-in named region- Parameters:
builtin- Built-in byte representation for the name record, use the public constantsindex-
-
-
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()
-
getIndexToSheet
public short getIndexToSheet()
Convenience method to retrieve the index the name refers to.- Returns:
- short
- See Also:
getEqualsToIndexToSheet()
-
getFnGroup
public byte getFnGroup()
- Returns:
- function group
- See Also:
FnGroupCountRecord
-
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
-
getDefinitionLength
public short getDefinitionLength()
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
-
isHiddenName
public boolean isHiddenName()
- Returns:
- true if name is hidden
-
isFunctionName
public boolean isFunctionName()
- Returns:
- true if name is a function
-
isCommandName
public boolean isCommandName()
- Returns:
- true if name is a command
-
isMacro
public boolean isMacro()
- Returns:
- true if function macro or command macro
-
isComplexFunction
public boolean isComplexFunction()
- Returns:
- true if array formula or user defined
-
isBuiltInName
public boolean isBuiltInName()
Convenience Function to determine if the name is a built-in name
-
getNameText
public java.lang.String getNameText()
gets the name- Returns:
- name
-
getBuiltInName
public byte getBuiltInName()
Gets the Built In Name- Returns:
- the built in 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:
validateSidin classRecord- 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
-
getTextsLength
public int getTextsLength()
gets the length of all texts- Returns:
- total length
-
getRecordSize
public int getRecordSize()
returns the record size- Overrides:
getRecordSizein classRecord
-
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(Workbook book)
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(RecordInputStream in)
called by the constructor, should set class level fields. Should throw runtime exception for bad/icomplete data.- Specified by:
fillFieldsin classRecord- Parameters:
in- the RecordInputstream to read the record from
-
getSid
public short getSid()
return the non static version of the id for this record.
-
toString
public java.lang.String toString()
Description copied from class:Recordget a string representation of the record (for biffview/debugging)
-
translateBuiltInName
protected java.lang.String translateBuiltInName(byte name)
Creates a human readable name for built in types- Returns:
- Unknown if the built-in name cannot be translated
-
-