com.versionone.om
Class EntityCollection<D extends Entity>

java.lang.Object
  extended by java.util.AbstractCollection<D>
      extended by com.versionone.om.EntityCollection<D>
All Implemented Interfaces:
java.lang.Iterable<D>, java.util.Collection<D>

public class EntityCollection<D extends Entity>
extends java.util.AbstractCollection<D>


Constructor Summary
EntityCollection(V1Instance instance, Entity entity, java.lang.String readAttributeName, java.lang.String writeAttributeName)
           
 
Method Summary
 boolean add(D item)
          Add item to collection.
 EntityCollection<D> asReadOnly()
           
 void clear()
          Removes all of the elements from this collection.
 boolean contains(java.lang.Object item)
           
 void copyTo(D[] array, int arrayIndex)
           
 boolean isReadOnly()
           
 java.util.Iterator<D> iterator()
           
 boolean remove(java.lang.Object item)
           
 int size()
           
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

EntityCollection

public EntityCollection(V1Instance instance,
                        Entity entity,
                        java.lang.String readAttributeName,
                        java.lang.String writeAttributeName)
Method Detail

add

public boolean add(D item)
            throws java.lang.UnsupportedOperationException
Add item to collection.

Specified by:
add in interface java.util.Collection<D extends Entity>
Overrides:
add in class java.util.AbstractCollection<D extends Entity>
Parameters:
item - item for addition (must be Entity or subclass).
Returns:
if item add then will return true in the other case false.
Throws:
java.lang.UnsupportedOperationException - if object is read only.

clear

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

Specified by:
clear in interface java.util.Collection<D extends Entity>
Overrides:
clear in class java.util.AbstractCollection<D extends Entity>
Throws:
java.lang.UnsupportedOperationException - if object is read only.
See Also:
Collection.clear().

contains

public boolean contains(java.lang.Object item)
                 throws java.lang.IllegalArgumentException
Specified by:
contains in interface java.util.Collection<D extends Entity>
Overrides:
contains in class java.util.AbstractCollection<D extends Entity>
Throws:
java.lang.IllegalArgumentException

copyTo

public void copyTo(D[] array,
                   int arrayIndex)
            throws java.lang.IndexOutOfBoundsException,
                   java.lang.IllegalArgumentException
Throws:
java.lang.IndexOutOfBoundsException
java.lang.IllegalArgumentException

remove

public boolean remove(java.lang.Object item)
               throws java.lang.UnsupportedOperationException
Specified by:
remove in interface java.util.Collection<D extends Entity>
Overrides:
remove in class java.util.AbstractCollection<D extends Entity>
Throws:
java.lang.UnsupportedOperationException

size

public int size()
Specified by:
size in interface java.util.Collection<D extends Entity>
Specified by:
size in class java.util.AbstractCollection<D extends Entity>

isReadOnly

public boolean isReadOnly()

iterator

public java.util.Iterator<D> iterator()
Specified by:
iterator in interface java.lang.Iterable<D extends Entity>
Specified by:
iterator in interface java.util.Collection<D extends Entity>
Specified by:
iterator in class java.util.AbstractCollection<D extends Entity>

asReadOnly

public EntityCollection<D> asReadOnly()