All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aspose.cells.NameCollection.html Maven / Gradle / Ivy

There is a newer version: 23.1
Show newest version





NameCollection




com.aspose.cells
Class NameCollection

java.lang.Object
  extended by CollectionBase
      extended by 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
intgetCount()→ inherited from com.aspose.cells.CollectionBase
          
Nameget(int)
           Gets the Name element at the specified index.
Nameget(java.lang.String)
           Gets the Name element with the specified name.
 
Method Summary
intadd(java.lang.Object value)→ inherited from com.aspose.cells.CollectionBase
          Reserved for internal use.
intadd(java.lang.String text)
           Defines a new name.
voidclear()
           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.
booleancontains(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.
intindexOf(java.lang.Object value)→ inherited from com.aspose.cells.CollectionBase
          Reserved for internal use.
java.util.Iteratoriterator()→ inherited from com.aspose.cells.CollectionBase
          
voidremove(java.lang.String text)
           Remove the name.
voidremove(java.lang.String[] names)
           Remove an array of name
voidremoveAt(int index)
           Remove the name at the specific index.
voidremoveDuplicateNames()
           Remove the duplicate defined names
voidsort()
           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.

Method Detail

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

sort

public void sort()
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.





© 2015 - 2024 Weber Informatics LLC | Privacy Policy