com.ibm.icu.text
Class MessagePattern.Part

java.lang.Object
  extended by com.ibm.icu.text.MessagePattern.Part
Enclosing class:
MessagePattern

public static final class MessagePattern.Part
extends Object

A message pattern "part", representing a pattern parsing event. There is a part for the start and end of a message or argument, for quoting and escaping of and with ASCII apostrophes, and for syntax elements of "complex" arguments.

Status:
Draft ICU 4.8.

Nested Class Summary
static class MessagePattern.Part.Type
          Part type constants.
 
Method Summary
 boolean equals(Object other)
           
 MessagePattern.ArgType getArgType()
          Returns the argument type if this part is of type ARG_START or ARG_LIMIT, otherwise ArgType.NONE.
 int getIndex()
          Returns the pattern string index associated with this Part.
 int getLength()
          Returns the length of the pattern substring associated with this Part.
 int getLimit()
          Returns the pattern string limit (exclusive-end) index associated with this Part.
 MessagePattern.Part.Type getType()
          Returns the type of this part.
 int getValue()
          Returns a value associated with this part.
 int hashCode()
          
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getType

public MessagePattern.Part.Type getType()
Returns the type of this part.

Returns:
the part type.
Status:
Draft ICU 4.8.

getIndex

public int getIndex()
Returns the pattern string index associated with this Part.

Returns:
this part's pattern string index.
Status:
Draft ICU 4.8.

getLength

public int getLength()
Returns the length of the pattern substring associated with this Part. This is 0 for some parts.

Returns:
this part's pattern string index.
Status:
Draft ICU 4.8.

getLimit

public int getLimit()
Returns the pattern string limit (exclusive-end) index associated with this Part. Convenience method for getIndex()+getLength().

Returns:
this part's pattern string limit index, same as getIndex()+getLength().
Status:
Draft ICU 4.8.

getValue

public int getValue()
Returns a value associated with this part. See the documentation of each part type for details.

Returns:
the part value.
Status:
Draft ICU 4.8.

getArgType

public MessagePattern.ArgType getArgType()
Returns the argument type if this part is of type ARG_START or ARG_LIMIT, otherwise ArgType.NONE.

Returns:
the argument type for this part.
Status:
Draft ICU 4.8.

toString

public String toString()
Overrides:
toString in class Object
Returns:
a string representation of this part.
Status:
Draft ICU 4.8.

equals

public boolean equals(Object other)
Overrides:
equals in class Object
Parameters:
other - another object to compare with.
Returns:
true if this object is equivalent to the other one.
Status:
Draft ICU 4.8.

hashCode

public int hashCode()

Overrides:
hashCode in class Object
Status:
Draft ICU 4.8.


Copyright (c) 2011 IBM Corporation and others.