gpt4 book ai didi

us.ihmc.yoVariables.registry.YoVariableRegistry.getNameSpace()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 13:44:40 33 4
gpt4 key购买 nike

本文整理了Java中us.ihmc.yoVariables.registry.YoVariableRegistry.getNameSpace()方法的一些代码示例,展示了YoVariableRegistry.getNameSpace()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YoVariableRegistry.getNameSpace()方法的具体详情如下:
包路径:us.ihmc.yoVariables.registry.YoVariableRegistry
类名称:YoVariableRegistry
方法名:getNameSpace

YoVariableRegistry.getNameSpace介绍

暂无

代码示例

代码示例来源:origin: us.ihmc/ihmc-yovariables

/**
* Retrieves this variable's full name and namespace, if applicable.
*
* @return String fully qualified name
*/
public String getFullNameWithNameSpace()
{
 if (registry == null)
   return this.name;
 if (registry.getNameSpace() == null)
   return this.name;
 return registry.getNameSpace() + "." + this.name;
}

代码示例来源:origin: us.ihmc/ihmc-yovariables

/**
* Retrieves this variable's namespace alone.
*
* @return String namespace for this variable
*/
public NameSpace getNameSpace()
{
 return registry.getNameSpace();
}

代码示例来源:origin: us.ihmc/ihmc-yovariables

private static YoVariableRegistry getRegistryWithSameNameSpace(ArrayList<YoVariableRegistry> registries, YoVariableRegistry registryToMatch)
{
 for (YoVariableRegistry registry : registries)
 {
   if (registryToMatch.getNameSpace().equals(registry.getNameSpace()))
   {
    return registry;
   }
 }
 return null;
}

代码示例来源:origin: us.ihmc/simulation-construction-set-tools

public int getIndex(YoVariableRegistry registry)
{
 Integer ret = registryIndexMap.get(registry);
 if (ret == null)
   throw new RuntimeException("YoVariableRegistry not found: " + registry.getNameSpace());
 return ret;
}

代码示例来源:origin: us.ihmc/ihmc-yovariables

static NameSpace getRelativeNamespace(NameSpace parameterNamespace, YoVariableRegistry registry)
  {
   NameSpace registryNamespace = registry.getNameSpace();
   if (registryNamespace.isRootNameSpace())
   {
     return parameterNamespace;
   }
   else
   {
     return parameterNamespace.stripOffFromBeginning(registry.getNameSpace().getParent());
   }
  }
}

代码示例来源:origin: us.ihmc/ihmc-yovariables

/**
* Checks if this variable's fully qualified name and namespace is equal to the given name, without respect to character case for only the variable's full name.
*
* <p>Returns false if this variable's registry is null, the full names differ (case ignored) or the namespace does not match exactly (case considered.)</p>
*
* @param name String variable name to compare to
* @return boolean if this variable's name and the given name meet the above conditions
*/
public boolean fullNameEndsWithCaseInsensitive(String name)
{
 int lastDotIndex = name.lastIndexOf(".");
 if (lastDotIndex == -1)
 {
   return this.name.toLowerCase().equals(name.toLowerCase());
 }
 
 String endOfName = name.substring(lastDotIndex + 1);
 String nameSpace = name.substring(0, lastDotIndex);
 if (!endOfName.toLowerCase().equals(this.name.toLowerCase()))
   return false;
 if (registry == null)
   return false;
 return registry.getNameSpace().endsWith(nameSpace);
}

代码示例来源:origin: us.ihmc/ihmc-yovariables

@Override
public ArrayList<YoVariable<?>> getVariables(String nameSpaceEnding, String name)
{
 if (name.contains("."))
 {
   throw new RuntimeException(name + " contains a dot. It must not when calling getVariables(String nameSpace, String name)");
 }
 ArrayList<YoVariable<?>> variablesWithThisName = yoVariableSet.get(name.toLowerCase());
 if (variablesWithThisName == null)
 {
   return new ArrayList<YoVariable<?>>(0);
 }
 ArrayList<YoVariable<?>> ret = new ArrayList<YoVariable<?>>();
 for (int i = 0; i < variablesWithThisName.size(); i++)
 {
   YoVariable<?> yoVariable = variablesWithThisName.get(i);
   if (yoVariable.getYoVariableRegistry().getNameSpace().endsWith(nameSpaceEnding))
   {
    ret.add(yoVariable);
   }
 }
 return ret;
}

代码示例来源:origin: us.ihmc/ihmc-yovariables

@Override
  public ArrayList<YoVariable<?>> getVariables(NameSpace nameSpace)
  {
   ArrayList<YoVariable<?>> ret = new ArrayList<YoVariable<?>>();

   Collection<ArrayList<YoVariable<?>>> variableLists = yoVariableSet.values();

   for (ArrayList<YoVariable<?>> list : variableLists)
   {
     for (YoVariable<?> variable : list)
     {
      if (variable.getYoVariableRegistry().getNameSpace().equals(nameSpace))
      {
        ret.add(variable);
      }
     }
   }

   return ret;
  }
}

代码示例来源:origin: us.ihmc/ihmc-yovariables

