public class

UniqueValueRenderer

extends Object
implements Renderer<V>
java.lang.Object
   ↳ com.esri.core.renderer.UniqueValueRenderer

Class Overview

A unique value renderer symbolizes groups of graphics that have matching attributes. This is most common with nominal, or string data. For example, you could use a unique value renderer to symbolize zoning designations: yellow for "Residential", purple for "Industrial", red for "Commercial", and so on. You can also use unique value renderers on numeric fields that are coded values, or on ordinal attributes such as "First", "Second", "Third", and so on. Typically features are rendered based on the unique values of one attribute field. However, up to three fields can be combined to generate a unique value.

Summary

Constants
String TYPE The Constant TYPE.
Public Constructors
UniqueValueRenderer()
Instantiates an empty UniqueValueRenderer object.
UniqueValueRenderer(JsonNode node)
Instantiates ClassBreak from a Json node object.
Public Methods
boolean addUniqueValue(UniqueValue uniqueValue)
Adds a unique value.
String getDefaultLabel()
Gets the default label.
Symbol getDefaultSymbol()
Gets the default symbol.
String getField1()
Gets the first attribute field.
String getField2()
Gets the second attribute field.
String getField3()
Gets the third attribute field.
String getFieldDelimiter()
Gets field delimiter.
Symbol getSymbol(Graphic graphic)
Returns the symbol of the unique value the graphic provided corresponds to.
List<UniqueValue> getUniqueValueInfos()
Gets a list of unique values.
boolean removeUniqueValue(UniqueValue uniqueValue)
Removes a unique value.
void setDefaultLabel(String defaultLabel)
Sets the default label.
void setDefaultSymbol(Symbol defaultSymbol)
Sets the default symbol.
void setField1(String field1)
Sets the first attribute field.
void setField2(String field2)
Sets the second attribute field.
void setField3(String field3)
Sets the third attribute field.
void setFieldDelimiter(String fieldDelimiter)
Sets field delimiter.
void setUniqueValueInfos(List<UniqueValue> uniqueValueInfos)
Sets unique values.
String toJson()
Converts into a JSON string.
FeatureType[] toTypes(Field[] fields, Geometry.Type type)
Creates templates out of the renderer.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.esri.core.renderer.Renderer

Constants

public static final String TYPE

The Constant TYPE.

Constant Value: "uniqueValue"

Public Constructors

public UniqueValueRenderer ()

Instantiates an empty UniqueValueRenderer object.

public UniqueValueRenderer (JsonNode node)

Instantiates ClassBreak from a Json node object.

Parameters
node the node
Throws
Exception the exception

Public Methods

public boolean addUniqueValue (UniqueValue uniqueValue)

Adds a unique value.

Parameters
uniqueValue the unique value to add.
Returns
  • true, if adds the unique value

public String getDefaultLabel ()

Gets the default label.

Returns
  • the default label.

public Symbol getDefaultSymbol ()

Gets the default symbol.

Returns
  • the default symbol used for unmatched values.

public String getField1 ()

Gets the first attribute field.

Returns
  • the name of the attribute field the renderer uses to match values against.

public String getField2 ()

Gets the second attribute field.

Returns
  • If needed, specifies an additional attribute field the renderer uses to match values.

public String getField3 ()

Gets the third attribute field.

Returns
  • If needed, specifies an additional attribute field the renderer uses to match values.

public String getFieldDelimiter ()

Gets field delimiter.

Returns
  • string inserted between the values if multiple attribute fields are specified

public Symbol getSymbol (Graphic graphic)

Returns the symbol of the unique value the graphic provided corresponds to.

Parameters
graphic the graphic to be symbolized
Returns
  • the symbol

public List<UniqueValue> getUniqueValueInfos ()

Gets a list of unique values.

Returns
  • the list of unique values.

public boolean removeUniqueValue (UniqueValue uniqueValue)

Removes a unique value.

Parameters
uniqueValue the unique value to remove.
Returns
  • true, if removes the unique value

public void setDefaultLabel (String defaultLabel)

Sets the default label.

Parameters
defaultLabel the default label to set.

public void setDefaultSymbol (Symbol defaultSymbol)

Sets the default symbol.

Parameters
defaultSymbol the default symbol used for unmatched values.

public void setField1 (String field1)

Sets the first attribute field.

Parameters
field1 the name of the attribute field the renderer uses to match values against.

public void setField2 (String field2)

Sets the second attribute field.

Parameters
field2 If needed, specifies an additional attribute field the renderer uses to match values.

public void setField3 (String field3)

Sets the third attribute field.

Parameters
field3 If needed, specifies an additional attribute field the renderer uses to match values.

public void setFieldDelimiter (String fieldDelimiter)

Sets field delimiter.

Parameters
fieldDelimiter string inserted between the values if multiple attribute fields are specified

public void setUniqueValueInfos (List<UniqueValue> uniqueValueInfos)

Sets unique values.

Parameters
uniqueValueInfos the unique value list

public String toJson ()

Converts into a JSON string.

Returns
  • a JSON string.
Throws
Exception the exception

public FeatureType[] toTypes (Field[] fields, Geometry.Type type)

Creates templates out of the renderer.

Parameters
fields the field types.
type the geometry type. The templates are defined on feature layers, the geometry type is defined on feature layers.
Returns
  • the feature type[]