Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.interview
Class TreeQuestion

    java.lang.Object
      com.sun.interview.Question
          com.sun.interview.TreeQuestion

    public abstract class TreeQuestion

extends Question

A `question` to which the response is a set of selected nodes within a tree. The nodes are identified by their paths.

Nested Class Summary
`static interface` | `TreeQuestion.Model` An interface that provides the model for the tree whose nodes are selected by a TreeQuestion.

Field Summary
`protected java.lang.String[]` | `value` The current response for this question.

Fields inherited from class com.sun.interview.Question
`interview, key, tag`

Constructor Summary
`protected` | `TreeQuestion(Interview interview, java.lang.String tag, TreeQuestion.Model model)` Create a tree question with a nominated tag and tree model.

Method Summary
`void` | `clear()` Clear any response to this question, resetting the value back to its initial state.
`java.lang.String[]` | `getDefaultValue()` Get the default response for this question.
`TreeQuestion.Model` | `getModel()` Get the tree model to which the question's path values relate.
`java.lang.String` | `getStringValue()` Get the response to this question as a string.
`java.lang.String[]` | `getValue()` Get the current (default or latest) response to this question.
`java.lang.String[]` | `getValueOnPath()` Verify this question is on the current path, and if it is, return the current value.
`boolean` | `isValueAlwaysValid()` Check if the question always has a valid response.
`boolean` | `isValueValid()` Check if the question currently has a valid response.
`static java.lang.String` | `join(java.lang.String[] paths)`
`protected void` | `load(java.util.Map data)` Load the value for this question from a dictionary, using the tag as the key.
`protected void` | `save(java.util.Map data)` Save the value for this question in a dictionary, using the tag as the key.
`void` | `setDefaultValue(java.lang.String[] v)` Set the default response for this question, used by the clear method.
`void` | `setValue(java.lang.Object[] nodes)` Set the current response to this question.
`void` | `setValue(java.lang.String newValue)` Set the response to this question to the value represented by a string-valued argument.
`void` | `setValue(java.lang.String[] newValue)` Set the current response to this question.
`static java.lang.String[]` | `split(java.lang.String s)`
`static boolean` | `white(char c)`

Methods inherited from class com.sun.interview.Question
`addMarker, equals, export, getChecklistItems, getHelpID, getImage, getInterview, getKey, getNext, getResourceString, getResourceString, getSummary, getTag, getText, getTextArgs, hashCode, hasMarker, isEnabled, isHidden, reload, removeMarker, setHelpID, setImage, setImage, setSummary, setText`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### value

    protected java.lang.String[] value

  The current response for this question.

Constructor Detail

### TreeQuestion

    protected TreeQuestion(Interview interview,
                           java.lang.String tag,
                           TreeQuestion.Model model)

  Create a tree question with a nominated tag and tree model.

  Parameters:
    `interview` - The interview containing this question.
    `tag` - A unique tag to identify this specific question.
    `model` - The tree model to which the question's path values relate.

Method Detail

### getModel

    public TreeQuestion.Model getModel()

  Get the tree model to which the question's path values relate.

  Returns:
    the tree model to which the question's path values relate

### getDefaultValue

    public java.lang.String[] getDefaultValue()

  Get the default response for this question.

  Returns:
    the default response for this question.
  See Also:
    `setDefaultValue(java.lang.String[])`

### setDefaultValue

    public void setDefaultValue(java.lang.String[] v)

  Set the default response for this question, used by the clear method.

  Parameters:
    `v` - the default response for this question.
  See Also:
    `getDefaultValue()`

### getValue

    public java.lang.String[] getValue()

  Get the current (default or latest) response to this question. The strings should each represent valid paths to nodes within the tree represented by the tree model.

  Returns:
    the current value for this question
  See Also:
    `setValue(java.lang.String)`

### getValueOnPath

    public java.lang.String[] getValueOnPath()
                                      throws Interview.NotOnPathFault

  Verify this question is on the current path, and if it is, return the current value.

  Returns:
    the current value of this question
  Throws:
    `Interview.NotOnPathFault` - if this question is not on the current path
  See Also:
    `getValue()`

### setValue

    public void setValue(java.lang.String newValue)

  Description copied from class: `Question`
  Set the response to this question to the value represented by a string-valued argument. Subtypes of Question will typically have type-specific methods to set the value as well.

  Specified by:
    `setValue` in class `Question`
  Parameters:
    `newValue` - A string containing a value value appropriate for the particular type of question whose value is being set.
  See Also:
    `Question.getStringValue()`

### setValue

    public void setValue(java.lang.String[] newValue)

  Set the current response to this question.

  Parameters:
    `newValue` - a set of strings (or null if none), representing paths to nodes within the tree represented by the tree model
  See Also:
    `getValue()`

### setValue

    public void setValue(java.lang.Object[] nodes)

  Set the current response to this question. The response is set to the paths of a set of specified nodes within the tree represented by the tree model.

  Parameters:
    `nodes` - a set of nodes (or null if none) within the tree represented by the tree model, whose paths will be set as the current response to the question
  See Also:
    `getValue()`

### getStringValue

    public java.lang.String getStringValue()

  Description copied from class: `Question`
  Get the response to this question as a string.

  Specified by:
    `getStringValue` in class `Question`
  Returns:
    a string representing the current response to this question, or null.
  See Also:
    `Question.setValue(String)`

### isValueValid

    public boolean isValueValid()

  Description copied from class: `Question`
  Check if the question currently has a valid response.

  Specified by:
    `isValueValid` in class `Question`
  Returns:
    true if the question currently has a valid response, and false otherwise.

### isValueAlwaysValid

    public boolean isValueAlwaysValid()

  Description copied from class: `Question`
  Check if the question always has a valid response. This may be true, for example, for a choice question with a default response.

  Specified by:
    `isValueAlwaysValid` in class `Question`
  Returns:
    true if the question always has a valid response, and false otherwise.

### clear

    public void clear()

  Clear any response to this question, resetting the value back to its initial state.

  Specified by:
    `clear` in class `Question`

### load

    protected void load(java.util.Map data)

  Load the value for this question from a dictionary, using the tag as the key.

  Specified by:
    `load` in class `Question`
  Parameters:
    `data` - The map from which to load the value for this question.

### save

    protected void save(java.util.Map data)

  Save the value for this question in a dictionary, using the tag as the key.

  Specified by:
    `save` in class `Question`
  Parameters:
    `data` - The map in which to save the value for this question.

### split

    public static java.lang.String[] split(java.lang.String s)

### join

    public static java.lang.String join(java.lang.String[] paths)

### white

    public static boolean white(char c)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.