@Test public void addAtomConnection() { data.addAtomConnection("Atom1", "Atom2", false); Assert.assertEquals(data.getAtoms().size(), 2); Assert.assertEquals(data.getAttributes().size(), 0); Assert.assertTrue(data.getAtoms().contains("Atom1")); Assert.assertTrue(data.getAtoms().contains("Atom2")); data.addAtomConnection("Atom1", "Atom3", false); Assert.assertEquals(data.getAtoms().size(), 3); Assert.assertEquals(data.getAttributes().size(), 0); Assert.assertTrue(data.getAtoms().contains("Atom1")); Assert.assertTrue(data.getAtoms().contains("Atom2")); Assert.assertTrue(data.getAtoms().contains("Atom3")); }
public void addAtomConnection(String atom1, String atom2, boolean addOnlyIfAtomsExist) { checkAttributeOrAtomName(atom1); checkAttributeOrAtomName(atom2); if (!addOnlyIfAtomsExist || (addOnlyIfAtomsExist && atoms.contains(atom1) && atoms.contains(atom2))) { int x1 = addAtom(atom1); int x2 = addAtom(atom2); int x3 = addSlice(CONNECTION_SLICE_NAME); tensor.setEntry(1.0d, x1, x2, x3); tensor.setEntry(1.0d, x2, x1, x3); } }
TensorMatchingData { public void addAtomConnection(String atom1, String atom2, boolean addOnlyIfAtomsExist) { checkAttributeOrAtomName(atom1); checkAttributeOrAtomName(atom2); if (!addOnlyIfAtomsExist || (addOnlyIfAtomsExist && atoms.contains(atom1) && atoms.contains(atom2))) { int x1 = addAtom(atom1); int x2 = addAtom(atom2); int x3 = addSlice(CONNECTION_SLICE_NAME); tensor.setEntry(1.0d, x1, x2, x3); tensor.setEntry(1.0d, x2, x1, x3); } } }
TensorMatchingData { public void addAtomConnection(String atom1, String atom2, boolean addOnlyIfAtomsExist) { checkAttributeOrAtomName(atom1); checkAttributeOrAtomName(atom2); if (!addOnlyIfAtomsExist || (addOnlyIfAtomsExist && atoms.contains(atom1) && atoms.contains(atom2))) { int x1 = addAtom(atom1); int x2 = addAtom(atom2); int x3 = addSlice(CONNECTION_SLICE_NAME); tensor.setEntry(1.0d, x1, x2, x3); tensor.setEntry(1.0d, x2, x1, x3); } } TensorMatchingData(); }
TensorMatchingData { public void addAtomConnection(String atom1, String atom2, boolean addOnlyIfAtomsExist) { checkAttributeOrAtomName(atom1); checkAttributeOrAtomName(atom2); if (!addOnlyIfAtomsExist || (addOnlyIfAtomsExist && atoms.contains(atom1) && atoms.contains(atom2))) { int x1 = addAtom(atom1); int x2 = addAtom(atom2); int x3 = addSlice(CONNECTION_SLICE_NAME); tensor.setEntry(1.0d, x1, x2, x3); tensor.setEntry(1.0d, x2, x1, x3); } } TensorMatchingData(); void addAtomConnection(String atom1, String atom2, boolean addOnlyIfAtomsExist); void addAtomAttribute(String sliceName, String atomUri, String attributeValue); void addAtomAttribute(TensorEntry entry); String getFirstAttributeOfAtom(String atom, String slice); boolean isValidTensor(); int[] getTensorDimensions(); ArrayList<String> getAtomHeaders(); List<String> getAtoms(); List<String> getAttributes(); List<String> getSlices(); int getNumberOfConnections(); TensorMatchingData writeCleanedOutputFiles(String folder); void writeOutputFiles(String folder); }
TensorMatchingData { public void addAtomConnection(String atom1, String atom2, boolean addOnlyIfAtomsExist) { checkAttributeOrAtomName(atom1); checkAttributeOrAtomName(atom2); if (!addOnlyIfAtomsExist || (addOnlyIfAtomsExist && atoms.contains(atom1) && atoms.contains(atom2))) { int x1 = addAtom(atom1); int x2 = addAtom(atom2); int x3 = addSlice(CONNECTION_SLICE_NAME); tensor.setEntry(1.0d, x1, x2, x3); tensor.setEntry(1.0d, x2, x1, x3); } } TensorMatchingData(); void addAtomConnection(String atom1, String atom2, boolean addOnlyIfAtomsExist); void addAtomAttribute(String sliceName, String atomUri, String attributeValue); void addAtomAttribute(TensorEntry entry); String getFirstAttributeOfAtom(String atom, String slice); boolean isValidTensor(); int[] getTensorDimensions(); ArrayList<String> getAtomHeaders(); List<String> getAtoms(); List<String> getAttributes(); List<String> getSlices(); int getNumberOfConnections(); TensorMatchingData writeCleanedOutputFiles(String folder); void writeOutputFiles(String folder); static final String HEADERS_FILE; static final String ATOM_INDICES_FILE; static final String CONNECTION_SLICE_NAME; }