- Alle implementierten Schnittstellen:
Serializable,Iterable<LineRange>,Collection<LineRange>,List<LineRange>,SequencedCollection<LineRange>
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.
- Autor:
- Kohsuke Kawaguchi
- Siehe auch:
-
Feldübersicht
Von Klasse geerbte Felder java.util.AbstractList
modCount -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungCreates an emptyLineRangeList.LineRangeList(int capacity) Creates an emptyLineRangeListwith the specified capacity.LineRangeList(LineRange... initialElements) Creates a newLineRangeListwith the specified elements.LineRangeList(Collection<LineRange> copy) Creates a newLineRangeListwith the specified elements. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidfinal booleanfinal booleanAppends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation).final booleanaddAll(Collection<? extends LineRange> c) voidclear()booleanget(int index) iterator()listIterator(int index) remove(int index) intsize()voidtrim()Minimizes the memory waste by throwing away excess capacity.Von Klasse geerbte Methoden java.util.AbstractList
addAll, equals, hashCode, indexOf, lastIndexOf, removeRange, subListVon Klasse geerbte Methoden java.util.AbstractCollection
containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringVon Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitVon Schnittstelle geerbte Methoden java.util.Collection
parallelStream, removeIf, stream, toArrayVon Schnittstelle geerbte Methoden java.util.List
addFirst, addLast, containsAll, getFirst, getLast, isEmpty, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator, toArray, toArray
-
Konstruktordetails
-
LineRangeList
public LineRangeList()Creates an emptyLineRangeList. It uses a capacity ofDEFAULT_CAPACITY. -
LineRangeList
public LineRangeList(int capacity) Creates an emptyLineRangeListwith the specified capacity.- Parameter:
capacity- the initial capacity of the list
-
LineRangeList
Creates a newLineRangeListwith the specified elements.- Parameter:
copy- the initial elements
-
LineRangeList
Creates a newLineRangeListwith the specified elements.- Parameter:
initialElements- the initial elements
-
-
Methodendetails
-
addAll
- Angegeben von:
addAllin SchnittstelleCollection<LineRange>- Angegeben von:
addAllin SchnittstelleList<LineRange>- Setzt außer Kraft:
addAllin KlasseAbstractCollection<LineRange>
-
addAll
Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)- Parameter:
ranges- collection containing elements to be added to this list- Gibt zurück:
trueif this list changed as a result of the call- Löst aus:
NullPointerException- if the specified collection contains one or more null elements and this list does not permit null elements, or if the specified collection is nullIllegalArgumentException- if some property of an element of the specified collection prevents it from being added to this list- Siehe auch:
-
contains
- Angegeben von:
containsin SchnittstelleCollection<LineRange>- Angegeben von:
containsin SchnittstelleList<LineRange>- Setzt außer Kraft:
containsin KlasseAbstractCollection<LineRange>
-
get
-
size
public int size()- Angegeben von:
sizein SchnittstelleCollection<LineRange>- Angegeben von:
sizein SchnittstelleList<LineRange>- Angegeben von:
sizein KlasseAbstractCollection<LineRange>
-
set
-
add
-
add
- Angegeben von:
addin SchnittstelleCollection<LineRange>- Angegeben von:
addin SchnittstelleList<LineRange>- Setzt außer Kraft:
addin KlasseAbstractList<LineRange>
-
remove
-
clear
public void clear()- Angegeben von:
clearin SchnittstelleCollection<LineRange>- Angegeben von:
clearin SchnittstelleList<LineRange>- Setzt außer Kraft:
clearin KlasseAbstractList<LineRange>
-
iterator
-
listIterator
- Angegeben von:
listIteratorin SchnittstelleList<LineRange>- Setzt außer Kraft:
listIteratorin KlasseAbstractList<LineRange>
-
listIterator
- Angegeben von:
listIteratorin SchnittstelleList<LineRange>- Setzt außer Kraft:
listIteratorin KlasseAbstractList<LineRange>
-
trim
public void trim()Minimizes the memory waste by throwing away excess capacity.
-