1 22 23 package org.xquark.mapper.metadata; 24 25 import org.xquark.mapper.util.RecyclingStack; 26 import org.xquark.schema.SchemaConstants; 27 28 32 public class ExtraNode implements Cloneable , RecyclingStack.StackObject 33 { 34 private static final String RCSRevision = "$Revision: 1.1 $"; 35 private static final String RCSName = "$Name: $"; 36 37 public long anchor = -1; 38 public short rowNum = 0; 39 public short path = -2; 41 42 public short type = -1; 43 public short position = 0; 44 public int offset = 0; 45 public String data =null; 46 47 public ExtraNode() 48 {} 49 50 55 public ExtraNode(long anchorOID, short rowNum, short path, short type, short position) 56 { 57 set(anchorOID, rowNum, path, type, position); 58 } 59 60 public ExtraNode(long anchorOID, short rowNum, short path, short type, short position, int offset, String data) 61 { 62 set(anchorOID, rowNum, path, type, position, offset, data); 63 } 64 65 68 public void set(long anchorOID, short path, short type, short position) 69 { 70 this.anchor = anchorOID; 71 this.path = path; 72 this.type = type; 73 this.position = position; 74 } 75 78 public void set(long anchorOID, short rowNum, short path, short type, short position) 79 { 80 set(anchorOID, path, type, position); 81 this.rowNum = rowNum; 82 } 83 84 public void set(long anchorOID, short rowNum, short path, short type, short position, int offset, String data) 85 { 86 set(anchorOID, rowNum, path, type, position); 87 this.data = data; 88 this.offset = offset; 89 } 90 91 public boolean isNil() 92 { 93 return (type == RepositoryConstants.XSI_NIL) 94 && data.equalsIgnoreCase(SchemaConstants.TRUE_VALUE); 95 } 96 97 public void clear() 98 { 99 anchor = -1; 100 path = -2; type = -1; 102 position = 0; 103 offset = 0; 104 data = null; 105 } 106 107 public String toString() 108 { 109 return "[" + anchor + ", " + path+ ", " + type + ", " + position 110 + ", " + offset + ", " + data + "]"; 111 } 112 113 public Object clone() 114 { 115 Object o = null; 116 try { 117 o = super.clone(); 118 } 119 catch (CloneNotSupportedException e) { 120 } 121 return o; 122 } 123 } 124 | Popular Tags |