@Test @Category(UnitTest.class) public void testEquals() throws ColorScale.ColorScaleException { String xml = "<ColorMap name=\"Grayscale\">"; xml += "<Scaling>MinMax</Scaling>"; xml += "<Interpolate>1</Interpolate>"; xml += "<ForceValuesIntoRange>0</ForceValuesIntoRange>"; xml += "<NullColor color=\"0,0,0\" opacity=\"0\"/>"; xml += "<Color value=\"0.0\" color=\"0,0,0\" opacity=\"255\"/>"; xml += "<Color value=\"1.0\" color=\"255,255,255\"/>"; xml += "</ColorMap>"; InputStream is = new ByteArrayInputStream(xml.getBytes()); ColorScale csXml = ColorScale.loadFromXML(is); String json = "{\"Scaling\":\"MinMax\",\"Interpolate\":\"1\",\"ForceValuesIntoRange\":\"0\",\"NullColor\":{\"color\":\"0,0,0\",\"opacity\":\"0\"},\"Colors\":[{\"color\":\"0,0,0\",\"opacity\":\"255\",\"value\":\"0.0\"},{\"color\":\"255,255,255\",\"opacity\":\"255\",\"value\":\"1.0\"}]}"; ColorScale csJson = ColorScale.loadFromJSON(json); Assert.assertTrue(csXml.equals(csJson)); }
@Override public boolean equals(Object obj) { return obj instanceof ColorScale && equals((ColorScale) obj); }
ColorScale extends TreeMap<Double, Color> { @Override public boolean equals(Object obj) { return obj instanceof ColorScale && equals((ColorScale) obj); } }
ColorScale extends TreeMap<Double, Color> { @Override public boolean equals(Object obj) { return obj instanceof ColorScale && equals((ColorScale) obj); } private  ColorScale(); }
ColorScale extends TreeMap<Double, Color> { @Override public boolean equals(Object obj) { return obj instanceof ColorScale && equals((ColorScale) obj); } private  ColorScale(); static ColorScale loadFromXML(InputStream stream); static ColorScale loadFromJSON(String json); static ColorScale empty(); synchronized static ColorScale createDefault(); synchronized static ColorScale createDefaultGrayScale(); synchronized static void setDefault(ColorScale colorScale); String getName(); void setName(String name); String getTitle(); String getDescription(); @Override void clear(); @Override Object clone(); @Override boolean equals(Object obj); @Override int hashCode(); boolean equals(ColorScale cs); boolean getForceValuesIntoRange(); void setForceValuesIntoRange(boolean i); boolean getInterpolate(); void setInterpolate(boolean i); Double getMax(); Double getMin(); Double getScaleMax(); Double getScaleMin(); int[] getNodataColor(); void setNodataColor(int[] color); Scaling getScaling(); void setScaling(Scaling s); double getTransparentValue(); void setTransparentValue(double transparent); void fromXML(Document doc); void fromXML(InputStream strm); void fromJSON(InputStream stream); @SuppressFBWarnings(value = "SIC_INNER_SHOULD_BE_STATIC_ANON", justification = "TypeReference<> is for Jackson") void fromJSON(String json); final int[] lookup(double v); final void lookup(double v, int[] color); final void lookup(double v, int[] colors, int offset); final int[] lookupRGB(double v); final void lookupRGB(double v, int[] color); final void lookupRGB(double v, int[] colors, int offset); void put(double key, Color c); void put(double key, int r, int g, int b); void put(double key, int r, int g, int b, int a); void put(double key, int[] c); void setDefaultGrayScaleValues(); void setDefaultValues(); void setScaleRange(double min, double max); void setScaleRangeWithQuantiles(double min, double max, double[] quantiles); }
ColorScale extends TreeMap<Double, Color> { @Override public boolean equals(Object obj) { return obj instanceof ColorScale && equals((ColorScale) obj); } private  ColorScale(); static ColorScale loadFromXML(InputStream stream); static ColorScale loadFromJSON(String json); static ColorScale empty(); synchronized static ColorScale createDefault(); synchronized static ColorScale createDefaultGrayScale(); synchronized static void setDefault(ColorScale colorScale); String getName(); void setName(String name); String getTitle(); String getDescription(); @Override void clear(); @Override Object clone(); @Override boolean equals(Object obj); @Override int hashCode(); boolean equals(ColorScale cs); boolean getForceValuesIntoRange(); void setForceValuesIntoRange(boolean i); boolean getInterpolate(); void setInterpolate(boolean i); Double getMax(); Double getMin(); Double getScaleMax(); Double getScaleMin(); int[] getNodataColor(); void setNodataColor(int[] color); Scaling getScaling(); void setScaling(Scaling s); double getTransparentValue(); void setTransparentValue(double transparent); void fromXML(Document doc); void fromXML(InputStream strm); void fromJSON(InputStream stream); @SuppressFBWarnings(value = "SIC_INNER_SHOULD_BE_STATIC_ANON", justification = "TypeReference<> is for Jackson") void fromJSON(String json); final int[] lookup(double v); final void lookup(double v, int[] color); final void lookup(double v, int[] colors, int offset); final int[] lookupRGB(double v); final void lookupRGB(double v, int[] color); final void lookupRGB(double v, int[] colors, int offset); void put(double key, Color c); void put(double key, int r, int g, int b); void put(double key, int r, int g, int b, int a); void put(double key, int[] c); void setDefaultGrayScaleValues(); void setDefaultValues(); void setScaleRange(double min, double max); void setScaleRangeWithQuantiles(double min, double max, double[] quantiles);  }