001/*
002 * To change this license header, choose License Headers in Project Properties.
003 * To change this template file, choose Tools | Templates
004 * and open the template in the editor.
005 */
006package gwt.material.design.jscore.client.api.core;
007
008import jsinterop.annotations.JsProperty;
009import jsinterop.annotations.JsType;
010
011/**
012 * Documentación de {@link DOMTokenList}.
013 *
014 * //TODO Documentar la interface
015 *
016 * @author Cristian Rinaldi <csrinaldi@gmail.com>
017 */
018@JsType(isNative = true)
019public class DOMTokenList {
020
021    /**
022     * This interface doesn't inherit any property.
023     *
024     * DOMTokenList.length Read only Is an integer representing the number of
025     * objects stored in the object.
026     */
027    @JsProperty
028    public native int getLenth();
029
030    /**
031     * Returns an item in the list by its index (or undefined if the number is
032     * greater than or equal to the length of the list, prior to Gecko 7.0
033     * returned null)
034     *
035     * @param index
036     */
037    public native String item(int index);
038
039    /**
040     * Returns true if the underlying string contains token, otherwise false
041     *
042     * @param obj
043     */
044    public native Boolean contains(String obj);
045
046    /**
047     * Adds token to the underlying string
048     *
049     * @param obj
050     */
051    public native void add(String obj);
052
053    /**
054     * Removes token from the underlying string
055     *
056     * @param obj
057     */
058    public native void remove(String obj);
059
060    /**
061     * Removes token from string and returns false. If token doesn't exist it's
062     * added and the function returns true
063     *
064     * @param obj
065     */
066    public native Boolean toggle(String obj);
067
068}