diff --git a/src/fr/devinsy/xidyn/data/TagDataListByIndex.java b/src/fr/devinsy/xidyn/data/TagDataListByIndex.java index 5e5f6e7..f25971d 100644 --- a/src/fr/devinsy/xidyn/data/TagDataListByIndex.java +++ b/src/fr/devinsy/xidyn/data/TagDataListByIndex.java @@ -21,11 +21,11 @@ package fr.devinsy.xidyn.data; import java.util.Vector; /** - * + * + * @author Christian Pierre MOMON (christian.momon@devinsy.fr) */ public class TagDataListByIndex extends Vector implements TagData { - private static final long serialVersionUID = 215545720925753884L; /** diff --git a/src/fr/devinsy/xidyn/data/TagDataManager.java b/src/fr/devinsy/xidyn/data/TagDataManager.java index 06c1460..e5746c4 100644 --- a/src/fr/devinsy/xidyn/data/TagDataManager.java +++ b/src/fr/devinsy/xidyn/data/TagDataManager.java @@ -37,11 +37,33 @@ public class TagDataManager /** * */ - public void appendAttribute(final String id, final int line, final String column, final String label, final String value) + public void addContent(final String id, final long value) { - SimpleTagData tag = this.getIdData(id, line, column); + addContent(id, String.valueOf(value)); + } - tag.attributes().appendAttribute(label, value); + /** + * + */ + public SimpleTagData addContent(final String id, final String content) + { + SimpleTagData result; + + TagDataListByIndex tags = (TagDataListByIndex) this.idsDataById.getId(id); + if (tags == null) + { + this.idsDataById.setId(id, new TagDataListByIndex()); + + tags = (TagDataListByIndex) this.idsDataById.getId(id); + } + + // Be sure that lines are existing. + result = new SimpleTagData(); + result.setContent(content); + tags.add(result); + + // + return result; } /** @@ -136,10 +158,10 @@ public class TagDataManager } // Be sure that lines are existing. - int nbLines = tags.size(); - for (int nLine = nbLines; nLine < line + 1; nLine++) + int lineCount = tags.size(); + for (int lineIndex = lineCount; lineIndex < line + 1; lineIndex++) { - tags.add(nLine, new SimpleTagData()); + tags.add(lineIndex, new SimpleTagData()); } // Get item. @@ -277,16 +299,16 @@ public class TagDataManager } /** - * - */ + * + */ public void setContent(final String id, final int line, final long value) { setContent(id, line, String.valueOf(value)); } /** - * - */ + * + */ public void setContent(final String id, final int line, final String content) { SimpleTagData tag = this.getIdData(id, line); @@ -305,16 +327,16 @@ public class TagDataManager } /** - * - */ + * + */ public void setContent(final String id, final int line, final String column, final long value) { setContent(id, line, column, String.valueOf(value)); } /** - * - */ + * + */ public void setContent(final String id, final int line, final String column, final String content) { SimpleTagData tag = this.getIdData(id, line, column);