compile TagSet to Tag[]
This commit is contained in:
parent
6ff66a7567
commit
00abbc839b
@ -14,14 +14,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.oscim.core;
|
package org.oscim.core;
|
||||||
|
|
||||||
|
|
||||||
public class TagSet {
|
public class TagSet {
|
||||||
public static TagSet EMPTY_TAG_SET = new TagSet();
|
public static TagSet EMPTY_TAG_SET = new TagSet();
|
||||||
|
|
||||||
public Tag[] tags;
|
public Tag[] tags;
|
||||||
public int numTags;
|
public int numTags;
|
||||||
|
|
||||||
private TagSet() {
|
public TagSet() {
|
||||||
|
tags = new Tag[10];
|
||||||
}
|
}
|
||||||
|
|
||||||
public TagSet(int count) {
|
public TagSet(int count) {
|
||||||
@ -32,6 +33,12 @@ public class TagSet {
|
|||||||
numTags = 0;
|
numTags = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Tag[] asArray(){
|
||||||
|
Tag[] result = new Tag[numTags];
|
||||||
|
System.arraycopy(tags, 0, result, 0, numTags);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/** find Tag by key - NOTE: key must be internal() */
|
/** find Tag by key - NOTE: key must be internal() */
|
||||||
public Tag get(String key) {
|
public Tag get(String key) {
|
||||||
for (int i = 0; i < numTags; i++) {
|
for (int i = 0; i < numTags; i++) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user