Subversion Repository Public Repository

litesoft

Diff Revisions 949 vs 950 for /trunk/Java/core/Anywhere/src/org/litesoft/bo/attributes/DisplayLength.java

Diff revisions: vs.
  @@ -1,55 +1,55 @@
1 - // This Source Code is in the Public Domain per: http://unlicense.org
2 - package org.litesoft.bo.attributes;
3 -
4 - import java.util.*;
5 -
6 - public class DisplayLength implements PropertyOfAMD {
7 - public static DisplayLength of( int pLength ) {
8 - return pLength >= 1 ? getInstance( pLength ) : null;
9 - }
10 -
11 - public static Integer get( AttributeMetaData pAMD ) {
12 - PropertyOfAMD zProperty = pAMD.getProperties().get( MAP_KEY );
13 - if ( zProperty != null ) {
14 - return ((DisplayLength) zProperty).mValue;
15 - }
16 - return null;
17 - }
18 -
19 - private static synchronized DisplayLength getInstance( int pLength ) {
20 - DisplayLength zInstance = sInstances.get( pLength );
21 - if ( zInstance == null ) {
22 - sInstances.put( pLength, zInstance = new DisplayLength( pLength ) );
23 - }
24 - return zInstance;
25 - }
26 -
27 - private static HashMap<Integer, DisplayLength> sInstances = new HashMap<Integer, DisplayLength>();
28 -
29 - private static final String MAP_KEY = "DisplayLength";
30 -
31 - private DisplayLength( int pValue ) {
32 - mValue = pValue;
33 - }
34 -
35 - private int mValue;
36 -
37 - @Override
38 - public String toString() {
39 - return MAP_KEY + ".of( " + mValue + ")";
40 - }
41 -
42 - public String getMapKey() {
43 - return MAP_KEY;
44 - }
45 -
46 - @Override
47 - public boolean equals( Object them ) {
48 - return (this == them) || ((them != null) && (this.getClass() == them.getClass()) && (this.mValue == ((DisplayLength) them).mValue));
49 - }
50 -
51 - @Override
52 - public int hashCode() {
53 - return mValue;
54 - }
55 - }
1 + // This Source Code is in the Public Domain per: http://unlicense.org
2 + package org.litesoft.bo.attributes;
3 +
4 + import java.util.*;
5 +
6 + public class DisplayLength implements PropertyOfAMD {
7 + public static DisplayLength of( int pLength ) {
8 + return pLength >= 1 ? getInstance( pLength ) : null;
9 + }
10 +
11 + public static Integer get( AttributeMetaData pAMD ) {
12 + PropertyOfAMD zProperty = pAMD.getProperties().get( MAP_KEY );
13 + if ( zProperty != null ) {
14 + return ((DisplayLength) zProperty).mValue;
15 + }
16 + return null;
17 + }
18 +
19 + private static synchronized DisplayLength getInstance( int pLength ) {
20 + DisplayLength zInstance = sInstances.get( pLength );
21 + if ( zInstance == null ) {
22 + sInstances.put( pLength, zInstance = new DisplayLength( pLength ) );
23 + }
24 + return zInstance;
25 + }
26 +
27 + private static HashMap<Integer, DisplayLength> sInstances = new HashMap<Integer, DisplayLength>();
28 +
29 + private static final String MAP_KEY = "DisplayLength";
30 +
31 + private DisplayLength( int pValue ) {
32 + mValue = pValue;
33 + }
34 +
35 + private int mValue;
36 +
37 + @Override
38 + public String toString() {
39 + return MAP_KEY + ".of( " + mValue + ")";
40 + }
41 +
42 + public String getMapKey() {
43 + return MAP_KEY;
44 + }
45 +
46 + @Override
47 + public boolean equals( Object them ) {
48 + return (this == them) || ((them != null) && (this.getClass() == them.getClass()) && (this.mValue == ((DisplayLength) them).mValue));
49 + }
50 +
51 + @Override
52 + public int hashCode() {
53 + return mValue;
54 + }
55 + }