All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gemstone.gemfire.cache.query.facets.lang.Faculty Maven / Gradle / Ivy

There is a newer version: 2.0-BETA
Show newest version
/*
 * Copyright (c) 2010-2015 Pivotal Software, Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you
 * may not use this file except in compliance with the License. You
 * may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied. See the License for the specific language governing
 * permissions and limitations under the License. See accompanying
 * LICENSE file.
 */


package com.gemstone.gemfire.cache.query.facets.lang;


import java.util.*;



public class Faculty extends Person {
  private String _rank;
  private Department _dept;
  private int _salary;
  //private IndexableSet _hobbies;
  //private IndexableSet _advisees;
  private Set _hobbies;
  private Set _advisees;
  
  public Faculty() {
  }
  
  public Faculty(String ssn, String name, Date bd,
          String rank, Department dept, int salary,
          Collection hobbies, Collection advisees) {
    super(ssn, name, bd);
    _rank = rank;
    _dept = dept;
    _salary = salary;
    if (hobbies != null) {
      initHobbies();
      _hobbies.addAll(hobbies);
    }
    
    if (advisees != null) {
      initAdvisees();
      _advisees.addAll(advisees);
    }
  }
  
  public String getRank() {
    return _rank;
  }
  
  public Department getDepartment() {
    return _dept;
  }
  
  public int getSalary() {
    return _salary;
  }
  
  public Set getHobbies() {
    if (_hobbies == null)
      return Collections.EMPTY_SET;
    return _hobbies;
  }
  
  
  public Set getAdvisees() {
    if (_advisees == null)
      return Collections.EMPTY_SET;
    return _advisees;
  }
  
  
  public void setRank(String rank) {
    _rank = rank;
  }
  
  
  public void setDepartment(Department dept) {
    _dept = dept;
  }
  
  
  public void setSalary(int salary) {
    _salary = salary;
  }
  
  
  public void addHobby(String hobby) {
    if (_hobbies == null)
      initHobbies();
    _hobbies.add(hobby);
  }
  
  public void removeHobby(String hobby) {
    if (_hobbies == null)
      return;
    _hobbies.remove(hobby);
    if (_hobbies.isEmpty())
      _hobbies = null;
  }
  
  public void setAdvisees(Set set) {
    _advisees = new HashSet();//Utils.getQueryService().newIndexableSet(Student.class, set);
  }
  
  
  public void addAdvisee(Student stud) {
    if (_advisees == null)
      initAdvisees();
    _advisees.add(stud);
  }
  
  private void initHobbies() {
    //_hobbies = Utils.getQueryService().newIndexableSet(String.class);
    _hobbies = new HashSet();
  }
  
  
  private void initAdvisees() {
    //_advisees = Utils.getQueryService().newIndexableSet(G_Student.class);
    _advisees = new HashSet();
  }
  
  
  
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy