Groups the current element according to the value

@param answer  the map containing the results
@param element the element to be placed
@param value   the value according to which the element will be placed
@since 1.5.0
762372
protected static <K, T> void groupAnswer(final Map<K, List<T>> answer, T element, K value) {
        if (answer.containsKey(value)) {
            answer.get(value).add(element);
        } else {
            List<T> groupedElements = new ArrayList<T>();
            groupedElements.add(element);
            answer.put(value, groupedElements);
        }
    }
992061
public void set(MessageMap value) {
    if (array != null)
      array[value.multiChoice.intValue()] = value;
    else
      hashtable.put(value.multiChoice, value);
  }
875835
public void addAction(M element, byte value)
    {
        actions.put(element, Byte.valueOf(value));
    }
1298514
boolean foundGroupFormat(Map<String,?> map, String elementFormat) {
        if (map.containsKey(elementFormat)) {
            initMessages();
            messages.error("doclet.Same_element_name_used", elementFormat);
            return true;
        }
        return false;
    }
326529
@Override
	public void add(long value, T element) {
		if (root == null) {
			root = new Node<T>(value, element, false);
			first = last = root;
			return;
		}
		root = add(value, element, root);
		root.red = false;
	}
1294606
private static void parseValueElement(Element element,
			ConfigurableEmitter.Value value) {
		if (element == null) {
			return;
		}

		String type = element.getAttribute("type");
		String v = element.getAttribute("value");

		if (type == null || type.length() == 0) {
			// support for old style which did not write the type
			if (value instanceof SimpleValue) {
				((SimpleValue) value).setValue(Float.parseFloat(v));
			} else if (value instanceof RandomValue) {
				((RandomValue) value).setValue(Float.parseFloat(v));
			} else {
				Log.warn("problems reading element, skipping: " + element);
			}
		} else {
			// type given: this is the new style
			if (type.equals("simple")) {
				((SimpleValue) value).setValue(Float.parseFloat(v));
			} else if (type.equals("random")) {
				((RandomValue) value).setValue(Float.parseFloat(v));
			} else if (type.equals("linear")) {
				String min = element.getAttribute("min");
				String max = element.getAttribute("max");
				String active = element.getAttribute("active");

				NodeList points = element.getElementsByTagName("point");

				ArrayList curve = new ArrayList();
				for (int i = 0; i < points.getLength(); i++) {
					Element point = (Element) points.item(i);

					float x = Float.parseFloat(point.getAttribute("x"));
					float y = Float.parseFloat(point.getAttribute("y"));

					curve.add(new Vector2f(x, y));
				}

				((LinearInterpolator) value).setCurve(curve);
				((LinearInterpolator) value).setMin(Integer.parseInt(min));
				((LinearInterpolator) value).setMax(Integer.parseInt(max));
				((LinearInterpolator) value).setActive("true".equals(active));
			} else {
				Log.warn("unkown type detected: " + type);
			}
		}
	}
1133966
function groupBy(expression) {

        //Check arguments
        if (!expression)
            throw new Error("Expression is invalid");

        //Define output maps
        var maps = [];

        //For each element on array
        for (var i = 0; i < this.items.length; i++) {

            //Get group key of current element
            var groupKey = expression(this.items[i]);

            //Check if another element with the same key is on maps
            var existingMap = null;

            //For each existing element on maps
            for (var n = 0; n < maps.length; n++) {
			
                //If we have element with the same key
				if (equals(maps[n].key, groupKey)){

                    //Set on external variable and break
                    existingMap = maps[n];
                    break;
                }
            }

            //If not existing elements were found, create
            if (!existingMap) {

                //Create with base values
                existingMap = {
                    key: groupKey,
                    count: 0, 
					elements: []
                };

                //Add element to map array
                maps.push(existingMap);
            }

            //Increment the counter
            existingMap.count++;
			
			//Push current element to "elements" property
			existingMap.elements.push(this.items[i]);
        }

        //Return for chaining
        return new jslinq(maps);
    }
436950
public double setCount(T element, double count) {
        AtomicDouble t = map.get(element);
        if (t != null) {
            double val = t.getAndSet(count);
            dirty.set(true);
            return val;
        } else {
            map.put(element, new AtomicDouble(count));
            totalCount.addAndGet(count);
            return 0;
        }

    }
1037744
public T put(final T value) {
		expungeStaleEntries();
		//
		final int hash = value.hashCode();
		int index = (hash & 0x7FFFFFFF) % elementData.length;
		Entry<T> entry = elementData[index];
		while (entry != null && !eq(value, entry.get())) {
			entry = entry.nextInSlot;
		}

		if (entry == null) {
			if (++elementCount > threshold) {
				expandElementArray(elementData.length);
				index = (hash & 0x7FFFFFFF) % elementData.length;
			}
			entry = createHashedEntry(value, index);
			return null;
		}

		final T result = entry.get();
		return result;
	}
363501
public void put(Interval1D<K> interval, V value) {
    Node<K, V> origNode = get(interval);
    if (origNode != null) {
      //System.err.println("Dupe is being put into the map. Interval: " + interval +
      //        "\n\tOld: " + origNode.getValue() + " New: " + value);
      origNode.setValue(value);
    } else {
      root = randomizedInsert(root, interval, value);
    }
  }
1306693
public ElementWithOptions addOptionToGroup(Option option, String groupId) {
        if (option == null) {
            throw new IllegalArgumentException("Option cannot be null");
        }

        for (OptionGroup group : optionGroups.values()) {
            if (group.hasValue(option.getValue())) {
                throw new IllegalArgumentException("The value '" + option.getValue() + "' is already present in this element");
            }
        }

        OptionGroup group = optionGroups.get(groupId);

        if (group == null) {
            group = new OptionGroup(groupId, null);
            this.addOptionGroup(group);
        }

        group.addOption(option);

        return this;
    }
791105
@Override
	public String put(String key, String value) {
		return this.groupedMap.put(DEFAULT_GROUP, key, value);
	}
733372
@Override
    public boolean contains(long value, T element) {
    	if (root == null) return false;
    	if (value < first.value) return false;
    	if (value > last.value) return false;
    	if (value == first.value && ObjectUtil.equalsOrNull(element, first.element)) return true;
    	if (value == last.value && ObjectUtil.equalsOrNull(element, last.element)) return true;
    	return contains(root, value, element);
    }
399247
public void addValue(String value)
    {
        if(this.values == null)
            this.values = new ArrayList<String>();
        this.values.add(value);
    }
345802
void add(MapElement element) {
		final Rectangle2d r = element.getBoundingBox();
		if (r != null) {
			if (Double.isNaN(this.minx) || this.minx > r.getMinX()) {
				this.minx = r.getMinX();
			}
			if (Double.isNaN(this.maxx) || this.maxx < r.getMaxX()) {
				this.maxx = r.getMaxX();
			}
			if (Double.isNaN(this.miny) || this.miny > r.getMinY()) {
				this.miny = r.getMinY();
			}
			if (Double.isNaN(this.maxy) || this.maxy < r.getMaxY()) {
				this.maxy = r.getMaxY();
			}
		}
		this.elements.add(element);
	}
456400
public void addElement(int value)
  {

    if (!m_mutable)
      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");

    super.addElement(value);
  }
234437
public ElementWithOptions removeOption(String value) {
        for (OptionGroup group : optionGroups.values()) {
            group.removeOption(value);
        }
        return this;
    }