com.starteam
Class StarTeamCollection

java.lang.Object
  extended by com.starteam.StarTeamCollection
All Implemented Interfaces:
java.lang.Iterable, java.util.Collection
Direct Known Subclasses:
ChangeCollection, EditCollection, PermissionCollection, PropertyCollection, ServerInfoCollection, TypeCollection, ViewMemberCollection

public abstract class StarTeamCollection
extends java.lang.Object
implements java.util.Collection

A stock implementation of an SDK collection. Every object in the collection is required to be unique and of the same class type The Java version implements java.util.Collection The C# version implement System.Collections.IList


Method Summary
 boolean add(java.lang.Object o)
          Add the specified element to the collection.
 boolean addAll(java.util.Collection c)
          Add all the elements of the specified collection to this one.
 boolean addAll(java.lang.Object[] c)
          Add all the elements of the specified array to this one.
 StarTeamCollection addTo(java.lang.Object o)
          Add the specified element to the collection.
 int attach(java.lang.Object o)
          add an object to this collection
 void clear()
          Removes all of the elements from this collection.
 boolean contains(java.lang.Object o)
          Returns true if the specified object is a member of this collection
 boolean containsAll(java.util.Collection c)
          Returns true if this collection contains all of the elements in the specified collection
 void detach(java.lang.Object o)
          remove the object from the collection
 java.lang.Object get(int index)
          Gets the object at the given index.
 java.lang.Object getSyncRoot()
          returns an object that can be used to synchronize this collection
 int indexOf(java.lang.Object o)
          returns the index of the object in this collection
 void insert(int index, java.lang.Object o)
          insert the object into the collection at the specified index
 boolean isEmpty()
          Returns true if this collection contains no elements
 boolean isFixedSize()
          returns true if this collection has a fixed size
 boolean isModified()
          returns true if this collection has been modified while being iterated over
 boolean isReadOnly()
          returns true if this collection is read only
 boolean isSynchronized()
          returns true if access to this collection is synchronized
 java.util.Iterator iterator()
          Returns an iterator over the elements in this collection.
 int positionOf(java.lang.Object o)
          returns the position of the object instance in this collection to locate this object, an identity comparison is made with every other object in the collection
 boolean remove(java.lang.Object o)
          Removes a single instance of the specified element from this collection, if it is present
 boolean removeAll(java.util.Collection c)
          Removes all this collection's elements that are also contained in the specified collection
 void removeAt(int index)
          remove the object at the specified index
 void resetCapacity(int newCapacity)
          Reset the collection, and change its initial loading capacity
 boolean retainAll(java.util.Collection c)
          Retains only the elements in this collection that are contained in the specified collection.
 void set(int index, java.lang.Object o)
          Sets the object at a given index in the collection, and removes the (existing) object at that index in the collection, provided that the object does not already exist in the collection
 int size()
          Returns the number of elements in this collection
 java.lang.Object[] toArray()
          Returns an array containing all of the elements in this collection
 java.lang.Object[] toArray(java.lang.Object[] a)
          Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array
 
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
 

Method Detail

add

public boolean add(java.lang.Object o)
Add the specified element to the collection. Returns true if this collection changed as a result of the call. Returns false if this collection already contains the specified element.

Specified by:
add in interface java.util.Collection
Parameters:
o - The Object to add to the collection
Returns:
true if this collection changed as a result of the call.
Throws:
java.lang.IllegalStateException - if the Collection is Read Only or IllegalArgumentException if the type of Object being added is not assignable to this collection

addTo

public StarTeamCollection addTo(java.lang.Object o)
Add the specified element to the collection.

Parameters:
o - The Object to add to the collection
Returns:
this collection itself, including the newly added object

addAll

public boolean addAll(java.util.Collection c)
Add all the elements of the specified collection to this one. Returns true if this collection changed as a result of the call. Returns false if this collection already contains the specified element.

Specified by:
addAll in interface java.util.Collection
Parameters:
c - the specified collection
Returns:
true if this collection changed as a result of the call.

addAll

public boolean addAll(java.lang.Object[] c)
Add all the elements of the specified array to this one. Returns true if this collection changed as a result of the call. Returns false if this collection already contains the specified element.

Parameters:
c - an array of Objects to add to this collection
Returns:
true if this collection changed as a result of the call.
Throws:
java.lang.IllegalStateException - if the Collection is Read Only or if the component type of the array is not assignable to this collection

clear

public void clear()
Removes all of the elements from this collection.

Specified by:
clear in interface java.util.Collection

contains

public boolean contains(java.lang.Object o)
Returns true if the specified object is a member of this collection

