@Override public boolean equals(Object obj) { if (obj instanceof IDataRelationElement) { IDataRelationElement obj2 = (IDataRelationElement) obj; return (parentBufferName.equals(obj2.getParentBufferName()) && childBufferName.equals(obj2.getChildBufferName()) && fieldPairs.equals(obj2.getFieldPairs())); } return false; } }
@Override public int getSizeInRCode() { int size = 24 + (bufferNames.length * 4); for (IDataRelationElement elem : relations) { size += elem.getSizeInRCode(); } return size + 7 & -8; }
@Override public boolean equals(Object obj) { if (obj instanceof IDataRelationElement) { IDataRelationElement obj2 = (IDataRelationElement) obj; return (parentBufferName.equals(obj2.getParentBufferName()) && childBufferName.equals(obj2.getChildBufferName()) && fieldPairs.equals(obj2.getFieldPairs())); } return false; } }
@Override public int getSizeInRCode() { int size = 24 + (bufferNames.length * 4 + 7 & -8); for (IDataRelationElement elem : relations) { size += elem.getSizeInRCode(); } return size; }
public static IDatasetElement fromDebugSegment(String name, Set<AccessType> accessType, byte[] segment, int currentPos, int textAreaOffset, ByteOrder order) { int bufferCount = ByteBuffer.wrap(segment, currentPos + 14, Short.BYTES).order(order).getShort(); int relationshipCount = ByteBuffer.wrap(segment, currentPos + 16, Short.BYTES).order(order).getShort(); int nameOffset = ByteBuffer.wrap(segment, currentPos, Integer.BYTES).order(order).getInt(); String name2 = nameOffset == 0 ? name : RCodeInfo.readNullTerminatedString(segment, textAreaOffset + nameOffset); String[] bufferNames = new String[bufferCount]; for (int zz = 0; zz < bufferCount; zz++) { bufferNames[zz] = RCodeInfo.readNullTerminatedString(segment, textAreaOffset + ByteBuffer.wrap(segment, currentPos + 24 + (zz * 4), Integer.BYTES).order(order).getInt()); } // Round to next byte int currPos = currentPos + 24 + (bufferCount * 4 + 7 & -8); IDataRelationElement[] relations = new DataRelationElementV12[relationshipCount]; for (int zz = 0; zz < relationshipCount; zz++) { IDataRelationElement param = DataRelationElementV12.fromDebugSegment(segment, currPos, textAreaOffset, order); currPos += param.getSizeInRCode(); relations[zz] = param; } return new DatasetElementV12(name2, accessType, bufferNames, relations); }
public static IDatasetElement fromDebugSegment(String name, Set<AccessType> accessType, byte[] segment, int currentPos, int textAreaOffset, ByteOrder order) { int bufferCount = ByteBuffer.wrap(segment, currentPos + 14, Short.BYTES).order(order).getShort(); int relationshipCount = ByteBuffer.wrap(segment, currentPos + 16, Short.BYTES).order(order).getShort(); int nameOffset = ByteBuffer.wrap(segment, currentPos, Integer.BYTES).order(order).getInt(); String name2 = nameOffset == 0 ? name : RCodeInfo.readNullTerminatedString(segment, textAreaOffset + nameOffset); String[] bufferNames = new String[bufferCount]; for (int zz = 0; zz < bufferCount; zz++) { bufferNames[zz] = RCodeInfo.readNullTerminatedString(segment, textAreaOffset + ByteBuffer.wrap(segment, currentPos + 24 + (zz * 4), Integer.BYTES).order(order).getInt()); } int currPos = currentPos + 4 * bufferCount; IDataRelationElement[] relations = new DataRelationElementV12[relationshipCount]; for (int zz = 0; zz < relationshipCount; zz++) { IDataRelationElement param = DataRelationElementV12.fromDebugSegment(segment, currPos, textAreaOffset, order); currPos += param.getSizeInRCode(); relations[zz] = param; } return new DatasetElementV12(name2, accessType, bufferNames, relations); }
public static IDatasetElement fromDebugSegment(String name, Set<AccessType> accessType, byte[] segment, int currentPos, int textAreaOffset, ByteOrder order) { int bufferCount = ByteBuffer.wrap(segment, currentPos, Short.BYTES).order(order).getShort(); int relationshipCount = ByteBuffer.wrap(segment, currentPos + 2, Short.BYTES).order(order).getShort(); int nameOffset = ByteBuffer.wrap(segment, currentPos + 16, Integer.BYTES).order(order).getInt(); String name2 = nameOffset == 0 ? name : RCodeInfo.readNullTerminatedString(segment, textAreaOffset + nameOffset); String[] bufferNames = new String[bufferCount]; for (int zz = 0; zz < bufferCount; zz++) { bufferNames[zz] = RCodeInfo.readNullTerminatedString(segment, textAreaOffset + ByteBuffer.wrap(segment, currentPos + 24 + (zz * 4), Integer.BYTES).order(order).getInt()); } int currPos = currentPos + 4 * bufferCount; IDataRelationElement[] relations = new DataRelationElementV11[relationshipCount]; for (int zz = 0; zz < relationshipCount; zz++) { IDataRelationElement param = DataRelationElementV11.fromDebugSegment(segment, currPos, textAreaOffset, order); currPos += param.getSizeInRCode(); relations[zz] = param; } return new DatasetElementV11(name2, accessType, bufferNames, relations); }
public static IDatasetElement fromDebugSegment(String name, Set<AccessType> accessType, byte[] segment, int currentPos, int textAreaOffset, ByteOrder order) { int bufferCount = ByteBuffer.wrap(segment, currentPos, Short.BYTES).order(order).getShort(); int relationshipCount = ByteBuffer.wrap(segment, currentPos + 2, Short.BYTES).order(order).getShort(); int nameOffset = ByteBuffer.wrap(segment, currentPos + 16, Integer.BYTES).order(order).getInt(); String name2 = nameOffset == 0 ? name : RCodeInfo.readNullTerminatedString(segment, textAreaOffset + nameOffset); String[] bufferNames = new String[bufferCount]; for (int zz = 0; zz < bufferCount; zz++) { bufferNames[zz] = RCodeInfo.readNullTerminatedString(segment, textAreaOffset + ByteBuffer.wrap(segment, currentPos + 24 + (zz * 4), Integer.BYTES).order(order).getInt()); } // Round to next byte int currPos = currentPos + 24 + (bufferCount * 4 + 7 & -8); IDataRelationElement[] relations = new DataRelationElementV11[relationshipCount]; for (int zz = 0; zz < relationshipCount; zz++) { IDataRelationElement param = DataRelationElementV11.fromDebugSegment(segment, currPos, textAreaOffset, order); currPos += param.getSizeInRCode(); relations[zz] = param; } return new DatasetElementV11(name2, accessType, bufferNames, relations); }