org.jnetpcap.util
Class PcapPacketArrayList

java.lang.Object
  extended by org.jnetpcap.util.PcapPacketArrayList
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<PcapPacket>, java.util.Collection<PcapPacket>, java.util.List<PcapPacket>, java.util.RandomAccess, PcapPacketHandler<java.lang.Object>

public class PcapPacketArrayList
extends java.lang.Object
implements java.util.List<PcapPacket>, java.util.RandomAccess, java.io.Serializable, PcapPacketHandler<java.lang.Object>

The Class PcapPacketArrayList.

Author:
Mark Bednarczyk, Sly Technologies, Inc.
See Also:
Serialized Form

Constructor Summary
PcapPacketArrayList()
          Instantiates a new pcap packet array list.
PcapPacketArrayList(java.util.Collection<? extends PcapPacket> collection)
          Instantiates a new pcap packet array list.
PcapPacketArrayList(int initialCapacity)
          Instantiates a new pcap packet array list.
 
Method Summary
 void add(int index, PcapPacket element)
          Adds the.
 boolean add(PcapPacket o)
          Adds the.
 boolean addAll(java.util.Collection<? extends PcapPacket> c)
          Adds the all.
 boolean addAll(int index, java.util.Collection<? extends PcapPacket> c)
          Adds the all.
 void clear()
          Clear.
 java.lang.Object clone()
          Clone.
 boolean contains(java.lang.Object elem)
          Contains.
 boolean containsAll(java.util.Collection<?> c)
          Contains all.
 void ensureCapacity(int minCapacity)
          Ensure capacity.
 boolean equals(java.lang.Object o)
          Equals.
 PcapPacket get(int index)
          Gets the.
 int hashCode()
          Hash code.
 int indexOf(java.lang.Object elem)
          Index of.
 boolean isEmpty()
          Checks if is empty.
 java.util.Iterator<PcapPacket> iterator()
          Iterator.
 int lastIndexOf(java.lang.Object elem)
          Last index of.
 java.util.ListIterator<PcapPacket> listIterator()
          List iterator.
 java.util.ListIterator<PcapPacket> listIterator(int index)
          List iterator.
 void nextPacket(PcapPacket packet, java.lang.Object user)
          Next packet.
 PcapPacket remove(int index)
          Removes the.
 boolean remove(java.lang.Object o)
          Removes the.
 boolean removeAll(java.util.Collection<?> c)
          Removes the all.
 boolean retainAll(java.util.Collection<?> c)
          Retain all.
 PcapPacket set(int index, PcapPacket element)
          Sets the.
 int size()
          Size.
 java.util.List<PcapPacket> subList(int fromIndex, int toIndex)
          Sub list.
 java.lang.Object[] toArray()
          To array.
<T> T[]
toArray(T[] a)
          To array.
 java.lang.String toString()
          To string.
 void trimToSize()
          Trim to size.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PcapPacketArrayList

public PcapPacketArrayList()
Instantiates a new pcap packet array list.


PcapPacketArrayList

public PcapPacketArrayList(int initialCapacity)
Instantiates a new pcap packet array list.

Parameters:
initialCapacity - the initial capacity

PcapPacketArrayList

public PcapPacketArrayList(java.util.Collection<? extends PcapPacket> collection)
Instantiates a new pcap packet array list.

Parameters:
collection - the collection
Method Detail

add

public void add(int index,
                PcapPacket element)
Adds the.

Specified by:
add in interface java.util.List<PcapPacket>
Parameters:
index - the index
element - the element
See Also:
ArrayList.add(int, java.lang.Object)

add

public boolean add(PcapPacket o)
Adds the.

Specified by:
add in interface java.util.Collection<PcapPacket>
Specified by:
add in interface java.util.List<PcapPacket>
Parameters:
o - the o
Returns:
true, if successful
See Also:
ArrayList.add(java.lang.Object)

addAll

public boolean addAll(java.util.Collection<? extends PcapPacket> c)
Adds the all.

Specified by:
addAll in interface java.util.Collection<PcapPacket>
Specified by:
addAll in interface java.util.List<PcapPacket>
Parameters:
c - the c
Returns:
true, if successful
See Also:
ArrayList.addAll(java.util.Collection)

addAll

public boolean addAll(int index,
                      java.util.Collection<? extends PcapPacket> c)
Adds the all.

Specified by:
addAll in interface java.util.List<PcapPacket>
Parameters:
index - the index
c - the c
Returns:
true, if successful
See Also:
ArrayList.addAll(int, java.util.Collection)

clear

public void clear()
Clear.

Specified by:
clear in interface java.util.Collection<PcapPacket>
Specified by:
clear in interface java.util.List<PcapPacket>
See Also:
ArrayList.clear()

clone

public java.lang.Object clone()
Clone.

Overrides:
clone in class java.lang.Object
Returns:
the object
See Also:
ArrayList.clone()

contains

public boolean contains(java.lang.Object elem)
Contains.

Specified by:
contains in interface java.util.Collection<PcapPacket>
Specified by:
contains in interface java.util.List<PcapPacket>
Parameters:
elem - the elem
Returns:
true, if successful
See Also:
ArrayList.contains(java.lang.Object)

containsAll

public boolean containsAll(java.util.Collection<?> c)
Contains all.

Specified by:
containsAll in interface java.util.Collection<PcapPacket>
Specified by:
containsAll in interface java.util.List<PcapPacket>
Parameters:
c - the c
Returns:
true, if successful
See Also:
AbstractCollection.containsAll(java.util.Collection)

ensureCapacity

public void ensureCapacity(int minCapacity)
Ensure capacity.

Parameters:
minCapacity - the min capacity
See Also:
ArrayList.ensureCapacity(int)

equals

