it.unimi.dsi.fastutil.shorts
Class AbstractShortStack

java.lang.Object
  extended by it.unimi.dsi.fastutil.AbstractStack<Short>
      extended by it.unimi.dsi.fastutil.shorts.AbstractShortStack
All Implemented Interfaces:
ShortStack, Stack<Short>

public abstract class AbstractShortStack
extends AbstractStack<Short>
implements ShortStack

An abstract class providing basic methods for implementing a type-specific stack interface.

To create a type-specific stack, you need both object methods and primitive-type methods. However, if you inherit from this class you need just one (anyone).


Constructor Summary
protected AbstractShortStack()
           
 
Method Summary
 Short peek(int i)
          Delegates to the corresponding type-specific method.
 short peekShort(int i)
          Delegates to the corresponding generic method.
 Short pop()
          Delegates to the corresponding type-specific method.
 short popShort()
          Delegates to the corresponding generic method.
 void push(short k)
          Delegates to the corresponding generic method.
 void push(Short o)
          Delegates to the corresponding type-specific method.
 Short top()
          Delegates to the corresponding type-specific method.
 short topShort()
          Delegates to the corresponding generic method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.fastutil.Stack
isEmpty
 

Constructor Detail

AbstractShortStack

protected AbstractShortStack()
Method Detail

push

public void push(Short o)
Delegates to the corresponding type-specific method.

Specified by:
push in interface Stack<Short>
Parameters:
o - the object that will become the new top of the stack.

pop

public Short pop()
Delegates to the corresponding type-specific method.

Specified by:
pop in interface Stack<Short>
Returns:
the top of the stack.

top

public Short top()
Delegates to the corresponding type-specific method.

Specified by:
top in interface Stack<Short>
Overrides:
top in class AbstractStack<Short>
Returns:
the top of the stack.

peek

public Short peek(int i)
Delegates to the corresponding type-specific method.

Specified by:
peek in interface Stack<Short>
Overrides:
peek in class AbstractStack<Short>
Returns:
the i-th element on the stack; 0 represents the top.

push

public void push(short k)
Delegates to the corresponding generic method.

Specified by:
push in interface ShortStack
See Also:
Stack.push(Object)

popShort

public short popShort()
Delegates to the corresponding generic method.

Specified by:
popShort in interface ShortStack
See Also:
Stack.pop()

topShort

public short topShort()
Delegates to the corresponding generic method.

Specified by:
topShort in interface ShortStack
See Also:
Stack.top()

peekShort

public short peekShort(int i)
Delegates to the corresponding generic method.

Specified by:
peekShort in interface ShortStack
See Also:
Stack.peek(int)


Copyright © 2011. All Rights Reserved.