for(Line line : lines){ writer.append(line.getItemNo()).append(","); writer.append(line.getDescription()).append(","); ... writer.append("\n"); }
public void setGeometryByValue(Line ln) throws ObjectStreamException { try { attribs = null; if (ln == null) { descriptionBitMask = -1; } VertexDescription vd = ln.getDescription(); descriptionBitMask = vd.m_semanticsBitArray; attribs = new double[vd.getTotalComponentCount() * 2]; attribs[0] = ln.getStartX(); attribs[1] = ln.getStartY(); attribs[2] = ln.getEndX(); attribs[3] = ln.getEndY(); int index = 4; for (int i = 1, n = vd.getAttributeCount(); i < n; i++) { int semantics = vd.getSemantics(i); int comps = VertexDescription.getComponentCount(semantics); for (int ord = 0; ord < comps; ord++) { attribs[index++] = ln.getStartAttributeAsDbl(semantics, ord); attribs[index++] = ln.getEndAttributeAsDbl(semantics, ord); } } } catch (Exception ex) { throw new InvalidObjectException("Cannot serialize this geometry"); } } }
public void setGeometryByValue(Line ln) throws ObjectStreamException { try { attribs = null; if (ln == null) { descriptionBitMask = -1; } VertexDescription vd = ln.getDescription(); descriptionBitMask = vd.m_semanticsBitArray; attribs = new double[vd.getTotalComponentCount() * 2]; attribs[0] = ln.getStartX(); attribs[1] = ln.getStartY(); attribs[2] = ln.getEndX(); attribs[3] = ln.getEndY(); int index = 4; for (int i = 1, n = vd.getAttributeCount(); i < n; i++) { int semantics = vd.getSemantics(i); int comps = VertexDescription.getComponentCount(semantics); for (int ord = 0; ord < comps; ord++) { attribs[index++] = ln.getStartAttributeAsDbl(semantics, ord); attribs[index++] = ln.getEndAttributeAsDbl(semantics, ord); } } } catch (Exception ex) { throw new InvalidObjectException("Cannot serialize this geometry"); } } }