@Override
public YoVariable<?> getVariable(String nameSpaceEnding, String name)
{
 if (name.contains("."))
 {
   throw new RuntimeException(name + " contains a dot. It must not when calling getVariable(String nameSpace, String name)");
 }
 
 ArrayList<YoVariable<?>> variablesWithThisName = yoVariableSet.get(name.toLowerCase());
 if (variablesWithThisName == null)
 {
   return null;
 }
 YoVariable<?> foundVariable = null;
 for (int i = 0; i < variablesWithThisName.size(); i++)
 {
   YoVariable<?> yoVariable = variablesWithThisName.get(i);
   if (yoVariable.getYoVariableRegistry().getNameSpace().endsWith(nameSpaceEnding))
   {
    if (foundVariable != null)
    {
      throw new RuntimeException("Called getVariable with " + nameSpaceEnding + ", " + name
                   + ". That is insufficient name information to distinguish a unique variable! Please include more of the name space!");
    }
    foundVariable = yoVariable;
   }
 }
 return foundVariable;
}

代码示例来源:origin: us.ihmc/ihmc-yovariables

@Override
public boolean hasUniqueVariable(String nameSpaceEnding, String name)
{
 if (name.contains("."))
 {
   throw new RuntimeException(name + " contains a dot. It must not when calling hasVariable(String nameSpace, String name)");
 }
 ArrayList<YoVariable<?>> variablesWithThisName = yoVariableSet.get(name.toLowerCase());
 if (variablesWithThisName == null)
 {
   return false;
 }
 boolean foundVariable = false;
 for (int i = 0; i < variablesWithThisName.size(); i++)
 {
   YoVariable<?> yoVariable = variablesWithThisName.get(i);
   if (yoVariable.getYoVariableRegistry().getNameSpace().endsWith(nameSpaceEnding))
   {
    if (foundVariable)
    {
      return false;
    }
    foundVariable = true;
   }
 }
 return foundVariable;
}

代码示例来源:origin: us.ihmc/ihmc-yovariables

public ArrayList<YoVariable<?>> getVariables(NameSpace nameSpace)
{
 ArrayList<YoVariable<?>> ret = new ArrayList<YoVariable<?>>();
 ArrayList<YoVariable<?>> allVariables = getAllVariables();
 for (YoVariable<?> variable : allVariables)
 {
   if (variable.getYoVariableRegistry().getNameSpace().equals(nameSpace))
   {
    ret.add(variable);
   }
 }
 return ret;
}

代码示例来源:origin: us.ihmc/simulation-construction-set-test

private String getRegistryNameSpaceFromRobot(Robot robotModel)
{
 return robotModel.getRobotsYoVariableRegistry().getNameSpace().getName();
}

代码示例来源:origin: us.ihmc/ihmc-yovariables

public void addChild(YoVariableRegistry child, boolean notifyListeners)
{
 // Prepend the parents nameSpace to the child. NameSpace will figure out if it's valid or not.
 // This then requires that the child only has it's portion of the NameSpace that the parent does not.
 if (child == null)
   return;
 // Make sure no children with this name already:
 for (YoVariableRegistry childToCheck : children)
 {
   String childToCheckShortName = childToCheck.getNameSpace().getShortName();
   String childShortName = child.getNameSpace().getShortName();
   if (childToCheckShortName.equals(childShortName))
   {
    throw new RuntimeException("Adding a child to a YoVariableRegistry that has the same name as a previous one: "
       + childToCheck.getNameSpace().getName() + ". Parent name space = " + this.getNameSpace().getName());
   }
 }
 NameSpace parentNameSpace = this.getNameSpace();
 child.prependNameSpace(parentNameSpace);
 //    System.err.println("Child: " + child.getNameSpace().getShortName() + " parent:" + this.getNameSpace().getName());
 child.setParent(this);
 children.add(child);
 if (notifyListeners) notifyListenersYoVariableRegistryWasAdded(child);
}

代码示例来源:origin: us.ihmc/ihmc-yovariables

private static void printInfo(YoVariableRegistry registry)
{
 int variables = registry.getNumberOfYoVariables();
 int children = registry.getChildren().size();
 int maxPropertyLength = 17;
 String variableString = trimStringToLength("Variables: " + variables, maxPropertyLength, "...");
 String childrenString = trimStringToLength("Children: " + children, maxPropertyLength, "...");
 int maxNameLength = 70;
 String name = registry.getClass().getSimpleName() + " " + registry.getNameSpace().getName();
 name = trimStringToLength(name, maxNameLength, "...");
 System.out.println(name + "\t" + variableString + "\t" + childrenString);
}

代码示例来源:origin: us.ihmc/ihmc-yovariables

return false;
if (!this.getNameSpace().equals(registry.getNameSpace()))
  return false;

代码示例来源:origin: us.ihmc/ihmc-yovariables

public void recursivelyChangeNameSpaces(NameSpaceRenamer nameSpaceRenamer)
{
 NameSpace nameSpace = this.getNameSpace();
 String nameSpaceString = nameSpace.getName();
 nameSpaceString = nameSpaceRenamer.changeNamespaceString(nameSpaceString);
 this.changeNameSpace(nameSpaceString);
 ArrayList<YoVariableRegistry> children = this.getChildren();
 for (YoVariableRegistry child : children)
 {
   child.recursivelyChangeNameSpaces(nameSpaceRenamer);
 }
}

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com