|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.perforce.p4java.core.ViewMap<E>
public class ViewMap<E extends IMapEntry>
Defines the common operations to Perforce view maps. View maps are normally used in Perforce clients, labels, branches, etc., to map one type of path (a depot path, for example) to a different type of path (e.g. a client path).
View maps work in a manner that's described in the main Perforce documentation for the basic client view, but in summary, map entries can be inclusive, exclusive, or overlays, and map entry order is (of course) deeply significant.
This implementation of view maps does not (yet) include advanced Perforce functionality (such as translation or testing the map to see whether a path is mapped or not), but future versions will; the emphasis here is on setting up a common basis for P4Java view maps.
Field Summary | |
---|---|
protected List<E> |
entryList
|
Constructor Summary | |
---|---|
ViewMap()
Default constructor. |
|
ViewMap(List<E> entryList)
Constructs a new ViewMap from the passed-in entry list. |
Method Summary | |
---|---|
void |
addEntry(E entry)
Add a map new entry at the end of the view map. |
void |
checkEntryList(List<E> entryList)
Do some sanity checks on the passed-in entry list. |
void |
deleteEntry(int position)
Delete the entry at the specified position. |
E |
getEntry(int position)
Get the map entry at the specified position. |
List<E> |
getEntryList()
Get the entry list associated with this view map. |
int |
getSize()
Return the number of elements in the associated entry list. |
Iterator<E> |
iterator()
|
void |
setEntry(int position,
E entry)
Set (replace) a specific map position. |
void |
setEntryList(List<E> entryList)
Set the entry list associated with this view map. |
protected void |
updateEntryListPositions()
Update the entry list entry positions after an update by reassigning entry-internal positions as appropriate. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected List<E extends IMapEntry> entryList
Constructor Detail |
---|
public ViewMap()
public ViewMap(List<E> entryList)
entryList
- non-null (but possibly-empty) entry list.Method Detail |
---|
public int getSize()
public void deleteEntry(int position)
position
- order of entry to be deletedpublic E getEntry(int position)
position
- list position to usepublic List<E> getEntryList()
public void addEntry(E entry)
entry
- non-null map entry.public void setEntry(int position, E entry)
Will throw a P4JavaError if order is out of bounds or if the new entry is null. The value of the entry's order field will be set to the order in the entry list; the value of the replaced entry's order field will be set to ORDER_UNKNOWN.
position
- list order of replacemententry
- non-null replacement entrypublic void setEntryList(List<E> entryList)
entryList
- non-null entry listpublic void checkEntryList(List<E> entryList)
protected void updateEntryListPositions()
public Iterator<E> iterator()
iterator
in interface Iterable<E extends IMapEntry>
Iterable.iterator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |