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     * @return 
027     */
028    @JsProperty
029    public native int getLenth();
030
031    /**
032     * Returns an item in the list by its index (or undefined if the number is
033     * greater than or equal to the length of the list, prior to Gecko 7.0
034     * returned null)
035     *
036     * @param index
037     * @return
038     */
039    public native String item(int index);
040
041    /**
042     * Returns true if the underlying string contains token, otherwise false
043     *
044     * @param obj
045     * @return
046     */
047    public native Boolean contains(String obj);
048
049    /**
050     * Adds token to the underlying string
051     *
052     * @param obj
053     */
054    public native void add(String obj);
055
056    /**
057     * Removes token from the underlying string
058     *
059     * @param obj
060     */
061    public native void remove(String obj);
062
063    /**
064     * Removes token from string and returns false. If token doesn't exist it's
065     * added and the function returns true
066     *
067     * @param obj
068     * @return
069     */
070    public native Boolean toggle(String obj);
071
072}