Пример #1
0
 /// <summary>
 /// Return true if the receiver wants a <code>Format.Field</code> value and
 /// <code>attribute</code> is equal to it, or true if the receiver
 /// represents an inteter constant and <code>field</code> equals it.
 /// </summary>
 private bool MatchesField(Format.Field attribute, int field)
 {
     if (this.Attribute != null)
     {
         return(this.Attribute.Equals(attribute));
     }
     return(field == this.Field_Renamed);
 }
Пример #2
0
 /// <summary>
 /// Return true if the receiver wants a <code>Format.Field</code> value and
 /// <code>attribute</code> is equal to it.
 /// </summary>
 private bool MatchesField(Format.Field attribute)
 {
     if (this.Attribute != null)
     {
         return(this.Attribute.Equals(attribute));
     }
     return(false);
 }
Пример #3
0
 public virtual void Formatted(int fieldID, Format.Field attr, Object value, int start, int end, StringBuffer buffer)
 {
     if (!EncounteredField && outerInstance.MatchesField(attr, fieldID))
     {
         outerInstance.BeginIndex = start;
         outerInstance.EndIndex   = end;
         EncounteredField         = (start != end);
     }
 }
 public virtual void Formatted(int fieldID, Format.Field attr, Object value, int start, int end, StringBuffer buffer)
 {
 }
Пример #5
0
 /// <summary>
 /// Constructs a new FieldPosition on the specified Field attribute and field
 /// id.
 /// </summary>
 ///
 /// <param name="attribute">the field attribute to identify</param>
 /// <param name="field">the field to identify</param>
 public FieldPosition(Format.Field attribute, int field)
 {
     myAttribute = attribute;
     myField     = field;
 }
Пример #6
0
 /// <summary>
 /// Constructs a new FieldPosition on the specified Field attribute.
 /// </summary>
 ///
 /// <param name="attribute">the field attribute to identify</param>
 public FieldPosition(Format.Field attribute)
 {
     myAttribute = attribute;
     myField     = -1;
 }
Пример #7
0
 /// <summary>
 /// Creates a <code>FieldPosition</code> object for the given field.
 /// The field is identified by an attribute constant from one of the
 /// <code>Field</code> subclasses as well as an integer field ID
 /// defined by the <code>Format</code> subclasses. <code>Format</code>
 /// subclasses that are aware of <code>Field</code> should give precedence
 /// to <code>attribute</code> and ignore <code>fieldID</code> if
 /// <code>attribute</code> is not null. However, older <code>Format</code>
 /// subclasses may not be aware of <code>Field</code> and rely on
 /// <code>fieldID</code>. If the field has no corresponding integer
 /// constant, <code>fieldID</code> should be -1.
 /// </summary>
 /// <param name="attribute"> Format.Field constant identifying a field </param>
 /// <param name="fieldID"> integer constant identifying a field
 /// @since 1.4 </param>
 public FieldPosition(Format.Field attribute, int fieldID)
 {
     this.Attribute     = attribute;
     this.Field_Renamed = fieldID;
 }
Пример #8
0
 /// <summary>
 /// Creates a FieldPosition object for the given field constant. Fields are
 /// identified by constants defined in the various <code>Format</code>
 /// subclasses. This is equivalent to calling
 /// <code>new FieldPosition(attribute, -1)</code>.
 /// </summary>
 /// <param name="attribute"> Format.Field constant identifying a field
 /// @since 1.4 </param>
 public FieldPosition(Format.Field attribute) : this(attribute, -1)
 {
 }