All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
|  | Components |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sas.graphics.components
Class ClassificationVariable

    com.sas.graphics.components.ClassificationVariable

Direct Known Subclasses:
  ClassificationVariableList

    public class ClassificationVariable

An ClassificationVariable is used by a graph when a sort order can be applied to the associated data values.

## Usage

Use a ClassificationVariable's sort parameter to cause a graph to sort the associated data values. The default sort is GraphConstants.SORT_NONE meaning that for non-continuous data the graph will order the values in the same order as they found in the data source.

A ClassificationVariable is typically used when assigning a data column to a graph variable role that can be categorized. All string variables inherently use a discrete categorization whereas numeric values can be categorized into discrete values or formatted into separate groupings.

Example

You can apply an ascending sort order to the BarCharts category values by:

     BarChart barChart = new BarChart();
     TableModel tableModel = myTableModel();
     // <...set up tableModel...>

     // create the graph's data model (contains a handle to the data source and
     // variables describing how to interpret the data)
     BarChartTableDataModel barChartTableDataModel = new BarChartTableDataModel(tableModel);

     // set the variable on the data model
     barChartTableDataModel.setCategoryVariable(categoryVariable);

     // set data model on the bar chart
     barChart.setDataModel( barChartTableDataModel );

## Behavior

ClassificationVariable provides a property to allow sort information to be associated with the data column specification. Note: Not all roles that use ClassificationVariable may support all sort types. See specific variable documentation on the graph data models for this info.

Since:
  SAS 9.1
See Also:
  `Variable`, `VariableList`, `ClassificationVariableList`, `AnalysisVariable`, `AnalysisVariableList`

Constructor Summary
`ClassificationVariable(ClassificationVariable cv)` Constructor for ClassificationVariable.
`ClassificationVariable(int columnIndex)` Constructor designating data column by index.
`ClassificationVariable(int columnIndex, java.lang.String format, java.lang.String informat, java.lang.String label, int sort)` Constructor designating data column by index along with the names of the SAS format and SAS informat and label to be applied.
`ClassificationVariable(int columnIndex, java.lang.String format, java.lang.String informat, java.lang.String label, int sort, com.sas.graphics.components.CategorizationModel categorizationModel, com.sas.graphics.components.SegmentedRangeStyle segmentedRangeStyle)` Constructor designating data column by index along with the names of the SAS format and SAS informat and label to be applied.
`ClassificationVariable(java.lang.String columnName)` Constructor designating data column by name.
`ClassificationVariable(java.lang.String columnName, int sort)` Constructor designating data column by name and defining a sort order.
`ClassificationVariable(java.lang.String columnName, java.lang.String format)` Constructor designating data column by name along with the name of the SAS format to be applied.
`ClassificationVariable(java.lang.String columnName, java.lang.String format, java.lang.String informat, java.lang.String label, int sort)` Constructor designating data column by name.
`ClassificationVariable(java.lang.String columnName, java.lang.String format, java.lang.String informat, java.lang.String label, int sort, com.sas.graphics.components.CategorizationModel categorizationModel, com.sas.graphics.components.SegmentedRangeStyle segmentedRangeStyle)` Constructor designating data column by name.

Method Summary
`boolean` | `equals(java.lang.Object obj)` Determines whether another object is equal to this `ClassificationVariable`.
`int` | `getSort()` Returns the type of sort order applied to the values in the data column designated by this variable.
`int` | `hashCode()` Computes the hash code for this `ClassificationVariable`.

Methods inherited from class com.sas.graphics.components.Variable
`getCategorizationModel, getColumnIndex, getColumnName, getFormat, getInformat, getLabel, getSegmentedRangeStyle`

Methods inherited from class com.sas.graphics.components.ModelBase
`addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, setContainedModel`

Constructor Detail

### ClassificationVariable

    public ClassificationVariable(java.lang.String columnName)

  Constructor designating data column by name.

  Parameters:
    `columnName` - the name identifying the data column

### ClassificationVariable

    public ClassificationVariable(java.lang.String columnName,
                                  int sort)

  Constructor designating data column by name and defining a sort order.

  Parameters:
    `columnName` - the name identifying the data column
    `sort` - the sort order

    Valid sort values are:

    - `GraphConstants.SORT_NONE`
    - `GraphConstants.SORT_ASCENDING`
    - `GraphConstants.SORT_DESCENDING`
    - `GraphConstants.SORT_ASCENDING_FORMATTED`
    - `GraphConstants.SORT_DESCENDING_FORMATTED`
    - `GraphConstants.SORT_ASCENDING_UNFORMATTED`
    - `GraphConstants.SORT_DESCENDING_UNFORMATTED`
  See Also:
    `GraphConstants`

