Class ConstraintDescriptorList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<ConstraintDescriptor>
-
- org.apache.derby.iapi.sql.dictionary.ConstraintDescriptorList
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<ConstraintDescriptor>
,java.util.Collection<ConstraintDescriptor>
,java.util.List<ConstraintDescriptor>
,java.util.RandomAccess
public class ConstraintDescriptorList extends java.util.ArrayList<ConstraintDescriptor>
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
scanned
-
Constructor Summary
Constructors Constructor Description ConstraintDescriptorList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 enforced)
Return a list of constraints where enforced 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, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
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 enforced)
Return a list of constraints where enforced is as passed in.- Parameters:
enforced
- 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.
-
-