cds.simbad
Class MFormat

java.lang.Object
  extended bycds.simbad.MFormat
All Implemented Interfaces:
java.io.Serializable

public class MFormat
extends java.lang.Object
implements java.io.Serializable

This class manages the compiled version of a measurement description format. It contains an array of format elements which must be applied sequencely on a string array to build the formatted string.

See Also:
CFormatElement, Serialized Form

Field Summary
(package private)  MFormatElement[] flist
           
(package private)  java.lang.String format
           
(package private)  int nbpercentelements
           
 
Constructor Summary
MFormat(java.lang.String format)
          Creates a format object from a string.
 
Method Summary
 java.lang.String format(java.lang.String[] data)
          Build the formatted string from the elements array, using this format
 int getNumberOfFormatElements()
          Gets the number of format elements (%... items)
static void main(java.lang.String[] args)
          test programme
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

flist

MFormatElement[] flist

nbpercentelements

int nbpercentelements

format

java.lang.String format
Constructor Detail

MFormat

public MFormat(java.lang.String format)
Creates a format object from a string. It can be seen as a compiled format, accelerationg its further usage.

Parameters:
format - the format string.
Method Detail

format

public java.lang.String format(java.lang.String[] data)
Build the formatted string from the elements array, using this format

Parameters:
data - string elements to format
Returns:
the formatted string

getNumberOfFormatElements

public int getNumberOfFormatElements()
Gets the number of format elements (%... items)

Returns:
number of format elements

main

public static void main(java.lang.String[] args)
test programme

Parameters:
args - command line parameters array