Javolution 6.0.0 java
javolution.util.Index.Decimal Class Reference
Inheritance diagram for javolution.util.Index.Decimal:
[legend]
Collaboration diagram for javolution.util.Index.Decimal:
[legend]

Public Member Functions

Appendable format (Index obj, Appendable dest) throws IOException
 
Index parse (CharSequence csq, Cursor cursor) throws IllegalArgumentException
 
parse (CharSequence csq) throws IllegalArgumentException
 
abstract Appendable format (T obj, Appendable dest) throws IOException
 
TextBuilder format (T obj, TextBuilder dest)
 
String format (T obj)
 

Detailed Description

Default text format for indices (decimal value representation).

Definition at line 49 of file Index.java.

Member Function Documentation

◆ format() [1/4]

Appendable javolution.util.Index.Decimal.format ( Index  obj,
Appendable  dest 
) throws IOException

Definition at line 52 of file Index.java.

52  {
53  return TypeFormat.format(obj.intValue(), dest);
54  }

References javolution.text.TypeFormat.format().

Here is the call graph for this function:

◆ format() [2/4]

String javolution.text.TextFormat< T >.format ( obj)
inherited

Convenience method to format the specified object to a String.

Parameters
objthe object to format.
Returns
the formatting result as a string.

Definition at line 121 of file TextFormat.java.

121  {
122  return this.format(obj, new TextBuilder()).toString();
123 
124  }

◆ format() [3/4]

abstract Appendable javolution.text.TextFormat< T >.format ( obj,
Appendable  dest 
) throws IOException
abstractinherited

Formats the specified object into an Appendable

Parameters
objthe object to format.
destthe appendable destination.
Returns
the specified Appendable.

Referenced by javolution.text.TextBuilder.append(), javolution.text.TextFormat< FastCollection<?> >.format(), and javolution.util.FastCollection< E >.Format.format().

Here is the caller graph for this function:

◆ format() [4/4]

TextBuilder javolution.text.TextFormat< T >.format ( obj,
TextBuilder  dest 
)
inherited

Convenience method to format the specified object to a TextBuilder; unlike the abstract format method, this method does not throw IOException.

Parameters
objthe object to format.
destthe appendable destination.
Returns
the specified TextBuilder.

Definition at line 106 of file TextFormat.java.

106  {
107  try {
108  this.format(obj, (Appendable) dest);
109  return dest;
110  } catch (IOException e) {
111  throw new Error(e); // Cannot happens.
112  }
113  }

◆ parse() [1/2]

T javolution.text.TextFormat< T >.parse ( CharSequence  csq) throws IllegalArgumentException
inherited

Convenience method to parse the whole character sequence; if there are unread extraneous characters after parsing then an exception is raised.

Parameters
csqthe CharSequence to parse from the first character to the last.
Exceptions
IllegalArgumentExceptionif the syntax of the specified character sequence is incorrect or if there are extraneous characters at the end not parsed.

Definition at line 89 of file TextFormat.java.

89  {
90  Cursor cursor = new Cursor();
91  T obj = parse(csq, cursor);
92  if (!cursor.atEnd(csq))
93  throw new IllegalArgumentException("Extraneous character(s) \""
94  + cursor.tail(csq) + "\"");
95  return obj;
96  }

◆ parse() [2/2]

Index javolution.util.Index.Decimal.parse ( CharSequence  csq,
Cursor  cursor 
) throws IllegalArgumentException

Reads a portion of the specified CharSequence from the specified cursor position to produce an object. If parsing succeeds, then the index of the cursor argument is updated to the index after the last character used.

Parameters
csqthe character sequence to parse.
cursorthe cursor holding the current parsing index.
Returns
the object parsed.
Exceptions
IllegalArgumentExceptionif the syntax of the specified character sequence is incorrect.
UnsupportedOperationExceptionif parsing is not supported.

Reimplemented from javolution.text.TextFormat< T >.

Definition at line 57 of file Index.java.

58  {
59  return Index.valueOf(TypeFormat.parseInt(csq, cursor));
60  }

References javolution.text.TypeFormat.parseInt(), and javolution.util.Index.valueOf().

Here is the call graph for this function:

The documentation for this class was generated from the following file:
javolution.text.TextFormat.parse
abstract T parse(CharSequence csq, Cursor cursor)
javolution.util.Index.Index
Index(int value)
Definition: Index.java:123
javolution.text.TextFormat.format
abstract Appendable format(T obj, Appendable dest)