### ClassificationVariable

    public ClassificationVariable(java.lang.String columnName,
                                  java.lang.String format)

  Constructor designating data column by name along with the name of the SAS format to be applied.

  Parameters:
    `columnName` - the name identifying the data column
    `format` - the name of the SAS format applied (by the graph) on the values found in this variable's data column

### ClassificationVariable

    public ClassificationVariable(java.lang.String columnName,
                                  java.lang.String format,
                                  java.lang.String informat,
                                  java.lang.String label,
                                  int sort)

  Constructor designating data column by name.

  Parameters:
    `columnName` - the name identifying the data column
    `format` - the name of the SAS format applied (by the graph) on the values found in this variable's data column
    `informat` - the name of the SAS informat applied (by the graph) on the values found in this variable's data column
    `label` - the label the chart will display via data tips, axis labels and legend labels (where applicable)
    `sort` - the sort order

    The supported informats are:

    - `DATE5. - "ddMMM"`
    - `DATE7. - "ddMMMyy"`
    - `DATE9. - "ddMMMyyyy"`
    - `DATETIME13. - "ddMMMyy:HH:mm"`
    - `DATETIME16. - "ddMMMyy:HH:mm:ss"`
    - `DATETIME18. - "ddMMMyyyy:HH:mm:ss"`
    - `DATETIME20. - "ddMMMyy:HH:mm:ss.SSS"`
    - `DATETIME22. - "ddMMMyyyy:HH:mm:ss.SSS"`
    - `TIME5. - "HH:mm"`
    - `TIME8. - "HH:mm:ss""`
    - `TIME12. - "HH:mm:ss.SSS"`

    Valid sort values are:

    - `GraphConstants.SORT_NONE`
    - `GraphConstants.SORT_ASCENDING`
    - `GraphConstants.SORT_DESCENDING`
    - `GraphConstants.SORT_ASCENDING_FORMATTED`
    - `GraphConstants.SORT_DESCENDING_FORMATTED`
    - `GraphConstants.SORT_ASCENDING_UNFORMATTED`
    - `GraphConstants.SORT_DESCENDING_UNFORMATTED`
  See Also:
    `GraphConstants`

### ClassificationVariable

    public ClassificationVariable(java.lang.String columnName,
                                  java.lang.String format,
                                  java.lang.String informat,
                                  java.lang.String label,
                                  int sort,
                                  com.sas.graphics.components.CategorizationModel categorizationModel,
                                  com.sas.graphics.components.SegmentedRangeStyle segmentedRangeStyle)

  Constructor designating data column by name.

  Parameters:
    `columnName` - the name identifying the data column
    `format` - the name of the SAS format applied (by the graph) on the values found in this variable's data column
    `informat` - the name of the SAS informat applied (by the graph) on the values found in this variable's data column
    `label` - the label the chart will display via data tips, axis labels and legend labels (where applicable)
    `sort` - the sort order

    The supported informats are:

    - `DATE5. - "ddMMM"`
    - `DATE7. - "ddMMMyy"`
    - `DATE9. - "ddMMMyyyy"`
    - `DATETIME13. - "ddMMMyy:HH:mm"`
    - `DATETIME16. - "ddMMMyy:HH:mm:ss"`
    - `DATETIME18. - "ddMMMyyyy:HH:mm:ss"`
    - `DATETIME20. - "ddMMMyy:HH:mm:ss.SSS"`
    - `DATETIME22. - "ddMMMyyyy:HH:mm:ss.SSS"`
    - `TIME5. - "HH:mm"`
    - `TIME8. - "HH:mm:ss""`
    - `TIME12. - "HH:mm:ss.SSS"`

    Valid sort values are:

    - `GraphConstants.SORT_NONE`
    - `GraphConstants.SORT_ASCENDING`
    - `GraphConstants.SORT_DESCENDING`
    - `GraphConstants.SORT_ASCENDING_FORMATTED`
    - `GraphConstants.SORT_DESCENDING_FORMATTED`
    - `GraphConstants.SORT_ASCENDING_UNFORMATTED`
    - `GraphConstants.SORT_DESCENDING_UNFORMATTED`
  See Also:
    `GraphConstants`

### ClassificationVariable

    public ClassificationVariable(int columnIndex)

  Constructor designating data column by index.

  Parameters:
    `columnIndex` - the index identifying the data column

