Chart FX 7 for Java Server

com.softwarefx.chartfx.server.statistical
Class StudiesCollection

java.lang.Object
  extended by com.softwarefx.chartfx.server.statistical.StudiesCollection
All Implemented Interfaces:
Iterable<Study>, Collection<Study>

public class StudiesCollection
extends Object
implements Iterable<Study>, Collection<Study>

Provides access to the StudiesCollection object

This class is used to control the analysis studies applied to a statistical chart instance. Many of the supported class members are standard CollectionBase members allowing developers to add, remove, insert, clear, etc., studies to the Statistical Extension.


Constructor Summary
StudiesCollection()
           
 
Method Summary
 Study add(Analysis analysis)
          Used to add a study or a group of studies to your statistical object.
 Study add(AnalysisMulti analysis)
          Used to add a study or a group of studies to your statistical object.
 StudyFormula add(DistributionFormula distribution)
          Used to add a study or a group of studies to your statistical object.
 boolean add(Study o)
          Used to add a study or a group of studies to your statistical object.
 void add(StudyGroup group)
          Used to add a study or a group of studies to your statistical object.
 StudyTest add(Test test)
          Used to add a study or a group of studies to your statistical object.
 StudyTest add(TestMulti test)
          Used to add a study or a group of studies to your statistical object.
 boolean addAll(Collection<? extends Study> c)
          Adds all of the elements in the specified collection to the StudiesCollection collection.
 StudyCustom addTitle(String text)
          Used to add a StudyCustom object to the Studies collection.
 void clear()
          Removes all of the elements from this collection.
 boolean contains(Object o)
          Determines whether the StudyCollection contains a specific element.
 boolean containsAll(Collection<?> c)
          Returns true if the StudiesCollection collection contains all of the elements in the specified collection.
 void copyTo(Study[] array, int index)
          Copies the entire StudiesCollection to a compatible one-dimensional Array, starting at the specified index of the target array.
 Study find(StudyType studyType, int id)
          Returns a study object when located in the Studies Collection.
 Study get(int n)
          Returns the element at the specified position in the StudiesCollection.
 int indexOf(Study obj)
          Searches for the specified Object and returns the zero-based index of the first occurrence within the entire StudiesCollection.
 void insert(int index, Study obj)
          Inserts an element into the StudiesCollection at the specified index.
 boolean isEmpty()
          Returns true if this collection contains no elements.
 Iterator<Study> iterator()
          Returns an iterator over the elements in this collection.
 boolean remove(Object o)
          Removes the first occurrence of a specific object from the Collection.
 boolean removeAll(Collection<?> c)
          Removes all of the elements in the specified collection from the StudiesCollection collection.
 boolean retainAll(Collection<?> c)
          Retains only the elements in the StudiesCollection collection that are contained in the specified collection.
 int size()
          Returns the number of elements in this collection.
 Object[] toArray()
          Returns an array containing all of the elements in this collection in proper sequence.
<T> T[]
toArray(T[] a)
          Returns an array containing all of the elements in this collection in proper sequence.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

StudiesCollection

public StudiesCollection()
Method Detail

add

public Study add(Analysis analysis)

Used to add a study or a group of studies to your statistical object.

