def initialize (val, unchanging)
@unchanging = unchanging
@val = val
unless (unchanging)
s = val.size - 1
if (val =~ /[@^][<]{#{s},#{s}}/)
@formatter = LeftFormatter.new(val)
elsif (val =~ /[@^][>]{#{s},#{s}}/)
@formatter = RightFormatter.new(val)
elsif (val =~ /[@^][\|]{#{s},#{s}}/)
@formatter = CenterFormatter.new(val)
elsif (val =~ /[@^](#*)([\.]{0,1})(#*)([eEgG])(#+)/)
@formatter = ScientificNotationFormatter.new($1, $2, $3, $4, $5)
elsif (val =~ /[@^](#*)([\.]{0,1})(#*)/)
@formatter = NumberFormatter.new($1, $2, $3)
else
raise FormatException.new(), "Malformed format entry \"#{@val}\""
end
end
end