public boolean equals(java.lang.Object o)
Equals.

Specified by:
equals in interface java.util.Collection<PcapPacket>
Specified by:
equals in interface java.util.List<PcapPacket>
Overrides:
equals in class java.lang.Object
Parameters:
o - the o
Returns:
true, if successful
See Also:
AbstractList.equals(java.lang.Object)

get

public PcapPacket get(int index)
Gets the.

Specified by:
get in interface java.util.List<PcapPacket>
Parameters:
index - the index
Returns:
the pcap packet
See Also:
ArrayList.get(int)

hashCode

public int hashCode()
Hash code.

Specified by:
hashCode in interface java.util.Collection<PcapPacket>
Specified by:
hashCode in interface java.util.List<PcapPacket>
Overrides:
hashCode in class java.lang.Object
Returns:
the int
See Also:
AbstractList.hashCode()

indexOf

public int indexOf(java.lang.Object elem)
Index of.

Specified by:
indexOf in interface java.util.List<PcapPacket>
Parameters:
elem - the elem
Returns:
the int
See Also:
ArrayList.indexOf(java.lang.Object)

isEmpty

public boolean isEmpty()
Checks if is empty.

Specified by:
isEmpty in interface java.util.Collection<PcapPacket>
Specified by:
isEmpty in interface java.util.List<PcapPacket>
Returns:
true, if is empty
See Also:
ArrayList.isEmpty()

iterator

public java.util.Iterator<PcapPacket> iterator()
Iterator.

Specified by:
iterator in interface java.lang.Iterable<PcapPacket>
Specified by:
iterator in interface java.util.Collection<PcapPacket>
Specified by:
iterator in interface java.util.List<PcapPacket>
Returns:
the iterator
See Also:
AbstractList.iterator()

lastIndexOf

public int lastIndexOf(java.lang.Object elem)
Last index of.

Specified by:
lastIndexOf in interface java.util.List<PcapPacket>
Parameters:
elem - the elem
Returns:
the int
See Also:
ArrayList.lastIndexOf(java.lang.Object)

listIterator

public java.util.ListIterator<PcapPacket> listIterator()
List iterator.

Specified by:
listIterator in interface java.util.List<PcapPacket>
Returns:
the list iterator
See Also:
AbstractList.listIterator()

listIterator

public java.util.ListIterator<PcapPacket> listIterator(int index)
List iterator.

Specified by:
listIterator in interface java.util.List<PcapPacket>
Parameters:
index - the index
Returns:
the list iterator
See Also:
AbstractList.listIterator(int)

remove

public PcapPacket remove(int index)
Removes the.

Specified by:
remove in interface java.util.List<PcapPacket>
Parameters:
index - the index
Returns:
the pcap packet
See Also:
ArrayList.remove(int)

remove

public boolean remove(java.lang.Object o)
Removes the.

Specified by:
remove in interface java.util.Collection<PcapPacket>
Specified by:
remove in interface java.util.List<PcapPacket>
Parameters:
o - the o
Returns:
true, if successful
See Also:
ArrayList.remove(java.lang.Object)

removeAll

public boolean removeAll(java.util.Collection<?> c)
Removes the all.

Specified by:
removeAll in interface java.util.Collection<PcapPacket>
Specified by:
removeAll in interface java.util.List<PcapPacket>
Parameters:
c - the c
Returns:
true, if successful
See Also:
AbstractCollection.removeAll(java.util.Collection)

retainAll

public boolean retainAll(java.util.Collection<?> c)
Retain all.

Specified by:
retainAll in interface java.util.Collection<PcapPacket>
Specified by:
retainAll in interface java.util.List<PcapPacket>
Parameters:
c - the c
Returns:
true, if successful
See Also:
AbstractCollection.retainAll(java.util.Collection)

set

public PcapPacket set(int index,
                      PcapPacket element)
Sets the.

Specified by:
set in interface java.util.List<PcapPacket>
Parameters:
index - the index
element - the element
Returns:
the pcap packet
See Also:
ArrayList.set(int, java.lang.Object)

size

public int size()
Size.

Specified by:
size in interface java.util.Collection<PcapPacket>
Specified by:
size in interface java.util.List<PcapPacket>
Returns:
the int
See Also:
ArrayList.size()

subList

public java.util.List<PcapPacket> subList(int fromIndex,
                                          int toIndex)
Sub list.

Specified by:
subList in interface java.util.List<PcapPacket>
Parameters:
fromIndex - the from index
toIndex - the to index
Returns:
the list
See Also:
AbstractList.subList(int, int)

toArray

public java.lang.Object[] toArray()
To array.

Specified by:
toArray in interface java.util.Collection<PcapPacket>
Specified by:
toArray in interface java.util.List<PcapPacket>
Returns:
the object[]
See Also:
ArrayList.toArray()

toArray

public <T> T[] toArray(T[] a)
To array.

Specified by:
toArray in interface java.util.Collection<PcapPacket>
Specified by:
toArray in interface java.util.List<PcapPacket>
Type Parameters:
T - the generic type
Parameters:
a - the a
Returns:
the t[]
See Also:
ArrayList.toArray(Object[])

toString

public java.lang.String toString()
To string.

Overrides:
toString in class java.lang.Object
Returns:
the string
See Also:
AbstractCollection.toString()

trimToSize

public void trimToSize()
Trim to size.

See Also:
ArrayList.trimToSize()

nextPacket

public void nextPacket(PcapPacket packet,
                       java.lang.Object user)
Next packet.

Specified by:
nextPacket in interface PcapPacketHandler<java.lang.Object>
Parameters:
packet - the packet
user - the user
See Also:
PcapPacketHandler.nextPacket(org.jnetpcap.packet.PcapPacket, java.lang.Object)