it.unimi.dsi.fastutil.longs
Class AbstractLongStack

java.lang.Object
  extended by it.unimi.dsi.fastutil.AbstractStack<Long>
      extended by it.unimi.dsi.fastutil.longs.AbstractLongStack
All Implemented Interfaces:
LongStack, Stack<Long>

public abstract class AbstractLongStack
extends AbstractStack<Long>
implements LongStack

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 AbstractLongStack()
           
 
Method Summary
 Long peek(int i)
          Delegates to the corresponding type-specific method.
 long peekLong(int i)
          Delegates to the corresponding generic method.
 Long pop()
          Delegates to the corresponding type-specific method.
 long popLong()
          Delegates to the corresponding generic method.
 void push(long k)
          Delegates to the corresponding generic method.
 void push(Long o)
          Delegates to the corresponding type-specific method.
 Long top()
          Delegates to the corresponding type-specific method.
 long topLong()
          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

AbstractLongStack

protected AbstractLongStack()
Method Detail

push

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

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

pop

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

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

top

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

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

peek

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

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

push

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

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

popLong

public long popLong()
Delegates to the corresponding generic method.

Specified by:
popLong in interface LongStack
See Also:
Stack.pop()

topLong

public long topLong()
Delegates to the corresponding generic method.

Specified by:
topLong in interface LongStack
See Also:
Stack.top()

peekLong

public long peekLong(int i)
Delegates to the corresponding generic method.

Specified by:
peekLong in interface LongStack
See Also:
Stack.peek(int)


Copyright © 2011. All Rights Reserved.