gpt4 book ai didi

us.ihmc.yoVariables.variable.YoVariable.getFullNameWithNameSpace()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 12:08:40 31 4
gpt4 key购买 nike

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

YoVariable.getFullNameWithNameSpace介绍

[英]Retrieves this variable's full name and namespace, if applicable.
[中]检索此变量的全名和命名空间(如果适用)。

代码示例

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

@Override
public String getFullVariableNameWithNameSpace()
{
 return variable.getFullNameWithNameSpace();
}

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

@Override
public int compare(YoVariable<?> arg0, YoVariable<?> arg1) 
{
  return arg0.getFullNameWithNameSpace().compareTo(arg1.getFullNameWithNameSpace());
}
};

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

private static YoVariable<?> getVariableWithSameName(ArrayList<YoVariable<?>> variables, YoVariable<?> variableToMatch)
{
 for (YoVariable<?> variable : variables)
 {
   if (variable.getFullNameWithNameSpace().equals(variableToMatch.getFullNameWithNameSpace()))
    return variable;
 }
 return null;
}

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

/**
* Compare full name including namespace of the passed variable to this variable's full name with namespace.
*
* @param variable YoVariable to compare names to
* @return boolean true if names are exactly identical
*/
public boolean hasSameFullName(YoVariable<?> variable)
{
 return this.getFullNameWithNameSpace().equals(variable.getFullNameWithNameSpace());
}

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

@Override
  public void createdNewVariable(YoVariable<?> variable)
  {
   System.err.println("RobotConnectionGUIUpdater: created new variable: " + variable.getFullNameWithNameSpace());
  }
}

代码示例来源:origin: us.ihmc/ihmc-robot-data-logger

public int getYoVariable(List<YoVariable<?>> yoVariables, String name)
{
 for(int i = 0; i < yoVariables.size(); i++)
 {
   if(yoVariables.get(i).getFullNameWithNameSpace().endsWith(name))
   {
    return i;
   }
 }
 return -1;
}

代码示例来源:origin: us.ihmc/ihmc-robot-data-logger

public String[] getSummarizedVariables()
{
 ArrayList<String> allVariables = new ArrayList<>();
 allVariables.addAll(summarizedVariables);
 for(YoVariable<?> var : summarizedYoVariables)
 {
   allVariables.add(var.getFullNameWithNameSpace());
 }
 
 return allVariables.toArray(new String[allVariables.size()]);
}

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

public YoVariable<?> getVariableUsingFullNamespace(String fullname)
{
 for (YoVariable<?> yoVariable : getAllVariables())
 {
   if (yoVariable.getFullNameWithNameSpace().equals(fullname))
    return yoVariable;
 }
 // not found
 String error = "Warning: " + fullname + " not found. (YoVariableHolderImplementation.getVariable)";
 System.err.println(error);
 return null;
}

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

public void printAllVariablesIncludingDescendants(PrintStream out)
{
 for (YoVariable<?> var : controlVars)
 {
   out.print(var.getFullNameWithNameSpace() + "\n");
 }
 for (YoVariableRegistry child : children)
 {
   child.printAllVariablesIncludingDescendants(out);
 }
}

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

private static boolean isException(ArrayList<String> exceptions, YoVariable<?> variable)
  {
   boolean isException = false;

   if (exceptions != null)
   {
     for (String exceptionName : exceptions)
     {
      String lowerCaseVariableName = variable.getFullNameWithNameSpace().toLowerCase();
      String lowerCaseExceptionString = exceptionName.toLowerCase();
      isException = (lowerCaseVariableName.contains(lowerCaseExceptionString));

      if (isException)
      {
        return isException;
      }
     }
   }

   return isException;
  }
}

代码示例来源:origin: us.ihmc/ihmc-robot-data-logger

public void createSummary(YoVariable<?> isWalkingVariable)
{
 createSummary(isWalkingVariable.getFullNameWithNameSpace());
}

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

private void verifyYoVariablesHaveSameNamesAndTypes(ArrayList<YoVariable<?>> variablesOne, ArrayList<YoVariable<?>> variablesTwo)
{
 if (variablesOne.size() != variablesTwo.size())
 {
   throw new RuntimeException("variablesOne.size() != variablesTwo.size()");
 }
 for (int i = 0; i < variablesOne.size(); i++)
 {
   YoVariable<?> variableOne = variablesOne.get(i);
   YoVariable<?> variableTwo = variablesTwo.get(i);
   verifyTypesAreEqual(variableOne, variableTwo);
   verifyNamesAreConsistent(variableOne.getFullNameWithNameSpace(), variableTwo.getFullNameWithNameSpace());
 }
}

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

private void putVariablesInIndexMap()
{
 for (int i = 0; i < allVariables.size(); i++)
 {
   YoVariable<?> v = allVariables.getVariable(i);
   allVariablesIndexMap.put(v, i);
   System.out.println(i + " " + v.getFullNameWithNameSpace());
 }
}

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

private void writeVariableNamesToBeVerified(ArrayList<YoVariable<?>> variables) throws IOException
{
 dataOutputStream.writeInt(variables.size());
 dataOutputStream.flush();
 for (YoVariable<?> yoVariable : variables)
 {
   dataOutputStream.writeUTF(yoVariable.getFullNameWithNameSpace());
   dataOutputStream.writeInt(yoVariable.getYoVariableType().ordinal());
   dataOutputStream.flush();
      try
   {
    Thread.sleep(1); // Give the other side some time to process it.
   } 
   catch (InterruptedException e)
   {
   }
 }
}

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

