Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
MapleCustomQuestData.java
Package: src.rar [view]
Upload User: gwt600
Upload Date: 2021-06-03
Package Size: 704k
Code Size: 3k
Category:
Games
Development Platform:
Java
- /*
- This file is part of the OdinMS Maple Story Server
- Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
- Matthias Butz <matze@odinms.de>
- Jan Christian Meyer <vimes@odinms.de>
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License version 3
- as published by the Free Software Foundation. You may not use, modify
- or distribute this program under any other version of the
- GNU Affero General Public License.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package net.sf.odinms.server.quest; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import net.sf.odinms.provider.MapleData; import net.sf.odinms.provider.MapleDataEntity; import net.sf.odinms.provider.wz.MapleDataType; /** * * @author Matze */ public class MapleCustomQuestData implements MapleData, Serializable { private static final long serialVersionUID = -8600005891655365066L; private List<MapleCustomQuestData> children = new LinkedList<MapleCustomQuestData>(); private String name; private Object data; private MapleDataEntity parent; public MapleCustomQuestData(String name, Object data, MapleDataEntity parent) { this.name = name; this.data = data; this.parent = parent; } public void addChild(MapleData child) { children.add((MapleCustomQuestData) child); } public String getName() { return name; } public MapleDataType getType() { return MapleDataType.UNKNOWN_TYPE; } public List<MapleData> getChildren() { MapleData[] ret = new MapleData[children.size()]; ret = children.toArray(ret); return new ArrayList<MapleData>(Arrays.asList(ret)); } public MapleData getChildByPath(String name) { if (name.equals(this.name)) return this; String lookup; String nextName; if (name.indexOf("/") == -1) { lookup = name; nextName = name; } else { lookup = name.substring(0, name.indexOf("/")); nextName = name.substring(name.indexOf("/") + 1); } for (MapleData child : children) { if (child.getName().equals(lookup)) return child.getChildByPath(nextName); } return null; } public Object getData() { return data; } public Iterator<MapleData> iterator() { return getChildren().iterator(); } public MapleDataEntity getParent() { return parent; } }