hudson.plugins.analysis.util.model
Class LineRangeList
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<LineRange>
hudson.plugins.analysis.util.model.LineRangeList
- All Implemented Interfaces:
- Serializable, Iterable<LineRange>, Collection<LineRange>, List<LineRange>
public class LineRangeList
- extends AbstractList<LineRange>
- implements Serializable
List of LineRange that stores values more efficiently at
runtime.
This class thinks of LineRange as two integers (start and end-start),
hence a list of LineRange becomes a list of integers. The class then
stores those integers in byte[]. Each number is packed to UTF-8 like
variable length format. To store a long value N, we first split into 7 bit
chunk, and store each 7 bit chunk as a byte, in the little endian order. The
last byte gets its 8th bit set to indicate that that's the last byte. Thus in
this format, 0x0 gets stored as 0x80, 0x1234 gets stored as
{0x34,0xA4(0x24|0x80)}.
This variable length mode stores data most efficiently, since most line
numbers are small. Access characteristic gets close to that of
LinkedList, since we can only traverse this packed byte[] from the
start or from the end.
- Author:
- Kohsuke Kawaguchi
- See Also:
- Serialized Form
LineRangeList
public LineRangeList()
LineRangeList
public LineRangeList(int capacity)
LineRangeList
public LineRangeList(Collection<LineRange> copy)
contains
public boolean contains(Object o)
- Specified by:
contains in interface Collection<LineRange>- Specified by:
contains in interface List<LineRange>- Overrides:
contains in class AbstractCollection<LineRange>
get
public LineRange get(int index)
- Specified by:
get in interface List<LineRange>- Specified by:
get in class AbstractList<LineRange>
size
public int size()
- Specified by:
size in interface Collection<LineRange>- Specified by:
size in interface List<LineRange>- Specified by:
size in class AbstractCollection<LineRange>
set
public LineRange set(int index,
LineRange element)
- Specified by:
set in interface List<LineRange>- Overrides:
set in class AbstractList<LineRange>
add
public void add(int index,
LineRange element)
- Specified by:
add in interface List<LineRange>- Overrides:
add in class AbstractList<LineRange>
remove
public LineRange remove(int index)
- Specified by:
remove in interface List<LineRange>- Overrides:
remove in class AbstractList<LineRange>
add
public boolean add(LineRange lr)
- Specified by:
add in interface Collection<LineRange>- Specified by:
add in interface List<LineRange>- Overrides:
add in class AbstractList<LineRange>
clear
public void clear()
- Specified by:
clear in interface Collection<LineRange>- Specified by:
clear in interface List<LineRange>- Overrides:
clear in class AbstractList<LineRange>
iterator
public Iterator<LineRange> iterator()
- Specified by:
iterator in interface Iterable<LineRange>- Specified by:
iterator in interface Collection<LineRange>- Specified by:
iterator in interface List<LineRange>- Overrides:
iterator in class AbstractList<LineRange>
listIterator
public ListIterator<LineRange> listIterator()
- Specified by:
listIterator in interface List<LineRange>- Overrides:
listIterator in class AbstractList<LineRange>
listIterator
public ListIterator<LineRange> listIterator(int index)
- Specified by:
listIterator in interface List<LineRange>- Overrides:
listIterator in class AbstractList<LineRange>
trim
public void trim()
- Minimizes the memory waste by throwing away excess capacity.
Copyright © 2004-2012 Hudson. All Rights Reserved.