2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
20 package org.apache.thrift.helper;
27 private var _elements = new haxe.ds.StringMap<Int>();
28 private var _size : Int = 0;
29 public var size(get,never) : Int;
31 public function new( values : Array<String> = null) {
32 if ( values != null) {
33 for ( value in values) {
39 public function iterator():Iterator<String> {
40 return _elements.keys();
43 public function traceAll() : Void {
44 trace('$_size entries');
46 var yes = contains(entry);
47 trace('- $entry, contains() = $yes');
51 public function add(o : String) : Bool {
52 if( _elements.exists(o)) {
56 _elements.set(o,_size);
60 public function clear() : Void {
62 remove( _elements.keys().next());
66 public function contains(o : String) : Bool {
67 return _elements.exists(o);
70 public function isEmpty() : Bool {
74 public function remove(o : String) : Bool {
84 public function toArray() : Array<String> {
85 var ret : Array<String> = new Array<String>();
86 for (key in _elements.keys()) {
92 public function get_size() : String {