public final class ProtectedRangeCollection extends Object implements Iterable<ProtectedRange>
ExcelWorksheet
.Modifier and Type | Method and Description |
---|---|
ProtectedRange |
addNew(String title,
String refersToCells)
Adds the new
ProtectedRange to the current ExcelWorksheet . |
ProtectedRange |
addNew(String title,
String refersToCells,
String password)
Adds the new
ProtectedRange to the current ExcelWorksheet . |
void |
clear()
Removes all
ProtectedRange s from the current ExcelWorksheet . |
ProtectedRange |
get(int index)
Gets the
ProtectedRange at the specified index. |
ProtectedRange |
get(String title)
Gets the
ProtectedRange with the specified title or null . |
Iterator<ProtectedRange> |
iterator()
Returns an iterator that iterates through the
ProtectedRangeCollection . |
void |
remove(int index)
Removes the
ProtectedRange at the specified index of the ProtectedRangeCollection . |
int |
size()
Gets the number of
ProtectedRange s actually contained in the ProtectedRangeCollection . |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public ProtectedRange addNew(String title, String refersToCells)
ProtectedRange
to the current ExcelWorksheet
.title
- The ProtectedRange
title.refersToCells
- A reference to a range of cells that should be protected.ProtectedRange
added to the current ExcelWorksheet
.NullPointerException
- title
or refersToCells
is null
or empty string.public ProtectedRange addNew(String title, String refersToCells, String password)
ProtectedRange
to the current ExcelWorksheet
.title
- The ProtectedRange
title.refersToCells
- A reference to a range of cells that should be protected.password
- The optional password.ProtectedRange
added to the current ExcelWorksheet
.NullPointerException
- title
or refersToCells
is null
or empty string.public void clear()
ProtectedRange
s from the current ExcelWorksheet
.public ProtectedRange get(int index)
ProtectedRange
at the specified index.index
- The zero-based index of the ProtectedRange
to get.ProtectedRange
at the specified index.IndexOutOfBoundsException
- index
is less than zero or is equal to or greater than size()
.public ProtectedRange get(String title)
ProtectedRange
with the specified title or null
.title
- The ProtectedRange
title.ProtectedRange
with the specified title or null
.public Iterator<ProtectedRange> iterator()
ProtectedRangeCollection
.iterator
in interface Iterable<ProtectedRange>
ProtectedRangeCollection
.public void remove(int index)
ProtectedRange
at the specified index of the ProtectedRangeCollection
.index
- The zero-based index of the ProtectedRange
to remove.IndexOutOfBoundsException
- index
is less than zero or is equal to or greater than size()
.public int size()
ProtectedRange
s actually contained in the ProtectedRangeCollection
.ProtectedRange
s actually contained in the ProtectedRangeCollection
.© GemBox Ltd. — All rights reserved.