JavaScript is disabled on your browser.
java.lang.Object
CollectionBase
com.aspose.cells.NameCollection
All Implemented Interfaces: java.lang.Iterable
public class NameCollection extends CollectionBase
Represents a collection of all the Name objects in the spreadsheet.
Property Getters/Setters Summary
int
getCount ()
→ inherited from com.aspose.cells.CollectionBase
Name
get (int)
Gets the Name element at the specified index.
Name
get (java.lang.String)
Gets the Name element with the specified name.
Method Summary
int
add (java.lang.Object value)
→ inherited from com.aspose.cells.CollectionBase
Reserved for internal use.
int
add (java.lang.String text)
Defines a new name.
void
clear ()
Remove all defined names which are not referenced by the formulas and data source.
If the defined name is referred, we only set Name.ReferTo as null and hide them.
boolean
contains (java.lang.Object value)
→ inherited from com.aspose.cells.CollectionBase
Reserved for internal use.
com.aspose.cells.Name[]
filter (int type, int sheetIndex)
Gets all defined name by scope.
int
indexOf (java.lang.Object value)
→ inherited from com.aspose.cells.CollectionBase
Reserved for internal use.
java.util.Iterator
iterator ()
→ inherited from com.aspose.cells.CollectionBase
void
remove (java.lang.String text)
Remove the name.
void
remove (java.lang.String[] names)
Remove an array of name
void
removeAt (int index)
Remove the name at the specific index.
void
removeDuplicateNames ()
Remove the duplicate defined names
void
sort ()
Sorts defined names.
Property Getters/Setters Detail
getCount → inherited from com.aspose.cells.CollectionBase
public int getCount ()
get
public Name get (int index)
Gets the Name element at the specified index.
Parameters: index
- The zero based index of the element.Returns: The element at the specified index.
get
public Name get (java.lang.String text)
Gets the Name element with the specified name.
Parameters: text
- Name text.Returns: The element with the specified name.
add
public int add (java.lang.String text)
Defines a new name.
Name cannot include spaces and cannot look like cell references. Parameters: text
- The text to use as the name.Returns: Name object index.
filter
public com.aspose.cells.Name[] filter (int type, int sheetIndex)
Gets all defined name by scope.
Parameters: type
- A NameScopeType value. The scope type.sheetIndex
-
The sheet index.
Only effects when scope type is NameScopeType.WORKSHEET Returns:
remove
public void remove (java.lang.String[] names)
Remove an array of name
Parameters: names
- The names' text.
remove
public void remove (java.lang.String text)
Remove the name.
Parameters: text
- The name text.
removeAt
public void removeAt (int index)
Remove the name at the specific index.
Please make sure that the name is not referred by the other formulas before calling the method.
And if the name is referred, setting Name.RefersTo as null is better.
Parameters: index
- index of the Name to be removed.
clear
public void clear ()
Remove all defined names which are not referenced by the formulas and data source.
If the defined name is referred, we only set Name.ReferTo as null and hide them.
removeDuplicateNames
public void removeDuplicateNames ()
Remove the duplicate defined names
Sorts defined names.
If you create a large amount of named ranges in the Excel file, please call this method after all named ranges are created and before saving
iterator → inherited from com.aspose.cells.CollectionBase
public java.util.Iterator iterator ()
contains → inherited from com.aspose.cells.CollectionBase
public boolean contains (java.lang.Object value)
Reserved for internal use.
add → inherited from com.aspose.cells.CollectionBase
public int add (java.lang.Object value)
Reserved for internal use.
indexOf → inherited from com.aspose.cells.CollectionBase
public int indexOf (java.lang.Object value)
Reserved for internal use.
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.