artisynth.core.modelbase
Class NameRange
java.lang.Object
maspack.util.RangeBase
artisynth.core.modelbase.NameRange
- All Implemented Interfaces:
- java.lang.Cloneable, Clonable, Range, Scannable
public class NameRange
- extends RangeBase
Performs checks to see if a name for a ModelComponent is valid. The main
criteria are that (a) the name does not contain invalid characters, and (b)
the name is unique among the component's siblings in the component
hierarchy. Enforcement of the second criteria depends on static settings in
ModelComponentBase
.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NameRange
public NameRange()
NameRange
public NameRange(ModelComponent comp)
NameRange
public NameRange(ModelComponent comp,
CompositeComponent parent)
makeValid
public java.lang.String makeValid(java.lang.Object obj)
- Returns the valid name (passes
isValid(Object, StringHolder)
).
- Specified by:
makeValid
in interface Range
- Overrides:
makeValid
in class RangeBase
- Parameters:
obj
- object to be projected
- Returns:
- original obj if within range, or a projected object, or
null
.
isValid
public boolean isValid(java.lang.Object obj,
StringHolder errMsg)
- Description copied from class:
RangeBase
- Returns true if the specified object is valid for this Range,
and false otherwise. If the object is not valid, and
errMsg
is not null
, then errMsg.value
should
be set to a message describing why the object is not valid.
- Specified by:
isValid
in interface Range
- Specified by:
isValid
in class RangeBase
- Parameters:
obj
- Object to be testeserrMsg
- Optional handle for storing error message
- Returns:
- true if the object is valid