J
Jan Danielsson
Hello all,
I get the folloing errors:
--------------------------
PersonalEconomy.java:1374: getTableId() in IdPair cannot be applied to (int)
int id = ip.getTableId(i);
^
PersonalEconomy.java:1375: getTableId() in IdPair cannot be applied to (int)
if(idTable == ip.getTableId(i)) {
^
PersonalEconomy.java:1376: getFileId() in IdPair cannot be applied to (int)
return ip.getFileId(i);
^
PersonalEconomy.java:1384: getFileId() in IdPair cannot be applied to (int)
if(idFile == ip.getFileId(i)) {
^
PersonalEconomy.java:1385: getTableId() in IdPair cannot be applied to (int)
return ip.getTableId(i);
^
5 errors
--------------------------
When I compile this:
--------------------------
class IdPair {
private int idFile; // id in file
private int idTable; // id in table
public IdPair(int idFile, int idTable) {
this.idFile = idFile;
this.idTable = idTable;
}
public int getFileId() {
return idFile;
}
public int getTableId() {
return idTable;
}
}
class IdPairs {
private Vector<IdPair> list = new Vector<IdPair>();
public void add(int idFile, int idTable) {
list.add(new IdPair(idFile, idTable));
}
public int lookupFile(int idTable) {
for(int i = 0; i < list.size(); i++) {
IdPair ip = list.elementAt(i);
int id = ip.getTableId(i);
if(idTable == ip.getTableId(i)) {
return ip.getFileId(i);
}
}
return -1;
}
public int lookupTable(int idFile) {
for(int i = 0; i < list.size(); i++) {
IdPair ip = list.elementAt(i);
if(idFile == ip.getFileId(i)) {
return ip.getTableId(i);
}
}
return -1;
}
}
I get the folloing errors:
--------------------------
PersonalEconomy.java:1374: getTableId() in IdPair cannot be applied to (int)
int id = ip.getTableId(i);
^
PersonalEconomy.java:1375: getTableId() in IdPair cannot be applied to (int)
if(idTable == ip.getTableId(i)) {
^
PersonalEconomy.java:1376: getFileId() in IdPair cannot be applied to (int)
return ip.getFileId(i);
^
PersonalEconomy.java:1384: getFileId() in IdPair cannot be applied to (int)
if(idFile == ip.getFileId(i)) {
^
PersonalEconomy.java:1385: getTableId() in IdPair cannot be applied to (int)
return ip.getTableId(i);
^
5 errors
--------------------------
When I compile this:
--------------------------
class IdPair {
private int idFile; // id in file
private int idTable; // id in table
public IdPair(int idFile, int idTable) {
this.idFile = idFile;
this.idTable = idTable;
}
public int getFileId() {
return idFile;
}
public int getTableId() {
return idTable;
}
}
class IdPairs {
private Vector<IdPair> list = new Vector<IdPair>();
public void add(int idFile, int idTable) {
list.add(new IdPair(idFile, idTable));
}
public int lookupFile(int idTable) {
for(int i = 0; i < list.size(); i++) {
IdPair ip = list.elementAt(i);
int id = ip.getTableId(i);
if(idTable == ip.getTableId(i)) {
return ip.getFileId(i);
}
}
return -1;
}
public int lookupTable(int idFile) {
for(int i = 0; i < list.size(); i++) {
IdPair ip = list.elementAt(i);
if(idFile == ip.getFileId(i)) {
return ip.getTableId(i);
}
}
return -1;
}
}