Package com.microstrategy.web.app.utils
Class FileContentsObjectList
- java.lang.Object
-
- com.microstrategy.web.app.utils.FileContentsObjectList
-
public class FileContentsObjectList extends java.lang.Object
Title: FileContentsObjectList class Description: This class has been created with the purpose of handling the objects that get saved to files. Each object is represented by aFileContentsObjectWrapper
instance and this class represents a collection of these instances. Copyright: Copyright (c) 2001 Company: MicroStrategy, Inc.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Constructor Summary
Constructors Constructor Description FileContentsObjectList()
Class Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(FileContentsObjectWrapper newObject)
Adds a new element to this instance.FileContentsObjectWrapper
get(int index)
Returns theFileContentsObjectWrapper
instance at the indicated index position.FileContentsObjectList
get(java.lang.String key)
Analyzes all the list searching for objects with the specified key and returns a new collection with the elements found.boolean
hasNext()
Verifies if the list has another element after the one that it's currently being pointed at.int
indexOf(FileContentsObjectWrapper obj)
Searches for the requested object and returns its position on this collection.FileContentsObjectWrapper
next()
Returns the nextFileContentsObjectWrapper
element available on the collection.void
remove()
Removes the collection element that it's currently pointed at.void
remove(int index)
Removes the indicated element from this collection instanceboolean
remove(FileContentsObjectWrapper oldObject)
Searches for the object sent as parameter and removes its first instance from this collection.void
resetList()
Creates a pointer to the list contents and sets it to the first element on the list.void
set(int index, FileContentsObjectWrapper obj)
Modifies the indicated element of this collection with the object sent as parameter.int
size()
Returns the number of elements on this list.
-
-
-
Method Detail
-
resetList
public void resetList()
Creates a pointer to the list contents and sets it to the first element on the list.
-
hasNext
public boolean hasNext()
Verifies if the list has another element after the one that it's currently being pointed at.- Returns:
True
if there's another element on the list, otherwise it returnsFalse
-
next
public FileContentsObjectWrapper next()
Returns the nextFileContentsObjectWrapper
element available on the collection. If no pointer has been defined yet, it creates it.- Returns:
- a
FileContentsObjectWrapper
instance pointing to the next element in the list
-
add
public void add(FileContentsObjectWrapper newObject)
Adds a new element to this instance.- Parameters:
newObject
- Instance ofFileContentsObjectWrapper
to add at the end of this collection.
-
remove
public void remove(int index) throws WebAppException
Removes the indicated element from this collection instance- Parameters:
index
-int
index value of the element to be removed from the list.- Throws:
WebAppException
- if an error ocurrs while removing the requested element
-
remove
public void remove()
Removes the collection element that it's currently pointed at.
-
remove
public boolean remove(FileContentsObjectWrapper oldObject)
Searches for the object sent as parameter and removes its first instance from this collection. The object to delete needs to be one of the actual elements of this list.- Parameters:
oldObject
-FileContentsObjectWrapper
list instance to be searched for and removed from the collection.- Returns:
True
if there was an element being removed, otherwise returnsFalse
.
-
get
public FileContentsObjectWrapper get(int index) throws WebAppException
Returns theFileContentsObjectWrapper
instance at the indicated index position.- Parameters:
index
- Value of the index from where to return the element instance from this collection- Returns:
- the
FileContentsObjectWrapper
instance corresponding to the requested index - Throws:
WebAppException
- if an error ocurrs while trying to get the requested element
-
get
public FileContentsObjectList get(java.lang.String key)
Analyzes all the list searching for objects with the specified key and returns a new collection with the elements found.- Parameters:
key
-String
value of the key to search for- Returns:
- A
FileContentsObjectList
> collection with the elements found with the specified key.
-
indexOf
public int indexOf(FileContentsObjectWrapper obj)
Searches for the requested object and returns its position on this collection. The object to search needs to be one of the objects of this list.- Parameters:
obj
- TheFileContentsObjectWrapper
instance to search on the collection- Returns:
- the index where the requested object is found in the collection
-
set
public void set(int index, FileContentsObjectWrapper obj) throws WebAppException
Modifies the indicated element of this collection with the object sent as parameter. The object to search and replace needs to be one of the objects of this list.- Parameters:
index
- Index indicating the position of the element to be modified.obj
-FileContentsObjectWrapper
instance to replace the old element.- Throws:
WebAppException
- if an error ocurrs while setting the object
-
size
public int size()
Returns the number of elements on this list.- Returns:
- the size of the collection.
-
-