FileDocCategorySizeDatePackage
ExtentCollection.javaAPI DocGlassfish v2 API8710Fri May 04 22:34:58 BST 2007com.sun.jdo.spi.persistence.support.sqlstore

ExtentCollection

public class ExtentCollection extends Object implements Collection
author
Michael Bouschen
version
0.1

Fields Summary
protected com.sun.jdo.spi.persistence.support.sqlstore.PersistenceManager
pm
The PersistenceManager getExtent is called from
protected Class
persistenceCapableClass
This extent collection reperesents the extent of persistenceCapableClass.
private static final ResourceBundle
messages
I18N message handler
Constructors Summary
public ExtentCollection(com.sun.jdo.spi.persistence.support.sqlstore.PersistenceManager pm, Class persistenceCapableClass, boolean subclasses)

param
persistenceCapableClass Class of instances
param
subclasses whether to include instances of subclasses


                      
           
        this.pm = pm;
        this.persistenceCapableClass = persistenceCapableClass;

        // check persistenceCapableClass parameter being null
        if (persistenceCapableClass == null)
            throw new JDOUserException(
                    I18NHelper.getMessage(messages, "jdo.extentcollection.constructor.invalidclass", "null"));// NOI18N
        // check persistence-capable
        if (Model.RUNTIME.getMappingClass(persistenceCapableClass.getName(),
                persistenceCapableClass.getClassLoader()) == null)
            throw new JDOUserException(
                    I18NHelper.getMessage(messages, "jdo.extentcollection.constructor.nonpc", // NOI18N
                            persistenceCapableClass.getName()));

        // subclasses == true is not yet supported
        if (subclasses)
            throw new JDOUnsupportedOptionException(
                    I18NHelper.getMessage(messages, "jdo.extentcollection.constructor.subclasses"));// NOI18N
    
Methods Summary
public booleanadd(java.lang.Object o)
Extent collection is unmodifiable => throw UnsupportedOperationException

        throw new UnsupportedOperationException(
                I18NHelper.getMessage(messages, "jdo.extentcollection.illegalmodification", // NOI18N
                        persistenceCapableClass.getName()));
    
public booleanaddAll(java.util.Collection c)
Extent collection is unmodifiable => throw UnsupportedOperationException

        throw new UnsupportedOperationException(
                I18NHelper.getMessage(messages, "jdo.extentcollection.illegalmodification", // NOI18N
                        persistenceCapableClass.getName()));
    
public voidclear()
Extent collection is unmodifiable => throw UnsupportedOperationException

        throw new UnsupportedOperationException(
                I18NHelper.getMessage(messages, "jdo.extentcollection.illegalmodification", // NOI18N
                        persistenceCapableClass.getName()));
    
public booleancontains(java.lang.Object o)

        throw new JDOUnsupportedOptionException(
                I18NHelper.getMessage(messages, "jdo.extentcollection.methodnotsupported", "contains"));// NOI18N
    
public booleancontainsAll(java.util.Collection c)

        throw new JDOUnsupportedOptionException(
                I18NHelper.getMessage(messages, "jdo.extentcollection.methodnotsupported", "containsAll"));// NOI18N
    
public booleanequals(java.lang.Object o)
Two extent collections are equal, iff the names of their persistence capable class are equal

        if (o == this)
            return true;
        if (o instanceof ExtentCollection) {
            String otherClassName = ((ExtentCollection) o).persistenceCapableClass.getName();
            return persistenceCapableClass.getName().equals(otherClassName);
        }
        return false;
    
public java.lang.ClassgetPersistenceCapableClass()

        return persistenceCapableClass;
    
public inthashCode()
The hashCode is mapped to the hashCode of the name of the extent collection's persistence capable class

        return persistenceCapableClass.getName().hashCode();
    
public booleanisEmpty()

        throw new JDOUnsupportedOptionException(
                I18NHelper.getMessage(messages, "jdo.extentcollection.methodnotsupported", "isEmpty"));// NOI18N
    
public java.util.Iteratoriterator()

        RetrieveDesc rd = pm.getRetrieveDesc(persistenceCapableClass);
        return ((Collection)pm.retrieve(rd)).iterator();
    
public booleanremove(java.lang.Object o)
Extent collection is unmodifiable => throw UnsupportedOperationException

        throw new UnsupportedOperationException(
                I18NHelper.getMessage(messages, "jdo.extentcollection.illegalmodification", // NOI18N
                        persistenceCapableClass.getName()));
    
public booleanremoveAll(java.util.Collection c)
Extent collection is unmodifiable => throw UnsupportedOperationException

        throw new UnsupportedOperationException(
                I18NHelper.getMessage(messages, "jdo.extentcollection.illegalmodification", // NOI18N
                        persistenceCapableClass.getName()));
    
public booleanretainAll(java.util.Collection c)
Extent collection is unmodifiable => throw UnsupportedOperationException

        throw new UnsupportedOperationException(
                I18NHelper.getMessage(messages, "jdo.extentcollection.illegalmodification", // NOI18N
                        persistenceCapableClass.getName()));
    
public intsize()

        throw new JDOUnsupportedOptionException(
                I18NHelper.getMessage(messages, "jdo.extentcollection.methodnotsupported", "size"));// NOI18N
    
public java.lang.Object[]toArray()

        throw new JDOUnsupportedOptionException(
                I18NHelper.getMessage(messages, "jdo.extentcollection.methodnotsupported", "toArray"));// NOI18N
    
public java.lang.Object[]toArray(java.lang.Object[] a)

        throw new JDOUnsupportedOptionException(
                I18NHelper.getMessage(messages, "jdo.extentcollection.methodnotsupported", "toArray"));// NOI18N