it.unimi.dsi.fastutil.bytes
Class AbstractByteStack

java.lang.Object
  extended by it.unimi.dsi.fastutil.AbstractStack<Byte>
      extended by it.unimi.dsi.fastutil.bytes.AbstractByteStack
All Implemented Interfaces:
ByteStack, Stack<Byte>

public abstract class AbstractByteStack
extends AbstractStack<Byte>
implements ByteStack

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 AbstractByteStack()
           
 
Method Summary
 Byte peek(int i)
          Delegates to the corresponding type-specific method.
 byte peekByte(int i)
          Delegates to the corresponding generic method.
 Byte pop()
          Delegates to the corresponding type-specific method.
 byte popByte()
          Delegates to the corresponding generic method.
 void push(byte k)
          Delegates to the corresponding generic method.
 void push(Byte o)
          Delegates to the corresponding type-specific method.
 Byte top()
          Delegates to the corresponding type-specific method.
 byte topByte()
          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

AbstractByteStack

protected AbstractByteStack()
Method Detail

push

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

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

pop

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

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

top

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

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

peek

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

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

push

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

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

popByte

public byte popByte()
Delegates to the corresponding generic method.

Specified by:
popByte in interface ByteStack
See Also:
Stack.pop()

topByte

public byte topByte()
Delegates to the corresponding generic method.

Specified by:
topByte in interface ByteStack
See Also:
Stack.top()

peekByte

public byte peekByte(int i)
Delegates to the corresponding generic method.

Specified by:
peekByte in interface ByteStack
See Also:
Stack.peek(int)


Copyright © 2011. All Rights Reserved.