Class PiActionProfileGroup.WeightedMember

  • Enclosing class:
    PiActionProfileGroup

    public static final class PiActionProfileGroup.WeightedMember
    extends java.lang.Object
    Weighted reference to an action profile member as used in an action profile group.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_WEIGHT  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      PiActionProfileMemberId id()
      Returns the ID of the action profile member.
      PiActionProfileMember instance()
      If present, returns the instance of the action profile member pointed by this reference, otherwise returns null.
      java.lang.String toString()  
      int weight()
      Returns the weight of this group member.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • WeightedMember

        public WeightedMember​(PiActionProfileMemberId memberId,
                              int weight)
        Creates a new reference for the given action profile member ID and weight.
        Parameters:
        memberId - action profile member ID
        weight - weight
      • WeightedMember

        public WeightedMember​(PiActionProfileMember memberInstance,
                              int weight)
        Creates a new reference from the given action profile member instance and weight. This constructor should be used when performing one-shot group programming (see instance()).
        Parameters:
        memberInstance - action profile member instance
        weight - weight
    • Method Detail

      • id

        public PiActionProfileMemberId id()
        Returns the ID of the action profile member.
        Returns:
        action profile member ID
      • weight

        public int weight()
        Returns the weight of this group member.
        Returns:
        weight
      • instance

        public PiActionProfileMember instance()
        If present, returns the instance of the action profile member pointed by this reference, otherwise returns null. This method is provided as a convenient way to perform one-shot group programming, and as such is meaningful only when performing write operations to a device. In other words, when reading groups from a device only the member reference should be returned and not the actual instance, hence this method should return null.
        Returns:
        action profile member instance, or null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object