Adding JMCR-Stable version
[Benchmarks_CSolver.git] / JMCR-Stable / real-world application / derby-10.3.2.1 / java / engine / org / apache / derby / iapi / sql / dictionary / GenericDescriptorList.java
diff --git a/JMCR-Stable/real-world application/derby-10.3.2.1/java/engine/org/apache/derby/iapi/sql/dictionary/GenericDescriptorList.java b/JMCR-Stable/real-world application/derby-10.3.2.1/java/engine/org/apache/derby/iapi/sql/dictionary/GenericDescriptorList.java
new file mode 100644 (file)
index 0000000..e36c691
--- /dev/null
@@ -0,0 +1,93 @@
+/*\r
+\r
+   Derby - Class org.apache.derby.iapi.sql.dictionary.GenericDescriptorList\r
+\r
+   Licensed to the Apache Software Foundation (ASF) under one or more\r
+   contributor license agreements.  See the NOTICE file distributed with\r
+   this work for additional information regarding copyright ownership.\r
+   The ASF licenses this file to you under the Apache License, Version 2.0\r
+   (the "License"); you may not use this file except in compliance with\r
+   the License.  You may obtain a copy of the License at\r
+\r
+      http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+   Unless required by applicable law or agreed to in writing, software\r
+   distributed under the License is distributed on an "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+   See the License for the specific language governing permissions and\r
+   limitations under the License.\r
+\r
+ */\r
+\r
+package org.apache.derby.iapi.sql.dictionary;\r
+\r
+import org.apache.derby.iapi.error.StandardException;\r
+import org.apache.derby.iapi.services.sanity.SanityManager;\r
+\r
+import org.apache.derby.catalog.UUID;\r
+\r
+import org.apache.derby.iapi.sql.dictionary.DataDictionary;\r
+import org.apache.derby.iapi.sql.dictionary.UniqueTupleDescriptor;\r
+import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;\r
+\r
+import org.apache.derby.iapi.error.StandardException;\r
+import org.apache.derby.iapi.services.sanity.SanityManager;\r
+\r
+import org.apache.derby.catalog.UUID;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Iterator;\r
+\r
+public class GenericDescriptorList extends ArrayList\r
+{\r
+       private boolean scanned;\r
+\r
+       /**\r
+        * Mark whether or not the underlying system table has\r
+        * been scanned.  (If a table does not have any\r
+        * constraints then the size of its CDL will always\r
+        * be 0.  We used these get/set methods to determine\r
+        * when we need to scan the table.\r
+        *\r
+        * @param scanned       Whether or not the underlying system table has been scanned.\r
+        */\r
+       public void setScanned(boolean scanned)\r
+       {\r
+               this.scanned = scanned;\r
+       }\r
+\r
+       /**\r
+        * Return whether or not the underlying system table has been scanned.\r
+        *\r
+        * @return              Where or not the underlying system table has been scanned.\r
+        */\r
+       public boolean getScanned()\r
+       {\r
+               return scanned;\r
+       }\r
+\r
+       /**\r
+        * Get the UniqueTupleDescriptor that matches the \r
+        * input uuid.\r
+        *\r
+        * @param uuid          The UUID for the object\r
+        *\r
+        * @return The matching UniqueTupleDescriptor.\r
+        */\r
+       public UniqueTupleDescriptor getUniqueTupleDescriptor(UUID uuid)\r
+       {\r
+               for (Iterator iterator = iterator(); iterator.hasNext(); )\r
+               {\r
+                       UniqueTupleDescriptor ud = (UniqueTupleDescriptor) iterator.next();\r
+                       if (ud.getUUID().equals(uuid))\r
+                       {\r
+                               return ud;\r
+                       }\r
+               }\r
+               return null;\r
+       }\r
+\r
+       public java.util.Enumeration elements() {\r
+               return java.util.Collections.enumeration(this);\r
+       }\r
+}\r