com.sas.graphics.components
Class ClassificationVariableList

com.sas.graphics.components.ClassificationVariableList

public class ClassificationVariableList

ClassificationVariableLists are used to form an ordered list of ClassificationVariables. Graphs support multiple data column associations on some of their variable roles. For example graphs allow multiple data columns to be associated with their Column and Row Variables via the graph's DataModel. Some graphs like the BarChart also support multiple data column associations on other graph variables roles (such as the ResponseVariable in this example) to enable better data comparisons.

Usage

You can chain ClassificationVariableList objects together via the "next" property.

Example

You can chain together the "Product" and "Region" data columns by doing one of the following:

 ClassificationVariableList myVariable1 = new ClassificationVariableList();
 myVariable1.setColumnName("Product");
 ClassificationVariableList myVariable2 = new ClassificationVariableList();
 myVariable2.setColumnName("Region");

 

As a convenience the constructor supports constructing a list this same way as follows:

 myVariable = new ClassificationVariableList( new String[]{"Product","Region"});
 
Example as applicable to a BarChart
 BarChart barChart = new BarChart();
 TableModel tableModel = myTableModel();
 // <...set up tableModel...>
 BarChartTableDataModel barChartTableDataModel = new BarChartTableDataModel(tableModel);
 barChartTableDataModel.setColumnVariable(new ClassificationVariableList( new String[]{"Product","Region"}));
 barChart.setDataModel( barChartTableDataModel );
 

Behavior

ClassificationVariableList acts as a simple linked list of ClassificationVariable objects.

Since:
SAS 9.1
See Also:
Variable, VariableList, ClassificationVariable, AnalysisVariable, AnalysisVariableList

Constructor Summary
ClassificationVariableList(ClassificationVariable[] variableArray)
          Construct a list of VariableList objects whose properties and order are defined by the Variables in the array.
ClassificationVariableList(int columnIndex, java.lang.String format, java.lang.String informat, java.lang.String label, int sort, ClassificationVariableList next)
          Constructor designating data column by index.
ClassificationVariableList(java.lang.String[] columnNames)
          Construct a list of VariableList objects designated by column name in the order provided.
ClassificationVariableList(java.lang.String columnName, java.lang.String format, java.lang.String informat, java.lang.String label, int sort, ClassificationVariableList next)
          Constructor designating data column by name.
 
Method Summary
 ClassificationVariable[] asArray()
          Provides a conversion into a Variable array.
 java.util.ArrayList asArrayList()
          Provides a conversion into an ArrayList.
 boolean equals(java.lang.Object obj)
          Determines whether another object is equal to this ClassificationVariableList.
 ClassificationVariableList getNext()
          Returns the next ClassificationVariableList in the list.
 int hashCode()
          Computes the hash code for this ClassificationVariableList.
 java.util.Iterator iterator()
          Provides an iterator to the list.
 
Methods inherited from class com.sas.graphics.components.ClassificationVariable
getSort
 
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

ClassificationVariableList

public ClassificationVariableList(java.lang.String columnName,
                                  java.lang.String format,
                                  java.lang.String informat,
                                  java.lang.String label,
                                  int sort,
                                  ClassificationVariableList next)
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
next - the next variable in the list

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

ClassificationVariableList

public ClassificationVariableList(int columnIndex,
                                  java.lang.String format,
                                  java.lang.String informat,
                                  java.lang.String label,
                                  int sort,
                                  ClassificationVariableList next)
Constructor designating data column by index.

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
next - the next variable in the list

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

ClassificationVariableList

public ClassificationVariableList(java.lang.String[] columnNames)
Construct a list of VariableList objects designated by column name in the order provided.

Parameters:
columnNames - the column names

ClassificationVariableList

public ClassificationVariableList(ClassificationVariable[] variableArray)
Construct a list of VariableList objects whose properties and order are defined by the Variables in the array.

Parameters:
variableArray - the array of variables
Method Detail

getNext

public ClassificationVariableList getNext()
Returns the next ClassificationVariableList in the list.

Returns:
the next classifcaiton variable list

asArray

public ClassificationVariable[] asArray()
Provides a conversion into a Variable array.


asArrayList

public java.util.ArrayList asArrayList()
Provides a conversion into an ArrayList. Please note that modifying the ArrayList will not have an affect on the graph but modifying the properties of the elements in the List will.

See Also:
ArrayList

iterator

public java.util.Iterator iterator()
Provides an iterator to the list. Note: Since the VariableList class is immutable the remove method will not have any affect on the list.


equals

public boolean equals(java.lang.Object obj)
Determines whether another object is equal to this ClassificationVariableList.

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

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

hashCode

public int hashCode()
Computes the hash code for this ClassificationVariableList.

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



Copyright © 2009 SAS Institute Inc. All Rights Reserved.