Adds a character to the set.

 @param [String, Integer] other
   The character(s) or byte to add.

 @return [CharSet]
   The modified character set.

 @raise [TypeError]
   The argument was not a {String} or {Integer}.

 @since 0.2.1
326883
def <<(other)
      case other
      when String
        other.each_char do |char|
          byte = char_to_byte(char)

          @chars[byte] = char
          super(byte)
        end

        return self
      when Integer
        super(other)
      else
        raise(TypeError,"can only append Strings and Integers")
      end
    end
1006567
def merge(self, other):
        
        for key, value in other.items():
            if not key in self:
                self[key] = value
            elif isinstance(value, (list, tuple)):
                self[key] += value
            elif isinstance(value, OrderedSet):
                if isinstance(self[key], str):
                    self[key] = OrderedSet([self[key]])
                elif not isinstance(self[key], OrderedSet):
                    self[key] = OrderedSet(self[key])
                self[key] |= value
            else:
                self[key] = value
        return self
1341636
def merge(self, other):
        """"""
        assert self.attrs == other.attrs
        self.tokens.extend(other.tokens)
        self.spaces.extend(other.spaces)
        self.strings.update(other.strings)
866339
def convert_to(other)
      return self if other.nil?

      case other
        when Unit
          return self if other == self
          target = other
        when String
          target = SIUnits::Unit.new(other.to_f)
        else
          raise ArgumentError, "Unknown target units"
      end
    end
1041780
def union(other)
      raise Erlang::ImproperListError if improper?
      other = Erlang.from(other)
      raise ArgumentError, "other must be of Erlang::List type" if not Erlang.is_list(other)
      raise Erlang::ImproperListError if other.improper?
      items = ::Set.new
      return _uniq(items).append(other._uniq(items))
    end
475683
def deep_merge!(other_hash, &block)
      other_hash.each_pair do |current_key, other_value|
        this_value = self[current_key]

        self[current_key] = if this_value.is_a?(Hash) && other_value.is_a?(Hash)
          _this_value = HashExt.new.replace(this_value)
          _this_value.deep_merge(other_value, &block).to_h
        else
          if block_given? && key?(current_key)
            block.call(current_key, this_value, other_value)
          else
            other_value
          end
        end
      end

      self
    end
726222
def merge!(other)
      other.each_pair do |key, value|
        if value.is_a?(Hash) && self[key.to_s].is_a?(Hash)
          value = self[key.to_s].merge(value) do |_key, old_val, new_val|
            if in?(_key)
              new_val & old_val
            elsif nin?(_key)
              (old_val + new_val).uniq
            else
              new_val
            end
          end
        end
        if multi_selection?(key)
          value = (self[key.to_s] || []).concat(value)
        end
        store(key, value)
      end
    end
1290452
public DigitBuffer append(String s) {
    int len = s.length();
    check(len);
    for (int i = 0; i < len; i++) {
      this.buf[size] = s.charAt(i);
      size++;
    }
    return this;
  }
323904
def difference_update(self, other):
        
        if not isinstance(other, Set):
            raise ValueError('other must be a Set instance')
        if self is other:
            self.items = []
        else:
            for item in other.items:
                self.discard(item)
966701
def +(other)
      rgb =
        case other
        when RGB
          compound_by(other.rgb) { |a, b| [a+b, 255].min }
        when Array
          raise ArgumentError, "Invalid size of Array given" unless other.size==3
          compound_by(other) { |a, b| (a + b) % 256 }
        when Integer
          compound_by([other] * 3) { |a, b| (a + b) % 256 }
        else
          raise ArgumentError, "Invalid argument given"
        end
      self.class.new *rgb
    end
56640
def initialize_copy(other)
      @fields = {}

      self.type = other.type
      self.key = other.key

      add(other.fields)
    end
733724
def +(other)
      case other
      when LinExpr
        # Add the terms of two expressions
        # For now, this assumes variables are not duplicated
        LinExpr.new(@terms.merge(other.terms) { |_, c1, c2| c1 + c2 })
      when Variable
        # Add the variable to the expression
        self + other * 1.0
      else
        fail TypeError
      end
    end
770717
def cmp(other)
			if (!other.kind_of?(Mask128))
				raise ArgumentError, "Expected an Mask128 object for 'other' but got a #{other.class}."
			end
			if (self.prefix_len < other.prefix_len)
				return 1
			elsif (self.prefix_len > other.prefix_len)
				return -1
			end
			return 0
		end
203731
def othertype(self, othertype):
        
        if othertype is not None:
            self._el.set('TYPE', 'OTHER')
            self._el.set('OTHERTYPE', othertype)
12194
def add(*args)
      args.flatten! # allow [] as a param
      args.each do |arg|
        arg = arg.to_sym if arg.is_a? String
        @set << arg unless @set.include? arg # avoid duplicates
      end
    end
273885
def set_char(key, value):
    
    global _chars
    category = _get_char_category(key)
    if not category:
        raise KeyError
    _chars[category][key] = value
1000081
def update_chr(options = {} )
    @opt = {
      :name => ''
    }.merge!(options)
    return false if !@opt[:index]

    @index = @opt[:index].to_i
    
    # need to create the characters
    
    raise(NexusParser::ParseError, "Can't update character of index #{@index}, it doesn't exist! This is a problem parsing the character state labels. Check the indices. It may be for this character \"#{@opt[:name]}\".") if !@nf.characters[@index]

    (@nf.characters[@index].name = @opt[:name]) if @opt[:name]
  
    @opt.delete(:index)
    @opt.delete(:name)
   
    # the rest have states
    @opt.keys.each do |k|
      
      if (@nf.characters[@index].states != {}) && @nf.characters[@index].states[k] # state exists
        
        ## !! ONLY HANDLES NAME, UPDATE TO HANDLE notes etc. when we get them ##
        update_state(@index, :index => k, :name => @opt[k])
        
      else # doesn't, create it
        @nf.characters[@index].add_state(:label => k.to_s, :name => @opt[k])
      end
    end
    
  end