1 2 12 package com.versant.core.metadata.parser; 13 14 import com.versant.core.metadata.MDStaticUtils; 15 import com.versant.core.common.Debug; 16 17 import java.io.PrintStream ; 18 import java.util.Collections ; 19 20 23 public final class JdoArray extends JdoElement { 24 25 public int embeddedElement; 26 public JdoExtension[] extensions; 27 public JdoField parent; 28 29 public JdoElement getParent() { return parent; } 30 31 36 public String getSubContext() { 37 return "array"; 38 } 39 40 public String toString() { 41 StringBuffer s = new StringBuffer (); 42 s.append("array embeddedElement="); 43 s.append(MDStaticUtils.toTriStateString(embeddedElement)); 44 return s.toString(); 45 } 46 47 public void dump() { 48 dump(Debug.OUT, ""); 49 } 50 51 public void dump(PrintStream out, String indent) { 52 out.println(indent + this); 53 String is = indent + " "; 54 if (extensions != null) { 55 for (int i = 0; i < extensions.length; i++) { 56 extensions[i].dump(out, is); 57 } 58 } 59 } 60 61 public void synchronizeForHorizontal(JdoArray array) { 62 if (array.extensions != null) { 63 JdoExtension[] copy = new JdoExtension[array.extensions.length]; 64 for (int i = 0; i < array.extensions.length; i++) { 65 copy[i] = array.extensions[i].createCopy(this); 66 } 67 if (extensions != null) { 68 JdoExtension.synchronize3(extensions, copy, Collections.EMPTY_SET, false); 69 } else { 70 extensions = copy; 71 } 72 } 73 } 74 75 public JdoArray createCopy(JdoField jdoField) { 76 JdoArray tmp = new JdoArray(); 77 tmp.parent = jdoField; 78 tmp.embeddedElement = embeddedElement; 79 80 if (extensions != null) { 81 tmp.extensions = new JdoExtension[extensions.length]; 82 for (int i = 0; i < extensions.length; i++) { 83 tmp.extensions[i] = extensions[i].createCopy(tmp); 84 } 85 } 86 return tmp; 87 } 88 } 89 90 | Popular Tags |