Specified by:
contains in interface java.util.Collection
Parameters:
o - the object to test for
Returns:
true if the specified object is a member of this collection

containsAll

public boolean containsAll(java.util.Collection c)
Returns true if this collection contains all of the elements in the specified collection

Specified by:
containsAll in interface java.util.Collection
Returns:
true if this collection contains all of the elements in the specified collection

isEmpty

public boolean isEmpty()
Returns true if this collection contains no elements

Specified by:
isEmpty in interface java.util.Collection
Returns:
true if this collection contains no elements

iterator

public java.util.Iterator iterator()
Returns an iterator over the elements in this collection. There are no guarantees concerning the order in which the elements are returned

Specified by:
iterator in interface java.lang.Iterable
Specified by:
iterator in interface java.util.Collection
Returns:
an iterator over the elements in this collection.

remove

public boolean remove(java.lang.Object o)
Removes a single instance of the specified element from this collection, if it is present

Specified by:
remove in interface java.util.Collection
Parameters:
o - the object to remove
Returns:
true if the collection changed as a result of the call

removeAll

public boolean removeAll(java.util.Collection c)
Removes all this collection's elements that are also contained in the specified collection

Specified by:
removeAll in interface java.util.Collection
Returns:
true if the collection changed as a result of the call

retainAll

public boolean retainAll(java.util.Collection c)
Retains only the elements in this collection that are contained in the specified collection. In other words, removes from this collection all of its elements that are not contained in the specified collection

Specified by:
retainAll in interface java.util.Collection
Returns:
true if the collection changed as a result of the call

size

public int size()
Returns the number of elements in this collection

Specified by:
size in interface java.util.Collection
Returns:
the number of elements in this collection

toArray

public java.lang.Object[] toArray()
Returns an array containing all of the elements in this collection

Specified by:
toArray in interface java.util.Collection
Returns:
an array containing all of the elements in this collection

toArray

public java.lang.Object[] toArray(java.lang.Object[] a)
Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array

Specified by:
toArray in interface java.util.Collection
Parameters:
a - the specified array whose runtime type will be used to construct the returned array
Returns:
an array containing all of the elements in this collection;

isSynchronized

public boolean isSynchronized()
returns true if access to this collection is synchronized

Returns:
true if access to this collection is synchronized

getSyncRoot

public java.lang.Object getSyncRoot()
returns an object that can be used to synchronize this collection

Returns:
an object that can be used to synchronize this collection

isFixedSize

public boolean isFixedSize()
returns true if this collection has a fixed size

Returns:
true if this collection has a fixed size

isReadOnly

public boolean isReadOnly()
returns true if this collection is read only

Returns:
true if this collection is read only

detach

public void detach(java.lang.Object o)
remove the object from the collection

Parameters:
o - the object to remove
See Also:
StarTeamCollection.remove(Object)

attach

public int attach(java.lang.Object o)
add an object to this collection

Parameters:
o - the object to add
Returns:
the index of the object in the collection
See Also:
StarTeamCollection.add(Object)

get

public java.lang.Object get(int index)
Gets the object at the given index.

Parameters:
index - A valid index into the collection.
Returns:
The object at that given index.

set

public void set(int index,
                java.lang.Object o)
Sets the object at a given index in the collection, and removes the (existing) object at that index in the collection, provided that the object does not already exist in the collection

Parameters:
index - A valid index into the collection.
o - The object to be set.

indexOf

public int indexOf(java.lang.Object o)
returns the index of the object in this collection

Parameters:
o - the object to test for
Returns:
it's index in the collection, or -1 if not found
See Also:
StarTeamCollection.positionOf(Object)

positionOf

public int positionOf(java.lang.Object o)
returns the position of the object instance in this collection to locate this object, an identity comparison is made with every other object in the collection

Parameters:
o - the object to test for
Returns:
it's position in the collection, or -1 if not found
See Also:
StarTeamCollection.indexOf(Object)

insert

public void insert(int index,
                   java.lang.Object o)
insert the object into the collection at the specified index

Parameters:
index - the position at which the object should be inserted
o - the object to insert

removeAt

public void removeAt(int index)
remove the object at the specified index

Parameters:
index - the index at which the object should be removed

isModified

public boolean isModified()
returns true if this collection has been modified while being iterated over

Returns:
true if this collection has been modified

resetCapacity

public void resetCapacity(int newCapacity)
Reset the collection, and change its initial loading capacity

Parameters:
newCapacity - the new capacity


StarTeam SDK 14.0, Build 21
Copyright © 2003-2012 Borland Software Corporation. All rights reserved.