|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.dna.graph.Location
@Immutable public class Location

The location of a node, as specified by either its path, UUID, and/or identification properties.
| Constructor Summary | |
|---|---|
Location(Iterable<Property> idProperties)
Create a location defined by a path and an iterator over identification properties. |
|
Location(List<Property> idProperties)
Create a location defined by multiple identification properties. |
|
Location(Path path)
Create a location defined by a path. |
|
Location(Path path,
Iterable<Property> idProperties)
Create a location defined by a path and an iterator over identification properties. |
|
Location(Path path,
Property idProperty)
Create a location defined by a path and a single identification property. |
|
Location(Path path,
Property firstIdProperty,
Property... remainingIdProperties)
Create a location defined by a path and multiple identification properties. |
|
Location(Path path,
UUID uuid)
Create a location defined by a path and an UUID. |
|
Location(Property idProperty)
Create a location defined by a single identification property. |
|
Location(Property firstIdProperty,
Property... remainingIdProperties)
Create a location defined by multiple identification properties. |
|
Location(UUID uuid)
Create a location defined by a UUID. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
List<Property> |
getIdProperties()
Get the identification properties that (at least in part) define this location. |
Property |
getIdProperty(Name name)
Get the identification property with the supplied name, if there is such a property. |
Path |
getPath()
Get the path that (at least in part) defines this location. |
int |
hashCode()
|
boolean |
hasIdProperties()
Return whether this location is defined (at least in part) with identification properties. |
boolean |
hasPath()
Return whether this location is defined (at least in part) by a path. |
boolean |
isSame(Location other)
Compare this location to the supplied location, and determine whether the two locations represent the same logical location. |
boolean |
isSame(Location other,
boolean requireSameNameSiblingIndexes)
Compare this location to the supplied location, and determine whether the two locations represent the same logical location. |
Iterator<Property> |
iterator()
|
String |
toString()
|
Location |
with(Path newPath)
Create a copy of this location that uses the supplied path. |
Location |
with(Property newIdProperty)
Create a copy of this location that adds the supplied identification property. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Location(Path path)
path - the path
IllegalArgumentException - if path is nullpublic Location(UUID uuid)
uuid - the UUID
IllegalArgumentException - if uuid is null
public Location(Path path,
UUID uuid)
path - the pathuuid - the UUID, or null if there is no UUID
IllegalArgumentException - if path is null
public Location(Path path,
Property idProperty)
path - the pathidProperty - the identification property
IllegalArgumentException - if path or idProperty is null
public Location(Path path,
Property firstIdProperty,
Property... remainingIdProperties)
path - the pathfirstIdProperty - the first identification propertyremainingIdProperties - the remaining identification property
IllegalArgumentException - if any of the arguments are null
public Location(Path path,
Iterable<Property> idProperties)
path - the pathidProperties - the iterator over the identification properties
IllegalArgumentException - if any of the arguments are nullpublic Location(Property idProperty)
idProperty - the identification property
IllegalArgumentException - if idProperty is null
public Location(Property firstIdProperty,
Property... remainingIdProperties)
firstIdProperty - the first identification propertyremainingIdProperties - the remaining identification property
IllegalArgumentException - if any of the arguments are nullpublic Location(Iterable<Property> idProperties)
idProperties - the iterator over the identification properties
IllegalArgumentException - if any of the arguments are nullpublic Location(List<Property> idProperties)
idProperties - the identification properties
IllegalArgumentException - if idProperties is null or empty| Method Detail |
|---|
public Path getPath()
public boolean hasPath()
path helps define this locationpublic List<Property> getIdProperties()
public boolean hasIdProperties()
identification properties help define this locationpublic Property getIdProperty(Name name)
name - the name of the identification property
are no identification propertiespublic boolean isSame(Location other)
/x/y" path/x/y/z"/x/y/z" path and an identification property {id=3}Note that passing a null location as a parameter will always return false.
other - the other location to compare
public boolean isSame(Location other,
boolean requireSameNameSiblingIndexes)
/x/y" path/x/y/z"/x/y/z" path and an identification property {id=3}Note that passing a null location as a parameter will always return false.
other - the other location to comparerequireSameNameSiblingIndexes - true if the paths must have equivalent same-name-sibling indexes, or false if the same-name-siblings may be different
public Iterator<Property> iterator()
iterator in interface Iterable<Property>Iterable.iterator()public int hashCode()
hashCode in class ObjectObject.hashCode()public boolean equals(Object obj)
equals in class ObjectObject.equals(java.lang.Object)public String toString()
toString in class ObjectObject.toString()public Location with(Property newIdProperty)
newIdProperty - the new identification property, which may be null
public Location with(Path newPath)
newPath - the new path for the location
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||