Package com.microstrategy.web.objects
Interface WebDisplayUnits
- 
- All Known Subinterfaces:
 WebMDXSources
public interface WebDisplayUnitsThe WebDisplayUnits interface represents a group ofWebDisplayUnitobjects. 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 voidadd(WebDisplayUnit unit)Adds the givenWebDisplayUnitobject to the collection.intadd(WebDisplayUnit unit, int beforeKey)Adds the givenWebDisplayUnitobject to the collection.intadd(WebDisplayUnit unit, WebDisplayUnit beforeObject)Adds the givenWebObjectInfoobject to the folder collection.voidaddDetails(boolean details)Sets whether details should be added to all objects within the collection.intaddX(WebDisplayUnit unit)Adds the givenWebDisplayUnitobject to the available display units collection.voidapplyVisitor(DisplayUnitsVisitor visitor, boolean deep)voidclear()Clears all objects from the collection.booleancontainsKey(int key)Returns true if the folder contains an item by the given key, false if not.booleancontainsObject(WebDisplayUnit object)Returns true if the folder contains the given object, false if it does not.java.util.Enumerationelements()Returns a java.util.Enumeration containing the objects in this collection.java.util.Enumerationentries()Returns a java.util.Enumeration containing theWebDisplayUnitEntryobjects in this collection.WebDisplayUnitsfindAllItems(java.lang.Object object)Tries to find the given item within the objects which are in the collection.WebDisplayUnitfindItem(java.lang.Object object)Tries to find the given item within the objects which are in the collection.WebDisplayUnitget(int index)Returns the display unit in the collection with the given index.intgetBlockBegin()Returns the index of the first retrieved object in the collection relative to the entire set.intgetBlockCount()Returns the current blockCount setting, which is used for incremental fetch of contents.intgetChildCount()Returns the child count, which is the total number of items in the collection.intgetFolderCount()Returns the folder count, which is the total number of folder objects in the underlying I-Server collection.java.util.EnumerationgetHighlightedItems()java.util.EnumerationgetHighlightedItems(boolean deep)WebDisplayUnitgetItemByKey(int key)Returns the display unit in the collection with the given key.intgetObjectCount(int objectType)Returns the number of objects of the specified object type in the collection.intgetPartialFolderCount()Returns the number of folders in the collection.intgetSelectedCount()Returns the number of selected child display units.java.util.EnumerationgetSelectedItems()java.util.EnumerationgetSelectedItems(boolean deep)voidhighlightUnits()Highlights all units in the collection (without details).voidhighlightUnits(boolean details)Highlights all units in the collection.booleanisEmpty()Returns whether the collection is empty.intkeyOf(int index)Returns the key of the object with specified index.intkeyOf(WebDisplayUnit object)Returns the key of the given object, if it exists in the collection.voidmove(int key, int beforeKey)Moves the object with the given key to position before specified object.voidremove(int index)Removes the display unit with the given index from the collection.voidremove(WebDisplayUnit unit)Removes the display unit from the collection.voidremoveItemByKey(int key)Removes the object in the collection with the given key.voidsetBlockBegin(int blockBegin)Sets the index of the first retrieved object in the collection relative to the entire set.voidsetBlockCount(int blockCount)Sets the blockCount setting, which is used for incremental fetch of folder contents.voidsetChildCount(int val)Sets the child count.voidsetFolderCount(int val)Sets the folder count'voidsetSelected(boolean selected)Sets the selected status of all units in the collection.intsize()Returns the number of items in the collection.voidsort(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 
WebDisplayUnitobject 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 
WebObjectInfoobject 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 theWebDisplayUnitEntryobjects in this collection. Entries are ordered in the index sequence.- Returns:
 - An Enumeration  containing the 
WebDisplayUnitEntryobjects 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 
WebDisplayUnitobject 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 aWebDisplayUnitscollection. 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 
WebDisplayUnitscollection 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- TheWebDisplayUnitobject 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- TheWebObjectInfoobject 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 givenWebDisplayUnitobject to the collection.- Parameters:
 unit- TheWebDisplayUnitobject 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 givenWebDisplayUnitobject to the available display units collection. This will cause the object to be placed into the <available> section of the display XML.- Parameters:
 unit- TheWebDisplayUnitobject 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 givenWebDisplayUnitobject to the collection.- Parameters:
 unit- TheWebDisplayUnitobject 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 givenWebObjectInfoobject to the folder collection.- Parameters:
 unit- TheWebDisplayUnitobject 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.IndexOutOfBoundsExceptionRemoves 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- TheWebDisplayUnitobject 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.IllegalArgumentExceptionRemoves 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.IllegalArgumentExceptionMoves 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.UnsupportedOperationExceptionClears all objects from the collection.- Throws:
 java.lang.UnsupportedOperationException- Thrown in the case of a read-only collection.
 
- 
highlightUnits
void highlightUnits() throws WebObjectsExceptionHighlights all units in the collection (without details).- Throws:
 WebObjectsException- Thrown if the objects cannot be highlighted.
 
- 
highlightUnits
void highlightUnits(boolean details) throws WebObjectsExceptionHighlights 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 WebObjectsExceptionSets 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
 
 - 
 
 -