/** * Returns the name of the class followed by a "(", the name of the * attribute, and a ")". * * @return the string representing this instance. */ @Override public String toString() { return getClass().getName() + '(' + getName() + ')'; } }
private String getName(AttributedCharacterIterator.Attribute attribute) { Exception ex = null; if (getName != null) { try { return (String)getName.invoke(attribute, (Object[])null); } catch (IllegalAccessException e) { ex = e; } catch (InvocationTargetException e) { ex = e; } } String s = attribute.toString(); String className = attribute.getClass().getName(); if (s.startsWith(className)) { return s.substring(className.length()+1, s.length()-1); } ConversionException exception = new ConversionException("Cannot find name of attribute", ex); exception.add("attribute-type", className); throw exception; }
Attribute attr = entry.getKey(); Object val = entry.getValue(); if (attr.equals(java.text.DateFormat.Field.AM_PM)) { val = attr = Field.AM_PM; } else if (attr.equals(java.text.DateFormat.Field.DAY_OF_MONTH)) { val = attr = Field.DAY_OF_MONTH; } else if (attr.equals(java.text.DateFormat.Field.DAY_OF_WEEK)) { val = attr = Field.DAY_OF_WEEK ; } else if (attr.equals(java.text.DateFormat.Field.DAY_OF_WEEK_IN_MONTH)) { val = attr = Field.DAY_OF_WEEK_IN_MONTH ; } else if (attr.equals(java.text.DateFormat.Field.DAY_OF_YEAR)) { val = attr = Field.DAY_OF_YEAR; } else if (attr.equals(java.text.DateFormat.Field.ERA)) { val = attr = Field.ERA; } else if (attr.equals(java.text.DateFormat.Field.HOUR_OF_DAY0)) { val = attr = Field.HOUR_OF_DAY0; } else if (attr.equals(java.text.DateFormat.Field.HOUR_OF_DAY1)) { val = attr = Field.HOUR_OF_DAY1; } else if (attr.equals(java.text.DateFormat.Field.HOUR0)) { val = attr = Field.HOUR0; } else if (attr.equals(java.text.DateFormat.Field.HOUR1)) { val = attr = Field.HOUR1; } else if (attr.equals(java.text.DateFormat.Field.MILLISECOND)) { val = attr = Field.MILLISECOND; } else if (attr.equals(java.text.DateFormat.Field.MINUTE)) { val = attr = Field.MINUTE; } else if (attr.equals(java.text.DateFormat.Field.MONTH)) { val = attr = Field.MONTH; } else if (attr.equals(java.text.DateFormat.Field.SECOND)) {
Attribute attr = entry.getKey(); Object val = entry.getValue(); if (attr.equals(java.text.DateFormat.Field.AM_PM)) { val = attr = Field.AM_PM; } else if (attr.equals(java.text.DateFormat.Field.DAY_OF_MONTH)) { val = attr = Field.DAY_OF_MONTH; } else if (attr.equals(java.text.DateFormat.Field.DAY_OF_WEEK)) { val = attr = Field.DAY_OF_WEEK ; } else if (attr.equals(java.text.DateFormat.Field.DAY_OF_WEEK_IN_MONTH)) { val = attr = Field.DAY_OF_WEEK_IN_MONTH ; } else if (attr.equals(java.text.DateFormat.Field.DAY_OF_YEAR)) { val = attr = Field.DAY_OF_YEAR; } else if (attr.equals(java.text.DateFormat.Field.ERA)) { val = attr = Field.ERA; } else if (attr.equals(java.text.DateFormat.Field.HOUR_OF_DAY0)) { val = attr = Field.HOUR_OF_DAY0; } else if (attr.equals(java.text.DateFormat.Field.HOUR_OF_DAY1)) { val = attr = Field.HOUR_OF_DAY1; } else if (attr.equals(java.text.DateFormat.Field.HOUR0)) { val = attr = Field.HOUR0; } else if (attr.equals(java.text.DateFormat.Field.HOUR1)) { val = attr = Field.HOUR1; } else if (attr.equals(java.text.DateFormat.Field.MILLISECOND)) { val = attr = Field.MILLISECOND; } else if (attr.equals(java.text.DateFormat.Field.MINUTE)) { val = attr = Field.MINUTE; } else if (attr.equals(java.text.DateFormat.Field.MONTH)) { val = attr = Field.MONTH; } else if (attr.equals(java.text.DateFormat.Field.SECOND)) {
Attribute attr = entry.getKey(); Object val = entry.getValue(); if (attr.equals(java.text.MessageFormat.Field.ARGUMENT)) { val = attr = Field.ARGUMENT;
Attribute attr = entry.getKey(); Object val = entry.getValue(); if (attr.equals(java.text.MessageFormat.Field.ARGUMENT)) { val = attr = Field.ARGUMENT;
Attribute attr = entry.getKey(); Object val = entry.getValue(); if (attr.equals(java.text.NumberFormat.Field.CURRENCY)) { val = attr = Field.CURRENCY; } else if (attr.equals(java.text.NumberFormat.Field.DECIMAL_SEPARATOR)) { val = attr = Field.DECIMAL_SEPARATOR; } else if (attr.equals(java.text.NumberFormat.Field.EXPONENT)) { val = attr = Field.EXPONENT; } else if (attr.equals(java.text.NumberFormat.Field.EXPONENT_SIGN)) { val = attr = Field.EXPONENT_SIGN; } else if (attr.equals(java.text.NumberFormat.Field.EXPONENT_SYMBOL)) { val = attr = Field.EXPONENT_SYMBOL; } else if (attr.equals(java.text.NumberFormat.Field.FRACTION)) { val = attr = Field.FRACTION; } else if (attr.equals(java.text.NumberFormat.Field.GROUPING_SEPARATOR)) { val = attr = Field.GROUPING_SEPARATOR; } else if (attr.equals(java.text.NumberFormat.Field.INTEGER)) { val = attr = Field.INTEGER; } else if (attr.equals(java.text.NumberFormat.Field.PERCENT)) { val = attr = Field.PERCENT; } else if (attr.equals(java.text.NumberFormat.Field.PERMILLE)) { val = attr = Field.PERMILLE; } else if (attr.equals(java.text.NumberFormat.Field.SIGN)) { val = attr = Field.SIGN;
Attribute attr = entry.getKey(); Object val = entry.getValue(); if (attr.equals(java.text.NumberFormat.Field.CURRENCY)) { val = attr = Field.CURRENCY; } else if (attr.equals(java.text.NumberFormat.Field.DECIMAL_SEPARATOR)) { val = attr = Field.DECIMAL_SEPARATOR; } else if (attr.equals(java.text.NumberFormat.Field.EXPONENT)) { val = attr = Field.EXPONENT; } else if (attr.equals(java.text.NumberFormat.Field.EXPONENT_SIGN)) { val = attr = Field.EXPONENT_SIGN; } else if (attr.equals(java.text.NumberFormat.Field.EXPONENT_SYMBOL)) { val = attr = Field.EXPONENT_SYMBOL; } else if (attr.equals(java.text.NumberFormat.Field.FRACTION)) { val = attr = Field.FRACTION; } else if (attr.equals(java.text.NumberFormat.Field.GROUPING_SEPARATOR)) { val = attr = Field.GROUPING_SEPARATOR; } else if (attr.equals(java.text.NumberFormat.Field.INTEGER)) { val = attr = Field.INTEGER; } else if (attr.equals(java.text.NumberFormat.Field.PERCENT)) { val = attr = Field.PERCENT; } else if (attr.equals(java.text.NumberFormat.Field.PERMILLE)) { val = attr = Field.PERMILLE; } else if (attr.equals(java.text.NumberFormat.Field.SIGN)) { val = attr = Field.SIGN;
private String getName(AttributedCharacterIterator.Attribute attribute) { Exception ex = null; if (getName != null) { try { return (String)getName.invoke(attribute, (Object[])null); } catch (IllegalAccessException e) { ex = e; } catch (InvocationTargetException e) { ex = e; } } String s = attribute.toString(); String className = attribute.getClass().getName(); if (s.startsWith(className)) { return s.substring(className.length()+1, s.length()-1); } ConversionException exception = new ConversionException("Cannot find name of attribute", ex); exception.add("attribute-type", className); throw exception; }
private String getName(AttributedCharacterIterator.Attribute attribute) { Exception ex = null; if (getName != null) { try { return (String)getName.invoke(attribute, (Object[])null); } catch (IllegalAccessException e) { ex = e; } catch (InvocationTargetException e) { ex = e; } } String s = attribute.toString(); String className = attribute.getClass().getName(); if (s.startsWith(className)) { return s.substring(className.length()+1, s.length()-1); } ConversionException exception = new ConversionException("Cannot find name of attribute", ex); exception.add("attribute-type", className); throw exception; }
private String getName(final AttributedCharacterIterator.Attribute attribute) { Exception ex = null; if (getName != null) { try { return (String)getName.invoke(attribute); } catch (final IllegalAccessException e) { ex = e; } catch (final InvocationTargetException e) { ex = e; } } final String s = attribute.toString(); final String className = attribute.getClass().getName(); if (s.startsWith(className)) { return s.substring(className.length() + 1, s.length() - 1); } final ConversionException exception = new ConversionException("Cannot find name of attribute", ex); exception.add("attribute-type", className); throw exception; }
private String getName(AttributedCharacterIterator.Attribute attribute) { Exception ex = null; if (getName != null) { try { return (String)getName.invoke(attribute, (Object[])null); } catch (IllegalAccessException e) { ex = e; } catch (InvocationTargetException e) { ex = e; } } String s = attribute.toString(); String className = attribute.getClass().getName(); if (s.startsWith(className)) { return s.substring(className.length()+1, s.length()-1); } ConversionException exception = new ConversionException("Cannot find name of attribute", ex); exception.add("attribute-type", className); throw exception; }
private String getName(AttributedCharacterIterator.Attribute attribute) { Exception ex = null; if (getName != null) { try { return (String)getName.invoke(attribute, (Object[])null); } catch (IllegalAccessException e) { ex = e; } catch (InvocationTargetException e) { ex = e; } } String s = attribute.toString(); String className = attribute.getClass().getName(); if (s.startsWith(className)) { return s.substring(className.length()+1, s.length()-1); } throw new ConversionException("Cannot find name of attribute of type " + className, ex); }
public int hashCode() { return key.hashCode() ^ (value==null ? 0 : value.hashCode()); }
public int hashCode() { return key.hashCode() ^ (value==null ? 0 : value.hashCode()); }
/** * Resolves instances being deserialized to the predefined constants. */ protected Object readResolve() throws InvalidObjectException { if (this.getClass() != Attribute.class) { throw new InvalidObjectException("subclass didn't correctly implement readResolve"); } Attribute instance = (Attribute) instanceMap.get(getName()); if (instance != null) { return instance; } else { throw new InvalidObjectException("unknown attribute name"); } }
public int hashCode() { return key.hashCode() ^ (value==null ? 0 : value.hashCode()); }
@Override public int hashCode() { return key.hashCode() ^ (value==null ? 0 : value.hashCode()); }
public boolean equals(Object o) { if (!(o instanceof AttributeEntry)) { return false; } AttributeEntry other = (AttributeEntry) o; return other.key.equals(key) && (value == null ? other.value == null : other.value.equals(value)); }