Statistics
| Revision:

gvsig-tools / org.gvsig.tools / library / trunk / org.gvsig.tools / org.gvsig.tools.lib / src / main / java / org / gvsig / tools / dataTypes / CoercionContextDecimal.java @ 2208

History | View | Annotate | Download (2.46 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2020 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.dataTypes;
25

    
26
import java.math.MathContext;
27
import java.util.Locale;
28

    
29
/**
30
 *
31
 * @author jjdelcerro
32
 */
33
public interface CoercionContextDecimal extends CoercionContextLocale {
34

    
35
  public static CoercionContextDecimal create(Locale locale) {
36
    return new CoercionContextDecimalImpl(locale);
37
  }
38

    
39
  public static CoercionContextDecimal create(int precision, int scale) {
40
    return new CoercionContextDecimalImpl(precision,scale);
41
  }
42

    
43
  public static CoercionContextDecimal create(Locale locale, int precision, int scale) {
44
    return new CoercionContextDecimalImpl(locale, precision,scale);
45
  }
46

    
47
  public static CoercionContextDecimal create(Locale locale, int precision, int scale, int roundMode) {
48
    return new CoercionContextDecimalImpl(locale, precision,scale, roundMode);
49
  }
50

    
51
  /**
52
   * MathContext used to make a BigDecimal.
53
   * Should never return null.
54
   * if no has precision limit return MathContext.UNLIMITED.
55
   *
56
   * @return the MathContext
57
   */
58
  public MathContext getMathContext();
59

    
60
  /**
61
   * Total number of digits, decimals and integers, that you may have.
62
   * hasPrecision() return false if it has no limit.
63
   *
64
   * @return
65
   */
66
  public int precision();
67
  
68
  public boolean hasPrecision();
69

    
70
  /**
71
   * Number of decimal digits you can have.
72
   * hasScale() return to false if it has no limit.
73
   *
74
   * @return
75
   */
76
  public int scale();
77

    
78
  public boolean hasScale();
79
  
80
  /**
81
   * Return the round mode to use.
82
   *
83
   * @return the Round mode
84
   * @see RoundingMode
85
   */
86
  public int roundMode();
87
  
88
}