Class ConstraintDescriptorList
java.lang.Object
java.util.AbstractCollection<ConstraintDescriptor>
java.util.AbstractList<ConstraintDescriptor>
java.util.ArrayList<ConstraintDescriptor>
org.apache.derby.iapi.sql.dictionary.ConstraintDescriptorList
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<ConstraintDescriptor>
,Collection<ConstraintDescriptor>
,List<ConstraintDescriptor>
,RandomAccess
,SequencedCollection<ConstraintDescriptor>
- See Also:
-
Field Summary
FieldsFields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDrop the constraint with the given UUID.elementAt
(int n) Return the nth (0-based) element in the list.getConstraintDescriptor
(UUID indexUUID) Get the ConstraintDescriptor with the matching UUID String for the backing index.Get the ConstraintDescriptor with the matching constraint id.Get the ConstraintDescriptor with the matching constraint name.getConstraintDescriptorList
(boolean enforced) Return a list of constraints where enforced is as passed in.Get the ConstraintDescriptor with the matching constraint name.boolean
Return whether or not the underlying system table has been scanned.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, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll, reversed
-
Field Details
-
scanned
private boolean scanned
-
-
Constructor Details
-
ConstraintDescriptorList
public ConstraintDescriptorList()
-
-
Method Details
-
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
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
Get the ConstraintDescriptor with the matching constraint id.- Parameters:
uuid
- The constraint id.- Returns:
- The matching ConstraintDescriptor.
-
dropConstraintDescriptorById
Drop the constraint with the given UUID.- Parameters:
uuid
- The constraint id.- Returns:
- The matching ConstraintDescriptor.
-
getConstraintDescriptorByName
Get the ConstraintDescriptor with the matching constraint name.- Parameters:
sd
- The constraint schema descriptor.name
- The constraint name.- Returns:
- The matching ConstraintDescriptor.
-
getPrimaryKey
Get the ConstraintDescriptor with the matching constraint name.- Returns:
- The matching ConstraintDescriptor.
-
getConstraintDescriptorList
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
Return the nth (0-based) element in the list.- Parameters:
n
- Which element to return.- Returns:
- The nth element in the list.
-
getSubList
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.
-