public class VertexArrayList extends Object implements VertexListInternal
VertexListInternal that stores the actual vertex references
and simply wraps an ArrayList and keeps a boolean flag to remember whether this list is in sort order.| Modifier and Type | Field and Description |
|---|---|
static Comparator<TitanVertex> |
VERTEX_ID_COMPARATOR |
| Constructor and Description |
|---|
VertexArrayList(StandardTitanTx tx) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(TitanVertex n)
Adds the provided vertex to this list.
|
void |
addAll(VertexList vertexlist)
Copies all vertices in the given vertex list into this list.
|
TitanVertex |
get(int pos)
Returns the vertex at a given position in the list.
|
long |
getID(int pos)
Returns the id of the vertex at the specified position
|
com.carrotsearch.hppc.LongArrayList |
getIDs()
Returns a list of ids of all vertices in this list of vertices in the same order of the original vertex list.
|
boolean |
isSorted()
Whether this list of vertices is sorted by id in increasing order.
|
Iterator<TitanVertex> |
iterator() |
int |
size()
Returns the number of vertices in this list.
|
void |
sort()
Sorts this list according to vertex ids in increasing order.
|
VertexList |
subList(int fromPosition,
int length)
Returns a sub list of this list of vertices from the given position with the given number of vertices.
|
VertexLongList |
toVertexLongList() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic static final Comparator<TitanVertex> VERTEX_ID_COMPARATOR
public VertexArrayList(StandardTitanTx tx)
public void add(TitanVertex n)
VertexListInternaladd in interface VertexListInternalpublic long getID(int pos)
VertexListgetID in interface VertexListpos - The position of the vertex in the listpublic com.carrotsearch.hppc.LongArrayList getIDs()
VertexListgetIDs in interface VertexListLongArrayListpublic TitanVertex get(int pos)
VertexListget in interface VertexListpos - Position for which to retrieve the vertex.public void sort()
VertexListsort in interface VertexListpublic boolean isSorted()
VertexListisSorted in interface VertexListpublic VertexList subList(int fromPosition, int length)
VertexListsubList in interface VertexListpublic int size()
VertexListsize in interface VertexListpublic void addAll(VertexList vertexlist)
VertexListInternaladdAll in interface VertexListInternalpublic VertexLongList toVertexLongList()
public Iterator<TitanVertex> iterator()
iterator in interface Iterable<TitanVertex>Copyright © 2012–2015. All rights reserved.