Adds a subject.
@param subject array of subjects
960266
public void addSubject(String[] subject) {
		XmpArray array = new XmpArray(XmpArray.UNORDERED);
		for (int i = 0; i < subject.length; i++) {
			array.add(subject[i]);
		}
		setProperty(SUBJECT, array);
	}
478293
public void addMean( double[] point , double responsibility ) {
		for (int i = 0; i < mean.numRows; i++) {
			mean.data[i] += responsibility*point[i];
		}
		weight += responsibility;
	}
161726
protected void add(SubjectNode subject,
                       RDFName predicate,
                       ObjectNode object,
                       Set<Triple> set) throws ResourceIndexException {
        set.add(new SimpleTriple(subject, predicate, object));
    }
1194963
public void sendEmail(final List<String> emailList, final String subject, final String body) {
    if (emailList != null && !emailList.isEmpty()) {
      final EmailMessage message = super.createEmailMessage(subject, "text/html", emailList);
      message.setBody(body);
      sendEmail(message, true, "email message " + body);
    }
  }
1157004
protected function containsObject($subject)
    {
        if (is_object($subject)) {
            return true;
        }
        if (!is_array($subject)) {
            return false;
        }
        foreach ($subject as $value) {
            if ($this->containsObject($value)) {
                return true;
            }
        }
        return false;
    }
597444
public void add(SubjectObserver<T> subjectObserver)
   {
      if (subjectObserver == null)
         throw new RequiredException("subjectObserver in Topic.add");
      
      String id = subjectObserver.getId();
      
      if (id == null || id.length() == 0)
         throw new IllegalArgumentException("Subject observer id required");
      
     //get previous
      SubjectObserver<?> prev = (SubjectObserver<?>)observerMap.get(subjectObserver.getId());
      
      if(prev != null && prev != subjectObserver)
      {
         Debugger.println(this,"Object registered, but observer id already exists "+subjectObserver.getId()+" for subject="+this.name);
      }
      
      //add       
      observerMap.put(subjectObserver.getId(), subjectObserver);
      
   }
749962
private void addStatement(RecordImpl record,
                            String subject,
                            String property,
                            String object) {
    Collection<Column> cols = columns.get(property);
    if (cols == null) {
      if (property.equals(RDF_TYPE) && !types.isEmpty())
        addValue(record, subject, property, object);
      return;
    }
    
    for (Column col : cols) {
      String cleaned = object;
      if (col.getCleaner() != null)
        cleaned = col.getCleaner().clean(object);
      if (cleaned != null && !cleaned.equals(""))
        addValue(record, subject, col.getProperty(), cleaned);
    }
  }
116288
protected function castToArray(&$subject)
    {
        if (is_array($subject) === false) {
            if (Arr::accessible($subject) === false) {
                $subject = new Collection($subject);
            }
            $subject = $subject instanceof Arrayable ? $subject->toArray() : (array)$subject;
        }
        return $this;
    }
343853
protected function _saveToSession($subject)
    {
        $this->mergePrincipals($subject);
        $this->mergeAuthenticationState($subject);
        $this->mergeAuthorizationState($subject);

    }
784305
private void setSubjectPrincipals() {
        if (null != userPrincipal) {
            this.subject.getPrincipals().add(userPrincipal);
        }
        if (null != rolePrincipals) {
            for (Principal rolePrincipal : rolePrincipals) {
                this.subject.getPrincipals().add(rolePrincipal);
            }
        }
    }
195381
public function openSubject(Subject $subject)
    {
        $this->om->startFlushSuite();
        $subject->setIsClosed(false);
        $this->om->persist($subject);
        $this->dispatch(new OpenSubjectEvent($subject));
        $this->om->endFlushSuite();
    }
672533
void put(String subject, String predicate, String object) {
		// Subject to Predicates map
		ArrayList<String> predicateList = subjectToPredicates.get(subject);
		if (predicateList == null) {
			predicateList = new ArrayList<String>();
		}
		insert(predicateList, predicate);
		subjectToPredicates.put(subject, predicateList);

		// Predicate to Objects map
		ArrayList<String> objectList = predicateToObjects.get(predicate + "_" + subject); // predicate that appears in 2 different subjects should not have all objects assigned  to both subjects
		if (objectList == null) {
			objectList = new ArrayList<String>();
		}
		objectList.add(object);
		predicateToObjects.put(predicate + "_" + subject, objectList);
	}
795787
public final void addObject(Object object) {
        if (object instanceof Iterable) {
            // Iterable
            for (Object o : (Iterable<?>) object) {
                objects.add(o);
            }
        } else if (object.getClass().isArray()) {
            // Array
            for (Object o : (Object[]) object) {
                objects.add(o);
            }
        } else {
            // Single object
            objects.add(object);
        }
    }
1149935
protected function create_subject_node($value, $subject_type = 'anzsrc-for')
    {
        if (empty($value)) {
            return;
        }
        $c = $this->addChild($this->working_node, 'subject', $value);
        $c->setAttribute('type', $subject_type);
    }
811733
public function stickSubject(Subject $subject)
    {
        $this->om->startFlushSuite();
        $subject->setIsSticked(true);
        $this->om->persist($subject);
        $this->dispatch(new StickSubjectEvent($subject));
        $this->om->endFlushSuite();
    }
422474
private function addWhereForSharing(QueryBuilder $qb, array $subjects, array $sids)
    {
        $where = '';
        $parameters = [];

        foreach ($subjects as $i => $subject) {
            $class = 'subject'.$i.'_class';
            $id = 'subject'.$i.'_id';
            $parameters[$class] = $subject->getType();
            $parameters[$id] = $subject->getIdentifier();
            $where .= '' === $where ? '' : ' OR ';
            $where .= sprintf('(s.subjectClass = :%s AND s.subjectId = :%s)', $class, $id);
        }

        $qb->where($where);

        foreach ($parameters as $key => $value) {
            $qb->setParameter($key, $value);
        }

        return $this->addWhereSecurityIdentitiesForSharing($qb, $sids);
    }
15919
public function update(SubjectInterface $subject)
   {
       try {
           foreach ($this->observer as $value) {
               $value->update($subject);
           }
       } catch (Throwable $e) {
           throw new ViewException(
               "Can't update " . static::class . " " . $e->getMessage()
           );
       }
   }