use of com.cosylab.acs.maci.IntArray in project ACS by ACS-Community.
the class ClientProxyImpl method components_available.
/**
* @see si.ijs.maci.ClientOperations#components_available(ComponentInfo[])
*/
public void components_available(ComponentInfo[] components) {
try {
com.cosylab.acs.maci.ComponentInfo[] info = new com.cosylab.acs.maci.ComponentInfo[components.length];
for (int i = 0; i < components.length; i++) {
info[i] = new com.cosylab.acs.maci.ComponentInfo(components[i].h, components[i].name, components[i].type, components[i].code, new ComponentProxy(components[i].name, components[i].reference));
info[i].setContainer(components[i].container);
info[i].setContainerName(components[i].container_name);
info[i].setClients(new IntArray(components[i].clients));
info[i].setInterfaces(components[i].interfaces);
info[i].setAccessRights(components[i].access);
}
client.components_available(info);
} catch (RemoteException re) {
// noop.
}
}
use of com.cosylab.acs.maci.IntArray in project ACS by ACS-Community.
the class ContainerProxy method get_component_info.
/**
* @see com.cosylab.acs.maci.Container#get_component_info(int[])
*/
public ComponentInfo[] get_component_info(int[] handles) throws RemoteException {
try {
// returned value
ComponentInfo[] retVal = null;
// transform to CORBA specific
si.ijs.maci.ComponentInfo[] infos = container.get_component_info(handles);
if (infos != null) {
retVal = new ComponentInfo[infos.length];
for (int i = 0; i < infos.length; i++) {
ComponentInfo componentInfo = new ComponentInfo(infos[i].h, infos[i].name, infos[i].type, infos[i].code, new ComponentProxy(infos[i].name, infos[i].reference));
componentInfo.setContainer(infos[i].container);
componentInfo.setContainerName(infos[i].container_name);
componentInfo.setAccessRights(inverseMapAccessRights(infos[i].access));
componentInfo.setClients(new IntArray(infos[i].clients));
componentInfo.setInterfaces(infos[i].interfaces);
retVal[i] = componentInfo;
}
}
return retVal;
} catch (Exception ex) {
RemoteException re = new RemoteException("Failed to invoke 'get_component_info()' method.", ex);
throw re;
}
}
use of com.cosylab.acs.maci.IntArray in project ACS by ACS-Community.
the class IntArrayTest method testContainment.
/**
*/
public void testContainment() {
IntArray ia = new IntArray();
int i = 0;
for (; i <= 12; i++) {
ia.add(i);
assertEquals(i, ia.get(i));
}
// remove odd
for (i = 0; i < ia.size(); ) if (ia.get(i) % 2 == 1)
ia.removeAt(i);
else
i++;
for (i = 0; i < ia.size(); i++) assertEquals(i * 2, ia.get(i));
System.out.println(ia.toString());
}
use of com.cosylab.acs.maci.IntArray in project ACS by ACS-Community.
the class IntArrayTest method testAddRemoveContains.
/**
*/
public void testAddRemoveContains() {
IntArray ia = new IntArray();
ia.add(1);
assertTrue(ia.contains(1));
ia.add(3);
assertTrue(ia.contains(1));
assertTrue(ia.contains(3));
ia.add(5);
assertTrue(ia.contains(1));
assertTrue(ia.contains(3));
assertTrue(ia.contains(5));
ia.remove(3);
assertTrue(!ia.contains(3));
ia.remove(1);
assertTrue(!ia.contains(1));
ia.remove(5);
assertTrue(!ia.contains(5));
}
Aggregations