Package com.microstrategy.web.objects
Interface WebDisplayUnits
-
- All Known Subinterfaces:
WebMDXSources
public interface WebDisplayUnits
The WebDisplayUnits interface represents a group ofWebDisplayUnit
objects. This interface contains methods for iterating through the collection of objects it represents, along with shortcut methods to allow the user to change the state of all objects in the collection at once.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(WebDisplayUnit unit)
Adds the givenWebDisplayUnit
object to the collection.int
add(WebDisplayUnit unit, int beforeKey)
Adds the givenWebDisplayUnit
object to the collection.int
add(WebDisplayUnit unit, WebDisplayUnit beforeObject)
Adds the givenWebObjectInfo
object to the folder collection.void
addDetails(boolean details)
Sets whether details should be added to all objects within the collection.int
addX(WebDisplayUnit unit)
Adds the givenWebDisplayUnit
object to the available display units collection.void
applyVisitor(DisplayUnitsVisitor visitor, boolean deep)
void
clear()
Clears all objects from the collection.boolean
containsKey(int key)
Returns true if the folder contains an item by the given key, false if not.boolean
containsObject(WebDisplayUnit object)
Returns true if the folder contains the given object, false if it does not.java.util.Enumeration
elements()
Returns a java.util.Enumeration containing the objects in this collection.java.util.Enumeration
entries()
Returns a java.util.Enumeration containing theWebDisplayUnitEntry
objects in this collection.WebDisplayUnits
findAllItems(java.lang.Object object)
Tries to find the given item within the objects which are in the collection.WebDisplayUnit
findItem(java.lang.Object object)
Tries to find the given item within the objects which are in the collection.WebDisplayUnit
get(int index)
Returns the display unit in the collection with the given index.int
getBlockBegin()
Returns the index of the first retrieved object in the collection relative to the entire set.int
getBlockCount()
Returns the current blockCount setting, which is used for incremental fetch of contents.int
getChildCount()
Returns the child count, which is the total number of items in the collection.int
getFolderCount()
Returns the folder count, which is the total number of folder objects in the underlying I-Server collection.java.util.Enumeration
getHighlightedItems()
java.util.Enumeration
getHighlightedItems(boolean deep)
WebDisplayUnit
getItemByKey(int key)
Returns the display unit in the collection with the given key.int
getObjectCount(int objectType)
Returns the number of objects of the specified object type in the collection.int
getPartialFolderCount()
Returns the number of folders in the collection.int
getSelectedCount()
Returns the number of selected child display units.java.util.Enumeration
getSelectedItems()
java.util.Enumeration
getSelectedItems(boolean deep)
void
highlightUnits()
Highlights all units in the collection (without details).void
highlightUnits(boolean details)
Highlights all units in the collection.boolean
isEmpty()
Returns whether the collection is empty.int
keyOf(int index)
Returns the key of the object with specified index.int
keyOf(WebDisplayUnit object)
Returns the key of the given object, if it exists in the collection.void
move(int key, int beforeKey)
Moves the object with the given key to position before specified object.void
remove(int index)
Removes the display unit with the given index from the collection.void
remove(WebDisplayUnit unit)
Removes the display unit from the collection.void
removeItemByKey(int key)
Removes the object in the collection with the given key.void
setBlockBegin(int blockBegin)
Sets the index of the first retrieved object in the collection relative to the entire set.void
setBlockCount(int blockCount)
Sets the blockCount setting, which is used for incremental fetch of folder contents.void
setChildCount(int val)
Sets the child count.void
setFolderCount(int val)
Sets the folder count'void
setSelected(boolean selected)
Sets the selected status of all units in the collection.int
size()
Returns the number of items in the collection.void
sort(java.util.Comparator comp)
-
-
-
Method Detail
-
get
WebDisplayUnit get(int index) throws java.lang.IndexOutOfBoundsException
Returns the display unit in the collection with the given index.- Parameters:
index
- The index of the object within the available display unit collection to return.- Returns:
- The
WebDisplayUnit
object corresponding to the given index in the collection. - Throws:
java.lang.IndexOutOfBoundsException
- Thrown if the given index is invalid.
-
getItemByKey
WebDisplayUnit getItemByKey(int key) throws java.lang.IllegalArgumentException
Returns the display unit in the collection with the given key.- Parameters:
key
- The key into the collection of the desired item.- Returns:
- The
WebObjectInfo
object with the given key in the collection. - Throws:
java.lang.IllegalArgumentException
- Thrown if the given key is not found in the collection.
-
isEmpty
boolean isEmpty()
Returns whether the collection is empty.- Returns:
- True if the collection is empty, false otherwise.
-
size
int size()
Returns the number of items in the collection.- Returns:
- The size of the collection.
-
elements
java.util.Enumeration elements()
Returns a java.util.Enumeration containing the objects in this collection.- Returns:
- An Enumeration containing the objects in this collection.
-
entries
java.util.Enumeration entries()
Returns a java.util.Enumeration containing theWebDisplayUnitEntry
objects in this collection. Entries are ordered in the index sequence.- Returns:
- An Enumeration containing the
WebDisplayUnitEntry
objects in this collection.
-
findItem
WebDisplayUnit findItem(java.lang.Object object)
Tries to find the given item within the objects which are in the collection. If one or more objects are found which match the given object, the first one is returned. Note that for the current version, the given object must be of typeWebObjectInfo
, though this restriction may be lifted in future versions.This method is generally used to highlight objects within the available units collection.
- Parameters:
object
- The object to search for in the available units collection.- Returns:
- The
WebDisplayUnit
object corresponding to the given object, or null if the object is not found.
-
findAllItems
WebDisplayUnits findAllItems(java.lang.Object object)
Tries to find the given item within the objects which are in the collection. If one or more objects are found which match the given object, they are returned in the form of aWebDisplayUnits
collection. This method is generally used to highlight objects within the available units collection. Note that for the current version, the given object must be of typeWebObjectInfo
, though this restriction may be lifted in future versions.- Parameters:
object
- The object to search for in the available units collection.- Returns:
- A
WebDisplayUnits
collection containing the items found, or null if no items were found.
-
getObjectCount
int getObjectCount(int objectType)
Returns the number of objects of the specified object type in the collection.- Parameters:
objectType
- The type of object, fromEnumDSSXMLObjectTypes
, to be counted.- Returns:
- the number of objects of the specified object type in the collection. This value
should come from
EnumDSSXMLObjectTypes
.
-
keyOf
int keyOf(WebDisplayUnit object) throws java.lang.IllegalArgumentException
Returns the key of the given object, if it exists in the collection.- Parameters:
object
- TheWebDisplayUnit
object to search for in the folder.- Returns:
- The key of the object.
- Throws:
java.lang.IllegalArgumentException
- Thrown if the object does not exist in the collection.
-
keyOf
int keyOf(int index) throws java.lang.IndexOutOfBoundsException
Returns the key of the object with specified index.- Parameters:
index
- an index of object in the collection.- Returns:
- The key of the object.
- Throws:
java.lang.IndexOutOfBoundsException
- Thrown if the index is out boundaries.
-
containsKey
boolean containsKey(int key)
Returns true if the folder contains an item by the given key, false if not.- Parameters:
key
- The key to search for in the folder collection.- Returns:
- True if the collection contains the key, false if it does not.
-
containsObject
boolean containsObject(WebDisplayUnit object)
Returns true if the folder contains the given object, false if it does not.- Parameters:
object
- TheWebObjectInfo
object to search for in the folder.- Returns:
- True if the collection contains the value, false if it does not.
-
add
void add(WebDisplayUnit unit) throws java.lang.UnsupportedOperationException
Adds the givenWebDisplayUnit
object to the collection.- Parameters:
unit
- TheWebDisplayUnit
object to add to the collection.- Throws:
java.lang.UnsupportedOperationException
- Thrown if the collection is read-only.
-
addX
int addX(WebDisplayUnit unit) throws java.lang.UnsupportedOperationException
Adds the givenWebDisplayUnit
object to the available display units collection. This will cause the object to be placed into the <available> section of the display XML.- Parameters:
unit
- TheWebDisplayUnit
object to add to the collection.- Returns:
- the key assigned to this object in the collection
- Throws:
java.lang.UnsupportedOperationException
- Thrown if the collection is read-only.
-
add
int add(WebDisplayUnit unit, int beforeKey) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
Adds the givenWebDisplayUnit
object to the collection.- Parameters:
unit
- TheWebDisplayUnit
object to add to the collection.beforeKey
- The key of an object which this object should be inserted before in the list. If the kye is less then 0 the object will be inserted after the last object in the collection.- Returns:
- the key assigned to this object in the collection
- Throws:
java.lang.UnsupportedOperationException
- Thrown if the folder object is marked as read-onlyjava.lang.IllegalArgumentException
- Thrown if there is an error when adding the object to the collection, for example, if the key given does not exist..
-
add
int add(WebDisplayUnit unit, WebDisplayUnit beforeObject) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
Adds the givenWebObjectInfo
object to the folder collection.- Parameters:
unit
- TheWebDisplayUnit
object to add to the collection.beforeObject
- The object already in the folder to place the new object before.- Returns:
- the key assigned to this object in the collection
- Throws:
java.lang.UnsupportedOperationException
- Thrown if the folder object is marked as read-onlyjava.lang.IllegalArgumentException
- Thrown if there is an error when adding the object to the collection, for example, if the beforeObject given does not exist..
-
remove
void remove(int index) throws java.lang.UnsupportedOperationException, java.lang.IndexOutOfBoundsException
Removes the display unit with the given index from the collection.- Parameters:
index
- The index of the object to remove from the collection.- Throws:
java.lang.UnsupportedOperationException
- Thrown if the collection is marked as read-only.java.lang.IndexOutOfBoundsException
- Thrown if the given index is invalid.
-
remove
void remove(WebDisplayUnit unit) throws java.lang.UnsupportedOperationException, java.lang.IndexOutOfBoundsException
Removes the display unit from the collection.- Parameters:
unit
- TheWebDisplayUnit
object to be removed from the collection.- Throws:
java.lang.UnsupportedOperationException
- Thrown if the collection is marked as read-only.java.lang.IndexOutOfBoundsException
- Thrown if the given index is invalid.
-
removeItemByKey
void removeItemByKey(int key) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
Removes the object in the collection with the given key.- Parameters:
key
- The key into the collection of the item to be removed.- Throws:
java.lang.IllegalArgumentException
- Thrown if the given key is not found in the collection.java.lang.UnsupportedOperationException
- Thrown if the folder object is read-only.
-
move
void move(int key, int beforeKey) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
Moves the object with the given key to position before specified object.- Parameters:
key
- The key into the collection of the item to be removed.beforeKey
- The key of an object which this object should be inserted before in the list. If the kye is less then 0 the object will be inserted after the last object in the collection.- Throws:
java.lang.IllegalArgumentException
- Thrown if the given key is not found in the collection.java.lang.UnsupportedOperationException
- Thrown if the folder object is read-only.
-
clear
void clear() throws java.lang.UnsupportedOperationException
Clears all objects from the collection.- Throws:
java.lang.UnsupportedOperationException
- Thrown in the case of a read-only collection.
-
highlightUnits
void highlightUnits() throws WebObjectsException
Highlights all units in the collection (without details).- Throws:
WebObjectsException
- Thrown if the objects cannot be highlighted.
-
highlightUnits
void highlightUnits(boolean details) throws WebObjectsException
Highlights all units in the collection. The given detail setting will determine whether the highlighting will be detailed or not.- Parameters:
details
- Whether to have the highlighting include details.- Throws:
WebObjectsException
- Thrown if the objects cannot be highlighted.
-
addDetails
void addDetails(boolean details) throws WebObjectsException
Sets whether details should be added to all objects within the collection.- Parameters:
details
- True if details should be included, false otherwise.- Throws:
WebObjectsException
- Thrown if details could not be retrieved for one or more objects in the collection.
-
setSelected
void setSelected(boolean selected)
Sets the selected status of all units in the collection.- Parameters:
selected
- True if the objects should be marked selected, false otherwise.
-
getSelectedCount
int getSelectedCount()
Returns the number of selected child display units.- Returns:
- The number of units has been selected.
-
getChildCount
int getChildCount()
Returns the child count, which is the total number of items in the collection. This value can be grater then size as the number of items returned from the I-Server can be restricted by the blockBegin and blockCount properties.- Returns:
- The child count.
- See Also:
setChildCount(int)
-
setChildCount
void setChildCount(int val)
Sets the child count.- Parameters:
val
- The child count to be set.- See Also:
getChildCount()
-
getFolderCount
int getFolderCount()
Returns the folder count, which is the total number of folder objects in the underlying I-Server collection. This value can be grater then partial folder count due to the block count restriction.- Returns:
- The folder count.
- See Also:
setChildCount(int)
-
setFolderCount
void setFolderCount(int val)
Sets the folder count'- Parameters:
val
- the folder count value.- See Also:
setChildCount(int)
-
getPartialFolderCount
int getPartialFolderCount()
Returns the number of folders in the collection.- Returns:
- The number of folders in the collection.
- See Also:
setChildCount(int)
-
getBlockBegin
int getBlockBegin()
Returns the index of the first retrieved object in the collection relative to the entire set.- Returns:
- The current blockBegin setting.
- See Also:
setBlockBegin(int)
-
setBlockBegin
void setBlockBegin(int blockBegin)
Sets the index of the first retrieved object in the collection relative to the entire set.- Parameters:
blockBegin
- The blockBegin setting.- See Also:
getBlockBegin()
-
getBlockCount
int getBlockCount()
Returns the current blockCount setting, which is used for incremental fetch of contents. This value tells the number of objects in the collection to be retrieved. This value is usually used in conjunction with blockBegin.- Returns:
- The current blockCount setting.
- See Also:
setBlockCount(int)
-
setBlockCount
void setBlockCount(int blockCount)
Sets the blockCount setting, which is used for incremental fetch of folder contents. This value tells the number of objects in the folder to be retrieved. This value is usually used in conjunction with blockBegin.- Parameters:
blockCount
- The blockCount setting to be used upon populating the folder from the Intelligence Server.- See Also:
getBlockCount()
-
sort
void sort(java.util.Comparator comp)
-
applyVisitor
void applyVisitor(DisplayUnitsVisitor visitor, boolean deep) throws WebObjectsException
- Throws:
WebObjectsException
-
getHighlightedItems
java.util.Enumeration getHighlightedItems() throws WebObjectsException
- Throws:
WebObjectsException
-
getHighlightedItems
java.util.Enumeration getHighlightedItems(boolean deep) throws WebObjectsException
- Throws:
WebObjectsException
-
getSelectedItems
java.util.Enumeration getSelectedItems() throws WebObjectsException
- Throws:
WebObjectsException
-
getSelectedItems
java.util.Enumeration getSelectedItems(boolean deep) throws WebObjectsException
- Throws:
WebObjectsException
-
-