public Object setValue(String privateCreator, int tag, VR vr, Object value) { return set(privateCreator, tag, vr, value != null ? value : Value.NULL); }
public Object setNull(String privateCreator, int tag, VR vr) { return set(privateCreator, tag, vr, Value.NULL); }
public Sequence newSequence(String privateCreator, int tag, int initialCapacity) { Sequence seq = new Sequence(this, initialCapacity); set(privateCreator, tag, VR.SQ, seq); return seq; }
public boolean addSelected(Attributes other, String privateCreator, int tag) { int index = other.indexOf(privateCreator, tag); if (index < 0) return false; Object value = other.values[index]; if (value instanceof Sequence) { set(privateCreator, tag, (Sequence) value, null); } else if (value instanceof Fragments) { set(privateCreator, tag, (Fragments) value); } else { VR vr = other.vrs[index]; set(privateCreator, tag, vr, toggleEndian(vr, value, bigEndian != other.bigEndian)); } return true; }
public Fragments newFragments(String privateCreator, int tag, VR vr, int initialCapacity) { Fragments frags = new Fragments(vr, bigEndian, initialCapacity); set(privateCreator, tag, vr, frags); return frags; }
public Object setInt(String privateCreator, int tag, VR vr, int... is) { return set(privateCreator, tag, vr, vr.toValue(is, bigEndian)); }
public Object setDouble(String privateCreator, int tag, VR vr, double... ds) { return set(privateCreator, tag, vr, vr.toValue(ds, bigEndian)); }
public Object setBytes(String privateCreator, int tag, VR vr, byte[] b) { return set(privateCreator, tag, vr, vr.toValue(b)); }
public Object setFloat(String privateCreator, int tag, VR vr, float... fs) { return set(privateCreator, tag, vr, vr.toValue(fs, bigEndian)); }
public Object setString(String privateCreator, int tag, VR vr, String s) { return set(privateCreator, tag, vr, vr.toValue(s, bigEndian)); }
public Object setString(String privateCreator, int tag, VR vr, String... ss) { return set(privateCreator, tag, vr, vr.toValue(ss, bigEndian)); }
public int diff(Attributes other, int[] selection, Attributes diff) { int count = 0; for (int tag : selection) { int index = indexOf(tag); int otherIndex = other.indexOf(tag); if (!equalValues(other, index, otherIndex)) { if (diff != null) { Object value = index < 0 ? Value.NULL : values[index]; if (value instanceof Sequence) { diff.set(null, tag, (Sequence) value, null); } else { diff.set(tag, index < 0 ? other.vrs[otherIndex] : vrs[index], value); } } count++; } } return count; }
public Object setDate(String privateCreator, int tag, VR vr, DatePrecision precision, Date... ds) { return set(privateCreator, tag, vr, vr.toValue(ds, getTimeZone(), precision)); }
public Object setDateRange(String privateCreator, int tag, VR vr, DatePrecision precision, DateRange range) { return set(privateCreator, tag, vr, toString(range, vr, getTimeZone(), precision)); }
private Object set(String privateCreator, int tag, VR vr, Object value) { if (vr == null) throw new NullPointerException("vr"); if (privateCreator != null) { int creatorTag = creatorTagOf(privateCreator, tag, true); tag = TagUtils.toPrivateTag(creatorTag, tag); } if (TagUtils.isGroupLength(tag)) return null; Object oldValue = set(tag, vr, value); if (tag == Tag.SpecificCharacterSet) { containsSpecificCharacterSet = true; cs = null; } else if (tag == Tag.TimezoneOffsetFromUTC) { containsTimezoneOffsetFromUTC = value != Value.NULL; tz = null; } return oldValue; }
if (modified != null && !isEmpty(origValue) && !modified.contains(privateCreator, tag)) { if (origValue instanceof Sequence) { modified.set(privateCreator, tag, (Sequence) origValue, null); } else if (origValue instanceof Fragments) { modified.set(privateCreator, tag, (Fragments) origValue); } else { modified.set(privateCreator, tag, vr, toggleEndian(vr, origValue, modifiedToggleEndian)); set(privateCreator, tag, (Sequence) value, selection != null ? selection.getNestedDataset(tag) : null); } else if (value instanceof Fragments) { set(privateCreator, tag, (Fragments) value); } else { set(privateCreator, tag, vr, toggleEndian(vr, value, toggleEndian));