Remarks:
  • If Count already equals the capacity, the capacity of the list is doubled by automatically reallocating the internal array and copying the existing elements to the new array before the new element is added.

  • If Count is less than the capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(n) operation, where n is Count.

  • Parameters:
    analysis - Analysis study to add.
    See Also:
    StudiesCollection#getItem, addTitle(java.lang.String), #setClear, contains(java.lang.Object), copyTo(com.softwarefx.chartfx.server.statistical.Study[], int), find(com.softwarefx.chartfx.server.statistical.StudyType, int), insert(int, com.softwarefx.chartfx.server.statistical.Study), remove(java.lang.Object)

    add

    public Study add(AnalysisMulti analysis)

    Used to add a study or a group of studies to your statistical object.

    Remarks:
  • If Count already equals the capacity, the capacity of the list is doubled by automatically reallocating the internal array and copying the existing elements to the new array before the new element is added.

  • If Count is less than the capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(n) operation, where n is Count.

  • Parameters:
    analysis - Analysis study to add.
    See Also:
    StudiesCollection#getItem, addTitle(java.lang.String), #setClear, contains(java.lang.Object), copyTo(com.softwarefx.chartfx.server.statistical.Study[], int), find(com.softwarefx.chartfx.server.statistical.StudyType, int), insert(int, com.softwarefx.chartfx.server.statistical.Study), remove(java.lang.Object)

    add

    public StudyFormula add(DistributionFormula distribution)

    Used to add a study or a group of studies to your statistical object.

    Remarks:
  • If Count already equals the capacity, the capacity of the list is doubled by automatically reallocating the internal array and copying the existing elements to the new array before the new element is added.

  • If Count is less than the capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(n) operation, where n is Count.

  • Parameters:
    distribution - DistributionFormula to add.
    See Also:
    StudiesCollection#getItem, addTitle(java.lang.String), #setClear, contains(java.lang.Object), copyTo(com.softwarefx.chartfx.server.statistical.Study[], int), find(com.softwarefx.chartfx.server.statistical.StudyType, int), insert(int, com.softwarefx.chartfx.server.statistical.Study), remove(java.lang.Object)

    add

    public boolean add(Study o)

    Used to add a study or a group of studies to your statistical object.

    Remarks:
  • If Count already equals the capacity, the capacity of the list is doubled by automatically reallocating the internal array and copying the existing elements to the new array before the new element is added.

  • If Count is less than the capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(n) operation, where n is Count.

  • Specified by:
    add in interface Collection<Study>
    Parameters:
    o -
    See Also:
    StudiesCollection#getItem, addTitle(java.lang.String), #setClear, contains(java.lang.Object), copyTo(com.softwarefx.chartfx.server.statistical.Study[], int), find(com.softwarefx.chartfx.server.statistical.StudyType, int), insert(int, com.softwarefx.chartfx.server.statistical.Study), remove(java.lang.Object)

    add

    public void add(StudyGroup group)

    Used to add a study or a group of studies to your statistical object.

    Remarks:
  • If Count already equals the capacity, the capacity of the list is doubled by automatically reallocating the internal array and copying the existing elements to the new array before the new element is added.

  • If Count is less than the capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(n) operation, where n is Count.

  • Parameters:
    group - StudyGroup to add.
    See Also:
    StudiesCollection#getItem, addTitle(java.lang.String), #setClear, contains(java.lang.Object), copyTo(com.softwarefx.chartfx.server.statistical.Study[], int), find(com.softwarefx.chartfx.server.statistical.StudyType, int), insert(int, com.softwarefx.chartfx.server.statistical.Study), remove(java.lang.Object)

    add

    public StudyTest add(Test test)

    Used to add a study or a group of studies to your statistical object.

    Remarks:
  • If Count already equals the capacity, the capacity of the list is doubled by automatically reallocating the internal array and copying the existing elements to the new array before the new element is added.

  • If Count is less than the capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(n) operation, where n is Count.

  • Parameters:
    test - TestMulti to add.
    See Also:
    StudiesCollection#getItem, addTitle(java.lang.String), #setClear, contains(java.lang.Object), copyTo(com.softwarefx.chartfx.server.statistical.Study[], int), find(com.softwarefx.chartfx.server.statistical.StudyType, int), insert(int, com.softwarefx.chartfx.server.statistical.Study), remove(java.lang.Object)

    add

    public StudyTest add(TestMulti test)

    Used to add a study or a group of studies to your statistical object.

    Remarks:
  • If Count already equals the capacity, the capacity of the list is doubled by automatically reallocating the internal array and copying the existing elements to the new array before the new element is added.

  • If Count is less than the capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(n) operation, where n is Count.

  • Parameters:
    test - TestMulti to add.
    See Also:
    StudiesCollection#getItem, addTitle(java.lang.String), #setClear, contains(java.lang.Object), copyTo(com.softwarefx.chartfx.server.statistical.Study[], int), find(com.softwarefx.chartfx.server.statistical.StudyType, int), insert(int, com.softwarefx.chartfx.server.statistical.Study), remove(java.lang.Object)

    addAll

    public boolean addAll(Collection<? extends Study> c)

    Adds all of the elements in the specified collection to the StudiesCollection collection.

    Specified by:
    addAll in interface Collection<Study>
    Parameters:
    c - Elements to be inserted into this collection.

    addTitle

    public StudyCustom addTitle(String text)

    Used to add a StudyCustom object to the Studies collection.

    Remarks:
  • The add(com.softwarefx.chartfx.server.statistical.Analysis) Method is used to add other study types to the Studies Collection.

  • This method returns a StudyCustom object which may be customized using the members of the StudyCustom class.

  • Parameters:
    text - Title for the StudyCustom object to add.
    See Also:
    StudiesCollection#getItem, add(com.softwarefx.chartfx.server.statistical.Analysis), #setClear, contains(java.lang.Object), copyTo(com.softwarefx.chartfx.server.statistical.Study[], int), find(com.softwarefx.chartfx.server.statistical.StudyType, int), insert(int, com.softwarefx.chartfx.server.statistical.Study), remove(java.lang.Object), StudyCustom

    clear

    public void clear()

    Removes all of the elements from this collection.

    Specified by:
    clear in interface Collection<Study>

    contains

    public boolean contains(Object o)

    Determines whether the StudyCollection contains a specific element.

    Remarks:
  • This method returns true if the CollectionBase contains the specified value; otherwise, false.

  • This method performs a linear search. On average, this is an O(n/2) operation, where n is Count. The longest search is an O(n) operation.

  • Specified by:
    contains in interface Collection<Study>
    Parameters:
    o -
    See Also:
    StudiesCollection#getItem, add(com.softwarefx.chartfx.server.statistical.Analysis), addTitle(java.lang.String), copyTo(com.softwarefx.chartfx.server.statistical.Study[], int), find(com.softwarefx.chartfx.server.statistical.StudyType, int), insert(int, com.softwarefx.chartfx.server.statistical.Study), remove(java.lang.Object)

    containsAll

    public boolean containsAll(Collection<?> c)

    Returns true if the StudiesCollection collection contains all of the elements in the specified collection.

    Specified by:
    containsAll in interface Collection<Study>
    Parameters:
    c - Collection to be checked for containment in this collection.

    copyTo

    public void copyTo(Study[] array,
                       int index)

    Copies the entire StudiesCollection to a compatible one-dimensional Array, starting at the specified index of the target array.

    Remarks:
  • The specified array must be of a compatible type.

  • Parameters:
    array - The one-dimensional Array that is the destination of the elements copied from StudiesCollection. The Array must have zero-based indexing.
    index - The zero-based index in array at which copying begins.
    See Also:
    StudiesCollection#getItem, add(com.softwarefx.chartfx.server.statistical.Analysis), addTitle(java.lang.String), contains(java.lang.Object), find(com.softwarefx.chartfx.server.statistical.StudyType, int), insert(int, com.softwarefx.chartfx.server.statistical.Study), remove(java.lang.Object)

    find

    public Study find(StudyType studyType,
                      int id)

    Returns a study object when located in the Studies Collection.

    Remarks:
  • The contains(java.lang.Object) method allows you to determine if a selected study exists in a StudyCollection instance.

  • Parameters:
    studyType - Study to find.
    id - Index to start search.
    See Also:
    StudiesCollection#getItem, add(com.softwarefx.chartfx.server.statistical.Analysis), addTitle(java.lang.String), #setClear, contains(java.lang.Object), copyTo(com.softwarefx.chartfx.server.statistical.Study[], int), find(com.softwarefx.chartfx.server.statistical.StudyType, int), insert(int, com.softwarefx.chartfx.server.statistical.Study), remove(java.lang.Object)

    get

    public Study get(int n)

    Returns the element at the specified position in the StudiesCollection.

    Parameters:
    n - Index of element to return.

    indexOf

    public int indexOf(Study obj)

    Searches for the specified Object and returns the zero-based index of the first occurrence within the entire StudiesCollection.

    Remarks:
  • This method performs a linear search. On average, this is an O(n/2) operation, where n is Count. The longest search is an O(n) operation.

  • Parameters:
    obj - Study to find.
    See Also:
    StudiesCollection#getItem, add(com.softwarefx.chartfx.server.statistical.Analysis), addTitle(java.lang.String), contains(java.lang.Object), copyTo(com.softwarefx.chartfx.server.statistical.Study[], int), find(com.softwarefx.chartfx.server.statistical.StudyType, int), insert(int, com.softwarefx.chartfx.server.statistical.Study), remove(java.lang.Object)

    insert

    public void insert(int index,
                       Study obj)

    Inserts an element into the StudiesCollection at the specified index.

    Remarks:
  • If Count already equals the capacity, the capacity of the list is doubled by automatically reallocating the internal array before the new element is inserted.

  • Parameters:
    index - Index to insert the study.
    obj - Study to insert.
    See Also:
    StudiesCollection#getItem, add(com.softwarefx.chartfx.server.statistical.Analysis), addTitle(java.lang.String), contains(java.lang.Object), copyTo(com.softwarefx.chartfx.server.statistical.Study[], int), find(com.softwarefx.chartfx.server.statistical.StudyType, int), indexOf(com.softwarefx.chartfx.server.statistical.Study), remove(java.lang.Object)

    isEmpty

    public boolean isEmpty()

    Returns true if this collection contains no elements.

    Specified by:
    isEmpty in interface Collection<Study>

    iterator

    public Iterator<Study> iterator()

    Returns an iterator over the elements in this collection.

    Specified by:
    iterator in interface Iterable<Study>
    Specified by:
    iterator in interface Collection<Study>

    remove

    public boolean remove(Object o)

    Removes the first occurrence of a specific object from the Collection.

    Remarks:
  • This method performs a linear search; therefore, the average execution time is proportional to Count. That is, this method is an O(n) operation, where n is Count.

  • Specified by:
    remove in interface Collection<Study>
    Parameters:
    o -
    See Also:
    StudiesCollection#getItem, add(com.softwarefx.chartfx.server.statistical.Analysis), addTitle(java.lang.String), contains(java.lang.Object), copyTo(com.softwarefx.chartfx.server.statistical.Study[], int), find(com.softwarefx.chartfx.server.statistical.StudyType, int), indexOf(com.softwarefx.chartfx.server.statistical.Study), insert(int, com.softwarefx.chartfx.server.statistical.Study)

    removeAll

    public boolean removeAll(Collection<?> c)

    Removes all of the elements in the specified collection from the StudiesCollection collection.

    Specified by:
    removeAll in interface Collection<Study>
    Parameters:
    c - Elements to be removed from this collection.

    retainAll

    public boolean retainAll(Collection<?> c)

    Retains only the elements in the StudiesCollection collection that are contained in the specified collection.

    Specified by:
    retainAll in interface Collection<Study>
    Parameters:
    c - Elements to be retained in this collection.

    size

    public int size()

    Returns the number of elements in this collection.

    Specified by:
    size in interface Collection<Study>

    toArray

    public Object[] toArray()

    Returns an array containing all of the elements in this collection in proper sequence.

    Specified by:
    toArray in interface Collection<Study>

    toArray

    public <T> T[] toArray(T[] a)

    Returns an array containing all of the elements in this collection in proper sequence.

    Specified by:
    toArray in interface Collection<Study>

    http://www.softwarefx.com

    2008 Software FX, Inc. All Rights Reserved. Chart FX is a registered trademark of Software FX, Inc
    All other names are trademarks or registered trademarks of their respective owners.