ここにこのオブジェクトがあります:
public class ItemInfo {
String productName;
String rfidTagNumber;
String originalLocal;
String currentLocal;
double productPrice;
public ItemInfo(String name, String tag, String origLoc, String curLoc, double price) {
productName = name;
rfidTagNumber = tag;
originalLocal = origLoc;
currentLocal = curLoc;
productPrice = price;
}
ItemInfo
ここでオブジェクトを作成して参照する必要があります。
public class ItemInfoNode {
ItemInfoNode next;
ItemInfoNode prev;
public ItemInfoNode(){
}
public void setInfo(ItemInfo info) {
}
public ItemInfo getInfo(){
return null;
}
public void setNext(ItemInfoNode node) {
}
public void setPrev(ItemInfoNode node) {
}
public ItemInfoNode getNext() {
return null;
}
public ItemInfoNode getPrev() {
return null;
}
}
新しいオブジェクトを作成する方法は知っていますが、それが正しいかどうかよくわからないので、行を省略しました。参照だけを作成するにはどうすればよいですか?
編集: 別の小さなサイドバーですが、上記のように next と prev の 2 つの ItemInfoNode オブジェクトがありますが、コンストラクターを空白のままにしますか? それは大丈夫ですか?とにかく答えに役立つ場合は、関数を表示するためにクラスの残りの部分を貼り付けました。再度、感謝します!