Add(index i, Object o) method of arraylist showing random behaviour
vikas bisla
Greenhorn
Joined: Jul 17, 2010
Posts: 5
posted
0
dmAcc12.dmTree[0].clsAppAddr.lstPort.add(0,portNode); it is adding at 11 position in the arraylist and first 10 entries in the arraylist are null. It shows first index = 11 , lastIndex = 12 and first 10 postion are null.
David Newton wrote:Post the declaration and construction of the member.
vikas bisla
Greenhorn
Joined: Jul 17, 2010
Posts: 5
posted
0
public class DmAcc12SubTree
{
public App_DMAcc12_AppAddr_T clsAppAddr = new App_DMAcc12_AppAddr_T();
public App_DMAcc12_AppAuth_T clsAppAuth = new App_DMAcc12_AppAuth_T();
public class AppNode
{
public char cFormat;
public long lSize;
public String straucData;
};
public class App_DMAcc12_Port_T
{
public char cPort_modified[] = new char[DmAcc12Constants.APP_DMACC_MAX_PORT] ; //'T'/'F'->InTact/Ruptured
public ArrayList<AppNode> lstPortId = new ArrayList<AppNode>();
public ArrayList<AppNode> lstPortNbr = new ArrayList<AppNode>();
} ;