### ClassificationVariable

    public ClassificationVariable(int columnIndex,
                                  java.lang.String format,
                                  java.lang.String informat,
                                  java.lang.String label,
                                  int sort)

  Constructor designating data column by index along with the names of the SAS format and SAS informat and label to be applied.

  Parameters:
    `columnIndex` - the index identifying the data column
    `format` - the name of the SAS format applied (by the graph) on the values found in this variable's data column
    `informat` - the name of the SAS informat applied (by the graph) on the values found in this variable's data column
    `label` - the label the chart will display via data tips, axis labels and legend labels (where applicable)
    `sort` - the sort order

    The supported informats are:

    - `DATE5. - "ddMMM"`
    - `DATE7. - "ddMMMyy"`
    - `DATE9. - "ddMMMyyyy"`
    - `DATETIME13. - "ddMMMyy:HH:mm"`
    - `DATETIME16. - "ddMMMyy:HH:mm:ss"`
    - `DATETIME18. - "ddMMMyyyy:HH:mm:ss"`
    - `DATETIME20. - "ddMMMyy:HH:mm:ss.SSS"`
    - `DATETIME22. - "ddMMMyyyy:HH:mm:ss.SSS"`
    - `TIME5. - "HH:mm"`
    - `TIME8. - "HH:mm:ss""`
    - `TIME12. - "HH:mm:ss.SSS"`

    Valid sort values are:

    - `GraphConstants.SORT_NONE`
    - `GraphConstants.SORT_ASCENDING`
    - `GraphConstants.SORT_DESCENDING`
    - `GraphConstants.SORT_ASCENDING_FORMATTED`
    - `GraphConstants.SORT_DESCENDING_FORMATTED`
    - `GraphConstants.SORT_ASCENDING_UNFORMATTED`
    - `GraphConstants.SORT_DESCENDING_UNFORMATTED`
  See Also:
    `GraphConstants`

### ClassificationVariable

    public ClassificationVariable(int columnIndex,
                                  java.lang.String format,
                                  java.lang.String informat,
                                  java.lang.String label,
                                  int sort,
                                  com.sas.graphics.components.CategorizationModel categorizationModel,
                                  com.sas.graphics.components.SegmentedRangeStyle segmentedRangeStyle)

  Constructor designating data column by index along with the names of the SAS format and SAS informat and label to be applied.

  Parameters:
    `columnIndex` - the index identifying the data column
    `format` - the name of the SAS format applied (by the graph) on the values found in this variable's data column
    `informat` - the name of the SAS informat applied (by the graph) on the values found in this variable's data column
    `label` - the label the chart will display via data tips, axis labels and legend labels (where applicable)
    `sort` - the sort order

    The supported informats are:

    - `DATE5. - "ddMMM"`
    - `DATE7. - "ddMMMyy"`
    - `DATE9. - "ddMMMyyyy"`
    - `DATETIME13. - "ddMMMyy:HH:mm"`
    - `DATETIME16. - "ddMMMyy:HH:mm:ss"`
    - `DATETIME18. - "ddMMMyyyy:HH:mm:ss"`
    - `DATETIME20. - "ddMMMyy:HH:mm:ss.SSS"`
    - `DATETIME22. - "ddMMMyyyy:HH:mm:ss.SSS"`
    - `TIME5. - "HH:mm"`
    - `TIME8. - "HH:mm:ss""`
    - `TIME12. - "HH:mm:ss.SSS"`

    Valid sort values are:

    - `GraphConstants.SORT_NONE`
    - `GraphConstants.SORT_ASCENDING`
    - `GraphConstants.SORT_DESCENDING`
    - `GraphConstants.SORT_ASCENDING_FORMATTED`
    - `GraphConstants.SORT_DESCENDING_FORMATTED`
    - `GraphConstants.SORT_ASCENDING_UNFORMATTED`
    - `GraphConstants.SORT_DESCENDING_UNFORMATTED`
  See Also:
    `GraphConstants`

### ClassificationVariable

    public ClassificationVariable(ClassificationVariable cv)

  Constructor for ClassificationVariable.

  Parameters:
    `cv` -

Method Detail

### getSort

    public int getSort()

  Returns the type of sort order applied to the values in the data column designated by this variable.
  Valid returned sort values are:

  - `GraphConstants.SORT_NONE`
  - `GraphConstants.SORT_ASCENDING`
  - `GraphConstants.SORT_DESCENDING`
  - `GraphConstants.SORT_ASCENDING_FORMATTED`
  - `GraphConstants.SORT_DESCENDING_FORMATTED`
  - `GraphConstants.SORT_ASCENDING_UNFORMATTED`
  - `GraphConstants.SORT_DESCENDING_UNFORMATTED`

  Returns:
    sort order applied to the values in the data column.
  See Also:
    `GraphConstants`

### equals

    public boolean equals(java.lang.Object obj)

  Determines whether another object is equal to this `ClassificationVariable`.

  The result is `true` if and only if the argument is not `null` and is a `ClassificationVariable` object that has the same property values as this object.

  Overrides:
    `equals` in class `Variable`
  Parameters:
    `obj` - the object to test for equality with this `ClassificationVariable`
  Returns:
    `true` if the objects are the same; `false` otherwise.

### hashCode

    public int hashCode()

  Computes the hash code for this `ClassificationVariable`.

  Overrides:
    `hashCode` in class `Variable`
  Returns:
    a hash code value for this object.

All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
|  | Components |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 SAS Institute Inc. All Rights Reserved.