jsts
Version:
A JavaScript library of spatial predicates and functions for processing geometry
48 lines (47 loc) • 1.59 kB
TypeScript
/**
* @see http://download.oracle.com/javase/6/docs/api/java/util/Stack.html
*/
export default class Stack extends List {
array: any[];
add(e: any): boolean;
get(index: any): any;
/**
* Pushes an item onto the top of this stack.
* @param {Object} e
* @return {Object}
*/
push(e: any): any;
/**
* Removes the object at the top of this stack and returns that object as the value of this function.
* @return {Object}
*/
pop(): any;
/**
* Looks at the object at the top of this stack without removing it from the
* stack.
* @return {Object}
*/
peek(): any;
/**
* Tests if this stack is empty.
* @return {boolean} true if and only if this stack contains no items; false
* otherwise.
*/
empty(): boolean;
/**
* Returns the 1-based position where an object is on this stack. If the object
* o occurs as an item in this stack, this method returns the distance from the
* top of the stack of the occurrence nearest the top of the stack; the topmost
* item on the stack is considered to be at distance 1. The equals method is
* used to compare o to the items in this stack.
*
* NOTE: does not currently actually use equals. (=== is used)
*
* @param {Object} o
* @return {number} the 1-based position from the top of the stack where the
* object is located; the return value -1 indicates that the object is
* not on the stack.
*/
search(o: any): number;
}
import List from './List.js';