com.yobotics.simulationconstructionset
Class NameSpace

java.lang.Object
  extended by com.yobotics.simulationconstructionset.NameSpace
All Implemented Interfaces:
java.io.Serializable

public class NameSpace
extends java.lang.Object
implements java.io.Serializable

Title: SimulationConstructionSet

Description:

Copyright: Copyright (c) 2000

Company: Yobotics, Inc.

Version:
1.0
Author:
not attributable
See Also:
Serialized Form

Constructor Summary
NameSpace(java.util.ArrayList<java.lang.String> subNamesStartingWithRoot)
           
NameSpace(java.lang.String name)
           
 
Method Summary
 boolean contains(java.lang.String nameToMatch)
          Checks if the given name is in this nameSpace.
static NameSpace createNameSpaceFromAFullVariableName(java.lang.String fullVariableName)
           
 boolean endsWith(java.lang.String nameToMatch)
          Checks if the given name is in this nameSpace.
 boolean equals(java.lang.Object nameSpace)
           
 java.lang.String getName()
           
 java.lang.String getNameWithRootStripped()
           
 java.lang.String getRootName()
           
 java.lang.String getShortName()
           
 boolean startsWith(java.lang.String nameToMatch)
          Checks if the given name is in this nameSpace.
 NameSpace stripOffFromBeginning(NameSpace nameSpaceToRemove)
           
static java.lang.String stripOffNameSpaceToGetVariableName(java.lang.String variableName)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NameSpace

public NameSpace(java.lang.String name)

NameSpace

public NameSpace(java.util.ArrayList<java.lang.String> subNamesStartingWithRoot)
Method Detail

getName

public java.lang.String getName()

getShortName

public java.lang.String getShortName()

getRootName

public java.lang.String getRootName()

getNameWithRootStripped

public java.lang.String getNameWithRootStripped()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

endsWith

public boolean endsWith(java.lang.String nameToMatch)
Checks if the given name is in this nameSpace. Must match from the end up to a dot or the start. For example "robot.controller.module" endsWith("module") and endsWith("controller.module") and endsWith("robot.controller.module") but does not endsWith("bot.controller.module") or endsWith("") or anything else.

Parameters:
name - Name to check if this NameSpace ends with.
Returns:
boolean Whether this NameSpace ends with the given name.

startsWith

public boolean startsWith(java.lang.String nameToMatch)
Checks if the given name is in this nameSpace. Must match from the start up to a dot or the end. For example "robot.controller.module" startsWith("robot") and startsWith("robot.controller") and startsWith("robot.controller.module") but does not startsWith("robot.controller.mod") or startsWith("") or anything else.

Parameters:
name - Name to check if this NameSpace starts with.
Returns:
boolean Whether this NameSpace starts with the given name.

contains

public boolean contains(java.lang.String nameToMatch)
Checks if the given name is in this nameSpace. Must match from the start or a dot up to the end or a dot. For example "robot.controller.module" contains("robot") and contains("robot.controller") and contains("robot.controller.module") and contains("module") and contains("controller.module") and contains("robot.controller.module") and contains("controller") but does not contains("robot.controller.mod") or contains("") or anything else.

Parameters:
name - Name to check if this NameSpace contains it.
Returns:
boolean Whether this NameSpace contains the given name.

equals

public boolean equals(java.lang.Object nameSpace)
Overrides:
equals in class java.lang.Object

stripOffFromBeginning

public NameSpace stripOffFromBeginning(NameSpace nameSpaceToRemove)

createNameSpaceFromAFullVariableName

public static NameSpace createNameSpaceFromAFullVariableName(java.lang.String fullVariableName)

stripOffNameSpaceToGetVariableName

public static java.lang.String stripOffNameSpaceToGetVariableName(java.lang.String variableName)