Package org.onosproject.ui.topo
Class LayoutLocation
- java.lang.Object
- 
- org.onosproject.ui.topo.LayoutLocation
 
- 
 public final class LayoutLocation extends Object Represents a "node location" on a UI layout.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classLayoutLocation.TypeDesignates the type of location; either geographic or logical grid.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static List<LayoutLocation>fromCompactListString(String compactList)Returns a list of layout locations from a compact string representation.static LayoutLocationfromCompactString(String s)Produces a layout location instance from a compact string representation.Stringid()Returns the identifier associated with this location.booleanisOrigin()Returns true if the coordinates indicate the origin (0, 0) of the coordinate system; false otherwise.doublelatOrY()Returns the latitude (geo) or y-coord (grid) data value.static LayoutLocationlayoutLocation(String id, String locType, double latOrY, double longOrX)Creates an instance of a layout location.static LayoutLocationlayoutLocation(String id, LayoutLocation.Type locType, double latOrY, double longOrX)Creates an instance of a layout location.LayoutLocation.TypelocType()Returns the location type (geo or grid), which indicates how the data is to be interpreted.doublelongOrX()Returns the longitude (geo) or x-coord (grid) data value.StringtoCompactListString()Produces a compact string representation of this instance.static StringtoCompactListString(List<LayoutLocation> locs)Produces a compact encoding of a list of layout locations.static StringtoCompactListString(LayoutLocation... locs)Produces a compact encoding of a list of layout locations.StringtoString()
 
- 
- 
- 
Method Detail- 
isOriginpublic boolean isOrigin() Returns true if the coordinates indicate the origin (0, 0) of the coordinate system; false otherwise.- Returns:
- true if geo-coordinates are set; false otherwise
 
 - 
idpublic String id() Returns the identifier associated with this location.- Returns:
- the identifier
 
 - 
locTypepublic LayoutLocation.Type locType() Returns the location type (geo or grid), which indicates how the data is to be interpreted.- Returns:
- location type
 
 - 
latOrYpublic double latOrY() Returns the latitude (geo) or y-coord (grid) data value.- Returns:
- geo latitude or grid y-coord
 
 - 
longOrXpublic double longOrX() Returns the longitude (geo) or x-coord (grid) data value.- Returns:
- geo longitude or grid x-coord
 
 - 
toCompactListStringpublic String toCompactListString() Produces a compact string representation of this instance.- Returns:
- compact string rep
 
 - 
fromCompactStringpublic static LayoutLocation fromCompactString(String s) Produces a layout location instance from a compact string representation.- Parameters:
- s- the compact string
- Returns:
- a corresponding instance
 
 - 
toCompactListStringpublic static String toCompactListString(LayoutLocation... locs) Produces a compact encoding of a list of layout locations.- Parameters:
- locs- array of layout location instances
- Returns:
- string encoding
 
 - 
toCompactListStringpublic static String toCompactListString(List<LayoutLocation> locs) Produces a compact encoding of a list of layout locations.- Parameters:
- locs- list of layout location instances
- Returns:
- string encoding
 
 - 
fromCompactListStringpublic static List<LayoutLocation> fromCompactListString(String compactList) Returns a list of layout locations from a compact string representation.- Parameters:
- compactList- string representation
- Returns:
- corresponding list of layout locations
 
 - 
layoutLocationpublic static LayoutLocation layoutLocation(String id, LayoutLocation.Type locType, double latOrY, double longOrX) Creates an instance of a layout location.- Parameters:
- id- an identifier for the item at this location
- locType- the location type
- latOrY- geo latitude / grid y-coord
- longOrX- geo longitude / grid x-coord
- Returns:
- layout location instance
 
 - 
layoutLocationpublic static LayoutLocation layoutLocation(String id, String locType, double latOrY, double longOrX) Creates an instance of a layout location.- Parameters:
- id- an identifier for the item at this location
- locType- the location type ("geo" or "grid")
- latOrY- geo latitude / grid y-coord
- longOrX- geo longitude / grid x-coord
- Returns:
- layout location instance
- Throws:
- IllegalArgumentException- if the type is not "geo" or "grid"
 
 
- 
 
-