Interface Drawable<P extends Point<P>>

Type Parameters:
P - The point type (2d or 3d)
All Superinterfaces:
Serializable
All Known Subinterfaces:
Drawable2d, Drawable3d, LineSegment<P,R>, Point<P>, PolyLine<L,P,R,LS>
All Known Implementing Classes:
Bounds2d, Bounds3d, LineSegment2d, LineSegment3d, OrientedPoint2d, OrientedPoint3d, Point2d, Point3d, Polygon2d, Polygon3d, PolyLine2d, PolyLine3d, Ray2d, Ray3d, Surface3d

public interface Drawable<P extends Point<P>> extends Serializable
Drawable is an interface to indicate zero or more points can be retrieved to draw the object.

Copyright (c) 2020-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUTILS License.

Author:
Alexander Verbraeck, Peter Knoppers
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Return the number of dimensions.
    default List<P>
    Create a list of all points that make up this Drawable.
    Iterator<? extends P>
    Retrieve, or generate all points that make up the object.
    int
    Retrieve the number of points that make up the object.
    Produce a string describing the Drawable using default conversion for the (double) coordinate values.
    default String
    toString(boolean doNotIncludeClassName)
    Produce a String describing the Drawable.
    default String
    toString(String doubleFormat)
    Produce a String describing the Drawable.
    toString(String doubleFormat, boolean doNotIncludeClassName)
    Produce a String describing the Drawable.
  • Method Details

    • getPoints

      Iterator<? extends P> getPoints()
      Retrieve, or generate all points that make up the object.
      Returns:
      Iterable<Point2d>; an iterator that generates all points that make up the object
    • getPointList

      default List<P> getPointList()
      Create a list of all points that make up this Drawable. This method is expensive as a new list is constructed on each invocation.
      Returns:
      List<? extends P>; a list containing all points of this Drawable
    • size

      int size()
      Retrieve the number of points that make up the object.
      Returns:
      int; the number of points that make up the object
    • getDimensions

      int getDimensions()
      Return the number of dimensions.
      Returns:
      int; the number of dimensions
    • toString

      String toString()
      Produce a string describing the Drawable using default conversion for the (double) coordinate values. Regrettably, it is not allowed to provide a default implementation here.
      Overrides:
      toString in class Object
      Returns:
      String; a string describing the Drawable
    • toString

      String toString(String doubleFormat, boolean doNotIncludeClassName)
      Produce a String describing the Drawable.
      Parameters:
      doubleFormat - String; a format string (something like "%6.3f") which will be used to render every coordinate value)
      doNotIncludeClassName - boolean; if true; the output of toString is not prefixed by the class name. This is useful for concatenating the textual representation of lots of Drawables (e.g. an array, or a List).
      Returns:
      String; textual representation of the Drawable
    • toString

      default String toString(String doubleFormat)
      Produce a String describing the Drawable.
      Parameters:
      doubleFormat - String; a format string (something like "%6.3f") which will be used to render every coordinate value)
      Returns:
      String; textual representation of the Drawable
    • toString

      default String toString(boolean doNotIncludeClassName)
      Produce a String describing the Drawable.
      Parameters:
      doNotIncludeClassName - boolean; if true; the output of toString is not prefixed by the class name. This is useful for concatenating the textual representation of lots of Drawables (e.g. an array, or a List).
      Returns:
      String; textual representation of the Drawable