Module org.autogui

Class GuiReprValue.ObjectSpecifier

java.lang.Object
org.autogui.base.mapping.GuiReprValue.ObjectSpecifier
Direct Known Subclasses:
GuiReprValue.ObjectSpecifierIndex, GuiReprValue.ObjectSpecifierNothing
Enclosing class:
GuiReprValue

public static class GuiReprValue.ObjectSpecifier extends Object
an auxiliary information for specifying a property value. An typical example is an index of a list.

For regular properties, GuiReprValue.NONE is sufficient.

However, consider a list property, like

       class A { List<B> prop1; }
       class B { List<C> prop2; }
       class C { String prop3; }
   
To specify a value of prop3 from the top A, we can write a.prop1.get(i).prop2.get(j).prop3.

This class represents the expression of the property chain with indices: NONE.childIndex(i).child(false).childIndex(j).child(false)

  • Field Details

  • Constructor Details

  • Method Details

    • isUsingCache

      public boolean isUsingCache()
      Returns:
      true if the obtained property value can be a cached value
    • getParent

      public GuiReprValue.ObjectSpecifier getParent()
    • getIndex

      public int getIndex()
      Returns:
      index of an element, default is 0
    • isIndex

      public boolean isIndex()
      Returns:
      true if the specifier is an index. default is false
    • childIndex

      public GuiReprValue.ObjectSpecifierIndex childIndex(int index)
      Parameters:
      index - the next index
      Returns:
      created index specifier as a child of this specifier.
    • child

      public GuiReprValue.ObjectSpecifier child(boolean usingCache)
      Parameters:
      usingCache - specifying using cache values
      Returns:
      created (non-index) specifier as a child of this specifier
    • toString

      public String toString()
      Overrides:
      toString in class Object