Skip to content

Commit 014c589

Browse files
committed
todo notes and fix for copy() method in Dict classes
1 parent 73041e1 commit 014c589

5 files changed

Lines changed: 23 additions & 18 deletions

File tree

core/src/processing/data/FloatDict.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,7 @@ public FloatDict copy() {
519519
for (int i = 0; i < count; i++) {
520520
outgoing.indices.put(keys[i], i);
521521
}
522+
outgoing.count = count;
522523
return outgoing;
523524
}
524525

core/src/processing/data/IntDict.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ public IntDict copy() {
409409
for (int i = 0; i < count; i++) {
410410
outgoing.indices.put(keys[i], i);
411411
}
412+
outgoing.count = count;
412413
return outgoing;
413414
}
414415

core/src/processing/data/StringDict.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ public StringDict copy() {
346346
for (int i = 0; i < count; i++) {
347347
outgoing.indices.put(keys[i], i);
348348
}
349+
outgoing.count = count;
349350
return outgoing;
350351
}
351352

core/todo.txt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -153,24 +153,24 @@ o inc(), inc(amount), dec(), dec(amount)
153153
X replace (especially for null and NaN)
154154
X make note that these work, and are special cases
155155
o listAttributes() in XML is like array from keys() etc in our data classes
156-
_ removeIndex() vs removeValue() vs remove()
157-
_ remove() refers to an index (with array) or key (with hash)
158-
_ more consistent with other APIs (Java)
159-
_ replaceValue[s]() the same, though more on the line
160-
_ should we not have remove() and removeIndex()
161-
_ and instead always specify? removeKey(), removeIndex(), removeValue()?
162-
_ would mean that hash would only have removeKey
163-
_ downside: remove() takes whatever get() takes as arg
164-
_ with removeValue(), add removeValues() for all values that match?
165-
_ also support NaN here
166-
_ need to sort out the final version of hash/dict/etc and their names
167-
_ JSONObject.has(key) vs XML.hasAttribute(attr) vs HashMap.containsKey()
168-
_ and how it should be handled with hash/dict
169-
_ right now using hasKey().. in JSONObject
170-
_ contains() as default, then containsValue() as the alternate
171-
_ instead of containsKey() and containsValue()
172-
_ hasAttribute in XML, containsKey in java's Map, hasKey in JSON
173-
_ hasChildren() is another precedent
156+
X removeIndex() vs removeValue() vs remove()
157+
X remove() refers to an index (with array) or key (with hash)
158+
X more consistent with other APIs (Java)
159+
X replaceValue[s]() the same, though more on the line
160+
o should we not have remove() and removeIndex()
161+
o and instead always specify? removeKey(), removeIndex(), removeValue()?
162+
o would mean that hash would only have removeKey
163+
o downside: remove() takes whatever get() takes as arg
164+
X with removeValue(), add removeValues() for all values that match?
165+
X also support NaN here
166+
X need to sort out the final version of hash/dict/etc and their names
167+
X JSONObject.has(key) vs XML.hasAttribute(attr) vs HashMap.containsKey()
168+
X and how it should be handled with hash/dict
169+
X right now using hasKey().. in JSONObject
170+
o contains() as default, then containsValue() as the alternate
171+
o instead of containsKey() and containsValue()
172+
X hasAttribute in XML, containsKey in java's Map, hasKey in JSON
173+
X hasChildren() is another precedent
174174
o contains() is nice, but containsKey() is weird, often not 'containing'
175175
X hasKey/hasValue is best; fewest changes and most descriptive
176176
_ not doing print() methods, since alternatives are more descriptive

todo.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,8 @@ _ waiting on retina support for JDK 7
872872
_ http://bugs.sun.com/view_bug.do?bug_id=8009754
873873
_ b86 supposed to have some support (not available yet)
874874
_ http://jdk8.java.net/download.html
875+
_ "Are you sure you want to quit?" when switching modes on Oracle JVM
876+
_ because it's OS X, but menubar isn't available
875877
_ LWJGL forum discussion
876878
_ http://lwjgl.org/forum/index.php/topic,4711.225.html
877879
_ change cmd line for OS X to use symlink?

0 commit comments

Comments
 (0)