Class CollectiveOE

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<CollectiveOE>, npl.DynamicFactsProvider
    Direct Known Subclasses:
    Group, Scheme

    public abstract class CollectiveOE
    extends java.lang.Object
    implements java.io.Serializable, npl.DynamicFactsProvider, java.lang.Comparable<CollectiveOE>
    Represents a collective entity (groups and schemes)
    Author:
    Jomi Fred Hubner
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      CollectiveOE​(java.lang.String id)  
    • Method Summary

      Modifier and Type Method Description
      Player addPlayer​(java.lang.String ag, java.lang.String obj)  
      void clearExPlayers()  
      void clearPlayers()  
      abstract CollectiveOE clone()  
      int compareTo​(CollectiveOE g)  
      java.util.Iterator<jason.asSemantics.Unifier> consult​(jason.asSyntax.Literal l, jason.asSemantics.Unifier u)  
      boolean equals​(java.lang.Object obj)  
      protected static jaca.ToProlog getCollectionAsProlog​(java.util.Collection<? extends java.lang.Object> c)  
      abstract jason.asSyntax.Literal[] getDynamicFacts()  
      private jason.asSyntax.Literal getExPlayerLiteral​(Player p)  
      (package private) abstract jason.asSyntax.PredicateIndicator getExPlayerPI()  
      java.util.Collection<Player> getExPlayers()  
      java.lang.String getId()  
      private jason.asSyntax.Literal getPlayerLiteral​(Player p)  
      (package private) abstract jason.asSyntax.PredicateIndicator getPlayerPI()  
      java.util.Collection<Player> getPlayers()  
      int hashCode()  
      boolean hasPlayer​(java.lang.String ag, java.lang.String obj)  
      boolean isRelevant​(jason.asSyntax.PredicateIndicator pi)  
      boolean removePlayer​(java.lang.String ag, java.lang.String obj)  
      java.lang.String toString()  
      java.util.List<jason.asSyntax.Literal> transform()
      transforms a Scheme Instance into NPL code (dynamic facts)
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface npl.DynamicFactsProvider

        consultFromCollection, consultFromProviders
    • Field Detail

      • id

        protected final java.lang.String id
      • termId

        protected final jason.asSyntax.Term termId
      • players

        protected java.util.Set<Player> players
      • exPlayers

        protected java.util.Set<Player> exPlayers
      • playersAsLiteralList

        protected java.util.Set<jason.asSyntax.Literal> playersAsLiteralList
      • exPlayersAsLiteralList

        protected java.util.Set<jason.asSyntax.Literal> exPlayersAsLiteralList
    • Constructor Detail

      • CollectiveOE

        public CollectiveOE​(java.lang.String id)
    • Method Detail

      • getId

        public java.lang.String getId()
      • toString

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

        abstract jason.asSyntax.PredicateIndicator getPlayerPI()
      • getExPlayerPI

        abstract jason.asSyntax.PredicateIndicator getExPlayerPI()
      • addPlayer

        public Player addPlayer​(java.lang.String ag,
                                java.lang.String obj)
      • hasPlayer

        public boolean hasPlayer​(java.lang.String ag,
                                 java.lang.String obj)
      • removePlayer

        public boolean removePlayer​(java.lang.String ag,
                                    java.lang.String obj)
      • clearPlayers

        public void clearPlayers()
      • clearExPlayers

        public void clearExPlayers()
      • getPlayerLiteral

        private jason.asSyntax.Literal getPlayerLiteral​(Player p)
      • getExPlayerLiteral

        private jason.asSyntax.Literal getExPlayerLiteral​(Player p)
      • getPlayers

        public java.util.Collection<Player> getPlayers()
      • getExPlayers

        public java.util.Collection<Player> getExPlayers()
      • clone

        public abstract CollectiveOE clone()
        Overrides:
        clone in class java.lang.Object
      • hashCode

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

        protected static jaca.ToProlog getCollectionAsProlog​(java.util.Collection<? extends java.lang.Object> c)
      • equals

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

        public int compareTo​(CollectiveOE g)
        Specified by:
        compareTo in interface java.lang.Comparable<CollectiveOE>
      • transform

        public java.util.List<jason.asSyntax.Literal> transform()
        transforms a Scheme Instance into NPL code (dynamic facts)
      • getDynamicFacts

        public abstract jason.asSyntax.Literal[] getDynamicFacts()
      • isRelevant

        public boolean isRelevant​(jason.asSyntax.PredicateIndicator pi)
        Specified by:
        isRelevant in interface npl.DynamicFactsProvider
      • consult

        public java.util.Iterator<jason.asSemantics.Unifier> consult​(jason.asSyntax.Literal l,
                                                                     jason.asSemantics.Unifier u)
        Specified by:
        consult in interface npl.DynamicFactsProvider