def self.new(parent, name, *args)
tagobj = nil
TTagID_TBL.mutex.synchronize{
if TTagID_TBL[parent.path] && TTagID_TBL[parent.path][name]
tagobj = TTagID_TBL[parent.path][name]
else
(tagobj = self.allocate).instance_eval{
@parent = @t = parent
@tpath = parent.path
@path = @id = name
TTagID_TBL[@id] = self
TTagID_TBL[@tpath] = {} unless TTagID_TBL[@tpath]
TTagID_TBL[@tpath][@id] = self unless TTagID_TBL[@tpath][@id]
@t._addtag @id, self
}
end
}
if args != []
keys = args.pop
if keys.kind_of?(Hash)
tagobj.add(*args) if args != []
tagobj.configure(keys)
else
args.push keys
tagobj.add(*args)
end
end
tagobj
end