public char delim(int level) { if(level == 0) return m_encodingChars.getFieldSeparator(); else if(level == 1) return m_encodingChars.getRepetitionSeparator(); else if(level == 2) return m_encodingChars.getComponentSeparator(); else if(level == 3) return m_encodingChars.getSubcomponentSeparator(); else if(level == 4) return m_encodingChars.getTruncationCharacter(); else throw new java.lang.Error(); }
public char delim(int level) { if(level == 0) return m_encodingChars.getFieldSeparator(); else if(level == 1) return m_encodingChars.getRepetitionSeparator(); else if(level == 2) return m_encodingChars.getComponentSeparator(); else if(level == 3) return m_encodingChars.getSubcomponentSeparator(); else if(level == 4) return m_encodingChars.getTruncationCharacter(); else throw new java.lang.Error(); }
EncLookup(EncodingCharacters ec) { characters[0] = ec.getFieldSeparator(); characters[1] = ec.getComponentSeparator(); characters[2] = ec.getSubcomponentSeparator(); characters[3] = ec.getRepetitionSeparator(); characters[4] = ec.getEscapeCharacter(); characters[5] = ec.getTruncationCharacter(); characters[6] = '\r'; char[] codes = {'F', 'S', 'T', 'R', 'E', 'L'}; for (int i = 0; i < codes.length; i++) { StringBuilder seq = new StringBuilder(); seq.append(ec.getEscapeCharacter()); seq.append(codes[i]); seq.append(ec.getEscapeCharacter()); encodings[i] = seq.toString(); } // Escaping of truncation # is not implemented yet. It may only be escaped if it is the first character that // exceeds the conformance length of the component (ch 2.5.5.2). As of now, this information is not // available at this place. encodings[5] = "#"; encodings[6] = "\\X000d\\"; } }
EncLookup(EncodingCharacters ec) { characters[0] = ec.getFieldSeparator(); characters[1] = ec.getComponentSeparator(); characters[2] = ec.getSubcomponentSeparator(); characters[3] = ec.getRepetitionSeparator(); characters[4] = ec.getEscapeCharacter(); characters[5] = ec.getTruncationCharacter(); characters[6] = '\r'; char[] codes = {'F', 'S', 'T', 'R', 'E', 'L'}; for (int i = 0; i < codes.length; i++) { StringBuilder seq = new StringBuilder(); seq.append(ec.getEscapeCharacter()); seq.append(codes[i]); seq.append(ec.getEscapeCharacter()); encodings[i] = seq.toString(); } // Escaping of truncation # is not implemented yet. It may only be escaped if it is the first character that // exceeds the conformance length of the component (ch 2.5.5.2). As of now, this information is not // available at this place. encodings[5] = "#"; encodings[6] = "\\X000d\\"; } }
/** @see java.lang.Object#hashCode */ public int hashCode() { return 7 * (int) this.getComponentSeparator() * (int) this.getEscapeCharacter() * (int) this.getFieldSeparator() * (int) this.getRepetitionSeparator() * (int) this.getSubcomponentSeparator() * (int) this.getTruncationCharacter(); }
/** @see java.lang.Object#hashCode */ public int hashCode() { return 7 * (int) this.getComponentSeparator() * (int) this.getEscapeCharacter() * (int) this.getFieldSeparator() * (int) this.getRepetitionSeparator() * (int) this.getSubcomponentSeparator() * (int) this.getTruncationCharacter(); }
result.append(fieldText); if (j < reps.length - 1) result.append(encodingChars.getRepetitionSeparator());
result.append(fieldText); if (j < reps.length - 1) result.append(encodingChars.getRepetitionSeparator());
/** @see java.lang.Object#equals */ public boolean equals(Object o) { if (o instanceof EncodingCharacters) { EncodingCharacters other = (EncodingCharacters) o; return (this.getFieldSeparator() == other.getFieldSeparator() && this.getComponentSeparator() == other.getComponentSeparator() && this.getEscapeCharacter() == other.getEscapeCharacter() && this.getRepetitionSeparator() == other.getRepetitionSeparator() && this.getSubcomponentSeparator() == other.getSubcomponentSeparator() && this.getTruncationCharacter() == other.getTruncationCharacter()); } else { return false; } }
/** @see java.lang.Object#equals */ public boolean equals(Object o) { if (o instanceof EncodingCharacters) { EncodingCharacters other = (EncodingCharacters) o; return (this.getFieldSeparator() == other.getFieldSeparator() && this.getComponentSeparator() == other.getComponentSeparator() && this.getEscapeCharacter() == other.getEscapeCharacter() && this.getRepetitionSeparator() == other.getRepetitionSeparator() && this.getSubcomponentSeparator() == other.getSubcomponentSeparator() && this.getTruncationCharacter() == other.getTruncationCharacter()); } else { return false; } }
String[] reps = split(fields[i], String.valueOf(encodingChars.getRepetitionSeparator())); log.debug("{} reps delimited by: {}", reps.length, encodingChars.getRepetitionSeparator());
String[] reps = split(fields[i], String.valueOf(encodingChars.getRepetitionSeparator())); log.debug("{} reps delimited by: {}", reps.length, encodingChars.getRepetitionSeparator());
result.append(fieldText); if (j < reps.length - 1) result.append(encodingChars.getRepetitionSeparator());
result.append(fieldText); if (j < reps.length - 1) result.append(encodingChars.getRepetitionSeparator());
/** copies contents of "other" */ public EncodingCharacters(EncodingCharacters other) { this.fieldSep = other.getFieldSeparator(); this.encChars = new char[5]; setComponentSeparator(other.getComponentSeparator()); setRepetitionSeparator(other.getRepetitionSeparator()); setEscapeCharacter(other.getEscapeCharacter()); setSubcomponentSeparator(other.getSubcomponentSeparator()); setTruncationCharacter(other.getTruncationCharacter()); }
/** copies contents of "other" */ public EncodingCharacters(EncodingCharacters other) { this.fieldSep = other.getFieldSeparator(); this.encChars = new char[5]; setComponentSeparator(other.getComponentSeparator()); setRepetitionSeparator(other.getRepetitionSeparator()); setEscapeCharacter(other.getEscapeCharacter()); setSubcomponentSeparator(other.getSubcomponentSeparator()); setTruncationCharacter(other.getTruncationCharacter()); }
String[] reps = split(fields[i], String.valueOf(encodingChars.getRepetitionSeparator()));
String[] reps = split(fields[i], String.valueOf(encodingChars.getRepetitionSeparator()));