求解释一个java函数,用C++解释出来
public enum AxisId {
/** The X axis */
X(0),
/** The Y axis */
Y(1),
/** The Z axis */
Z(2),
/** The A axis (traditionally, rotational around X) */
A(3),
/** The B axis (traditionally, rotational around Y) */
B(4),
/** The C axis (traditionally, rotational around Z) */
C(5),
/** The U axis (traditionally, parallel to X) */
U(6),
/** The V axis (traditionally, parallel to Y) */
V(7),
/** The W axis (traditionally, parallel to Z) */
W(8);
private int index;
private AxisId(int index) { this.index = index; }
public int getIndex() { return index; }
}
EnumMap<AxisId,ToolModel> stepExtruderMap = new EnumMap<AxisId,ToolModel>(AxisId.class);
public class ToolModel
{
……
}
//下面这个函数求解释
private Iterable<AxisId> getAllHijackedAxes() {
Vector<AxisId> axes = new Vector<AxisId>();
for ( Map.Entry<AxisId,ToolModel> entry : stepExtruderMap.entrySet()) {
AxisId axis = entry.getKey();
axes.add(axis);
}
return axes;
}
/** The X axis */
X(0),
/** The Y axis */
Y(1),
/** The Z axis */
Z(2),
/** The A axis (traditionally, rotational around X) */
A(3),
/** The B axis (traditionally, rotational around Y) */
B(4),
/** The C axis (traditionally, rotational around Z) */
C(5),
/** The U axis (traditionally, parallel to X) */
U(6),
/** The V axis (traditionally, parallel to Y) */
V(7),
/** The W axis (traditionally, parallel to Z) */
W(8);
private int index;
private AxisId(int index) { this.index = index; }
public int getIndex() { return index; }
}
EnumMap<AxisId,ToolModel> stepExtruderMap = new EnumMap<AxisId,ToolModel>(AxisId.class);
public class ToolModel
{
……
}
//下面这个函数求解释
private Iterable<AxisId> getAllHijackedAxes() {
Vector<AxisId> axes = new Vector<AxisId>();
for ( Map.Entry<AxisId,ToolModel> entry : stepExtruderMap.entrySet()) {
AxisId axis = entry.getKey();
axes.add(axis);
}
return axes;
}
...全文
相关推荐
从C++到Java的成功之路
`SerialSum`类包含了计算序列和的函数,如求1到100的和以及1+1+2+...+100的和。通过`main`方法调用,我们可以看到Java的函数调用和变量赋值方式。
求奇数和偶数的和.rar
我们可以用多种编程语言来解决这个问题,如Python、Java、C++等。首先,让我们以Python为例来解释这个问题的解决方案。假设我们有一个数字列表,我们可以遍历这个列表,对每个元素进行判断。
java2cpp java转C++
java2cpp java转C++ JAVA代码转C++代码的工具。
CPP调用JAVA函数Demo
在C++调用Java函数的过程中,首先需要通过JNI创建一个Java虚拟机实例,然后加载包含待调用函数的Java类。
J2cpp-Java到C++的转换工具
J2CPP是一个Eclipse插件,可将Java代码自动转换为C++11代码,适用于需要跨平台移植的项目。该工具基于JDT和CDT框架,虽不能保证生成代码直接编译通过,但能显著减少手动重写的工作量。用


