01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2005-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library 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 GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.brewer.color;
17:
18: /**
19: * DOCUMENT ME!
20: *
21: * @author James Macgill
22: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/brewer/src/main/java/org/geotools/brewer/color/SampleScheme.java $
23: */
24: public class SampleScheme {
25: int[][] sampleScheme = new int[15][];
26: int minCount = -1;
27: int maxCount = -1;
28:
29: /**
30: * Creates a new instance of SampleScheme
31: */
32: public SampleScheme() {
33: }
34:
35: /**
36: * Indexed getter for property sampleScheme.
37: *
38: * @param length Index of the property.
39: *
40: * @return Value of the property at <CODE>index</CODE>.
41: */
42: public int[] getSampleScheme(int length) {
43: return this .sampleScheme[length - 2];
44: }
45:
46: /**
47: * Indexed setter for property sampleScheme.
48: *
49: * @param length Index of the property.
50: * @param sampleScheme New value of the property at <CODE>index</CODE>.
51: */
52: public void setSampleScheme(int length, int[] sampleScheme) {
53: this .sampleScheme[length - 2] = sampleScheme;
54:
55: if ((minCount == -1) || (minCount > length)) {
56: minCount = length;
57: }
58:
59: if ((maxCount == -1) || (maxCount < length)) {
60: maxCount = length;
61: }
62: }
63:
64: /**
65: * Getter for the min colour count
66: *
67: * @return the smallest number of colours we have a scheme for
68: */
69: public int getMinCount() {
70: return minCount;
71: }
72:
73: /**
74: * Getter for the max colour count
75: *
76: * @return the largest number of colours we have a scheme for
77: */
78: public int getMaxCount() {
79: return maxCount;
80: }
81: }
|