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

## shout3d.core
Class Field

    java.lang.Object
      |
      +--shout3d.core.Field

Direct Known Subclasses:
  ArrayField, BooleanField, DoubleField, FloatField, IntField, NodeField, StringField

public abstract class Field
extends java.lang.Object
implements UsageTypes

An abstract class which is subclassed to create Shout3D Fields

Constructor Summary
`Field(Node owner, java.lang.String name, int usage)` Constructs this Field

Method Summary
`void` | `addFieldObserver(FieldObserver fo, java.lang.Object userData)` This method registers the interest of a FieldObserver
`boolean` | `addRoute(Field toField)` Adds a route that copies values from this field to 'toField' each time that fromField's value changes.
`boolean` | `deleteRoute(Field toField)` Removes any existing route from this field to toField Returns true if a route existed and was removed, false otherwise Note: Routes of ArrayFields copy by reference, not by value.
`java.lang.String` | `getName()` Gets this Field's name.
`int` | `getNumRoutes()` Returns the number of fields to which this field is routed.
`Node` | `getOwner()` Gets this Field's owner.
`Field` | `getRoutedField(int i)` Returns a field to which this field is routed to.
`java.lang.String` | `getTypeName()` Gets a string representing this Field's type
`int` | `getUsage()` Gets this Field's usageType.
`java.lang.String` | `getValueByString()`
`boolean` | `isOfType(java.lang.String type)` Returns whether this field is of the same type, or a type derived from, the Field type given by the input string.
`boolean` | `isRouted(Field toField)` Checks if a route currently exists from this field to toField
`void` | `removeFieldObserver(FieldObserver fo)` This method unregisters the interest of a FieldObserver
`void` | `setValueByString(java.lang.String string)`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Field

    public Field(Node owner,
                 java.lang.String name,
                 int usage)

  Constructs this Field
  Parameters:
    `owner` - this field's owner
    `name` - this field's name
    `usage` - this field's usage

Method Detail

### getOwner

    public Node getOwner()

  Gets this Field's owner.

### getUsage

    public int getUsage()

  Gets this Field's usageType.

### getName

    public java.lang.String getName()

  Gets this Field's name.

### getTypeName

    public java.lang.String getTypeName()

  Gets a string representing this Field's type
  Returns:
    the string

### isOfType

    public boolean isOfType(java.lang.String type)

  Returns whether this field is of the same type, or a type derived from, the Field type given by the input string.
  Parameters:
    `type` - the field type string

### addFieldObserver

    public void addFieldObserver(FieldObserver fo,
                                 java.lang.Object userData)

  This method registers the interest of a FieldObserver
  Parameters:
    `observer` - the FieldObserver
    `userData` - data that will be passed back to the observer's onFieldChange method.

### removeFieldObserver

    public void removeFieldObserver(FieldObserver fo)

  This method unregisters the interest of a FieldObserver
  Parameters:
    `observer` - the FieldObserver to unregister

### addRoute

    public boolean addRoute(Field toField)
                     throws Shout3DException

  Adds a route that copies values from this field to 'toField' each time that fromField's value changes. 'toField' will, in turn, notify any listeners or routed fields of this change. Also copies value from this field to toField, so the values will match after this call. Note: Routes of ArrayFields copy by reference, not by value. This makes routing of ArrayFields efficient, since a value change does not cause a copy the array contents. However, deleting the route does not undo the fact that both fields refer to the array in memory. (See deleteRoute for more info). Throws a Shout3DException if toField is not of a type derived from this one. Will not add a second route if a route already exists. Returns true if a route was added, false otherwise
  Parameters:
    `toField` - the field to which values will be copied
  Returns:
    true if the route was added, false otherwise

### deleteRoute

    public boolean deleteRoute(Field toField)

  Removes any existing route from this field to toField Returns true if a route existed and was removed, false otherwise Note: Routes of ArrayFields copy by reference, not by value. (see addRoute) Deleting a route does not undo the fact that both fields refer to the array in memory. If you want to insure that the toField refers to unique memory, you should allocate a new value array of the same size as the source field, copy the values into the new array, and set this new array as the toField's value.
  Parameters:
    `toField` - the field to which values will be copied
  Returns:
    true if the route was removed, false otherwise

### getNumRoutes

    public int getNumRoutes()

  Returns the number of fields to which this field is routed.
  Returns:
    the number of fields to which this field is routed

### getRoutedField

    public Field getRoutedField(int i)

  Returns a field to which this field is routed to. You can find all the the routed fields by looping from 0 to getNumRoutes()-1
  Returns:
    the number of fields to which this field is routed

### isRouted

    public boolean isRouted(Field toField)

  Checks if a route currently exists from this field to toField
  Returns:
    true if the route exists, false otherwise

### setValueByString

    public void setValueByString(java.lang.String string)

### getValueByString

    public java.lang.String getValueByString()

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