public class

FileContentsObjectList

extends Object
java.lang.Object
   ↳ com.microstrategy.web.app.utils.FileContentsObjectList

Class Overview

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 a FileContentsObjectWrapper instance and this class represents a collection of these instances. Copyright: Copyright (c) 2001 Company: MicroStrategy, Inc.

Summary

Public Constructors
FileContentsObjectList()
Class Constructor.
Public Methods
void add(FileContentsObjectWrapper newObject)
Adds a new element to this instance.
FileContentsObjectWrapper get(int index)
Returns the FileContentsObjectWrapper instance at the indicated index position.
FileContentsObjectList get(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 next FileContentsObjectWrapper element available on the collection.
boolean remove(FileContentsObjectWrapper oldObject)
Searches for the object sent as parameter and removes its first instance from this collection.
void remove(int index)
Removes the indicated element from this collection instance
void remove()
Removes the collection element that it's currently pointed at.
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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public FileContentsObjectList ()

Class Constructor.

Public Methods

public void add (FileContentsObjectWrapper newObject)

Adds a new element to this instance.

Parameters
newObject Instance of FileContentsObjectWrapper to add at the end of this collection.

public FileContentsObjectWrapper get (int index)

Returns the FileContentsObjectWrapper instance at the indicated index position.

Parameters
index Value of the index from where to return the element instance from this collection
Returns
Throws
WebAppException if an error ocurrs while trying to get the requested element

public FileContentsObjectList get (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

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 returns False

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 The FileContentsObjectWrapper instance to search on the collection
Returns
  • the index where the requested object is found in the collection

public FileContentsObjectWrapper next ()

Returns the next FileContentsObjectWrapper 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

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 returns False.

public void remove (int index)

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

public void remove ()

Removes the collection element that it's currently pointed at.

public void resetList ()

Creates a pointer to the list contents and sets it to the first element on the list.

public void set (int index, FileContentsObjectWrapper obj)

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

public int size ()

Returns the number of elements on this list.

Returns
  • the size of the collection.