org.apache.derby.iapi.sql.dictionary
Class ConstraintDescriptorList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by org.apache.derby.iapi.sql.dictionary.ConstraintDescriptorList
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class ConstraintDescriptorList
extends java.util.ArrayList

See Also:
Serialized Form

Field Summary
private  boolean scanned
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ConstraintDescriptorList()
           
 
Method Summary
 ConstraintDescriptor dropConstraintDescriptorById(UUID uuid)
          Drop the constraint with the given UUID.
 ConstraintDescriptor elementAt(int n)
          Return the nth (0-based) element in the list.
 ConstraintDescriptor getConstraintDescriptor(UUID indexUUID)
          Get the ConstraintDescriptor with the matching UUID String for the backing index.
 ConstraintDescriptor getConstraintDescriptorById(UUID uuid)
          Get the ConstraintDescriptor with the matching constraint id.
 ConstraintDescriptor getConstraintDescriptorByName(SchemaDescriptor sd, java.lang.String name)
          Get the ConstraintDescriptor with the matching constraint name.
 ConstraintDescriptorList getConstraintDescriptorList(boolean enabled)
          Return a list of constraints where enabled is as passed in.
 ReferencedKeyConstraintDescriptor getPrimaryKey()
          Get the ConstraintDescriptor with the matching constraint name.
 boolean getScanned()
          Return whether or not the underlying system table has been scanned.
 ConstraintDescriptorList getSubList(int type)
          Return a ConstraintDescriptorList containing the ConstraintDescriptors of the specified type that are in this list.
 void setScanned(boolean scanned)
          Mark whether or not the underlying system table has been scanned.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Field Detail

scanned

private boolean scanned
Constructor Detail

ConstraintDescriptorList

public ConstraintDescriptorList()
Method Detail

setScanned

public void setScanned(boolean scanned)
Mark whether or not the underlying system table has been scanned. (If a table does not have any constraints then the size of its CDL will always be 0. We used these get/set methods to determine when we need to scan the table.

Parameters:
scanned - Whether or not the underlying system table has been scanned.

getScanned

public boolean getScanned()
Return whether or not the underlying system table has been scanned.

Returns:
Where or not the underlying system table has been scanned.

getConstraintDescriptor

public ConstraintDescriptor getConstraintDescriptor(UUID indexUUID)
Get the ConstraintDescriptor with the matching UUID String for the backing index.

Parameters:
indexUUID - The UUID for the backing index.
Returns:
The matching ConstraintDescriptor.

getConstraintDescriptorById

public ConstraintDescriptor getConstraintDescriptorById(UUID uuid)
Get the ConstraintDescriptor with the matching constraint id.

Parameters:
uuid - The constraint id.
Returns:
The matching ConstraintDescriptor.

dropConstraintDescriptorById

public ConstraintDescriptor dropConstraintDescriptorById(UUID uuid)
Drop the constraint with the given UUID.

Parameters:
uuid - The constraint id.
Returns:
The matching ConstraintDescriptor.

getConstraintDescriptorByName

public ConstraintDescriptor getConstraintDescriptorByName(SchemaDescriptor sd,
                                                          java.lang.String name)
Get the ConstraintDescriptor with the matching constraint name.

Parameters:
sd - The constraint schema descriptor.
name - The constraint name.
Returns:
The matching ConstraintDescriptor.

getPrimaryKey

public ReferencedKeyConstraintDescriptor getPrimaryKey()
Get the ConstraintDescriptor with the matching constraint name.

Returns:
The matching ConstraintDescriptor.

getConstraintDescriptorList

public ConstraintDescriptorList getConstraintDescriptorList(boolean enabled)
Return a list of constraints where enabled is as passed in.

Parameters:
enabled - true or false
Returns:
a constraint descriptor list built from this. Always a new list even if all the elements in this were of the correct type (i.e. not optimized for the case where every element is desired).

elementAt

public ConstraintDescriptor elementAt(int n)
Return the nth (0-based) element in the list.

Parameters:
n - Which element to return.
Returns:
The nth element in the list.

getSubList

public ConstraintDescriptorList getSubList(int type)
Return a ConstraintDescriptorList containing the ConstraintDescriptors of the specified type that are in this list.

Parameters:
type - The constraint type.
Returns:
A ConstraintDescriptorList containing the ConstraintDescriptors of the specified type that are in this list.

Built on Thu 2011-03-10 11:54:14+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.