private void readAndVerifyVariableNames(ArrayList<YoVariable<?>> variables) throws IOException
{
 int numberOfVariablesFromStream = dataInputStream.readInt();
 int numberOfVariables = variables.size();
 if (numberOfVariablesFromStream != numberOfVariables)
   throw new RuntimeException("numberOfVariablesFromStream = " + numberOfVariablesFromStream + ", but numberOfVariables = " + numberOfVariables);
 for (int i = 0; i < numberOfVariables; i++)
 {
   String fullName = dataInputStream.readUTF();
   int yoVariableTypeOrdinal = dataInputStream.readInt();
   YoVariableType yoVariableType = YoVariableType.values()[yoVariableTypeOrdinal];
      YoVariable<?> yoVariable = variables.get(i);
   if (yoVariable.getYoVariableType() != yoVariableType)
   {
    throw new RuntimeException("yoVariable.getYoVariableType() = " + yoVariable.getYoVariableType() + " != yoVariableType = " + yoVariableType);
   }
   verifyNamesAreConsistent(yoVariable.getFullNameWithNameSpace(), fullName);
 }
}

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

public void setVariableInThisBox(YoVariable<?> variableInThisBox)
{
 activeEntryContainer.bindToVariable(variableInThisBox);
 this.variableInThisBox = variableInThisBox;
 String toolTip = variableInThisBox.getDescription();
 if ((toolTip == null) || toolTip.equals(""))
   toolTip = variableInThisBox.getFullNameWithNameSpace();
 this.setToolTipText(toolTip);
}

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

private ArrayList<YoVariable<?>> readAndCreateVariables(YoVariableRegistry rootRegistry) throws IOException
{
 ArrayList<YoVariable<?>> ret = new ArrayList<YoVariable<?>>();
 
 int numberOfVariablesFromStream = dataInputStream.readInt();
 for (int i = 0; i < numberOfVariablesFromStream; i++)
 {
   String fullName = dataInputStream.readUTF();
   int yoVariableTypeOrdinal = dataInputStream.readInt();
   YoVariableType yoVariableType = YoVariableType.values()[yoVariableTypeOrdinal];
      String variableName = NameSpace.stripOffNameSpaceToGetVariableName(fullName);
   NameSpace fullNameSpace = NameSpace.createNameSpaceFromAFullVariableName(fullName);
   YoVariableRegistry registry = rootRegistry.getOrCreateAndAddRegistry(fullNameSpace);
      YoVariable<?> yoVariable = createNewYoVariable(variableName, yoVariableType, registry);
   ret.add(yoVariable);
      verifyNamesAreConsistent(yoVariable.getFullNameWithNameSpace(), fullName);
 }
 
 return ret;
}

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

private void verifyYoVariablesAreEqual(YoVariable<?> variableOne, YoVariable<?> variableTwo)
{
 assertTrue(variableOne.getYoVariableType() == variableTwo.getYoVariableType());
 assertTrue(variableOne.getFullNameWithNameSpace().equals(variableTwo.getFullNameWithNameSpace()));
 assertEquals(variableOne.getValueAsDouble(), variableTwo.getValueAsDouble(), 1e-7);
}

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

public void addVariable(YoVariable<?> variable)
  {
   if ((entryBoxArrayPanel != null) && entryBoxArrayPanel.isHoldingVariable(variable))
     return;

   activeEntryContainer.bindToVariable(variable);
   variableInThisBox = variable;

//    label.setText(textName);
   String toolTip = variableInThisBox.getDescription();
   if ((toolTip == null) || toolTip.equals(""))
     toolTip = variableInThisBox.getFullNameWithNameSpace();
   this.setToolTipText(toolTip);

//    setTextField();

   if (entryBoxArrayPanel != null)
     this.entryBoxArrayPanel.checkStatus();

  }

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

private void verifyRegistriesAndVariableListsAreConsistent(String[] registryNames, String[][] variableNames)
{
 for (int i=0; i<registryNames.length; i++)
 {
   String registryName = registryNames[i];
   NameSpace fullNameSpace = new NameSpace(registryName);
   YoVariableRegistry registry = rootRegistry.getOrCreateAndAddRegistry(fullNameSpace);
   if (registry.getNumberOfYoVariables() != variableNames[i].length)
   {
    String error = "registry.getNumberOfYoVariables() = " + registry.getNumberOfYoVariables() + "!= variableNames[i].length = " + variableNames[i].length;
    error = error + "\nregistry.getName() = " + registry.getName();
    error = error + "\n\n registry variables:\n";
    ArrayList<YoVariable<?>> registryVariables = registry.getAllVariablesInThisListOnly();
    for (int j=0; j<registryVariables.size(); j++)
    {
      error = error + registryVariables.get(j).getFullNameWithNameSpace() + "\n";
    }
    error = error + "\n\n variableNames:\n";
    for (int j=0; j<variableNames[i].length; j++)
    {
      error = error + variableNames[i][j] + "\n";
    }
    throw new RuntimeException(error);
   }
 }
}

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