Definition: A Tic, which is short for characteristic, is a holder for any kind of object.  It retains a default value, the class of the object to be held, and a Map<Ticable, V> to keep track of the values for the Tic for each Ticable object.  There are a number of other variables which may, or may not, be used.  These include an index position which is useful for finding the source in a delimited String.  A name for the Tic, which is useful when the Tic must be loaded from a database.  The name can refer to the field name.  The name may also be used when creating GUI screens as it can be used as part of the key string to access I18N resources.  A prompt field may be used like the name, or it can be the actual GUI screen prompt label for an input field.  The elementType variable holds the class of the elements if the Tic holds a Collection.

Naturally there are getters and setters for all of the variables, however, they do not follow the JavaBeans protocol for naming such methods.   The real workhorse is the valueOf() methods, and the setValue() method.   They allow a String to be converted to a value and for that value to be inserted into the Map to be associated with the desired Ticable object.

Variables:

  Modifier Class Name  
  private Class type
  private Integer index
  private Generic (V) defaultValue
  private String prompt
  private String name
  private Class elementType
  private Map<Ticable, V> values

Requirements:

  • HasDefault
  • mulitple constructors

Required Methods:

  • Implements equals(Object o).
  • Setters and getters for all variables.
  • ValueOf(String s) and valueOf(Class type, String s) to create a value based on a supplied String.
  • setValue(Ticable t, String s) to save a value for the Tic associated with the given Ticable object.