answer
stringlengths
17
10.2M
package com.sequenceiq.periscope.config; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.util.concurrent.Executor; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.conn.ssl.SSLContextBuilder; import org.apache.http.conn.ssl.TrustStrategy; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.scheduling.annotation.AsyncConfigurer; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean; import org.springframework.web.client.RestOperations; import org.springframework.web.client.RestTemplate; import com.sequenceiq.periscope.log.Logger; import com.sequenceiq.periscope.log.PeriscopeLoggerFactory; @Configuration @EnableAsync @EnableScheduling public class AppConfig implements AsyncConfigurer { private static final Logger LOGGER = PeriscopeLoggerFactory.getLogger(AppConfig.class); @Value("${periscope.threadpool.core.size:50}") private int corePoolSize; @Value("${periscope.threadpool.max.size:500}") private int maxPoolSize; @Value("${periscope.threadpool.queue.size:1000}") private int queueCapacity; @Bean public ThreadPoolExecutorFactoryBean getThreadPoolExecutorFactoryBean() { ThreadPoolExecutorFactoryBean executorFactoryBean = new ThreadPoolExecutorFactoryBean(); executorFactoryBean.setCorePoolSize(corePoolSize); executorFactoryBean.setMaxPoolSize(maxPoolSize); executorFactoryBean.setQueueCapacity(queueCapacity); return executorFactoryBean; } @Bean public RestOperations createRestTemplate() throws Exception { HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(); SSLContextBuilder sslContextBuilder = new SSLContextBuilder(); sslContextBuilder.loadTrustMaterial(null, new TrustStrategy() { @Override public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException { return true; } }); SSLConnectionSocketFactory sslConnectionSocketFactory = new SSLConnectionSocketFactory(sslContextBuilder.build()); CloseableHttpClient httpClient = HttpClients.custom().setSSLSocketFactory(sslConnectionSocketFactory).build(); requestFactory.setHttpClient(httpClient); return new RestTemplate(requestFactory); } @Override public Executor getAsyncExecutor() { try { return getThreadPoolExecutorFactoryBean().getObject(); } catch (Exception e) { LOGGER.error(Logger.NOT_CLUSTER_RELATED, "Error creating task executor.", e); } return null; } }
package com.uzh.csg.overlaynetworks.p2p; import com.uzh.csg.overlaynetworks.domain.dto.Contact; import com.uzh.csg.overlaynetworks.domain.dto.Message; import com.uzh.csg.overlaynetworks.domain.dto.MessageResult; import com.uzh.csg.overlaynetworks.domain.exception.LoginFailedException; import com.uzh.csg.overlaynetworks.p2p.error.P2PLoginError; import com.uzh.csg.overlaynetworks.p2p.error.P2PReceiveMessageError; import com.uzh.csg.overlaynetworks.p2p.error.P2PSendMessageError; import com.uzh.csg.overlaynetworks.p2p.error.P2PShutdownError; import net.tomp2p.connection.Bindings; import net.tomp2p.dht.*; import net.tomp2p.futures.*; import net.tomp2p.p2p.AutomaticFuture; import net.tomp2p.p2p.JobScheduler; import net.tomp2p.p2p.PeerBuilder; import net.tomp2p.peers.Number160; import net.tomp2p.peers.PeerAddress; import net.tomp2p.rpc.ObjectDataReply; import net.tomp2p.storage.Data; import java.io.IOException; import java.net.InetAddress; import java.net.ServerSocket; import java.net.UnknownHostException; import java.util.List; import java.util.Random; public class P2PClient { /* to receive events declared in P2PDelegate, implement P2PClientDelegate protocol and set yourself to this property */ public P2PClientDelegate delegate; private PeerDHT peer; private PeerInfo peerInfo; private Random random; private JobScheduler userDataUploader; /* bootstrapping server IP and port are fixed constants */ private static final String BOOTSTRAP_ADDRESS = "127.0.0.1"; private static final int BOOTSTRAP_PORT = 37823; /* TTL for peer credentials */ private static final int USER_DATA_TTL = 60; public P2PClient(String username) { this.peerInfo = new PeerInfo(username); random = new Random(85L); } public PeerInfo getPeerInfo() { return this.peerInfo; } public void start() throws LoginFailedException { try { ServerSocket socket = new ServerSocket(0, 0, InetAddress.getByName(null)); InetAddress address = socket.getInetAddress(); int port = socket.getLocalPort(); /* ServerSocket opened just to get free port */ socket.close(); Bindings bindings = new Bindings().addAddress(address); peer = new PeerBuilderDHT(new PeerBuilder(new Number160(random)).bindings(bindings).ports(port).start()).start(); /* Specifies what to do when message is received */ peer.peer().objectDataReply(new ObjectDataReply() { @Override public Object reply(PeerAddress sender, Object request) throws Exception { if (request instanceof String) { String payload = (String) request; int IDandUsernameSeparatorIndex = payload.indexOf("_"); int UsernameAndMessageSeparatorIndex = payload.lastIndexOf("_"); if (IDandUsernameSeparatorIndex > 0 && UsernameAndMessageSeparatorIndex > 0 && IDandUsernameSeparatorIndex != UsernameAndMessageSeparatorIndex) { try { String messageIDStr = payload.substring(0, IDandUsernameSeparatorIndex); long messageID = Long.parseLong(messageIDStr); String username = payload.substring(IDandUsernameSeparatorIndex+1, UsernameAndMessageSeparatorIndex); String message = payload.substring(UsernameAndMessageSeparatorIndex+1, payload.length()); Message messageObj = new Message(); messageObj.setMessage(message); Contact contact = new Contact(username); MessageResult result = new MessageResult(messageID); FutureDirect ackMessage = peer.peer().sendDirect(sender).object("ack_" + messageID).start(); ackMessage.addListener(new BaseFutureAdapter<FutureDirect>() { @Override public void operationComplete(FutureDirect future) throws Exception { if (future.isSuccess()) { System.out.println("Successfully acknowledged incoming message!"); } else { System.err.println("Failed to acknowledge for incoming message!"); System.err.println("Reason is: " + future.failedReason()); } } }); if (delegate != null) { delegate.didReceiveMessage(messageObj, contact, result, null); } } catch (NumberFormatException nfe) { System.err.println("Failed casting message ID to long!"); nfe.printStackTrace(); if (delegate != null) { delegate.didReceiveMessage(null, null, null, P2PReceiveMessageError.INVALID_MESSAGE_FORMAT); } } } else if (payload.startsWith("ack") && payload.indexOf("_") > 0) { try { String messageIDStr = payload.substring(payload.indexOf("_")+1, payload.length()); long messageID = Long.parseLong(messageIDStr); MessageResult result = new MessageResult(messageID); if (delegate != null) { delegate.didReceiveAck(result, null); } } catch (NumberFormatException nfe) { System.err.println("Failed casting message ID to long!"); nfe.printStackTrace(); if (delegate != null) { delegate.didReceiveAck(null, P2PReceiveMessageError.INVALID_MESSAGE_FORMAT); } } } else if(payload.compareTo("ping") == 0) { FutureDirect pingACKMessage = peer.peer().sendDirect(sender).object("pingACK_" + peerInfo.getUsername()).start(); pingACKMessage.addListener(new BaseFutureAdapter<FutureDirect>() { @Override public void operationComplete(FutureDirect future) throws Exception { if(future.isFailed()) { System.err.println("Failed to send ping ACK!"); System.err.println("Reason is: " + future.failedReason()); } } }); } else if(payload.startsWith("pingACK_")) { String username = payload.substring(payload.indexOf("_") + 1, payload.length()); Contact contact = new Contact(username); if (delegate != null) { delegate.didUpdateOnlineStatus(contact, true, null); } } else { if (delegate != null) { delegate.didReceiveMessage(null, null, null, P2PReceiveMessageError.INVALID_MESSAGE_FORMAT); } } } else { if (delegate != null) { delegate.didReceiveMessage(null, null, null, P2PReceiveMessageError.INVALID_MESSAGE_FORMAT); } } return null; } }); peerInfo.setInetAddress(address); peerInfo.setPort(port); peerInfo.setPeerAddress(peer.peerAddress()); System.out.println("Client peer started on IP " + address + " on port " + port); System.out.println("Bootstrapping peer..."); bootstrap(); } catch (IOException ie) { ie.printStackTrace(); if (delegate != null) { delegate.didLogin(null, P2PLoginError.SOCKET_OPEN_ERROR); } } } public void sendMessage(Message message, MessageResult result) { PeerInfo receiverInfo = new PeerInfo(message.getReceiver().getName()); System.out.println("GETTING " + receiverInfo.getUsername() + " DATA using " + receiverInfo.getUsernameKey().toString()); FutureGet getIPAddress = peer.get(receiverInfo.getUsernameKey()).start(); String messageToSend = result.getMessageId() + "_" + peerInfo.getUsername() + "_" + message.getMessage(); getIPAddress.addListener(new BaseFutureAdapter<FutureGet>() { public void operationComplete(FutureGet future) throws Exception { if (future.isSuccess() && future.data() != null) { try { PeerInfo receiverInfo = new PeerInfo(future.data().toBytes()); FutureDirect directMessage = peer.peer().sendDirect(receiverInfo.getPeerAddress()).object(messageToSend).start(); directMessage.addListener(new BaseFutureAdapter<FutureDirect>() { @Override public void operationComplete(FutureDirect future) throws Exception { if (future.isSuccess()) { System.out.println("Successfully sent direct message!"); if (delegate != null) { delegate.didSendMessage(null); } } else { System.err.println("Failed to directly send value!"); System.err.println("Reason is: " + future.failedReason()); if (delegate != null) { delegate.didSendMessage(P2PSendMessageError.SEND_FAILURE); } } } }); } catch (IllegalArgumentException iae) { iae.printStackTrace(); if (delegate != null) { delegate.didSendMessage(P2PSendMessageError.INVALID_MESSAGE_FORMAT); } } } else { System.err.println("Failed to retrieve data from DHT for key " + receiverInfo.getUsername() + "!"); System.err.println("Reason is " + future.failedReason()); if (delegate != null) { delegate.didSendMessage(P2PSendMessageError.USER_NOT_FOUND); } } } }); } /** * Checks whether given contact is online or not * First, checks whether peer info is present in DHT. If it is present, peer isn't necessarily online. * Hence, it tries to ping it with direct message. * Upon completion, corresponding didUpdateOnlineStatus(...) delegate method is called * @param contact */ public void updateOnlineStatus(Contact contact) { Number160 userKey = new Number160(contact.getName().hashCode()); FutureGet retrieveUser = peer.get(userKey).start(); retrieveUser.addListener(new BaseFutureAdapter<FutureGet>() { @Override public void operationComplete(FutureGet future) throws Exception { if(future.isSuccess() && future.data() != null) { PeerInfo peerInfo = new PeerInfo(future.data().toBytes()); FutureDirect pingMessage = peer.peer().sendDirect(peerInfo.getPeerAddress()).object("ping").start(); pingMessage.addListener(new BaseFutureAdapter<FutureDirect>() { @Override public void operationComplete(FutureDirect future) throws Exception { if(future.isFailed()) { System.err.println("Failed to ping " + contact.getName() + " with direct message!"); System.err.println(future.failedReason()); if (delegate != null) { delegate.didUpdateOnlineStatus(contact, false, null); } } } }); } else { if (delegate != null) { delegate.didUpdateOnlineStatus(contact, false, null); } } } }); } public void shutdown() { FutureRemove removeData = peer.remove(peerInfo.getUsernameKey()).start(); removeData.addListener(new BaseFutureAdapter<FutureRemove>() { @Override public void operationComplete(FutureRemove future) throws Exception { if(future.isSuccess()) { System.out.println("Successfully removed user credentials from DHT!"); System.out.println("Shutting down..."); FutureDone<Void> shutdownFuture = peer.peer().announceShutdown().start(); shutdownFuture.addListener(new BaseFutureAdapter<FutureDone<Void>>() { @Override public void operationComplete(FutureDone<Void> future) throws Exception { if(future.isSuccess()) { System.out.println("Successfully shutted down peer!"); } else { System.err.println("Error shutting down peer!"); System.err.println("Reason is " + future.failedReason()); if (delegate != null) { delegate.didShutdown(P2PShutdownError.SHUTDOWN_ERROR); } } } }); } else { System.err.println("Failed to remove peer credentials from DHT!"); System.err.println("Reasom is " + future.failedReason()); if (delegate != null) { delegate.didShutdown(P2PShutdownError.CLEAR_DHT_ERROR); } } } }); } private void bootstrap() throws LoginFailedException { try { InetAddress bootstrapAddress = InetAddress.getByName(BOOTSTRAP_ADDRESS); FutureBootstrap bootstrap = peer.peer().bootstrap().inetAddress(bootstrapAddress).ports(BOOTSTRAP_PORT).start(); bootstrap.addListener(new BaseFutureAdapter<FutureBootstrap>() { public void operationComplete(FutureBootstrap future) throws Exception { future. if (future.isSuccess()) { System.out.println("Successfully bootstrapped to server!"); Thread.sleep(5000); System.out.println(" System.out.println("MY PEER MAP (VERIFIED)"); List<PeerAddress> peers = peer.peerBean().peerMap().all(); for(PeerAddress peerAddress : peers) { System.out.println(peerAddress); } System.out.println(" System.out.println(" System.out.println("MY PEER MAP (UNVERIFIED)"); List<PeerAddress> peersUnverified = peer.peerBean().peerMap().allOverflow(); for(PeerAddress peerAddress : peersUnverified) { System.out.println(peerAddress); } System.out.println(" byte[] peerData = peerInfo.toByteArray(); Data dataToStore = new Data(peerData); //dataToStore.ttlSeconds(USER_DATA_TTL); //PutBuilder userDataPut = peer.put(peerInfo.getUsernameKey()).data(dataToStore); FuturePut userDataPut = peer.put(peerInfo.getUsernameKey()).data(dataToStore).start(); userDataPut.addListener(new BaseFutureAdapter<FuturePut>() { @Override public void operationComplete(FuturePut future) throws Exception { if(future.isFailed()) { System.err.println("Failed to store user data in DHT! Reason is " + future.failedReason()); } else if(future.isSuccess()) { System.out.println("STORED DATA FOR " + peerInfo.getUsername() + " under " + peerInfo.getUsernameKey().toString()); } } }); //userDataUploader = new JobScheduler(peer.peer()); //userDataUploader.start(userDataPut, (USER_DATA_TTL - 10) * 1000, -1, new AutomaticFuture() { // @Override // public void futureCreated(BaseFuture future) { // if(future.isSuccess()) { // System.out.println("Added data to DHT for peer " + peerInfo.getUsername()); // } else { // System.err.println("Failed adding data to DHT for peer " + peerInfo.getUsername() + "!"); // System.err.println(future.failedReason()); if (delegate != null) { delegate.didLogin(peerInfo, null); } } else { System.err.println("Failed to bootstrap!"); System.err.println("Reason is " + future.failedReason()); if (delegate != null) { delegate.didLogin(null, P2PLoginError.BOOTSTRAP_ERROR); } return; } } }); } catch (UnknownHostException uhe) { System.err.println("Invalid host specified: " + BOOTSTRAP_ADDRESS + "!"); if (delegate != null) { delegate.didLogin(null, P2PLoginError.BOOTSTRAP_ERROR); } return; } } }
package com.vaguehope.morrigan.sshui; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.googlecode.lanterna.TerminalSize; import com.googlecode.lanterna.gui2.AbstractListBox; import com.googlecode.lanterna.gui2.Button; import com.googlecode.lanterna.gui2.Direction; import com.googlecode.lanterna.gui2.EmptySpace; import com.googlecode.lanterna.gui2.GridLayout; import com.googlecode.lanterna.gui2.Interactable; import com.googlecode.lanterna.gui2.Label; import com.googlecode.lanterna.gui2.LinearLayout; import com.googlecode.lanterna.gui2.Panel; import com.googlecode.lanterna.gui2.TextBox; import com.googlecode.lanterna.gui2.TextGUIGraphics; import com.googlecode.lanterna.gui2.WindowBasedTextGUI; import com.googlecode.lanterna.gui2.dialogs.DialogWindow; import com.googlecode.lanterna.gui2.dialogs.MessageDialog; import com.googlecode.lanterna.input.KeyStroke; import com.vaguehope.morrigan.model.exceptions.MorriganException; import com.vaguehope.morrigan.model.media.IMediaTrack; import com.vaguehope.morrigan.model.media.IMixedMediaDb; import com.vaguehope.morrigan.model.media.MatchMode; import com.vaguehope.morrigan.model.media.MediaTag; import com.vaguehope.morrigan.model.media.MediaTagType; import com.vaguehope.morrigan.sqlitewrapper.DbException; import com.vaguehope.morrigan.sshui.Autocomplete.MergedResult; import com.vaguehope.morrigan.sshui.Autocomplete.PartialQuery; import com.vaguehope.morrigan.util.StringHelper; public class JumpToDialog extends DialogWindow { private static final int WIDTH = 70; private static final int HEIGHT = 14; private static final int MAX_RESULTS = 100; private static final int MAX_AUTOCOMPLETE_RESULTS = 20; private static final Logger LOG = LoggerFactory.getLogger(JumpToDialog.class); private final IMixedMediaDb db; private final AtomicReference<String> savedSearchTerm; private final Label lblMsgs; private final SearchTextBox txtSearch; private final MediaItemListBox lstResults; private final Label lblTags; private volatile boolean alive = true; private List<? extends IMediaTrack> searchResults; private JumpResult result; public JumpToDialog (final IMixedMediaDb db, final AtomicReference<String> savedSearchTerm) { super(db.getListName()); this.db = db; this.savedSearchTerm = savedSearchTerm; final Panel p = new Panel(); p.setLayoutManager(new GridLayout(1) .setLeftMarginSize(1) .setRightMarginSize(1)); this.lblMsgs = new Label(""); p.addComponent(this.lblMsgs); this.txtSearch = new SearchTextBox(new TerminalSize(WIDTH, 1), this); p.addComponent(this.txtSearch); this.lstResults = new MediaItemListBox(new TerminalSize(WIDTH, HEIGHT), this); p.addComponent(this.lstResults); this.lblTags = new FixedHeightLabel("", 2); this.lblTags.setLabelWidth(WIDTH); p.addComponent(this.lblTags); final Panel btnPanel = new Panel(); btnPanel.setLayoutManager(new LinearLayout(Direction.HORIZONTAL)); btnPanel.addComponent(new Button("Reveal", new Runnable() { @Override public void run () { acceptRevealResult(); } })); btnPanel.addComponent(new Button("Enqueue All", new Runnable() { @Override public void run () { acceptEnqueueAllResult(); } })); btnPanel.addComponent(new Button("Shuffle", new Runnable() { @Override public void run () { acceptShuffleResult(); } })); btnPanel.addComponent(new EmptySpace(new TerminalSize(WIDTH - 58, 1))); // FIXME magic numbers. btnPanel.addComponent(new Button("Open View", new Runnable() { @Override public void run () { acceptOpenResult(); } })); btnPanel.addComponent(new Button("Close", new Runnable() { @Override public void run () { close(); } })); btnPanel.addTo(p); setComponent(p); setCloseWindowWithEscape(true); setHints(new HashSet<>(Arrays.asList(Hint.CENTERED, Hint.MODAL))); setSearchResults(null); // Init msgs. final String term = savedSearchTerm.get(); if (term != null) { this.txtSearch.setText(term); requestSearch(new PartialQuery(term, null, -1)); } } @Override public void close () { this.alive = false; super.close(); } protected boolean isAlive () { return this.alive && getTextGUI() != null; } private static final AtomicInteger BG_THREAD_NUMBER = new AtomicInteger(0); private SearchRunner searchRunner; /** * Only call on UI thread. */ protected final void requestSearch (final PartialQuery partialQuery) { if (this.searchRunner == null) { this.searchRunner = new SearchRunner(this); final Thread t = new Thread(this.searchRunner, String.format("jtbg-%s", BG_THREAD_NUMBER.getAndIncrement())); t.setDaemon(true); t.start(); } this.searchRunner.requestSearch(partialQuery); } /** * Only call on UI thread. */ protected void requestTags (final IMediaTrack item) { if (this.searchRunner == null) return; this.searchRunner.requestTags(item); } private static class SearchRunner implements Runnable { private final JumpToDialog dlg; private final BlockingQueue<Object> queue; public SearchRunner (final JumpToDialog dlg) { this.dlg = dlg; this.queue = new LinkedBlockingQueue<>(1); } public void requestSearch (final PartialQuery partialQuery) { this.queue.offer(partialQuery); } public void requestTags (final IMediaTrack item) { if (item == null) return; this.queue.offer(item); } @Override public void run () { try { runAndThrow(); } catch (final Exception e) { // NOSONAR report all errors to user. this.dlg.getTextGUI().getGUIThread().invokeLater(new Runnable() { @Override public void run () { MessageDialog.showMessageDialog(SearchRunner.this.dlg.getTextGUI(), "Error running search", e.toString()); } }); } LOG.info("BG search thread done."); } private void runAndThrow () throws DbException, MorriganException { while (this.dlg.isAlive()) { try { final Object item = this.queue.poll(15, TimeUnit.SECONDS); if (item == null) continue; if (item instanceof PartialQuery) { final PartialQuery partialQuery = (PartialQuery) item; if (partialQuery.activeTerm != null) { String tagQuery = partialQuery.activeTerm; MatchMode matchMode = MatchMode.PREFIX; if (tagQuery.startsWith("t=")) { tagQuery = tagQuery.substring(2); } else if (tagQuery.startsWith("t~")) { tagQuery = tagQuery.substring(2); matchMode = MatchMode.SUBSTRING; } final Map<String, MediaTag> tags = this.dlg.db.tagSearch(tagQuery, matchMode, MAX_AUTOCOMPLETE_RESULTS); this.dlg.getTextGUI().getGUIThread().invokeLater(new ShowAutocomplete(this.dlg, partialQuery, tags)); } final List<? extends IMediaTrack> results = this.dlg.db.simpleSearch(partialQuery.fullText, MAX_RESULTS); this.dlg.getTextGUI().getGUIThread().invokeLater(new SetSearchResults(this.dlg, results)); } else if (item instanceof IMediaTrack) { final List<MediaTag> tags = this.dlg.db.getTags((IMediaTrack) item); this.dlg.getTextGUI().getGUIThread().invokeLater(new ShowTags(this.dlg, tags)); } else { LOG.warn("Unknown object on queue: {}", item); } } catch (final InterruptedException e) { /* ignore. */} } } } private static class ShowAutocomplete implements Runnable { private final JumpToDialog dlg; private final PartialQuery partialQuery; private final Map<String, MediaTag> tags; public ShowAutocomplete(final JumpToDialog dlg, final PartialQuery partialQuery, final Map<String, MediaTag> tags) { this.dlg = dlg; this.partialQuery = partialQuery; this.tags = tags; } @Override public void run() { this.dlg.showAutocomplete(this.partialQuery, this.tags); } } private static class SetSearchResults implements Runnable { private final JumpToDialog dlg; private final List<? extends IMediaTrack> results; public SetSearchResults (final JumpToDialog dlg, final List<? extends IMediaTrack> results) { this.dlg = dlg; this.results = results; } @Override public void run () { this.dlg.setSearchResults(this.results); } } private static class ShowTags implements Runnable { private final JumpToDialog dlg; private final List<MediaTag> tags; public ShowTags (final JumpToDialog dlg, final List<MediaTag> tags) { this.dlg = dlg; this.tags = tags; } @Override public void run () { final StringBuilder s = new StringBuilder(); for (final MediaTag tag : this.tags) { if (tag.getType() != MediaTagType.MANUAL) continue; if (s.length() > 0) s.append(", "); s.append(tag.getTag()); } this.dlg.showTags(s.toString()); } } protected String getSearchText () { final String text = this.txtSearch.getText(); this.savedSearchTerm.set(text); return text; } /** * Call on UI thread. */ protected final void showAutocomplete (final PartialQuery partialQuery, final Map<String, MediaTag> tags) { final List<Runnable> actions = new ArrayList<>(); for (final Entry<String, MediaTag> e : tags.entrySet()) { actions.add(new Runnable() { @Override public void run() { final MergedResult mr = Autocomplete.mergeResult(JumpToDialog.this.txtSearch.getText(), partialQuery, e.getValue().getTag()); if (mr == null) return; JumpToDialog.this.txtSearch.setText(mr.result); JumpToDialog.this.txtSearch.setCaretPosition(mr.caretPos); requestSearch(new PartialQuery(mr.result, null, -1)); } @Override public String toString() { return e.getKey(); } }); } this.txtSearch.showAutocomplete(actions); } /** * Call on UI thread. */ protected final void setSearchResults (final List<? extends IMediaTrack> results) { this.searchResults = results; this.lstResults.setItems(results); if (results != null && results.size() > 0) { this.lblMsgs.setText(results.size() + " results."); } else if (this.txtSearch.getText().length() > 0) { this.lblMsgs.setText("No results for query."); } else { this.lblMsgs.setText("Search:"); } } protected void showTags (final String msg) { this.lblTags.setText(msg); } protected void acceptEnqueueResult () { final IMediaTrack track = this.lstResults.getSelectedTrack(); if (track != null) setResult(new JumpResult(JumpType.ENQUEUE, this.txtSearch.getText(), track)); } protected void acceptEnqueueAllResult () { if (this.searchResults != null && this.searchResults.size() > 0) { setResult(new JumpResult(JumpType.ENQUEUE, this.txtSearch.getText(), this.searchResults)); } } protected void acceptOpenResult () { final String text = this.txtSearch.getText(); if (text != null && text.length() > 0) { setResult(new JumpResult(JumpType.OPEN_VIEW, text)); return; } final String dbSearch = this.db.getSearchTerm(); if (StringHelper.notBlank(dbSearch)) { setResult(new JumpResult(JumpType.OPEN_VIEW, dbSearch)); } } protected void acceptRevealResult () { final IMediaTrack track = this.lstResults.getSelectedTrack(); if (track != null) setResult(new JumpResult(JumpType.REVEAL, this.txtSearch.getText(), track)); } protected void acceptShuffleResult () { if (this.searchResults != null && this.searchResults.size() > 0) { setResult(new JumpResult(JumpType.SHUFFLE_AND_ENQUEUE, this.txtSearch.getText(), this.searchResults)); } } private void setResult (final JumpResult res) { if (this.result != null) throw new IllegalStateException(); this.result = res; close(); } public JumpResult getResult () { return this.result; } private static class SearchTextBox extends TextBox { private final JumpToDialog dialog; private AutocompletePopup autocompletePopup; public SearchTextBox (final TerminalSize preferredSize, final JumpToDialog dialog) { super(preferredSize); this.dialog = dialog; setTextChangeListener((newText, changedByUserInteraction) -> { if (!changedByUserInteraction) return; onTextChangedByUser(newText); }); } private void onTextChangedByUser(final String newText) { final PartialQuery partialQuery = Autocomplete.extractPartialSearchTerm(newText, getCaretPosition().getColumn()); if (partialQuery.activeTerm == null) closeAutocomplete(); this.dialog.requestSearch(partialQuery); } @Override public synchronized Result handleKeyStroke (final KeyStroke key) { if (this.autocompletePopup != null && this.autocompletePopup.offerInput(key)) { return Result.HANDLED; } switch (key.getKeyType()) { case Enter: this.dialog.acceptEnqueueResult(); return Result.HANDLED; case Character: if (key.isCtrlDown() && key.getCharacter() == 'u') { setText(""); return Result.HANDLED; } //$FALL-THROUGH$ default: return super.handleKeyStroke(key); } } @Override protected synchronized void afterLeaveFocus(final FocusChangeDirection direction, final Interactable nextInFocus) { closeAutocomplete(); } public void showAutocomplete(final List<Runnable> actions) { closeAutocomplete(); if (actions.size() < 1) return; this.autocompletePopup = AutocompletePopup.makeAndShow(this, actions, () -> this.autocompletePopup = null); } private void closeAutocomplete() { if (this.autocompletePopup == null) return; this.autocompletePopup.close(); this.autocompletePopup = null; } } private static class MediaItemListBox extends AbstractListBox<IMediaTrack, MediaItemListBox> { private final JumpToDialog dialog; public MediaItemListBox (final TerminalSize preferredSize, final JumpToDialog dialog) { super(preferredSize); this.dialog = dialog; } public void setItems (final List<? extends IMediaTrack> items) { clearItems(); if (items != null) { for (final IMediaTrack track : items) { addItem(track); } setSelectedIndex(0); } } public IMediaTrack getSelectedTrack () { if (getItemCount() < 1) return null; return getSelectedItem(); } @Override protected ListItemRenderer<IMediaTrack, MediaItemListBox> createDefaultListItemRenderer() { return new ListItemRenderer<IMediaTrack, MediaItemListBox>() { @Override public int getHotSpotPositionOnLine(final int selectedIndex) { return -1; } @Override public void drawItem(final TextGUIGraphics graphics, final MediaItemListBox listBox, final int index, final IMediaTrack item, final boolean selected, final boolean focused) { super.drawItem(graphics, listBox, index, item, selected, true); } }; } @Override protected synchronized void afterEnterFocus (final FocusChangeDirection direction, final Interactable previouslyInFocus) { super.afterEnterFocus(direction, previouslyInFocus); selectedChanged(); } @Override public synchronized Result handleKeyStroke(final KeyStroke key) { final Result result = super.handleKeyStroke(key); switch (key.getKeyType()) { case ArrowUp: case ArrowDown: selectedChanged(); //$FALL-THROUGH$ default: } if (result == Result.UNHANDLED) { switch (key.getKeyType()) { case Enter: this.dialog.acceptEnqueueResult(); return Result.HANDLED; default: return Result.UNHANDLED; } } return result; } private void selectedChanged () { this.dialog.requestTags(getSelectedItem()); } } private static class FixedHeightLabel extends Label { private final int height; public FixedHeightLabel(final String text, final int height) { super(text); this.height = height; setText(text); // Force getBounds() to be called AFTER setting height field. } @Override protected TerminalSize getBounds(String[] lines, TerminalSize currentBounds) { return super.getBounds(lines, currentBounds).withRows(this.height); } } public enum JumpType { ENQUEUE, REVEAL, SHUFFLE_AND_ENQUEUE, OPEN_VIEW; } public static class JumpResult { private final JumpType type; private final String text; private final IMediaTrack track; private final List<? extends IMediaTrack> tracks; public JumpResult (final JumpType type, final String text) { this(type, text, null, null); } public JumpResult (final JumpType type, final String text, final IMediaTrack track) { this(type, text, track, null); } public JumpResult (final JumpType type, final String text, final List<? extends IMediaTrack> tracks) { this(type, text, null, tracks); } private JumpResult (final JumpType type, final String text, final IMediaTrack track, final List<? extends IMediaTrack> tracks) { if (type == null) throw new IllegalArgumentException("type not specified"); this.type = type; this.track = track; this.text = text; this.tracks = tracks; } public JumpType getType () { return this.type; } public String getText () { if (this.text == null) throw new IllegalStateException("text not set."); return this.text; } public IMediaTrack getTrack () { if (this.track == null) throw new IllegalStateException("track not set."); return this.track; } public List<? extends IMediaTrack> getTracks () { if (this.tracks == null) { if (this.track != null) return Collections.singletonList(this.track); throw new IllegalStateException("tracks not set."); } return this.tracks; } } public static JumpResult show (final WindowBasedTextGUI owner, final IMixedMediaDb db, final AtomicReference<String> savedSearchTerm) { final JumpToDialog dialog = new JumpToDialog(db, savedSearchTerm); dialog.showDialog(owner); return dialog.getResult(); } }
package com.vaguehope.onosendai.model; import android.os.Bundle; import android.view.View; import android.widget.ListAdapter; import android.widget.ListView; public class ScrollState { private static final String KEY_ITEM_ID = "list_view_item_id"; private static final String KEY_TOP = "list_view_top"; private static final String KEY_ITEM_TIME = "list_view_item_time"; private final long itemId; private final int top; private final long itemTime; public ScrollState (final long itemId, final int top, final long itemTime) { this.itemId = itemId; this.top = top; this.itemTime = itemTime; } @Override public String toString () { return new StringBuilder() .append("SaveScrollState{").append(this.itemId) .append(',').append(this.top) .append(',').append(this.itemTime) .append('}') .toString(); } public long getItemId () { return this.itemId; } public int getTop () { return this.top; } public long getItemTime () { return this.itemTime; } public void applyTo (final ListView lv) { // NOTE if this seems unreliable try wrapping setSelection*() calls in lv.post(...). final ListAdapter adapter = lv.getAdapter(); for (int i = 0; i < adapter.getCount(); i++) { if (adapter.getItemId(i) == this.itemId) { lv.setSelectionFromTop(i, this.top); return; } } // Also search by time before giving up. if (this.itemTime > 0L && adapter instanceof TweetListAdapter) { final TweetList tweetList = ((TweetListAdapter) adapter).getInputData(); for (int i = 0; i < tweetList.count(); i++) { if (tweetList.getTweet(i).getTime() <= this.itemTime) { lv.setSelectionFromTop(i, 0); return; } } } lv.setSelection(lv.getCount() - 1); } public void addToBundle (final Bundle bundle) { if (bundle == null) return; bundle.putLong(KEY_ITEM_ID, this.itemId); bundle.putInt(KEY_TOP, this.top); bundle.putLong(KEY_ITEM_TIME, this.itemTime); } public static ScrollState from (final ListView lv) { final int index = lv.getFirstVisiblePosition(); final View v = lv.getChildAt(0); final int top = (v == null) ? 0 : v.getTop(); final long itemId = lv.getAdapter().getItemId(index); if (itemId < 0) return null; final Object item = lv.getAdapter().getItem(index); final long time = item instanceof Tweet ? ((Tweet) item).getTime() : 0L; return new ScrollState(itemId, top, time); } public static ScrollState fromBundle (final Bundle bundle) { if (bundle == null) return null; if (bundle.containsKey(KEY_ITEM_ID) && bundle.containsKey(KEY_TOP)) { long itemId = bundle.getLong(KEY_ITEM_ID); int top = bundle.getInt(KEY_TOP); long itemTime = bundle.getLong(KEY_ITEM_TIME); return new ScrollState(itemId, top, itemTime); } return null; } }
package com.valkryst.VTerminal.component; import com.valkryst.VTerminal.Screen; import com.valkryst.VTerminal.Tile; import com.valkryst.VTerminal.TileGrid; import com.valkryst.VTerminal.builder.TextAreaBuilder; import com.valkryst.VTerminal.font.Font; import com.valkryst.VTerminal.palette.java2d.Java2DPalette; import lombok.Getter; import lombok.NonNull; import lombok.Setter; import lombok.ToString; import org.apache.commons.text.WordUtils; import java.awt.*; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.util.Arrays; import java.util.regex.Matcher; import java.util.regex.Pattern; @ToString public class TextArea extends Component { /** The foreground color of the caret. */ @Getter @Setter private Color caretForegroundColor; /** The background color of the caret. */ @Getter @Setter private Color caretBackgroundColor; /** The foreground color of non-caret characters. */ @Getter private Color foregroundColor; /** The background color of non-caret characters. */ @Getter private Color backgroundColor; /** Whether or not the TextArea can be edited. */ @Getter @Setter private boolean editable; /** The current position of the caret. */ @Getter private Point caretPosition = new Point(0, 0); /** The text entered by the user. */ @Getter private int[][] enteredText; /** Whether the text area is in-focus. */ @Getter private boolean isFocused; /** The pattern used to determine which typed characters can be entered into the field. */ @Getter @Setter private Pattern allowedCharacterPattern; /** Whether the special listener code for the Enter key is enabled. */ @Getter @Setter private boolean isEnterKeyEnabled; /** Whether the special listener code for the Backspace key is enabled. */ @Getter @Setter private boolean isBackspaceKeyEnabled; /** Whether the special listener code for the Delete key is enabled. */ @Getter @Setter private boolean isDeleteKeyEnabled; /** Whether the special listener code for the Home key is enabled. */ @Getter @Setter private boolean isHomeKeyEnabled; /** Whether the special listener code for the End key is enabled. */ @Getter @Setter private boolean isEndKeyEnabled; /** Whether the special listener code for the Page Up key is enabled. */ @Getter @Setter private boolean isPageUpKeyEnabled; /** Whether the special listener code for the Page Down key is enabled. */ @Getter @Setter private boolean isPageDownKeyEnabled; /** Whether the special listener code for the Up Arrow key is enabled. */ @Getter @Setter private boolean isUpArrowKeyEnabled; /** Whether the special listener code for the Down Arrow key is enabled. */ @Getter @Setter private boolean isDownArrowKeyEnabled; /** Whether the special listener code for the Left Arrow key is enabled. */ @Getter @Setter private boolean isLeftArrowKeyEnabled; /** Whether the special listener code for the Right Arrow key is enabled. */ @Getter @Setter private boolean isRightArrowKeyEnabled; /** * Constructs a new AsciiTextField. * * @param builder * The builder to use. * * @throws NullPointerException * If the builder is null. */ public TextArea(final @NonNull TextAreaBuilder builder) { super(builder.getDimensions(), builder.getPosition()); setPalette(builder.getPalette(), false); editable = builder.isEditable(); enteredText = new int[builder.getHeight()][builder.getWidth()]; allowedCharacterPattern = builder.getAllowedCharacterPattern(); isEnterKeyEnabled = builder.isEnterKeyEnabled(); isBackspaceKeyEnabled = builder.isBackspaceKeyEnabled(); isDeleteKeyEnabled = builder.isDeleteKeyEnabled(); isHomeKeyEnabled = builder.isHomeKeyEnabled(); isEndKeyEnabled = builder.isEndKeyEnabled(); isPageUpKeyEnabled = builder.isPageUpKeyEnabled(); isPageDownKeyEnabled = builder.isPageDownKeyEnabled(); isUpArrowKeyEnabled = builder.isUpArrowKeyEnabled(); isDownArrowKeyEnabled = builder.isDownArrowKeyEnabled(); isLeftArrowKeyEnabled = builder.isLeftArrowKeyEnabled(); isRightArrowKeyEnabled = builder.isRightArrowKeyEnabled(); // Set the area's initial colors: for (int y = 0 ; y < super.tiles.getHeight() ; y++) { for (int x = 0 ; x < super.tiles.getWidth() ; x++) { final Tile tile = super.getTileAt(x, y); if (tile != null) { tile.setBackgroundColor(backgroundColor); tile.setForegroundColor(foregroundColor); } enteredText[y][x] = ' '; } } // Set initial caret position: changeCaretPosition(caretPosition.x, caretPosition.y); } @Override public void createEventListeners(final Screen parentScreen) { if (parentScreen == null || super.eventListeners.size() > 0) { return; } final TileGrid tiles = super.tiles; final MouseListener mouseListener = new MouseListener() { @Override public void mouseClicked(final MouseEvent e) { if (editable == false) { return; } if (e.getButton() != MouseEvent.BUTTON1) { return; } if (intersects(parentScreen.getMousePosition()) == false) { return; } final Font font = parentScreen.getImageCache().getFont(); final int columnIndexInArea = (e.getX() / font.getWidth()) - tiles.getXPosition(); final int rowIndexInArea = (e.getY() / font.getHeight()) - tiles.getYPosition(); int dx = columnIndexInArea - caretPosition.x; int dy = rowIndexInArea - caretPosition.y; while (dx != 0) { if (dx > 0) { moveCaretRight(); dx } else { moveCaretLeft(); dx++; } } while (dy != 0) { if (dy > 0) { moveCaretDown(); dy } else { moveCaretUp(); dy++; } } updateDisplayedCharacters(); } @Override public void mousePressed(final MouseEvent e) { isFocused = intersects(parentScreen.getMousePosition()); } @Override public void mouseReleased(final MouseEvent e) {} @Override public void mouseEntered(final MouseEvent e) {} @Override public void mouseExited(final MouseEvent e) {} }; final KeyListener keyListener = new KeyListener() { @Override public void keyTyped(final KeyEvent e) { if (editable == false || isFocused == false) { return; } final char character = e.getKeyChar(); final Matcher matcher = allowedCharacterPattern.matcher(character + ""); if (matcher.matches()) { final Tile tile = tiles.getTileAt(caretPosition.x, caretPosition.y); if (tile == null) { return; } tile.setCharacter(character); enteredText[caretPosition.y][caretPosition.x] = character; final boolean caretAtEndOfLine = caretPosition.x == tiles.getWidth() - 1; if (caretAtEndOfLine) { if (caretPosition.y < tiles.getHeight() - 1) { moveCaretDown(); moveCaretToStartOfLine(); } } else { moveCaretRight(); } updateDisplayedCharacters(); } } @Override public void keyPressed(final KeyEvent e) { if (editable == false || isFocused == false) { return; } switch (e.getKeyCode()) { // Move the caret to the first position of the next row: case KeyEvent.VK_ENTER: { if (isEnterKeyEnabled == false) { return; } if (caretPosition.y < tiles.getHeight() - 1) { moveCaretDown(); moveCaretToStartOfLine(); updateDisplayedCharacters(); } break; } // Delete the character to the left of the caret, then move the caret one position left: case KeyEvent.VK_BACK_SPACE: { if (isBackspaceKeyEnabled == false) { return; } final boolean caretAtStartOfLine = caretPosition.x == 0; final boolean caretAtEndOfLine = caretPosition.x == tiles.getWidth() - 1; if (caretAtStartOfLine) { if (caretPosition.y > 0) { moveCaretUp(); moveCaretToEndOfLine(); } } else if (caretAtEndOfLine) { final Tile currentChar = tiles.getTileAt(caretPosition.x, caretPosition.y); if (currentChar != null && currentChar.getCharacter() == ' ') { moveCaretLeft(); } } else { moveCaretLeft(); } clearCurrentCell(); updateDisplayedCharacters(); break; } } } @Override public void keyReleased(final KeyEvent e) { if (editable == false || isFocused == false) { return; } final int keyCode = e.getKeyCode(); switch (keyCode) { // Erase the current character: case KeyEvent.VK_DELETE: { if (isDeleteKeyEnabled) { clearCurrentCell(); } break; } // Move the caret to the first position on the left: case KeyEvent.VK_HOME: { if (isHomeKeyEnabled) { moveCaretToStartOfLine(); } break; } // Move the caret to the last position on the right: case KeyEvent.VK_END: { if (isEndKeyEnabled) { moveCaretToEndOfLine(); } break; } // Move the caret to the first row: case KeyEvent.VK_PAGE_UP: { if (isPageUpKeyEnabled) { moveCaretToFirstLine(); } break; } // Move the caret to the last row: case KeyEvent.VK_PAGE_DOWN: { if (isPageDownKeyEnabled) { moveCaretToLastLine(); } break; } // Move the caret one position to the left: case KeyEvent.VK_LEFT: { if (isLeftArrowKeyEnabled == false) { return; } boolean moveToPreviousLine = caretPosition.x == 0; moveToPreviousLine &= caretPosition.y > 0; if (moveToPreviousLine) { moveCaretUp(); moveCaretToEndOfLine(); } else { moveCaretLeft(); } break; } // Move the caret one position to the right: case KeyEvent.VK_RIGHT: { if (isRightArrowKeyEnabled == false) { return; } boolean moveToNextLine = caretPosition.x == tiles.getWidth() - 1; moveToNextLine &= caretPosition.y < tiles.getHeight() - 1; if (moveToNextLine) { moveCaretDown(); moveCaretToStartOfLine(); } else { moveCaretRight(); } break; } // Move the caret one position up: case KeyEvent.VK_UP: { if (isUpArrowKeyEnabled) { moveCaretUp(); } break; } // Move the caret one position down: case KeyEvent.VK_DOWN: { if (isDownArrowKeyEnabled) { moveCaretDown(); } break; } } updateDisplayedCharacters(); } }; super.eventListeners.add(keyListener); super.eventListeners.add(mouseListener); } public void setBackgroundColor(final @NonNull Color color) { setColor(color, true); } public void setForegroundColor(final @NonNull Color color) { setColor(color, false); } private void setColor(final Color color, final boolean isBackgroundColor) { if (isBackgroundColor) { backgroundColor = color; caretForegroundColor = color; } else { foregroundColor = color; caretBackgroundColor = color; } // Color All Tiles for (int y = 0 ; y < tiles.getHeight() ; y++) { for (int x = 0 ; x < tiles.getWidth() ; x++) { final Tile tile = tiles.getTileAt(x, y); if (tile != null) { tile.setBackgroundColor(backgroundColor); tile.setForegroundColor(foregroundColor); } } } // Color Caret final Tile tile = tiles.getTileAt(caretPosition.x, caretPosition.y); if (tile != null) { tile.setBackgroundColor(caretBackgroundColor); tile.setForegroundColor(caretForegroundColor); } try { redrawFunction.run(); } catch (final IllegalStateException ignored) { } } @Override public void setPalette(final Java2DPalette palette, final boolean redraw) { if (palette == null) { return; } // Set the instance variables. this.palette = palette; this.caretBackgroundColor = palette.getTextAreaPalette().getBackgroundCaret(); this.caretForegroundColor = palette.getTextAreaPalette().getForegroundCaret(); this.backgroundColor = palette.getTextAreaPalette().getBackground(); this.foregroundColor = palette.getTextAreaPalette().getForeground(); // Color All Tiles for (int y = 0 ; y < tiles.getHeight() ; y++) { for (int x = 0 ; x < tiles.getWidth() ; x++) { final Tile tile = tiles.getTileAt(x, y); if (tile != null) { tile.setBackgroundColor(backgroundColor); tile.setForegroundColor(foregroundColor); } } } // Color Caret final Tile tile = tiles.getTileAt(caretPosition.x, caretPosition.y); if (tile != null) { tile.setBackgroundColor(caretBackgroundColor); tile.setForegroundColor(caretForegroundColor); } if (redraw) { try { redrawFunction.run(); } catch (final IllegalStateException ignored) { } } } /** Moves the caret one cell up. */ public void moveCaretUp() { if (caretPosition.y > 0) { changeCaretPosition(caretPosition.x, caretPosition.y - 1); } } /** Moves the caret one cell down. */ public void moveCaretDown() { if (caretPosition.y < super.tiles.getHeight() - 1) { changeCaretPosition(caretPosition.x, caretPosition.y + 1); } } /** Moves the caret one cell left. */ public void moveCaretLeft() { if (caretPosition.x > 0) { changeCaretPosition(caretPosition.x - 1, caretPosition.y); } } /** Moves the caret one cell right. */ public void moveCaretRight() { if (caretPosition.x < super.tiles.getWidth() - 1) { changeCaretPosition(caretPosition.x + 1, caretPosition.y); } } /** Moves the caret to the first line. Does not change the x-axis position of the caret. */ public void moveCaretToFirstLine() { changeCaretPosition(caretPosition.x, 0); } /** Moves the caret to the last line. Does not change the x-axis position of the caret. */ public void moveCaretToLastLine() { changeCaretPosition(caretPosition.x, super.tiles.getHeight() - 1); } /** Moves the caret to the beginning of the current line. */ public void moveCaretToStartOfLine() { changeCaretPosition(0, caretPosition.y); } /** Moves the caret to the end of the current line. */ public void moveCaretToEndOfLine() { changeCaretPosition(super.tiles.getWidth() - 1, caretPosition.y); } /** Deletes the character in the current cell. */ private void clearCurrentCell() { super.getTileAt(caretPosition.x, caretPosition.y).setCharacter(' '); enteredText[caretPosition.y][caretPosition.x] = ' '; } /** * Moves the caret to a new position. * * @param x * The x-axis coordinate of the new position. * * @param y * The y-axis coordinate of the new position. */ public void changeCaretPosition(final int x, final int y) { // Reset current position. Tile tile = super.getTileAt(caretPosition.x, caretPosition.y); if (tile != null) { tile.setBackgroundColor(backgroundColor); tile.setForegroundColor(foregroundColor); } // Set new position. caretPosition.setLocation(x, y); if (editable) { tile = super.getTileAt(caretPosition.x, caretPosition.y); if (tile != null) { tile.setBackgroundColor(caretBackgroundColor); tile.setForegroundColor(caretForegroundColor); } } } /** Copies the entered text onto the tiles, so the user's input is displayed. */ private void updateDisplayedCharacters() { for (int y = 0 ; y < super.tiles.getHeight() ; y++) { for (int x = 0 ; x < super.tiles.getWidth() ; x++) { final Tile tile = super.getTileAt(x, y); if (tile != null) { tile.setCharacter(enteredText[y][x]); } } } super.redrawFunction.run(); } /** * Appends a string to the first empty row of the text area. * * If the string is too long to be displayed on a single line of the area, then it is split and displayed on * multiple lines. * * Newline '\n' characters result in a new line being appended. * Tab '\t' characters are converted to two space ' ' characters. * * @param text * The text to append. */ public void appendText(String text) { if (text == null) { text = ""; } // Convert Special Characters text = text.replace("\t", " "); // Split the text into separate lines if required. final int width = super.getTiles().getWidth(); text = WordUtils.wrap(text, width, "\n", true); final String[] textLines = text.split("\n"); // Convert Text Lines to Tile Lines and append them to the area. for (final String textLine : textLines) { final Tile[] tileLine = new Tile[textLine.length()]; for (int i = 0 ; i < textLine.length() ; i++) { final Tile tile = new Tile(textLine.charAt(i)); tile.setBackgroundColor(backgroundColor); tile.setForegroundColor(foregroundColor); tileLine[i] = tile; } appendText(tileLine); } } /** * Appends a string of tiles to the first empty row of the text area. * * If there are no empty rows, then the first row is discarded and all rows are moved up by one row. The * text is then appended to the bottom row. * * @param text * The new text. */ public void appendText(final Tile[] text) { // Find first empty row and append text: for (int y = 0 ; y < super.tiles.getHeight() ; y++) { boolean rowIsEmpty = true; for (int x = 0 ; x < super.tiles.getWidth() ; x++) { final int character = super.getTileAt(x, y).getCharacter(); rowIsEmpty &= Character.isSpaceChar(character); } if (rowIsEmpty) { setText(y, text); return; } } // If no empty rows found, move all rows up: for (int y = 0 ; y < super.tiles.getHeight() - 1 ;y++) { setText(y, super.tiles.getRow(y + 1)); } setText(super.tiles.getHeight() - 1, text); updateDisplayedCharacters(); } /** * Retrieves the text contained within this text area. * * @return * The text. */ public String getText() { final StringBuilder sb = new StringBuilder(); for (final int[] row : enteredText) { for (final int character : row) { sb.appendCodePoint(character); } } return sb.toString(); } /** * Sets the text contained within a row of the area. * * @param rowIndex * The row index. * * @param text * The text. */ public void setText(final int rowIndex, final Tile[] text) { clearText(rowIndex); if (text != null) { for (int x = 0; x < Math.min(super.tiles.getWidth(), text.length); x++) { super.getTileAt(x, rowIndex).copy(text[x]); enteredText[rowIndex][x] = text[x].getCharacter(); } } updateDisplayedCharacters(); } /** * Clears text from a row. * * @param rowIndex * The row index. */ public void clearText(final int rowIndex) { if (rowIndex < 0 || rowIndex > super.tiles.getHeight()) { return; } Arrays.fill(enteredText[rowIndex], ' '); for (int x = 0 ; x < super.tiles.getWidth() ; x++) { final Tile tile = super.getTileAt(x, rowIndex); tile.reset(); tile.setBackgroundColor(backgroundColor); tile.setForegroundColor(foregroundColor); } updateDisplayedCharacters(); } /** Clears all text from the field. */ public void clearText() { for (final int[] line : enteredText) { Arrays.fill(line, ' '); } for (int y = 0 ; y < super.tiles.getHeight() ; y++) { for (int x = 0 ; x < super.tiles.getWidth() ; x++) { super.getTileAt(x, y).setCharacter(' '); } } updateDisplayedCharacters(); } }
package com.wizzardo.http.framework.di; import com.wizzardo.tools.cache.Cache; import com.wizzardo.tools.reflection.FieldReflection; import com.wizzardo.tools.reflection.FieldReflectionFactory; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Iterator; import java.util.List; public abstract class Dependency<T> { protected static Cache<Class, List<FieldReflection>> dependencies = new Cache<>(0, clazz -> { List<FieldReflection> l = new ArrayList<>(); FieldReflectionFactory reflectionFactory = new FieldReflectionFactory(); while (clazz != null) { for (Field f : clazz.getDeclaredFields()) { int mod = f.getType().getModifiers(); if (Modifier.isFinal(mod) || f.getType().isPrimitive()) continue; if (f.getType().getAnnotation(Injectable.class) != null || Modifier.isAbstract(mod) || Modifier.isInterface(mod)) { l.add(reflectionFactory.create(f, true)); } else for (Class i : f.getType().getInterfaces()) { if (i.getAnnotation(Injectable.class) != null) { l.add(reflectionFactory.create(f, true)); break; } } } clazz = clazz.getSuperclass(); } return l; }); public abstract T get(); protected void injectDependencies(Object ob) { try { for (FieldReflection f : dependencies.get(ob.getClass())) { f.setObject(ob, DependencyFactory.getDependency(f.getField().getType())); } } catch (Exception e) { synchronized (ob.getClass()) { List<FieldReflection> list = new ArrayList<>(dependencies.get(ob.getClass())); Iterator<FieldReflection> iterator = list.iterator(); while (iterator.hasNext()) { FieldReflection f = iterator.next(); try { f.setObject(ob, DependencyFactory.getDependency(f.getField().getType())); } catch (Exception ex) { iterator.remove(); } } dependencies.put(ob.getClass(), list); } } } }
package cz.muni.fi.jboss.migration; import cz.muni.fi.jboss.migration.ex.InitMigratorsExceptions; import cz.muni.fi.jboss.migration.conf.Configuration; import cz.muni.fi.jboss.migration.conf.GlobalConfiguration; import cz.muni.fi.jboss.migration.ex.*; import cz.muni.fi.jboss.migration.migrators.connectionFactories.ResAdapterMigrator; import cz.muni.fi.jboss.migration.migrators.dataSources.DatasourceMigrator; import cz.muni.fi.jboss.migration.migrators.logging.LoggingMigrator; import cz.muni.fi.jboss.migration.migrators.security.SecurityMigrator; import cz.muni.fi.jboss.migration.migrators.server.ServerMigrator; import cz.muni.fi.jboss.migration.spi.IMigrator; import cz.muni.fi.jboss.migration.utils.AS7ModuleUtils; import cz.muni.fi.jboss.migration.utils.RollbackUtils; import cz.muni.fi.jboss.migration.utils.Utils; import org.apache.commons.collections.map.MultiValueMap; import org.apache.commons.io.FileUtils; import org.eclipse.persistence.exceptions.JAXBException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Node; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import java.io.File; import java.io.IOException; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.*; import org.w3c.dom.Document; /** * Controls the core migration processes. * * @author Roman Jakubco */ public class MigratorEngine { private static final Logger log = LoggerFactory.getLogger(MigratorEngine.class); private Configuration config; private MigrationContext ctx; private List<IMigrator> migrators; public MigratorEngine( Configuration config, MigrationContext context ) throws InitMigratorsExceptions { this.config = config; this.ctx = context; this.init(); } /** * Initializes this Migrator, especially instantiates the IMigrators. */ private void init() throws InitMigratorsExceptions { // Find IMigrator implementations. List<Class<? extends IMigrator>> migratorClasses = findMigratorClasses(); // Initialize migrator instances. Map<Class<? extends IMigrator>, IMigrator> migratorsMap = createMigrators( migratorClasses, config.getGlobal(), null); // TODO! MultiValueMap of plugin-specific config values. this.migrators = new ArrayList(migratorsMap.values()); // For each migrator (AKA module, AKA plugin)... for( IMigrator mig : this.migrators ){ // Supply some references. mig.setGlobalConfig( this.config.getGlobal() ); // Let migrators process module-specific args. for( Configuration.ModuleSpecificProperty moduleOption : config.getModuleConfigs() ){ mig.examineConfigProperty( moduleOption ); } } }// init() /** * Instantiate the plugins. */ private static Map<Class<? extends IMigrator>, IMigrator> createMigrators( List<Class<? extends IMigrator>> migratorClasses, GlobalConfiguration globalConfig, MultiValueMap config ) throws InitMigratorsExceptions { Map<Class<? extends IMigrator>, IMigrator> migs = new HashMap<>(); List<Exception> exs = new LinkedList<>(); for( Class<? extends IMigrator> cls : migratorClasses ){ try { //IMigrator mig = cls.newInstance(); //GlobalConfiguration globalConfig, MultiValueMap config Constructor<? extends IMigrator> ctor = cls.getConstructor(GlobalConfiguration.class, MultiValueMap.class); IMigrator mig = ctor.newInstance(globalConfig, config); migs.put(cls, mig); } catch( NoSuchMethodException ex ){ String msg = cls.getName() + " doesn't have constructor ...(GlobalConfiguration globalConfig, MultiValueMap config)."; log.error( msg ); exs.add( new MigrationException(msg) ); } catch( InvocationTargetException | InstantiationException | IllegalAccessException ex) { log.error("Failed instantiating " + cls.getSimpleName() + ": " + ex.toString()); log.debug("Stack trace: ", ex); exs.add(ex); } } if( ! exs.isEmpty() ){ throw new InitMigratorsExceptions(exs); } return migs; }// createMigrators() /** * Finds the implementations of the IMigrator. * TODO: Implement scanning for classes. */ private static List<Class<? extends IMigrator>> findMigratorClasses() { LinkedList<Class<? extends IMigrator>> migratorClasses = new LinkedList(); migratorClasses.add( SecurityMigrator.class ); migratorClasses.add( ServerMigrator.class ); migratorClasses.add( DatasourceMigrator.class ); migratorClasses.add( ResAdapterMigrator.class ); migratorClasses.add( LoggingMigrator.class ); return migratorClasses; } /** * Method which calls method for loading configuration data from AS5 on all migrators. * * @throws LoadMigrationException */ public void loadAS5Data() throws LoadMigrationException { try { for (IMigrator mig : this.migrators) { mig.loadAS5Data(this.ctx); } } catch (JAXBException e) { throw new LoadMigrationException(e); } } /** * Method which calls method for applying migrated configuration on all migrators. * * @throws ApplyMigrationException if inserting of generated nodes fails. */ public void apply() throws ApplyMigrationException { for (IMigrator mig : this.migrators) { mig.apply(this.ctx); } try { Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); StreamResult result = new StreamResult(new File(this.config.getGlobal().getAS7Config().getConfigFilePath())); DOMSource source = new DOMSource(this.ctx.getAS7ConfigXmlDoc()); transformer.transform(source, result); } catch (TransformerException ex) { throw new ApplyMigrationException(ex); } } /** * Calls all migrators' callback for generating Dom Nodes. * * @return List containing all generated Nodes * @throws MigrationException if migrating of file or generating of nodes fails. */ public List<Node> getDOMElements() throws MigrationException { List<Node> elements = new ArrayList<>(); for (IMigrator mig : this.migrators) { elements.addAll(mig.generateDomElements(this.ctx)); } return elements; } /** * Calls all migrators' callback for generating CLI scripts. * * @return List containing generated scripts from all migrated subsystems * @throws CliScriptException if creation of scripts fail */ public List<String> getCLIScripts() throws CliScriptException { List<String> scripts = new ArrayList<>(); for (IMigrator mig : this.migrators) { scripts.addAll(mig.generateCliScripts(this.ctx)); } return scripts; } /** * Copies all necessary files for migration from AS5 to their place in the AS7 home folder. * * @throws CopyException if copying of files fails. */ public void copyItems() throws CopyException { String targetPath = this.config.getGlobal().getAS7Config().getDir(); File as5ProfileDir = this.config.getGlobal().getAS5Config().getProfileDir(); File as5commonLibDir = Utils.createPath(this.config.getGlobal().getAS5Config().getDir(), "common", "lib"); for (RollbackData rollData : this.ctx.getRollbackData()) { if (rollData.getName() == null || rollData.getName().isEmpty()) { throw new IllegalStateException("Rollback data name is not set."); } List<File> list = Utils.searchForFile(rollData, as5ProfileDir); switch (rollData.getType()) { case DRIVER: case LOGMODULE:{ // For now only expecting one jar for driver. Pick the first one. if (list.isEmpty()) { List<File> altList = Utils.searchForFile(rollData, as5commonLibDir); RollbackUtils.setRollbackData(rollData, altList, targetPath); } else { RollbackUtils.setRollbackData(rollData, list, targetPath); } } break; case LOG: RollbackUtils.setRollbackData(rollData, list, targetPath); break; case SECURITY: RollbackUtils.setRollbackData(rollData, list, targetPath); break; case RESOURCE: RollbackUtils.setRollbackData(rollData, list, targetPath); break; } }// for each rollData try { final TransformerFactory tf = TransformerFactory.newInstance(); final Transformer transformer = tf.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "3"); for( RollbackData cp : this.ctx.getRollbackData() ) { RollbackData.Type type = cp.getType(); if( type.equals(RollbackData.Type.DRIVER) || type.equals(RollbackData.Type.LOGMODULE) ) { File directories = new File(cp.getTargetPath()); FileUtils.forceMkdir(directories); File moduleXml = new File(directories.getAbsolutePath(), "module.xml"); if( ! moduleXml.createNewFile() ) throw new CopyException("File already exists: " + moduleXml.getPath()); Document doc = RollbackData.Type.DRIVER.equals(type) ? AS7ModuleUtils.createDriverModuleXML(cp) : AS7ModuleUtils.createLogModuleXML(cp); transformer.transform( new DOMSource(doc), new StreamResult(moduleXml)); } FileUtils.copyFileToDirectory(new File(cp.getHomePath()), new File(cp.getTargetPath())); } } catch (IOException | ParserConfigurationException | TransformerException e) { throw new CopyException(e); } }// copyItems() }// class
package de.ustutt.iaas.cc.core; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import de.ustutt.iaas.cc.TextProcessorConfiguration; /** * A text processor that uses JMS to send text to a request queue and then waits * for the processed text on a response queue. For each text processing request, * a unique ID is generated that is later used to correlate responses to their * original request. * <p> * The text processing is realized by (one or more) workers that read from the * request queue and write to the response queue. * <p> * This implementation supports ActiveMQ as well as AWS SQS. * * @author hauptfn * */ public class QueueTextProcessor implements ITextProcessor { private final static Logger logger = LoggerFactory.getLogger(QueueTextProcessor.class); public QueueTextProcessor(TextProcessorConfiguration conf) { super(); logger.debug("Initializing QueueTextProcessor."); // TODO initialize JMS stuff, connect to queues, ... } @Override public String process(String text) { // text processing placeholder, to be replaced by your solution :-) String processedText = "[processed by incomplete QueueTextProcessor] - " + text; // TODO send text to request queue, receive processed text from response queue, return return processedText; } }
/** * * WaspDao.java * @author echeng * * this is the base class, * every class in the system should extend this. * * **/ package edu.yu.einstein.wasp.dao.impl; import java.io.Serializable; import java.lang.reflect.Method; import java.util.Date; import java.util.List; import java.util.Map; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.PersistenceException; import javax.persistence.Query; import org.apache.log4j.Logger; import org.springframework.orm.jpa.JpaCallback; import org.springframework.orm.jpa.support.JpaDaoSupport; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Repository; import edu.yu.einstein.wasp.model.Department; @Repository public abstract class WaspDaoImpl<E extends Serializable> implements edu.yu.einstein.wasp.dao.WaspDao<E> { protected Class<E> entityClass; private static final Logger log = Logger.getLogger(WaspDaoImpl.class); @PersistenceContext protected EntityManager entityManager; public void persist(final E entity) { setUpdateTs(entity); setEditorId(entity); entityManager.persist(entity); } public E save(E entity) { setEditorId(entity); setUpdateTs(entity); if (entityManager.contains(entity)) { entityManager.merge(entity); } else { entityManager.persist(entity); } entityManager.flush(); return entity; } public void remove(E entity) { entityManager.remove(entity); } public E merge(E entity) { setUpdateTs(entity); setEditorId(entity); return entityManager.merge(entity); } public void refresh(E entity) { entityManager.refresh(entity); } public E findById(int id) { return (E) entityManager.find(this.entityClass, id); } public E getById(int id) { return (E) entityManager.find(this.entityClass, id); } public E flush(E entity) { entityManager.flush(); return entity; } @SuppressWarnings("unchecked") public List<E> findAll() { return this.entityManager.createQuery( "FROM " + entityClass.getName() ).getResultList(); } public Integer removeAll() { return entityManager.createQuery("DELETE FROM " + entityClass.getName() + " h").executeUpdate(); } @SuppressWarnings("unchecked") public List<E> findByMap(final Map m) { boolean first = true; String qString = "SELECT h FROM " + entityClass.getName() + " h"; for (Object key: m.keySet()){ if (! first) { qString += " and "; } else { qString += " WHERE "; } qString += "h." + key.toString() + " = :" + key.toString() + "\n"; first = false; } Query q = entityManager.createQuery(qString); for (Object key: m.keySet()){ q.setParameter(key.toString(), m.get(key)); } return q.getResultList(); } @SuppressWarnings("unchecked") public List<E> findByMapDistinctOrderBy(final Map m, final List<String> distinctColumnNames, final List<String> orderByColumnNames, final String direction) { boolean where = false; boolean firstMap = true; boolean firstDistinct = true; boolean firstOrderBy = true; String qString = "SELECT h FROM " + entityClass.getName() + " h"; for (Object key: m.keySet()){ if(where == false){ qString += " WHERE "; where = true; } else if (firstMap == false) { qString += " and "; } qString += "h." + key.toString() + " = :" + key.toString(); firstMap = false; } if (distinctColumnNames != null && ! "".equals(distinctColumnNames)){ for(String distinctColumnName : distinctColumnNames){ if(where == false){ qString += " WHERE ("; where = true; } else if(firstDistinct == true){ qString += " AND ("; } else if(firstDistinct == false){ qString += ", "; } qString += "h." + distinctColumnName; firstDistinct = false; } if(firstDistinct == false){ qString += ") IN (SELECT DISTINCT"; firstDistinct = true; for(String distinctColumnName : distinctColumnNames){ if(firstDistinct == false){ qString += ", "; } qString += " j." + distinctColumnName; firstDistinct = false; } } if(firstDistinct == false){ qString += " FROM " + entityClass.getName() + " j) "; } } if (orderByColumnNames != null && !orderByColumnNames.isEmpty() ){ for(String orderByColumnName : orderByColumnNames){ if(firstOrderBy == true){ qString += " ORDER BY "; } else if(firstOrderBy == false){ qString += ", "; } qString += "h." + orderByColumnName; firstOrderBy = false; } if( firstOrderBy == false && direction != null && ! "".equals(direction) ){ qString += " " + direction; } } //logger.debug("ROBERT: " + qString); Query q = entityManager.createQuery(qString); for (Object key: m.keySet()){ q.setParameter(key.toString(), m.get(key)); } return q.getResultList(); } @SuppressWarnings("unchecked") public List<E> findDistinctOrderBy(final String distinctColumnName, final String orderByColumnName, final String direction) { String qString = "SELECT h FROM " + entityClass.getName() + " h"; if(distinctColumnName != null && ! "".equals(distinctColumnName)){ qString += " WHERE h." + distinctColumnName + " IN (SELECT DISTINCT j." + distinctColumnName + " FROM " + entityClass.getName() + " j)"; } if( orderByColumnName != null && ! "".equals(orderByColumnName) && direction != null && "".equals(direction) ){ qString += " ORDER BY h." + orderByColumnName; } else if(orderByColumnName != null && ! "".equals(orderByColumnName) && direction != null && ! "".equals(direction) ){ qString += " ORDER BY h." + orderByColumnName + " " + direction; } //logger.debug("ROBERT: " + qString); Query q = entityManager.createQuery(qString); return q.getResultList(); } @SuppressWarnings("unchecked") public List findAllOrderBy(final String orderByColumnName, final String direction) { String qString = "SELECT h FROM " + entityClass.getName() + " h"; if( ! "".equals(orderByColumnName) && "".equals(direction) ){ qString += " ORDER BY h." + orderByColumnName; } else if( ! "".equals(orderByColumnName) && ! "".equals(direction) ){ qString += " ORDER BY h." + orderByColumnName + " " + direction; } Query q = entityManager.createQuery(qString); return q.getResultList(); } private void setEditorId(E entity) { try { Method method = entity.getClass().getMethod("setLastUpdUser", new Class[] {Integer.class}); if (method!=null) { //org.springframework.security.core.userdetails.User u= // (org.springframework.security.core.userdetails.User)SecurityContextHolder.getContext().getAuthentication().getPrincipal(); Integer userId = new Integer(0); try { final String login = (String) SecurityContextHolder.getContext().getAuthentication().getName(); if (!login.equals("anonymousUser")) { Integer newUserId = (Integer)entityManager.createNativeQuery("select userId from user where login=:login").setParameter("login",login).getSingleResult(); if (newUserId != null) { userId = newUserId; } } } catch (Exception e) { // empty catch in case login or userId can't be found. } method.invoke(entity, new Object[]{userId}); } } catch (Throwable e) { log.warn("setEditorId() threw exception: " + e.getMessage() ); } } private void setUpdateTs(E entity) { try { Method method = entity.getClass().getMethod("setLastUpdTs", new Class[] {Date.class}); if (method!=null) { method.invoke(entity, new Object[]{new Date()}); } } catch (Throwable e) { log.warn("setUpdateTs() threw exception: " + e.getMessage() ); } } }
package fi.csc.chipster.auth; import java.time.Duration; //import java.time.Instant; //import java.time.temporal.ChronoUnit; import java.util.Arrays; import java.util.List; import java.util.Timer; import java.util.TimerTask; import java.util.UUID; import javax.ws.rs.ForbiddenException; import javax.ws.rs.InternalServerErrorException; import javax.ws.rs.NotFoundException; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.client.Entity; import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.MediaType; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature; import org.hibernate.service.spi.ServiceException; import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider; import fi.csc.chipster.auth.model.Role; import fi.csc.chipster.auth.model.Token; import fi.csc.chipster.auth.resource.TokenResource; import fi.csc.chipster.rest.CredentialsProvider; import fi.csc.chipster.rest.DynamicCredentials; import fi.csc.chipster.rest.JavaTimeObjectMapperProvider; import fi.csc.chipster.rest.token.TokenRequestFilter; import fi.csc.chipster.servicelocator.ServiceLocatorClient; public class AuthenticationClient { private static Logger logger = LogManager.getLogger(); private ServiceLocatorClient serviceLocator; private Token token; private String username; private String password; private List<String> authenticationServiceUris; private Timer tokenRefreshTimer; private Duration TOKEN_REFRESH_INTERVAL = Duration.of(1, ChronoUnit.HOURS); // UNIT MUST BE DAYS OR SHORTER private DynamicCredentials dynamicCredentials = new DynamicCredentials(); public AuthenticationClient(ServiceLocatorClient serviceLocator, String username, String password) { this.serviceLocator = serviceLocator; construct(username, password); } public AuthenticationClient(String authUri, String username, String password) { this.authenticationServiceUris = Arrays.asList(new String[] {authUri}); construct(username, password); } public AuthenticationClient(List<String> auths, String username, String password) { this.authenticationServiceUris = auths; construct(username, password); } private void construct(String username, String password) { this.username = username; this.password = password; setToken(getTokenFromAuth()); // schedule token refresh this.tokenRefreshTimer = new Timer("auth-client-token-refresh-timer", true); tokenRefreshTimer.schedule(new TimerTask() { @Override public void run() { try { refreshToken(); } catch (Exception e) { logger.warn("refresh token failed", e); } } }, TOKEN_REFRESH_INTERVAL.toMillis(), TOKEN_REFRESH_INTERVAL.toMillis()); } /** * Succeeds or throws * * @return */ private Token getTokenFromAuth() { List<String> auths = getAuths(); if (auths.size() == 0) { throw new InternalServerErrorException("no auths registered to service locator"); } for (String authUri : auths) { Client authClient = getClient(username, password, true); WebTarget authTarget = authClient.target(authUri); logger.info("get token from " + authUri); Token serverToken = authTarget .path("tokens") .request(MediaType.APPLICATION_JSON_TYPE) .post(Entity.json(""), Token.class); return serverToken; } throw new RuntimeException("get token from auth failed"); } private List<String> getAuths() { if (serviceLocator != null) { return serviceLocator.get(Role.AUTH); } else { return authenticationServiceUris; } } public static Client getClient(String username, String password, boolean enableAuth) { Client c = ClientBuilder.newClient() .register(JacksonJaxbJsonProvider.class) .register(JavaTimeObjectMapperProvider.class) ; if (enableAuth) { HttpAuthenticationFeature feature = HttpAuthenticationFeature.basic(username, password); c.register(feature); } return c; } public static Client getClient() { return getClient(null, null, false); } public Client getAuthenticatedClient() { return getClient(TokenRequestFilter.TOKEN_USER, token.getTokenKey().toString(), true); } public Token getDbToken(String tokenKey) { List<String> auths = getAuths(); for (String authUri : auths) { try { Token dbToken = getAuthenticatedClient() .target(authUri) .path(TokenResource.TOKENS) .request(MediaType.APPLICATION_JSON_TYPE) .header("chipster-token", tokenKey) .get(Token.class); if (dbToken != null) { return dbToken; } } catch (ServiceException e) { logger.warn("auth not available", e); } catch (NotFoundException e) { return null; } } return null; } public UUID getTokenKey() { return token.getTokenKey(); } private void refreshToken() { for (String authUri : getAuths()) { try { Token serverToken = getAuthenticatedClient() .target(authUri) .path(TokenResource.TOKENS) .path("refresh") .request(MediaType.APPLICATION_JSON_TYPE) .post(Entity.json(""), Token.class); if (serverToken != null) { setToken(serverToken); // if token is expiring before refresh interval * 2, get a new token if (serverToken.getValidUntil().isBefore(Instant.now().plus(TOKEN_REFRESH_INTERVAL.multipliedBy(2)))) { logger.info("refreshed token expiring soon, getting a new one (" + this.username + ")"); try { setToken(getTokenFromAuth()); logger.info("new token valid until " + token.getValidUntil() + " (" + this.username + ")"); } catch (Exception e) { logger.warn("getting new token to replace soon expiring token failed (" + this.username + ")", e); } } return; } else { // is it possible to get here? logger.warn("got null as response to refresh token (" + this.username + ")"); } } catch (ForbiddenException fe) { logger.info("got forbidden when refreshing token, getting new one (" + this.username + ")"); try { setToken(getTokenFromAuth()); logger.info("new token valid until " + token.getValidUntil() + " (" + this.username + ")"); return; } catch (Exception e) { logger.warn("getting new token after forbidden failed (" + this.username + ")", e); } } catch (ServiceException e) { logger.warn("auth not available (" + this.username + ")", e); } catch (Exception e) { logger.warn("refresh token failed (" + this.username + ")", e); } } logger.warn("refresh token failing (" + this.username + ")"); } private void setToken(Token token) { this.token = token; this.dynamicCredentials.setCredentials(TokenRequestFilter.TOKEN_USER, this.token.getTokenKey().toString()); } /** * @return */ public CredentialsProvider getCredentials() { return this.dynamicCredentials; } }
package function.annotation.base; import function.external.evs.Evs; import function.external.exac.Exac; import function.external.gerp.GerpCommand; import function.external.gerp.GerpManager; import function.variant.base.Variant; import function.variant.base.VariantManager; import function.external.kaviar.Kaviar; import function.external.knownvar.KnownVarCommand; import function.external.knownvar.KnownVarOutput; import function.variant.base.VariantLevelFilterCommand; import global.Data; import utils.FormatManager; import java.sql.ResultSet; import java.util.HashSet; import java.util.Set; import java.util.TreeSet; /** * * @author nick */ public class AnnotatedVariant extends Variant { String function; String geneName; String codonChange; String aminoAcidChange; String stableId; HashSet<String> geneSet = new HashSet<String>(); HashSet<String> transcriptSet = new HashSet<String>(); double polyphenHumdiv; double polyphenHumvar; Exac exac; Kaviar kaviar; Evs evs; float gerpScore; KnownVarOutput knownVarOutput; public boolean isValid = true; public AnnotatedVariant(int variantId, boolean isIndel, ResultSet rset) throws Exception { super(variantId, isIndel, rset); if (isIndel) { polyphenHumdiv = Data.NA; polyphenHumvar = Data.NA; } else { polyphenHumdiv = FormatManager.devide(rset.getInt("polyphen_humdiv"), 1000); polyphenHumvar = FormatManager.devide(rset.getInt("polyphen_humvar"), 1000); } function = ""; geneName = ""; codonChange = ""; aminoAcidChange = ""; stableId = ""; checkValid(); } // update code below for unit testing // public AnnotatedVariant(int v_id, boolean isIndel, // String alt, String ref, String rs, // int pos, String chr) throws Exception { // super(v_id, isIndel, alt, ref, rs, pos, chr); // public static void main(String[] args) throws Exception { // System.out.println("test"); // AnnotatedVariant variant = new AnnotatedVariant(0, false, "C", "T", "", 78082311, "17"); // variant.aminoAcidChange = "N570K"; // variant.codonChange = "aaC/aaG"; // String result = variant.getCodingSequenceChange(); // System.out.println(result); public void update(Annotation annotation) { if (isValid) { geneSet.add(annotation.geneName); if (function.isEmpty() || FunctionManager.isMoreDamage(annotation.function, function)) { function = annotation.function; geneName = annotation.geneName; codonChange = annotation.codonChange; aminoAcidChange = annotation.aminoAcidChange; stableId = annotation.stableId; } transcriptSet.add(annotation.function + "|" + annotation.geneName + "|" + annotation.stableId + "(" + annotation.aminoAcidChange + ")"); if (polyphenHumdiv < annotation.polyphenHumdiv) { polyphenHumdiv = annotation.polyphenHumdiv; } if (polyphenHumvar < annotation.polyphenHumvar) { polyphenHumvar = annotation.polyphenHumvar; } } } private void checkValid() throws Exception { isValid = VariantLevelFilterCommand.isCscoreValid(cscorePhred); if (isValid) { isValid = VariantManager.isValid(this); } if (isValid) { gerpScore = GerpManager.getScore(variantIdStr); isValid = GerpCommand.isGerpScoreValid(gerpScore); } if (isValid) { exac = new Exac(variantIdStr); isValid = exac.isValid(); } if (isValid) { kaviar = new Kaviar(variantIdStr); isValid = kaviar.isValid(); } if (isValid) { evs = new Evs(variantIdStr); isValid = evs.isValid(); } } public boolean isValid() { return isValid & PolyphenManager.isValid(polyphenHumdiv, function, AnnotationLevelFilterCommand.polyphenHumdiv) & PolyphenManager.isValid(polyphenHumvar, function, AnnotationLevelFilterCommand.polyphenHumvar); } public String getGeneName() { if (geneName.isEmpty()) { return "NA"; } return geneName; } public String getFunction() { return function; } public String getCodonChange() { if (codonChange.isEmpty()) { return "NA"; } return codonChange; } public String getStableId() { if (stableId.isEmpty()) { return "NA"; } return stableId; } public String getAminoAcidChange() { if (aminoAcidChange.isEmpty()) { return "NA"; } return aminoAcidChange; } public String getCodingSequenceChange() { if (aminoAcidChange.isEmpty() || aminoAcidChange.equals("NA") || isIndel()) { return "NA"; } String posStr = ""; for (int i = 0; i < aminoAcidChange.length(); i++) { char c = aminoAcidChange.charAt(i); if(Character.isDigit(c)){ posStr += c; } } int aminoAcidPos = Integer.valueOf(posStr); String leftStr = codonChange.split("/")[0]; String rightStr = codonChange.split("/")[1]; int codingPos = Data.NA; int changeIndex = Data.NA; int[] codonOffBase = {2, 1, 0}; // aminoAcidPos * 3 is the last position of codon for (int i = 0; i < leftStr.length(); i++) { if (leftStr.charAt(i) != rightStr.charAt(i)) { codingPos = aminoAcidPos * 3 - codonOffBase[i]; changeIndex = i; } } return "c." + codingPos + leftStr.charAt(changeIndex) + ">" + rightStr.charAt(changeIndex); } public String getTranscriptSet() { if (transcriptSet.size() > 0) { Set set = new TreeSet(transcriptSet); return set.toString().replaceAll(", ", ";").replace("[", "").replace("]", ""); } return "NA"; } public HashSet<String> getGeneSet() { return geneSet; } public String getPolyphenHumdivScore() { if (!function.startsWith("NON_SYNONYMOUS") || polyphenHumdiv < 0) { polyphenHumdiv = Data.NA; } return FormatManager.getDouble(polyphenHumdiv); } public String getPolyphenHumvarScore() { if (!function.startsWith("NON_SYNONYMOUS") || polyphenHumvar < 0) { polyphenHumvar = Data.NA; } return FormatManager.getDouble(polyphenHumvar); } public String getPolyphenHumdivPrediction() { return getPredictionByScore(polyphenHumdiv); } public String getPolyphenHumvarPrediction() { return getPredictionByScore(polyphenHumvar); } private String getPredictionByScore(double score) { String prediction = PolyphenManager.getPrediction(score, function); prediction = prediction.replaceAll("probably", "probably_damaging"); prediction = prediction.replaceAll("possibly", "possibly_damaging"); return prediction; } public String getExacStr() { return exac.toString(); } public String getKaviarStr() { return kaviar.toString(); } public String getEvsStr() { return evs.toString(); } public void initKnownVar() { if (KnownVarCommand.isIncludeKnownVar) { knownVarOutput = new KnownVarOutput(this); } } public String getKnownVarStr() { if (KnownVarCommand.isIncludeKnownVar) { return knownVarOutput.toString(); } else { return ""; } } public float getGerpScore() { return gerpScore; } }
package io.github.flibio.utils.file; import ninja.leaping.configurate.ConfigurationNode; import ninja.leaping.configurate.hocon.HoconConfigurationLoader; import ninja.leaping.configurate.loader.ConfigurationLoader; import org.slf4j.Logger; import org.spongepowered.api.Sponge; import org.spongepowered.api.plugin.Plugin; import com.google.common.reflect.TypeToken; import java.io.File; import java.util.Optional; public class ConfigManager { private Logger logger; private String folderName; protected ConfigManager(Logger logger, String folderName) { this.logger = logger; this.folderName = folderName; } /** * Creates a new ConfigManager instance. * * @param plugin An instance of the main plugin class. * @return The new ConfigManager instance, if the plugin class is valid. */ public static Optional<ConfigManager> createInstance(Object plugin) { if (plugin.getClass().isAnnotationPresent(Plugin.class)) { Plugin annotation = plugin.getClass().getAnnotation(Plugin.class); Logger logger = Sponge.getGame().getPluginManager().getPlugin(annotation.id()).get().getLogger(); return Optional.of(new ConfigManager(logger, annotation.name().toLowerCase().replaceAll(" ", "_"))); } else { return Optional.empty(); } } /** * Sets a value in a file if one doesn't exit. Saves the the changed file to * the disc. * * @param fileName The name of the file. Must include the extension. * @param path The path of the default value. Supports sub-paths using a '.' * seperator, only if subPath is set to true. * @param type The type of the default value. * @param value The default value. * @param subPath If the path should split into sub-paths using the '.' * seperator. */ public <T> void setDefault(String fileName, String path, Class<T> type, T value, boolean subPath) { try { Optional<ConfigurationNode> oRoot = getFile(fileName); if (oRoot.isPresent()) { ConfigurationNode root = oRoot.get(); if (subPath) { if (root.getNode((Object[]) path.split("\\.")).getValue(TypeToken.of(type)) == null) { root.getNode((Object[]) path.split("\\.")).setValue(TypeToken.of(type), value); saveFile(fileName, root); } } else { if (root.getNode(path).getValue(TypeToken.of(type)) == null) { root.getNode(path).setValue(TypeToken.of(type), value); saveFile(fileName, root); } } } } catch (Exception e) { logger.error(e.getMessage()); } } /** * Sets a value in a file if one doesn't exit. Saves the the changed file to * the disc. Defaults the subPath value to true. * * @param fileName The name of the file. Must include the extension. * @param path The path of the default value. Supports sub-paths using a '.' * seperator, only if subPath is set to true. * @param type The type of the default value. * @param value The default value. */ public <T> void setDefault(String fileName, String path, Class<T> type, T value) { setDefault(fileName, path, type, value, true); } /** * Deletes a value from a file, * * @param fileName The file to delete from. * @param path The path to delete. * @return If the deletion was successful or not. */ public boolean deleteValue(String fileName, String path) { try { Optional<ConfigurationNode> oRoot = getFile(fileName); if (oRoot.isPresent()) { ConfigurationNode root = oRoot.get(); root.getNode(path).setValue(null); saveFile(fileName, root); return true; } else { return false; } } catch (Exception e) { logger.error(e.getMessage()); return false; } } /** * Sets a value in a file. Saves the the changed file to the disc. * * @param fileName The name of the file. Must include the extension. * @param path The path of the value. Supports sub-paths using a '.' * seperator. * @param type The type of the value. * @param value The value. * @param subPath If the path should split into sub-paths using the '.' * seperator. * @return If the value was successfully set or not. */ public <T> boolean setValue(String fileName, String path, Class<T> type, T value, boolean subPath) { try { Optional<ConfigurationNode> oRoot = getFile(fileName); if (oRoot.isPresent()) { ConfigurationNode root = oRoot.get(); if (subPath) { root.getNode((Object[]) path.split("\\.")).setValue(TypeToken.of(type), value); } else { root.getNode(path).setValue(TypeToken.of(type), value); } saveFile(fileName, root); return true; } else { return false; } } catch (Exception e) { logger.error(e.getMessage()); return false; } } /** * Sets a value in a file. Saves the the changed file to the disc. Defaults * the subPath value to true. * * @param fileName The name of the file. Must include the extension. * @param path The path of the value. Supports sub-paths using a '.' * seperator. * @param type The type of the value. * @param value The value. * @return If the value was successfully set or not. */ public <T> boolean setValue(String fileName, String path, Class<T> type, T value) { return setValue(fileName, path, type, value, true); } /** * Gets a value from the specified file. * * @param fileName The name of the file. Must include the extension. * @param path The path of the value. Supports sub-paths using a '.' * seperator. * @param type The type of the value. * @param subPath If the path should split into sub-paths using the '.' * seperator. * @return The value, if it was found. */ public <T> Optional<T> getValue(String fileName, String path, Class<T> type, boolean subPath) { try { Optional<ConfigurationNode> oRoot = getFile(fileName); if (oRoot.isPresent()) { ConfigurationNode root = oRoot.get(); if (subPath) { if (root.getNode((Object[]) path.split("\\.")).getValue(TypeToken.of(type)) != null) { return Optional.of(root.getNode((Object[]) path.split("\\.")).getValue(TypeToken.of(type))); } else { return Optional.empty(); } } else { if (root.getNode(path).getValue(TypeToken.of(type)) != null) { return Optional.of(root.getNode(path).getValue(TypeToken.of(type))); } else { return Optional.empty(); } } } else { return Optional.empty(); } } catch (Exception e) { logger.error(e.getMessage()); return Optional.empty(); } } /** * Gets a value from the specified file. Defaults the subPath value to true. * * @param fileName The name of the file. Must include the extension. * @param path The path of the value. Supports sub-paths using a '.' * seperator. * @param type The type of the value. * @return The value, if it was found. */ public <T> Optional<T> getValue(String fileName, String path, Class<T> type) { return getValue(fileName, path, type, true); } /** * Checks if a configuration node exists. * * @param fileName The name of the file. Must include the extension. * @param path The path of the value. Supports sub-paths using a '.' * seperator. * @param subPath If the path should split into sub-paths using the '.' * seperator. * @return If the node exists or not. */ public boolean nodeExists(String fileName, String path, boolean subPath) { try { Optional<ConfigurationNode> oRoot = getFile(fileName); if (oRoot.isPresent()) { ConfigurationNode root = oRoot.get(); if (subPath) { return root.getNode((Object[]) path.split("\\.")) != null; } else { return root.getNode(path) != null; } } else { return false; } } catch (Exception e) { logger.error(e.getMessage()); return false; } } /** * Checks if a configuration node exists. Defaults the subPath value to * true. * * @param fileName The name of the file. Must include the extension. * @param path The path of the value. Supports sub-paths using a '.' * seperator. * @return If the node exists or not. */ public boolean nodeExists(String fileName, String path) { return nodeExists(fileName, path, true); } /** * Gets a file using the specified name. Generates a new file if one is not * already present. * * @param fileName The name of the file. Must include the extension. * @return The file, if no error has occurred. */ public Optional<ConfigurationNode> getFile(String fileName) { File folder = new File("config/" + folderName); File file = new File("config/" + folderName + "/" + fileName); try { folder.mkdirs(); file.createNewFile(); ConfigurationLoader<?> manager = HoconConfigurationLoader.builder().setFile(file).build(); ConfigurationNode root = manager.load(); return Optional.of(root); } catch (Exception e) { logger.error(e.getMessage()); return Optional.empty(); } } /** * Saves a file to the disc. * * @param fileName The name of the file. Must include the extension. * @param root The contents of the file. */ private void saveFile(String fileName, ConfigurationNode root) { File folder = new File("config/" + folderName); File file = new File("config/" + folderName + "/" + fileName); try { folder.mkdirs(); file.createNewFile(); ConfigurationLoader<?> manager = HoconConfigurationLoader.builder().setFile(file).build(); manager.save(root); } catch (Exception e) { logger.error(e.getMessage()); } } }
package io.rappid.webtest.common; import org.openqa.selenium.chrome.ChromeOptions; import org.openqa.selenium.firefox.FirefoxProfile; import org.openqa.selenium.remote.CapabilityType; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.remote.RemoteWebDriver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.net.URL; import java.util.concurrent.Callable; public class WebDriverBackend { public static final String SAUCE_ACCESS_KEY = "SAUCE_ACCESS_KEY"; public static final String SAUCE_USERNAME = "SAUCE_USERNAME"; private static final Logger log = LoggerFactory.getLogger(WebDriverBackend.class); private RemoteWebDriver driver; private final String host; private final int port; private final String browser; public WebDriverBackend(String host, int port, String browser) throws Exception { this.host = host; this.port = port; this.browser = browser; // define Browser for the webdriver final DesiredCapabilities capability = new DesiredCapabilities(); capability.setBrowserName(browser); capability.setCapability(CapabilityType.TAKES_SCREENSHOT, true); String sauceUsername = System.getProperty(SAUCE_USERNAME, System.getenv(SAUCE_USERNAME)); String sauceAccessKey = System.getProperty(SAUCE_ACCESS_KEY, System.getenv(SAUCE_ACCESS_KEY)); boolean isSauceLabs = sauceAccessKey != null && sauceUsername != null; if (isSauceLabs) { log.info(String.format("Setting username '%s' and accessKey for saucelabs as capability", sauceUsername)); capability.setCapability("username", sauceUsername); capability.setCapability("accessKey", sauceAccessKey); } setCapability(browser, capability); final URL hubUrl = new URL(url()); Logger log = LoggerFactory.getLogger(WebDriverBackend.class); new RetriableTask<Object>(log, new Callable<Object>() { @Override public Object call() throws Exception { driver = new RemoteWebDriver(hubUrl, capability); return null; } }).call(); if (!isSauceLabs) { driver.manage().window().maximize(); } } protected String url() { return "http://" + getHost() + ":" + getPort() + "/wd/hub"; } @Override public String toString() { return String.format("%s [%s]", url(), getBrowser()); } private void setCapability(String browser, DesiredCapabilities capability) { if (browser.equals(DesiredCapabilities.firefox().getBrowserName())) { // create Firefox profile for the tests FirefoxProfile fp = new FirefoxProfile(); fp.setAcceptUntrustedCertificates(true); fp.setAssumeUntrustedCertificateIssuer(true); fp.setEnableNativeEvents(true); capability.setCapability("firefox_profile", fp); fp.setPreference("intl.accept_languages", "de-de,de"); // chrome browser } else if (browser.equals(DesiredCapabilities.chrome().getBrowserName())) { ChromeOptions options = new ChromeOptions(); options.addArguments("--start-maximized", "--ignore-certificate-errors", "--disable-images"); capability.setCapability(ChromeOptions.CAPABILITY, options); // phantomjs browser } else if (browser.equals(DesiredCapabilities.phantomjs().getBrowserName())) { DesiredCapabilities capabilities = DesiredCapabilities.phantomjs(); capability.merge(capabilities); // internet explorer 8 on windows 7 } else if (browser.equals("iexplore8")) { DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer(); capabilities.setCapability("platform", "Windows 7"); capabilities.setCapability("version", "8"); capability.merge(capabilities); // internet explorer 9 on windows 7 } else if (browser.equals("iexplore9")) { DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer(); capabilities.setCapability("platform", "Windows 7"); capabilities.setCapability("version", "9"); capability.merge(capabilities); // internet explorer 10 on windows 8 } else if (browser.equals("iexplore10")) { DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer(); capabilities.setCapability("platform", "Windows 8"); capabilities.setCapability("version", "10"); capability.merge(capabilities); // iphone with OS 6 } else if (browser.equals(DesiredCapabilities.iphone().getBrowserName())) { DesiredCapabilities capabilities = DesiredCapabilities.iphone(); capabilities.setCapability("platform", "OS X 10.8"); capabilities.setCapability("version", "6"); capability.merge(capabilities); // iphone with OS 7 (upcoming OS) } else if (browser.equals(DesiredCapabilities.iphone().getBrowserName() + "7")) { DesiredCapabilities capabilities = DesiredCapabilities.iphone(); capabilities.setCapability("platform", "OS X 10.8"); capabilities.setCapability("version", "7"); capability.merge(capabilities); // ipad with OS 6 } else if (browser.equals(DesiredCapabilities.ipad().getBrowserName())) { DesiredCapabilities capabilities = DesiredCapabilities.ipad(); capabilities.setCapability("platform", "OS X 10.8"); capabilities.setCapability("version", "6"); capability.merge(capabilities); // ipad with OS 7 } else if (browser.equals(DesiredCapabilities.ipad().getBrowserName() + "7")) { DesiredCapabilities capabilities = DesiredCapabilities.ipad(); capabilities.setCapability("platform", "OS X 10.8"); capabilities.setCapability("version", "7"); capability.merge(capabilities); // android 4 phone form } else if (browser.equals(DesiredCapabilities.android().getBrowserName())) { DesiredCapabilities capabilities = DesiredCapabilities.android(); capabilities.setCapability("platform", "Linux"); capabilities.setCapability("version", "4.0"); capability.merge(capabilities); // android 4 tablet form } else if (browser.equals(DesiredCapabilities.android().getBrowserName() + "tablet")) { DesiredCapabilities capabilities = DesiredCapabilities.android(); capabilities.setCapability("platform", "Linux"); capabilities.setCapability("version", "4.0"); capabilities.setCapability("device-type", "tablet"); capability.merge(capabilities); // safari 5 on windows 7 } else if (browser.equals("safari5win7")) { DesiredCapabilities capabilities = DesiredCapabilities.safari(); capabilities.setCapability("platform", "Windows 7"); capabilities.setCapability("version", "5"); capability.merge(capabilities); // safari 6 on macosx mountain lion } else if (browser.equals("safari6macosx108")) { DesiredCapabilities capabilities = DesiredCapabilities.safari(); capabilities.setCapability("platform", "OS X 10.8"); capabilities.setCapability("version", "6"); capability.merge(capabilities); // chrome on linux } else if (browser.equals("chromelinux")) { DesiredCapabilities capabilities = DesiredCapabilities.chrome(); capabilities.setCapability("platform", "Linux"); capabilities.setCapability("version", ""); capability.merge(capabilities); } else { throw new RuntimeException("Sorry I do have no idea what kind of browser " + browser + " is. I currently" + "am aware only about: chrome, firefox, phantomjs, iexplore8, iexplore9, iexplore10, iphone " + "(which is iOS6), iphone7, ipad (same iOS6), ipad7, android, androidtablet, safari5win7, " + "safari6macosx108, chromelinux. Read here about configurations: https://saucelabs.com/docs/" + "platforms/webdriver"); } } public RemoteWebDriver driver() { return driver; } public String getHost() { return host; } public int getPort() { return port; } public String getBrowser() { return browser; } public void close() { if (driver != null) { driver.quit(); // driver.close(); } } }
package io.scif.ome.services; import io.scif.ome.OMEMetadata; import java.util.Hashtable; import loci.common.services.DependencyException; import loci.common.services.ServiceException; import loci.common.services.ServiceFactory; import loci.formats.meta.MetadataRetrieve; import loci.formats.meta.MetadataStore; import loci.formats.ome.OMEXMLMetadata; import org.scijava.plugin.Plugin; import org.scijava.service.AbstractService; import org.scijava.service.Service; /** Default implementation of {@link OMEXMLService}. */ @Plugin(type = Service.class) public class DefaultOMEXMLService extends AbstractService implements OMEXMLService { private loci.formats.services.OMEXMLService omexmlService; @Override public String getLatestVersion() { return omexmlService().getLatestVersion(); } @Override public String transformToLatestVersion(final String xml) throws ServiceException { return omexmlService().transformToLatestVersion(xml); } @Override public OMEXMLMetadata createOMEXMLMetadata() throws ServiceException { return omexmlService().createOMEXMLMetadata(); } @Override public OMEXMLMetadata createOMEXMLMetadata(final String xml) throws ServiceException { return omexmlService().createOMEXMLMetadata(xml); } @Override public OMEXMLMetadata createOMEXMLMetadata(String xml, final String version) throws ServiceException { return omexmlService().createOMEXMLMetadata(xml, version); } @Override public Object createOMEXMLRoot(final String xml) throws ServiceException { return omexmlService().createOMEXMLRoot(xml); } @Override public boolean isOMEXMLMetadata(final Object o) { return omexmlService().isOMEXMLMetadata(o); } @Override public boolean isOMEXMLRoot(final Object o) { return omexmlService().isOMEXMLRoot(o); } @Override public String getOMEXMLVersion(final Object o) { return omexmlService().getOMEXMLVersion(o); } @Override public OMEXMLMetadata getOMEMetadata(final MetadataRetrieve src) throws ServiceException { return omexmlService().getOMEMetadata(src); } @Override public String getOMEXML(final MetadataRetrieve src) throws ServiceException { return omexmlService().getOMEXML(src); } @Override public boolean validateOMEXML(final String xml) { return omexmlService().validateOMEXML(xml); } @Override public boolean validateOMEXML(String xml, final boolean pixelsHack) { return omexmlService().validateOMEXML(xml, pixelsHack); } @Override public void populateOriginalMetadata(final OMEMetadata omeMeta, final Hashtable<String, Object> metadata) { omexmlService().populateOriginalMetadata(omeMeta.getRoot(), metadata); } @Override public void populateOriginalMetadata(final OMEMetadata omeMeta, final String key, final String value) { omexmlService().populateOriginalMetadata(omeMeta.getRoot(), key, value); } @Override public Hashtable<String, Object> getOriginalMetadata( final OMEXMLMetadata omexmlMeta) { @SuppressWarnings("unchecked") final Hashtable<String, Object> originalMetadata = omexmlService().getOriginalMetadata(omexmlMeta); return originalMetadata; } @Override public void convertMetadata(final String xml, final MetadataStore dest) throws ServiceException { omexmlService().convertMetadata(xml, dest); } @Override public void convertMetadata(final MetadataRetrieve src, final MetadataStore dest) { omexmlService().convertMetadata(src, dest); } @Override public void removeBinData(final OMEXMLMetadata omexmlMeta) { omexmlService().removeBinData(omexmlMeta); } @Override public void removeChannels(final OMEXMLMetadata omexmlMeta, final int image, final int sizeC) { omexmlService().removeChannels(omexmlMeta, image, sizeC); } @Override public void addMetadataOnly(final OMEXMLMetadata omexmlMeta, final int image) { omexmlService().addMetadataOnly(omexmlMeta, image); } @Override public boolean isEqual(final OMEXMLMetadata src1, final OMEXMLMetadata src2) { return omexmlService().isEqual(src1, src2); } @Override public MetadataStore asStore(final MetadataRetrieve meta) { return omexmlService().asStore(meta); } @Override public MetadataRetrieve asRetrieve(final MetadataStore meta) { return omexmlService().asRetrieve(meta); } // -- Helper methods -- private loci.formats.services.OMEXMLService omexmlService() { if (omexmlService == null) initOMEXMLService(); return omexmlService; } private synchronized void initOMEXMLService() { if (omexmlService != null) return; try { final ServiceFactory serviceFactory = new ServiceFactory(); omexmlService = serviceFactory.getInstance(loci.formats.services.OMEXMLService.class); } catch (final DependencyException exc) { throw new IllegalStateException("Cannot access OME-XML service", exc); } } }
package lemming.context.inbound; import lemming.context.Context; import lemming.data.EntityManagerListener; import lemming.data.GenericDao; import org.hibernate.StaleObjectStateException; import org.hibernate.UnresolvableObjectException; import javax.persistence.EntityManager; import javax.persistence.EntityTransaction; import javax.persistence.TypedQuery; import java.util.List; /** * Represents a Data Access Object providing data operations for inbound contexts. */ @SuppressWarnings("unused") public class InboundContextDao extends GenericDao<InboundContext> implements IInboundContextDao { /** * {@inheritDoc} */ @Override public Boolean isTransient(InboundContext context) { return context.getId() == null; } /** * {@inheritDoc} * * @throws RuntimeException */ public void persist(InboundContext context) throws RuntimeException { EntityManager entityManager = EntityManagerListener.createEntityManager(); EntityTransaction transaction = null; try { transaction = entityManager.getTransaction(); transaction.begin(); entityManager.persist(context); transaction.commit(); } catch (RuntimeException e) { e.printStackTrace(); if (transaction != null && transaction.isActive()) { transaction.rollback(); } if (e instanceof StaleObjectStateException) { panicOnSaveLockingError(context, e); } else if (e instanceof UnresolvableObjectException) { panicOnSaveUnresolvableObjectError(context, e); } else { throw e; } } finally { entityManager.close(); } } /** * {@inheritDoc} * * @throws RuntimeException */ public void batchPersist(List<InboundContext> contexts) throws RuntimeException { EntityManager entityManager = EntityManagerListener.createEntityManager(); EntityTransaction transaction = null; InboundContext currentContext = null; Integer batchSize = 50; Integer counter = 0; try { transaction = entityManager.getTransaction(); transaction.begin(); for (InboundContext context : contexts) { currentContext = context; entityManager.persist(context); counter++; if (counter % batchSize == 0) { entityManager.flush(); entityManager.clear(); } } transaction.commit(); } catch (RuntimeException e) { e.printStackTrace(); if (transaction != null && transaction.isActive()) { transaction.rollback(); } if (e instanceof StaleObjectStateException) { panicOnSaveLockingError(currentContext, e); } else if (e instanceof UnresolvableObjectException) { panicOnSaveUnresolvableObjectError(currentContext, e); } else { throw e; } } finally { entityManager.close(); } } /** * {@inheritDoc} * * @throws RuntimeException */ public InboundContext merge(InboundContext context) throws RuntimeException { EntityManager entityManager = EntityManagerListener.createEntityManager(); EntityTransaction transaction = null; try { transaction = entityManager.getTransaction(); transaction.begin(); InboundContext mergedContext = entityManager.merge(context); transaction.commit(); return mergedContext; } catch (RuntimeException e) { e.printStackTrace(); if (transaction != null && transaction.isActive()) { transaction.rollback(); } if (e instanceof StaleObjectStateException) { panicOnSaveLockingError(context, e); } else if (e instanceof UnresolvableObjectException) { panicOnSaveUnresolvableObjectError(context, e); } else { throw e; } return null; } finally { entityManager.close(); } } /** * Finds the ancestor of an inbound context with the same package and location. * * @param entityManager entity manager * @param context an inbound context * @return An inbound context or null. */ private InboundContext findAncestor(EntityManager entityManager, InboundContext context) { TypedQuery<InboundContext> query = entityManager.createQuery("SELECT i FROM InboundContext i " + "LEFT JOIN FETCH i.match WHERE i._package = :package AND i.location = :location " + "AND i.number < :number ORDER BY i.number DESC", InboundContext.class); List<InboundContext> ancestors = query.setParameter("package", context.getPackage()) .setParameter("location", context.getLocation()).setParameter("number", context.getNumber()) .setMaxResults(1).getResultList(); return ancestors.isEmpty() ? null : ancestors.get(0); } /** * Finds the successor of an inbound context with the same package and location. * * @param entityManager entity manager * @param context an inbound context * @return An inbound context or null. */ private InboundContext findSuccessor(EntityManager entityManager, InboundContext context) { TypedQuery<InboundContext> query = entityManager.createQuery("SELECT i FROM InboundContext i " + "LEFT JOIN FETCH i.match WHERE i._package = :package AND i.location = :location " + "AND i.number > :number ORDER BY i.number ASC", InboundContext.class); List<InboundContext> successors = query.setParameter("package", context.getPackage()) .setParameter("location", context.getLocation()).setParameter("number", context.getNumber()) .setMaxResults(1).getResultList(); return successors.isEmpty() ? null : successors.get(0); } /** * Finds a matching context for an inbound context. * * @param context an inbound context * @return A matching context or null. */ private Context findMatch(InboundContext context) { if (context == null) { return null; } else { return context.getMatch(); } } /** * Finds contexts before a successor. * * @param entityManager entity manager * @param successor successor of contexts * @return A list of contexts. */ public List<Context> findBefore(EntityManager entityManager, Context successor) { if (successor == null) { throw new IllegalStateException(); } TypedQuery<Context> query = entityManager.createQuery("SELECT i FROM Context i " + "WHERE i.location = :location AND i.number < :number ORDER BY i.number ASC", Context.class); List<Context> contexts = query.setParameter("location", successor.getLocation()) .setParameter("number", successor.getNumber()).getResultList(); return contexts; } /** * Finds contexts after an ancestor. * * @param entityManager entity manager * @param ancestor ancestor of contexts * @return A list of contexts. */ public List<Context> findAfter(EntityManager entityManager, Context ancestor) { if (ancestor == null) { throw new IllegalStateException(); } TypedQuery<Context> query = entityManager.createQuery("SELECT i FROM Context i " + "WHERE i.location = :location AND i.number > :number ORDER BY i.number ASC", Context.class); List<Context> contexts = query.setParameter("location", ancestor.getLocation()) .setParameter("number", ancestor.getNumber()).getResultList(); return contexts; } /** * Finds contexts between an ancestor and a successor. * * @param entityManager entity manager * @param ancestor ancestor of contexts * @param successor successor of contexts * @return A list of contexts. */ private List<Context> findBetween(EntityManager entityManager, Context ancestor, Context successor) { if (ancestor == null && successor == null) { throw new IllegalArgumentException(); } else if (ancestor == null) { return findBefore(entityManager, successor); } else if (successor == null) { return findAfter(entityManager, ancestor); } else { if (!ancestor.getLocation().equals(successor.getLocation())) { throw new IllegalArgumentException(); } if (ancestor.getNumber() >= successor.getNumber()) { throw new IllegalArgumentException(); } } TypedQuery<Context> query = entityManager.createQuery("SELECT i FROM Context i " + "WHERE i.location = :location AND i.number > :number1 AND i.number < :number2 " + "ORDER BY i.number ASC", Context.class); List<Context> contexts = query.setParameter("location", ancestor.getLocation()) .setParameter("number1", ancestor.getNumber()).setParameter("number2", successor.getNumber()) .getResultList(); return contexts; } /** * {@inheritDoc} * * @throws RuntimeException */ @Override public List<Context> findComplements(List<InboundContext> contexts) { InboundContext firstUnmatchedContext = contexts.get(0); InboundContext lastUnmatchedContext = contexts.get(contexts.size() - 1); EntityManager entityManager = EntityManagerListener.createEntityManager(); EntityTransaction transaction = null; try { transaction = entityManager.getTransaction(); transaction.begin(); InboundContext ancestor = findAncestor(entityManager, firstUnmatchedContext); InboundContext successor = findSuccessor(entityManager, lastUnmatchedContext); Context ancestorMatch = findMatch(ancestor); Context successorMatch = findMatch(successor); List<Context> complements = null; if (ancestorMatch != null || successorMatch != null) { complements = findBetween(entityManager, ancestorMatch, successorMatch); } transaction.commit(); return complements; } catch (RuntimeException e) { e.printStackTrace(); if (transaction != null && transaction.isActive()) { transaction.rollback(); } throw e; } finally { entityManager.close(); } } }
package lucene4ir.indexer; import lucene4ir.Lucene4IRConstants; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; public class TRECNEWSDocumentIndexer extends DocumentIndexer { private Field docnumField; private Field titleField; private Field textField; private Field authorField; private Field allField; private Document doc; public TRECNEWSDocumentIndexer(String indexPath, String tokenFilterFile, boolean positional) { super(indexPath, tokenFilterFile, positional); doc = new Document(); initFields(); initNEWSDoc(); } private void initFields() { docnumField = new StringField(Lucene4IRConstants.FIELD_DOCNUM, "", Field.Store.YES); if (indexPositions) { titleField = new TermVectorEnabledTextField(Lucene4IRConstants.FIELD_TITLE, "", Field.Store.YES); textField = new TermVectorEnabledTextField(Lucene4IRConstants.FIELD_CONTENT, "", Field.Store.YES); allField = new TermVectorEnabledTextField(Lucene4IRConstants.FIELD_ALL, "", Field.Store.YES); authorField = new TermVectorEnabledTextField(Lucene4IRConstants.FIELD_AUTHOR, "", Field.Store.YES); } else { titleField = new TextField(Lucene4IRConstants.FIELD_TITLE, "", Field.Store.YES); textField = new TextField(Lucene4IRConstants.FIELD_CONTENT, "", Field.Store.YES); allField = new TextField(Lucene4IRConstants.FIELD_ALL, "", Field.Store.YES); authorField = new TextField(Lucene4IRConstants.FIELD_AUTHOR, "", Field.Store.YES); } } private void initNEWSDoc() { doc.add(docnumField); doc.add(titleField); doc.add(textField); doc.add(allField); doc.add(authorField); } public Document createNEWSDocument(String docid, String author, String title, String content, String all) { doc.clear(); docnumField.setStringValue(docid); titleField.setStringValue(title); allField.setStringValue(all); textField.setStringValue(content); authorField.setStringValue(author); doc.add(docnumField); doc.add(authorField); doc.add(titleField); doc.add(textField); doc.add(allField); return doc; } public void indexDocumentsFromFile(String filename) { String line; java.lang.StringBuilder text = new StringBuilder(); try (BufferedReader br = openDocumentFile(filename)) { line = br.readLine(); while (line != null) { if (line.startsWith("<DOC>")) { text = new StringBuilder(); } text.append(line).append("\n"); if (line.startsWith("</DOC>")) { DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = builderFactory.newDocumentBuilder(); String docString = text.toString(); // Remove all escaped entities from the string. docString = docString.replaceAll("&[a-zA-Z0-9]+;", ""); docString = docString.replaceAll("&", ""); org.w3c.dom.Document xmlDocument = builder.parse(new InputSource(new StringReader(docString))); XPath xPath = XPathFactory.newInstance().newXPath(); String expression = "/DOC/DOCNO"; String docid = xPath.compile(expression).evaluate(xmlDocument).trim(); // The title can either be a HEAD tag or a HL tag. expression = "/DOC/HEAD/descendant-or-self::*/text()|/DOC/HL/descendant-or-self::*/text()|/DOC/HEADLINE/descendant-or-self::*/text()|/DOC/DOCTITLE/descendant-or-self::*/text()"; //String title = xPath.compile(expression).evaluate(xmlDocument).trim(); StringBuilder title = new StringBuilder(); NodeList nodeList = (NodeList) xPath.compile(expression).evaluate(xmlDocument, XPathConstants.NODESET); for (int i = 0; i < nodeList.getLength(); i++) { Node currentNode = nodeList.item(i); title.append(" ").append(currentNode.getNodeValue()); } title = new StringBuilder(title.toString().trim()); //String title = xPath.compile(expression).evaluate(xmlDocument).trim(); System.out.println(docid + " :" + title + ":"); expression = "/DOC/TEXT/descendant-or-self::*/text()"; String content = xPath.compile(expression).evaluate(xmlDocument).trim(); // Similar to title, the author field can be represented as multiple tags. expression = "/DOC/BYLINE/descendant-or-self::*/text()|/DOC/SO/descendant-or-self::*/text()"; String author = xPath.compile(expression).evaluate(xmlDocument).trim(); String all = title + " " + content + " " + author; createNEWSDocument(docid, author, title.toString(), content, all); addDocumentToIndex(doc); text = new StringBuilder(); } line = br.readLine(); } } catch (IOException | SAXException | XPathExpressionException | ParserConfigurationException e) { e.printStackTrace(); System.exit(1); } } }
package me.jacky1356400.simplesponge; import me.jacky1356400.simplesponge.creative.SimpleSpongeTab; import me.jacky1356400.simplesponge.proxy.CommonProxy; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @Mod(modid = SimpleSponge.MODID, version = SimpleSponge.VERSION, name = "SimpleSponge", useMetadata = true, dependencies = "required-after:forge@14.21.0.2338,") public class SimpleSponge { public static final String VERSION = "3.2"; public static final String MODID = "simplesponge"; public static final SimpleSpongeTab spongeCreativeTab = new SimpleSpongeTab(); public static Logger logger = LogManager.getLogger("SimpleSponge"); @SidedProxy(serverSide = "me.jacky1356400.simplesponge.proxy.CommonProxy", clientSide = "me.jacky1356400.simplesponge.proxy.ClientProxy") public static CommonProxy proxy; @Mod.EventHandler public void preInit(FMLPreInitializationEvent e){ proxy.preInit(e); } @Mod.EventHandler public void init(FMLInitializationEvent e){ proxy.init(e); } @Mod.EventHandler public void postInit(FMLPostInitializationEvent e){ proxy.postInit(e); } }
package net.aeronica.mods.mxtune.sound; import net.minecraft.client.audio.ISound; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.Constants; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @SuppressWarnings("unused") public enum SoundRange { NORMAL(2F, "mxtune.sound_range.normal", true), // 32 Blocks, linear attenuation, point source INFINITY(1F, "mxtune.sound_range.infinity", false); // Background music, no attenuation, non-directional public static final int LENGTH = SoundRange.values().length; public static final String SOUND_RANGE_KEY = "soundRange"; float range; String languageKey; boolean useLinear; SoundRange(float rangeIn, String languageKeyIn, boolean useLinearIn) { range = rangeIn; languageKey = languageKeyIn; useLinear = useLinearIn; } /** * Note: when SoundRange == INFINITY the ClientAudio#getAudioFormat method changes the audio format to stereo * which disables the directional 3D sound feature. Thus the sound has no source. Essentially it becomes * background music. * @return the range selected */ public float getRange() { return range; } @SideOnly(Side.CLIENT) public ISound.AttenuationType getAttenuationType() { return useLinear ? ISound.AttenuationType.LINEAR : ISound.AttenuationType.NONE; } public String getLanguageKey() { return languageKey; } public static SoundRange nextRange(SoundRange soundRange) { return getSoundRange(soundRange.ordinal() + 1); } public static int getIndex(SoundRange soundRange) { return soundRange.ordinal(); } public static SoundRange getSoundRange(SoundRange soundRange) { return SoundRange.values()[soundRange.ordinal()]; } public static SoundRange getSoundRange(int index) { return SoundRange.values()[index % LENGTH]; } public void toNBT(NBTTagCompound nbt) { nbt.setString(SOUND_RANGE_KEY, name()); } public static SoundRange fromNBT(NBTTagCompound nbt) { SoundRange soundRange = NORMAL; if (nbt.hasKey(SOUND_RANGE_KEY, Constants.NBT.TAG_STRING)) { String s = nbt.getString(SOUND_RANGE_KEY); soundRange = safeSetFromString(s); } return soundRange; } private static SoundRange safeSetFromString(String name) { for (SoundRange soundRange :SoundRange.values()) if (name.contentEquals(soundRange.name())) return valueOf(name); return NORMAL; } }
package net.caseif.flint.common.round; import net.caseif.flint.arena.Arena; import net.caseif.flint.common.arena.CommonArena; import net.caseif.flint.common.event.round.CommonRoundChangeLifecycleStageEvent; import net.caseif.flint.common.event.round.CommonRoundEndEvent; import net.caseif.flint.common.event.round.CommonRoundTimerChangeEvent; import net.caseif.flint.common.metadata.CommonMetadatable; import net.caseif.flint.common.minigame.CommonMinigame; import net.caseif.flint.common.round.challenger.CommonChallenger; import net.caseif.flint.common.round.challenger.CommonTeam; import net.caseif.flint.config.ConfigNode; import net.caseif.flint.config.RoundConfigNode; import net.caseif.flint.minigame.Minigame; import net.caseif.flint.round.LifecycleStage; import net.caseif.flint.round.Round; import net.caseif.flint.round.challenger.Challenger; import net.caseif.flint.round.challenger.Team; import com.google.common.base.Optional; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; import com.google.common.collect.ImmutableSet; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; import java.util.UUID; public abstract class CommonRound extends CommonMetadatable implements Round { protected CommonArena arena; protected BiMap<UUID, Challenger> challengers = HashBiMap.create(); protected BiMap<String, Team> teams = HashBiMap.create(); protected HashMap<RoundConfigNode<?>, Object> config = new HashMap<>(); protected final ImmutableSet<LifecycleStage> stages; protected int currentStage = 0; protected long time; public int spectators; public CommonRound(CommonArena arena, ImmutableSet<LifecycleStage> stages) { this.arena = arena; this.stages = stages; } @Override public Arena getArena() { return arena; } @Override public Set<Challenger> getChallengers() { return ImmutableSet.copyOf(challengers.values()); } @Override public Optional<Challenger> getChallenger(UUID uuid) { return Optional.fromNullable(challengers.get(uuid)); } @Override public void removeChallenger(UUID uuid) throws IllegalArgumentException { Challenger c = challengers.get(uuid); if (c == null) { throw new IllegalArgumentException("Could not get challenger from UUID"); } removeChallenger(c); } @Override public void removeChallenger(Challenger challenger) { if (challenger.getRound() == this) { challengers.remove(challenger.getUniqueId(), challenger); ((CommonChallenger)challenger).invalidate(); } else { throw new IllegalArgumentException("Cannot remove challenger: round mismatch"); } } @Override public Set<Team> getTeams() { return ImmutableSet.copyOf(teams.values()); } @Override public Optional<Team> getTeam(String id) { return Optional.fromNullable(teams.get(id)); } @Override public Team createTeam(String id) throws IllegalArgumentException { if (teams.containsKey(id)) { throw new IllegalArgumentException("Team \"" + id + "\" already exists"); } return new CommonTeam(id, this); } @Override public Team getOrCreateTeam(String id) { Optional<Team> team = getTeam(id); if (team.isPresent()) { return team.get(); } else { return createTeam(id); } } @Override public int getSpectatorCount() { return spectators; } @Override public ImmutableSet<LifecycleStage> getLifecycleStages() { return stages; } @Override public LifecycleStage getLifecycleStage() { return (LifecycleStage)getLifecycleStages().toArray()[currentStage]; } @Override public void setLifecycleStage(LifecycleStage stage) { if (stages.contains(stage)) { if (!stage.equals(getLifecycleStage())) { Iterator<LifecycleStage> iterator = stages.iterator(); int i = 0; while (iterator.hasNext()) { if (iterator.next().equals(stage)) { break; } i++; } currentStage = i; getMinigame().getEventBus() .post(new CommonRoundChangeLifecycleStageEvent(this, getLifecycleStage(), stage)); } } else { throw new IllegalArgumentException("Invalid lifecycle stage"); } } @Override public Optional<LifecycleStage> getLifecycleStage(String id) { for (LifecycleStage stage : stages) { if (stage.getId().equals(id)) { return Optional.of(stage); } } return Optional.absent(); } @Override public LifecycleStage getLifecycleStage(int index) { if (index >= stages.size()) { throw new IndexOutOfBoundsException(); } return stages.asList().get(index); } @Override public Optional<LifecycleStage> getNextLifecycleStage() { return Optional.fromNullable( currentStage < stages.size() - 1 ? (LifecycleStage) getLifecycleStages().toArray()[currentStage + 1] : null ); } @Override public void nextLifecycleStage() throws IllegalStateException { Optional<LifecycleStage> next = getNextLifecycleStage(); if (!next.isPresent()) { throw new IllegalStateException("Current lifecycle stage is last defined"); } setLifecycleStage(next.get()); } @Override public long getTime() { return time; } @Override public void setTime(long time) { setTime(time, true); } /** * Sets the time of this {@link Round}. * * @param time The new time of the {@link Round} * @param callEvent Whether an event should be posted */ public void setTime(long time, boolean callEvent) { this.time = time; if (callEvent) { getMinigame().getEventBus().post(new CommonRoundTimerChangeEvent(this, this.getTime(), time)); } } @Override public long getRemainingTime() { return getLifecycleStage().getDuration() == -1 ? -1 : getLifecycleStage().getDuration() - time; } @Override public void resetTimer() { setTimerTicking(false); time = 0; setLifecycleStage((LifecycleStage)getLifecycleStages().toArray()[0]); } @Override public void end() { end(true); } @Override public void end(boolean rollback) { end(rollback, getConfigValue(ConfigNode.ROLLBACK_ON_END)); } public void end(boolean rollback, boolean natural) { ((CommonMinigame) getMinigame()).getRoundMap().remove(getArena()); for (Challenger challenger : getChallengers()) { challenger.removeFromRound(); } if (rollback) { getArena().rollback(); } getMinigame().getEventBus().post(new CommonRoundEndEvent(this, natural)); } @Override @SuppressWarnings("unchecked") public <T> T getConfigValue(RoundConfigNode<T> node) { return config.containsKey(node) ? (T) config.get(node) : node.getDefaultValue(); } @Override public <T> void setConfigValue(RoundConfigNode<T> node, T value) { config.put(node, value); } @Override public Minigame getMinigame() { return getArena().getMinigame(); } @Override public String getPlugin() { return getArena().getPlugin(); } public Map<UUID, Challenger> getChallengerMap() { return challengers; } public Map<String, Team> getTeamMap() { return teams; } }
package net.imagej.legacy.plugin; import java.util.Arrays; import java.util.List; import javax.script.ScriptEngine; import net.imagej.legacy.DefaultLegacyService; import org.scijava.plugin.Parameter; import org.scijava.plugin.Plugin; import org.scijava.script.AbstractScriptLanguage; import org.scijava.script.ScriptLanguage; /** * Implements a factory for the ImageJ 1.x Macro language engine. * * @author Johannes Schindelin */ @Plugin(type = ScriptLanguage.class, name = "IJ1 Macro") public class IJ1MacroLanguage extends AbstractScriptLanguage { @Parameter(required = false) private DefaultLegacyService legacyService; @Override public List<String> getExtensions() { return Arrays.asList("ijm"); } @Override public String getLanguageName() { return "IJ1 Macro"; } @Override public ScriptEngine getScriptEngine() { return new IJ1MacroEngine(legacyService().getIJ1Helper()); } private DefaultLegacyService legacyService() { if (legacyService != null) return legacyService; synchronized (this) { if (legacyService != null) return legacyService; legacyService = getContext().getService(DefaultLegacyService.class); if (legacyService == null) { throw new RuntimeException("No legacy service available!"); } return legacyService; } } }
package net.sf.jabref.gui.entryeditor; import java.awt.AWTKeyStroke; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Insets; import java.awt.KeyboardFocusManager; import java.awt.RenderingHints; import java.awt.event.ActionEvent; import java.awt.event.FocusAdapter; import java.awt.event.FocusEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Map.Entry; import java.util.Objects; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.ActionMap; import javax.swing.InputMap; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.JScrollPane; import javax.swing.JTabbedPane; import javax.swing.JTextArea; import javax.swing.JToolBar; import javax.swing.KeyStroke; import javax.swing.ScrollPaneConstants; import javax.swing.SwingConstants; import javax.swing.SwingUtilities; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.text.JTextComponent; import net.sf.jabref.Globals; import net.sf.jabref.external.WriteXMPEntryEditorAction; import net.sf.jabref.gui.BasePanel; import net.sf.jabref.gui.EntryContainer; import net.sf.jabref.gui.FieldContentSelector; import net.sf.jabref.gui.GUIGlobals; import net.sf.jabref.gui.IconTheme; import net.sf.jabref.gui.JabRefFrame; import net.sf.jabref.gui.OSXCompatibleToolbar; import net.sf.jabref.gui.actions.Actions; import net.sf.jabref.gui.fieldeditors.FieldEditor; import net.sf.jabref.gui.fieldeditors.FieldEditorFocusListener; import net.sf.jabref.gui.fieldeditors.FileListEditor; import net.sf.jabref.gui.fieldeditors.JTextAreaWithHighlighting; import net.sf.jabref.gui.fieldeditors.TextField; import net.sf.jabref.gui.help.HelpAction; import net.sf.jabref.gui.keyboard.KeyBinding; import net.sf.jabref.gui.menus.ChangeEntryTypeMenu; import net.sf.jabref.gui.undo.NamedCompound; import net.sf.jabref.gui.undo.UndoableChangeType; import net.sf.jabref.gui.undo.UndoableFieldChange; import net.sf.jabref.gui.undo.UndoableKeyChange; import net.sf.jabref.gui.undo.UndoableRemoveEntry; import net.sf.jabref.gui.util.FocusRequester; import net.sf.jabref.gui.util.component.CheckBoxMessage; import net.sf.jabref.gui.util.component.VerticalLabelUI; import net.sf.jabref.importer.ParserResult; import net.sf.jabref.importer.fileformat.BibtexParser; import net.sf.jabref.logic.TypedBibEntry; import net.sf.jabref.logic.autocompleter.AutoCompleter; import net.sf.jabref.logic.bibtex.BibEntryWriter; import net.sf.jabref.logic.bibtex.LatexFieldFormatter; import net.sf.jabref.logic.bibtex.LatexFieldFormatterPreferences; import net.sf.jabref.logic.help.HelpFile; import net.sf.jabref.logic.l10n.Localization; import net.sf.jabref.logic.labelpattern.LabelPatternPreferences; import net.sf.jabref.logic.labelpattern.LabelPatternUtil; import net.sf.jabref.logic.search.SearchQueryHighlightListener; import net.sf.jabref.logic.util.date.TimeStamp; import net.sf.jabref.model.EntryTypes; import net.sf.jabref.model.database.BibDatabase; import net.sf.jabref.model.database.BibDatabaseMode; import net.sf.jabref.model.entry.BibEntry; import net.sf.jabref.model.entry.EntryConverter; import net.sf.jabref.model.entry.EntryType; import net.sf.jabref.model.entry.FieldName; import net.sf.jabref.model.entry.FieldProperties; import net.sf.jabref.model.entry.InternalBibtexFields; import net.sf.jabref.model.event.FieldChangedEvent; import net.sf.jabref.preferences.JabRefPreferences; import net.sf.jabref.specialfields.SpecialFieldUpdateListener; import com.google.common.eventbus.Subscribe; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * GUI component that allows editing of the fields of a BibEntry (i.e. the * one that shows up, when you double click on an entry in the table) * <p> * It hosts the tabs (required, general, optional) and the buttons to the left. * <p> * EntryEditor also registers itself to the event bus, receiving * events whenever a field of the entry changes, enabling the text fields to * update themselves if the change is made from somewhere else. */ public class EntryEditor extends JPanel implements EntryContainer { private static final Log LOGGER = LogFactory.getLog(EntryEditor.class); // A reference to the entry this object works on. private BibEntry entry; // The currently displayed type private final String displayedBibEntryType; // The action concerned with closing the window. private final CloseAction closeAction; // The action that deletes the current entry, and closes the editor. private final DeleteAction deleteAction = new DeleteAction(); // Actions for switching to next/previous entry. private final AbstractAction nextEntryAction = new NextEntryAction(); private final AbstractAction prevEntryAction = new PrevEntryAction(); // The action concerned with storing a field value. private final StoreFieldAction storeFieldAction; // The actions concerned with switching the panels. private final SwitchLeftAction switchLeftAction = new SwitchLeftAction(); private final SwitchRightAction switchRightAction = new SwitchRightAction(); // The action which generates a bibtexkey for this entry. private final GenerateKeyAction generateKeyAction; // UGLY HACK to have a pointer to the fileListEditor to call autoSetLinks() private FileListEditor fileListEditor; private final AutoLinkAction autoLinkAction = new AutoLinkAction(); private final AbstractAction writeXmp; private final SaveDatabaseAction saveDatabaseAction = new SaveDatabaseAction(); private final JPanel srcPanel = new JPanel(); private final JPanel pdfPanel = new JPanel(); private JTextArea source; private final JTabbedPane tabbed = new JTabbedPane(); private final JabRefFrame frame; private final BasePanel panel; private final Set<FieldContentSelector> contentSelectors = new HashSet<>(); private boolean updateSource = true; // This can be set to false to stop the source private boolean movingToDifferentEntry; // Indicates that we are about to go to the next or previous entry private boolean validEntry = true; private final List<Object> tabs = new ArrayList<>(); // text area from getting updated. This is used in cases where the source // couldn't be parsed, and the user is given the option to edit it. private boolean lastSourceAccepted = true; // This indicates whether the last // attempt // at parsing the source was successful. It is used to determine whether the // dialog should close; it should stay open if the user received an error // message about the source, whatever he or she chose to do about it. private String lastSourceStringAccepted; // This is used to prevent double // fields. // These values can be used to calculate the preferred height for the form. // reqW starts at 1 because it needs room for the bibtex key field. private int sourceIndex = -1; // The index the source panel has in tabbed. private final HelpAction helpAction; private final UndoAction undoAction = new UndoAction(); private final RedoAction redoAction = new RedoAction(); private final TabListener tabListener = new TabListener(); public EntryEditor(JabRefFrame frame, BasePanel panel, BibEntry entry) { this.frame = frame; this.panel = panel; this.entry = entry; entry.registerListener(this); entry.registerListener(SpecialFieldUpdateListener.getInstance()); displayedBibEntryType = entry.getType(); helpAction = new HelpAction(HelpFile.ENTRY_EDITOR, IconTheme.JabRefIcon.HELP.getIcon()); closeAction = new CloseAction(); generateKeyAction = new GenerateKeyAction(); storeFieldAction = new StoreFieldAction(); writeXmp = new WriteXMPEntryEditorAction(panel, this); BorderLayout borderLayout = new BorderLayout(); setLayout(borderLayout); setupToolBar(); setupFieldPanels(); setupSourcePanel(); add(tabbed, BorderLayout.CENTER); tabbed.addChangeListener(tabListener); if (Globals.prefs.getBoolean(JabRefPreferences.DEFAULT_SHOW_SOURCE)) { tabbed.setSelectedIndex(sourceIndex); } updateAllFields(); if (this.fileListEditor != null){ this.fileListEditor.adjustColumnWidth(); } } private void setupFieldPanels() { tabbed.removeAll(); tabs.clear(); EntryType type = EntryTypes.getTypeOrDefault(entry.getType(), this.frame.getCurrentBasePanel().getBibDatabaseContext().getMode()); // required fields List<String> requiredFields = addRequiredTab(type); // optional fields List<String> displayedOptionalFields = new ArrayList<>(); if ((type.getOptionalFields() != null) && !type.getOptionalFields().isEmpty()) { if (!frame.getCurrentBasePanel().getBibDatabaseContext().isBiblatexMode()) { addOptionalTab(type); } else { displayedOptionalFields.addAll(type.getPrimaryOptionalFields()); displayedOptionalFields.addAll(type.getSecondaryOptionalFields()); addOptionalTab(type); Set<String> deprecatedFields = new HashSet<>(EntryConverter.FIELD_ALIASES_TEX_TO_LTX.keySet()); deprecatedFields.add(FieldName.YEAR); deprecatedFields.add(FieldName.MONTH); List<String> secondaryOptionalFields = type.getSecondaryOptionalFields(); List<String> optionalFieldsNotPrimaryOrDeprecated = new ArrayList<>(secondaryOptionalFields); optionalFieldsNotPrimaryOrDeprecated.removeAll(deprecatedFields); // Get list of all optional fields of this entry and their aliases Set<String> optionalFieldsAndAliases = new HashSet<>(); for (String field : type.getOptionalFields()) { optionalFieldsAndAliases.add(field); if (EntryConverter.FIELD_ALIASES_LTX_TO_TEX.containsKey(field)) { optionalFieldsAndAliases.add(EntryConverter.FIELD_ALIASES_LTX_TO_TEX.get(field)); } } // Get all optional fields which are deprecated Set<String> usedOptionalFieldsDeprecated = new HashSet<>(deprecatedFields); usedOptionalFieldsDeprecated.retainAll(optionalFieldsAndAliases); // Add tabs EntryEditorTab optPan2 = new EntryEditorTab(frame, panel, optionalFieldsNotPrimaryOrDeprecated, this, false, true, Localization.lang("Optional fields 2")); if (optPan2.fileListEditor != null) { fileListEditor = optPan2.fileListEditor; } tabbed.addTab(Localization.lang("Optional fields 2"), IconTheme.JabRefIcon.OPTIONAL.getSmallIcon(), optPan2 .getPane(), Localization.lang("Show optional fields")); tabs.add(optPan2); if (!usedOptionalFieldsDeprecated.isEmpty()) { EntryEditorTab optPan3; optPan3 = new EntryEditorTab(frame, panel, new ArrayList<>(usedOptionalFieldsDeprecated), this, false, true, Localization.lang("Deprecated fields")); if (optPan3.fileListEditor != null) { fileListEditor = optPan3.fileListEditor; } tabbed.addTab(Localization.lang("Deprecated fields"), IconTheme.JabRefIcon.OPTIONAL.getSmallIcon(), optPan3 .getPane(), Localization.lang("Show deprecated BibTeX fields")); tabs.add(optPan3); } } } // other fields List<String> displayedFields = Stream.concat(requiredFields.stream(), displayedOptionalFields.stream()).map(String::toLowerCase).collect(Collectors.toList()); List<String> otherFields = entry.getFieldNames().stream().map(String::toLowerCase).filter(f -> !displayedFields.contains(f)).collect(Collectors.toList()); otherFields.remove(BibEntry.KEY_FIELD); otherFields.removeAll(Globals.prefs.getCustomTabFieldNames()); if (!otherFields.isEmpty()) { addOtherTab(otherFields); } // general fields from preferences addGeneralTabs(); // source tab addSourceTab(); addPdfTab(); } private void addGeneralTabs() { EntryEditorTabList tabList = Globals.prefs.getEntryEditorTabList(); for (int i = 0; i < tabList.getTabCount(); i++) { EntryEditorTab newTab = new EntryEditorTab(frame, panel, tabList.getTabFields(i), this, false, false, tabList.getTabName(i)); if (newTab.fileListEditor != null) { fileListEditor = newTab.fileListEditor; } tabbed.addTab(tabList.getTabName(i), newTab.getPane()); tabs.add(newTab); } } private void addSourceTab() { srcPanel.setName(Localization.lang("BibTeX source")); tabbed.addTab(Localization.lang("BibTeX source"), IconTheme.JabRefIcon.SOURCE.getSmallIcon(), srcPanel, Localization.lang("Show/edit BibTeX source")); tabs.add(srcPanel); sourceIndex = tabs.size() - 1; // Set the sourceIndex variable. srcPanel.setFocusCycleRoot(true); } private void addOtherTab(List<String> otherFields) { EntryEditorTab otherPanel = new EntryEditorTab(frame, panel, otherFields, this, false, false, Localization.lang("Other fields")); if (otherPanel.fileListEditor != null) { fileListEditor = otherPanel.fileListEditor; } tabbed.addTab(Localization.lang("Other fields"), IconTheme.JabRefIcon.OPTIONAL.getSmallIcon(), otherPanel .getPane(), Localization.lang("Show remaining fields")); tabs.add(otherPanel); } private List<String> addRequiredTab(EntryType type) { List<String> requiredFields = type.getRequiredFieldsFlat(); EntryEditorTab requiredPanel = new EntryEditorTab(frame, panel, requiredFields, this, true, false, Localization.lang("Required fields")); if (requiredPanel.fileListEditor != null) { fileListEditor = requiredPanel.fileListEditor; } tabbed.addTab(Localization.lang("Required fields"), IconTheme.JabRefIcon.REQUIRED.getSmallIcon(), requiredPanel .getPane(), Localization.lang("Show required fields")); tabs.add(requiredPanel); return requiredFields; } private void addOptionalTab(EntryType type) { EntryEditorTab optionalPanel = new EntryEditorTab(frame, panel, type.getPrimaryOptionalFields(), this, false, true, Localization.lang("Optional fields")); if (optionalPanel.fileListEditor != null) { fileListEditor = optionalPanel.fileListEditor; } tabbed.addTab(Localization.lang("Optional fields"), IconTheme.JabRefIcon.OPTIONAL.getSmallIcon(), optionalPanel .getPane(), Localization.lang("Show optional fields")); tabs.add(optionalPanel); } private void addPdfTab() { pdfPanel.setName(Localization.lang("PDF Comments")); tabbed.addTab(Localization.lang("PDF Comments"), IconTheme.JabRefIcon.SOURCE.getSmallIcon(), pdfPanel, Localization.lang("Show PDF Comments")); tabs.add(pdfPanel); } public String getDisplayedBibEntryType() { return displayedBibEntryType; } /** * @return reference to the currently edited entry */ @Override public BibEntry getEntry() { return entry; } public BibDatabase getDatabase() { return panel.getDatabase(); } private void setupToolBar() { JPanel leftPan = new JPanel(); leftPan.setLayout(new BorderLayout()); JToolBar toolBar = new OSXCompatibleToolbar(SwingConstants.VERTICAL); toolBar.setBorder(null); toolBar.setRollover(true); toolBar.setMargin(new Insets(0, 0, 0, 2)); // The toolbar carries all the key bindings that are valid for the whole // window. ActionMap actionMap = toolBar.getActionMap(); InputMap inputMap = toolBar.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); inputMap.put(Globals.getKeyPrefs().getKey(KeyBinding.CLOSE_ENTRY_EDITOR), "close"); actionMap.put("close", closeAction); inputMap.put(Globals.getKeyPrefs().getKey(KeyBinding.ENTRY_EDITOR_STORE_FIELD), "store"); actionMap.put("store", getStoreFieldAction()); inputMap.put(Globals.getKeyPrefs().getKey(KeyBinding.AUTOGENERATE_BIBTEX_KEYS), "generateKey"); actionMap.put("generateKey", getGenerateKeyAction()); inputMap.put(Globals.getKeyPrefs().getKey(KeyBinding.AUTOMATICALLY_LINK_FILES), "autoLink"); actionMap.put("autoLink", autoLinkAction); inputMap.put(Globals.getKeyPrefs().getKey(KeyBinding.ENTRY_EDITOR_PREVIOUS_ENTRY), "prev"); actionMap.put("prev", getPrevEntryAction()); inputMap.put(Globals.getKeyPrefs().getKey(KeyBinding.ENTRY_EDITOR_NEXT_ENTRY), "next"); actionMap.put("next", getNextEntryAction()); inputMap.put(Globals.getKeyPrefs().getKey(KeyBinding.UNDO), "undo"); actionMap.put("undo", undoAction); inputMap.put(Globals.getKeyPrefs().getKey(KeyBinding.REDO), "redo"); actionMap.put("redo", redoAction); inputMap.put(Globals.getKeyPrefs().getKey(KeyBinding.HELP), "help"); actionMap.put("help", getHelpAction()); toolBar.setFloatable(false); // Add actions (and thus buttons) JButton closeBut = new JButton(closeAction); closeBut.setText(null); closeBut.setBorder(null); closeBut.setMargin(new Insets(8, 0, 8, 0)); leftPan.add(closeBut, BorderLayout.NORTH); // Create type-label TypedBibEntry typedEntry = new TypedBibEntry(entry, panel.getBibDatabaseContext().getMode()); leftPan.add(new TypeLabel(typedEntry.getTypeForDisplay()), BorderLayout.CENTER); TypeButton typeButton = new TypeButton(); toolBar.add(typeButton); toolBar.add(getGenerateKeyAction()); toolBar.add(autoLinkAction); toolBar.add(writeXmp); toolBar.addSeparator(); toolBar.add(deleteAction); toolBar.add(getPrevEntryAction()); toolBar.add(getNextEntryAction()); toolBar.addSeparator(); toolBar.add(getHelpAction()); Component[] comps = toolBar.getComponents(); for (Component comp : comps) { ((JComponent) comp).setOpaque(false); } leftPan.add(toolBar, BorderLayout.SOUTH); add(leftPan, BorderLayout.WEST); } /** * Rebuild the field tabs. This is called e.g. when a new content selector * has been added. */ public void rebuildPanels() { // Remove change listener, because the rebuilding causes meaningless // events and trouble: tabbed.removeChangeListener(tabListener); setupFieldPanels(); // Add the change listener again: tabbed.addChangeListener(tabListener); revalidate(); repaint(); } /** * getExtra checks the field name against InternalBibtexFields.getFieldExtras(name). * If the name has an entry, the proper component to be shown is created and * returned. Otherwise, null is returned. In addition, e.g. listeners can be * added to the field editor, even if no component is returned. * * @param editor Field editor * @return Component to show, or null if none. */ public Optional<JComponent> getExtra(final FieldEditor editor) { final String fieldName = editor.getFieldName(); final Set<FieldProperties> fieldExtras = InternalBibtexFields.getFieldExtras(fieldName); // timestamp or a other field with datepicker command if (Globals.prefs.get(JabRefPreferences.TIME_STAMP_FIELD).equals(fieldName) || fieldExtras.contains(FieldProperties.DATE)) { // double click AND datefield => insert the current date (today) return FieldExtraComponents.getDateTimeExtraComponent(editor, fieldExtras.contains(FieldProperties.DATE), fieldExtras.contains(FieldProperties.ISO_DATE)); } else if (fieldExtras.contains(FieldProperties.EXTERNAL)) { return FieldExtraComponents.getExternalExtraComponent(panel, editor); } else if (fieldExtras.contains(FieldProperties.JOURNAL_NAME)) { // Add controls for switching between abbreviated and full journal names. // If this field also has a FieldContentSelector, we need to combine these. return FieldExtraComponents.getJournalExtraComponent(frame, panel, editor, entry, contentSelectors, getStoreFieldAction()); } else if (!panel.getBibDatabaseContext().getMetaData().getContentSelectors(fieldName).isEmpty()) { return FieldExtraComponents.getSelectorExtraComponent(frame, panel, editor, contentSelectors, getStoreFieldAction()); } else if (fieldExtras.contains(FieldProperties.URL)) { return FieldExtraComponents.getURLExtraComponent(editor, getStoreFieldAction()); } else if (fieldExtras.contains(FieldProperties.DOI)) { return FieldExtraComponents.getDoiExtraComponent(panel, this, editor); } else if (fieldExtras.contains(FieldProperties.OWNER)) { return FieldExtraComponents.getSetOwnerExtraComponent(editor, getStoreFieldAction()); } else if (fieldExtras.contains(FieldProperties.YES_NO)) { return FieldExtraComponents.getYesNoExtraComponent(editor, this); } else if (fieldExtras.contains(FieldProperties.MONTH)) { return FieldExtraComponents.getMonthExtraComponent(editor, this, frame.getCurrentBasePanel().getBibDatabaseContext().getMode()); } else if (fieldExtras.contains(FieldProperties.GENDER)) { return FieldExtraComponents.getGenderExtraComponent(editor, this); } else if (fieldExtras.contains(FieldProperties.EDITOR_TYPE)) { return FieldExtraComponents.getEditorTypeExtraComponent(editor, this); } else if (fieldExtras.contains(FieldProperties.PAGINATION)) { return FieldExtraComponents.getPaginationExtraComponent(editor, this); } else if (fieldExtras.contains(FieldProperties.TYPE)) { return FieldExtraComponents.getTypeExtraComponent(editor, this, "patent".equalsIgnoreCase(entry.getType())); } else if (fieldExtras.contains(FieldProperties.CROSSREF)) { return FieldExtraComponents.getCrossrefExtraComponent(editor, frame.getCurrentBasePanel()); } return Optional.empty(); } private void setupSourcePanel() { source = new JTextAreaWithHighlighting(); panel.getSearchBar().getSearchQueryHighlightObservable().addSearchListener((SearchQueryHighlightListener) source); source.setEditable(true); source.setLineWrap(true); source.setTabSize(Globals.prefs.getInt(JabRefPreferences.INDENT)); source.addFocusListener(new FieldEditorFocusListener()); // Add the global focus listener, so a menu item can see if this field was focused when an action was called. source.addFocusListener(Globals.getFocusListener()); source.setFont(new Font("Monospaced", Font.PLAIN, Globals.prefs.getInt(JabRefPreferences.FONT_SIZE))); setupJTextComponent(source); updateSource(); JScrollPane scrollPane = new JScrollPane(source, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); srcPanel.setLayout(new BorderLayout()); srcPanel.add(scrollPane, BorderLayout.CENTER); } public void updateSource() { if (updateSource) { try { String srcString = getSourceString(entry, panel.getBibDatabaseContext().getMode()); source.setText(srcString); lastSourceStringAccepted = srcString; // Set the current Entry to be selected. // Fixes the bug of losing selection after, e.g. // an autogeneration of a BibTeX key. // - ILC (16/02/2010) - SwingUtilities.invokeLater(() -> { final int row = panel.getMainTable().findEntry(entry); if (row >= 0) { if (panel.getMainTable().getSelectedRowCount() == 0) { panel.getMainTable().setRowSelectionInterval(row, row); } panel.getMainTable().ensureVisible(row); } }); } catch (IOException ex) { source.setText(ex.getMessage() + "\n\n" + Localization.lang("Correct the entry, and " + "reopen editor to display/edit source.")); source.setEditable(false); LOGGER.debug("Incorrect entry", ex); } } } public static String getSourceString(BibEntry entry, BibDatabaseMode type) throws IOException { StringWriter stringWriter = new StringWriter(200); LatexFieldFormatter formatter = LatexFieldFormatter .buildIgnoreHashes(LatexFieldFormatterPreferences.fromPreferences(Globals.prefs)); new BibEntryWriter(formatter, false).writeWithoutPrependedNewlines(entry, stringWriter, type); return stringWriter.getBuffer().toString(); } /** * NOTE: This method is only used for the source panel, not for the * other tabs. Look at EntryEditorTab for the setup of text components * in the other tabs. */ private void setupJTextComponent(JTextComponent textComponent) { // Set up key bindings and focus listener for the FieldEditor. InputMap inputMap = textComponent.getInputMap(JComponent.WHEN_FOCUSED); ActionMap actionMap = textComponent.getActionMap(); inputMap.put(Globals.getKeyPrefs().getKey(KeyBinding.ENTRY_EDITOR_STORE_FIELD), "store"); actionMap.put("store", getStoreFieldAction()); inputMap.put(Globals.getKeyPrefs().getKey(KeyBinding.ENTRY_EDITOR_NEXT_PANEL), "right"); inputMap.put(Globals.getKeyPrefs().getKey(KeyBinding.ENTRY_EDITOR_NEXT_PANEL_2), "right"); actionMap.put("right", getSwitchRightAction()); inputMap.put(Globals.getKeyPrefs().getKey(KeyBinding.ENTRY_EDITOR_PREVIOUS_PANEL), "left"); inputMap.put(Globals.getKeyPrefs().getKey(KeyBinding.ENTRY_EDITOR_PREVIOUS_PANEL_2), "left"); actionMap.put("left", getSwitchLeftAction()); inputMap.put(Globals.getKeyPrefs().getKey(KeyBinding.HELP), "help"); actionMap.put("help", getHelpAction()); inputMap.put(Globals.getKeyPrefs().getKey(KeyBinding.SAVE_DATABASE), "save"); actionMap.put("save", getSaveDatabaseAction()); inputMap.put(Globals.getKeyPrefs().getKey(KeyBinding.NEXT_TAB), "nexttab"); actionMap.put("nexttab", frame.nextTab); inputMap.put(Globals.getKeyPrefs().getKey(KeyBinding.PREVIOUS_TAB), "prevtab"); actionMap.put("prevtab", frame.prevTab); Set<AWTKeyStroke> keys = new HashSet<>( textComponent.getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS)); keys.clear(); keys.add(AWTKeyStroke.getAWTKeyStroke("pressed TAB")); textComponent.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, keys); keys = new HashSet<>(textComponent .getFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS)); keys.clear(); keys.add(KeyStroke.getKeyStroke("shift pressed TAB")); textComponent.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, keys); textComponent.addFocusListener(new FieldListener()); } @Override public void requestFocus() { activateVisible(); } private void activateVisible() { Object activeTab = tabs.get(tabbed.getSelectedIndex()); if (activeTab instanceof EntryEditorTab) { ((EntryEditorTab) activeTab).activate(); } else { new FocusRequester(source); } } /** * Reports the enabled status of the editor, as set by setEnabled() */ @Override public boolean isEnabled() { return source.isEnabled(); } /** * Sets the enabled status of all text fields of the entry editor. */ @Override public void setEnabled(boolean enabled) { for (Object tab : tabs) { if (tab instanceof EntryEditorTab) { ((EntryEditorTab) tab).setEnabled(enabled); } } source.setEnabled(enabled); } /** * Centers the given row, and highlights it. * * @param row an <code>int</code> value */ private void scrollTo(int row) { movingToDifferentEntry = true; panel.getMainTable().setRowSelectionInterval(row, row); panel.getMainTable().ensureVisible(row); } /** * Makes sure the current edit is stored. */ public void storeCurrentEdit() { Component comp = Globals.getFocusListener().getFocused(); if (Objects.equals(comp, source) || ((comp instanceof FieldEditor) && this.isAncestorOf(comp))) { if (comp instanceof FieldEditor) { ((FieldEditor) comp).clearAutoCompleteSuggestion(); } getStoreFieldAction().actionPerformed(new ActionEvent(comp, 0, "")); } } /** * Returns the index of the active (visible) panel. * * @return an <code>int</code> value */ public int getVisiblePanel() { return tabbed.getSelectedIndex(); } /** * Returns the name of the currently selected component. */ public String getVisiblePanelName() { return tabbed.getSelectedComponent().getName(); } public void setVisiblePanel(String name) { for (int i = 0; i < tabbed.getTabCount(); ++i) { if ((tabbed.getComponent(i).getName() != null) && tabbed.getComponent(i).getName().equals(name)) { tabbed.setSelectedIndex(i); return; } } if (tabbed.getTabCount() > 0) { tabbed.setSelectedIndex(0); } } public void setFocusToField(String fieldName) { for (Object tab : tabs) { if ((tab instanceof EntryEditorTab) && ((EntryEditorTab) tab).getFields().contains(fieldName)) { EntryEditorTab entryEditorTab = (EntryEditorTab) tab; setVisiblePanel(entryEditorTab.getTabTitle()); entryEditorTab.setActive(fieldName); entryEditorTab.activate(); } } } /** * Updates this editor to show the given entry, regardless of type * correspondence. * * @param switchEntry a <code>BibEntry</code> value */ public synchronized void switchTo(BibEntry switchEntry) { storeCurrentEdit(); // Remove this instance as property listener for the entry: this.entry.unregisterListener(this); this.entry = switchEntry; // Register as property listener for the new entry: this.entry.registerListener(this); updateAllFields(); validateAllFields(); updateSource(); panel.newEntryShowing(switchEntry); } private boolean storeSource() { BibtexParser bibtexParser = new BibtexParser(new StringReader(source.getText())); try { ParserResult parserResult = bibtexParser.parse(); BibDatabase database = parserResult.getDatabase(); if (database.getEntryCount() > 1) { throw new IllegalStateException("More than one entry found."); } if (!database.hasEntries()) { if (parserResult.hasWarnings()) { // put the warning into as exception text -> it will be displayed to the user throw new IllegalStateException(parserResult.warnings().get(0)); } else { throw new IllegalStateException("No entries found."); } } NamedCompound compound = new NamedCompound(Localization.lang("source edit")); BibEntry newEntry = database.getEntries().get(0); String newKey = newEntry.getCiteKey(); boolean entryChanged = false; boolean duplicateWarning = false; boolean emptyWarning = (newKey == null) || newKey.isEmpty(); if (panel.getDatabase().setCiteKeyForEntry(entry, newKey)) { duplicateWarning = true; } // First, remove fields that the user has removed. for (Entry<String, String> field : entry.getFieldMap().entrySet()) { String fieldName = field.getKey(); String fieldValue = field.getValue(); if (InternalBibtexFields.isDisplayableField(fieldName) && !newEntry.hasField(fieldName)) { compound.addEdit( new UndoableFieldChange(entry, fieldName, fieldValue, null)); entry.clearField(fieldName); entryChanged = true; } } // Then set all fields that have been set by the user. for (Entry<String, String> field : newEntry.getFieldMap().entrySet()) { String fieldName = field.getKey(); String oldValue = entry.getFieldOptional(fieldName).orElse(null); String newValue = field.getValue(); if (!Objects.equals(oldValue, newValue)) { new LatexFieldFormatter(LatexFieldFormatterPreferences.fromPreferences(Globals.prefs)) .format(newValue, fieldName); compound.addEdit(new UndoableFieldChange(entry, fieldName, oldValue, newValue)); entry.setField(fieldName, newValue); entryChanged = true; } } // See if the user has changed the entry type: if (!Objects.equals(newEntry.getType(), entry.getType())) { compound.addEdit(new UndoableChangeType(entry, entry.getType(), newEntry.getType())); entry.setType(newEntry.getType()); entryChanged = true; } compound.end(); if (!entryChanged) { return true; } panel.getUndoManager().addEdit(compound); if (duplicateWarning) { warnDuplicateBibtexkey(); } else if (emptyWarning) { warnEmptyBibtexkey(); } else { panel.output(Localization.lang("Stored entry") + '.'); } lastSourceStringAccepted = source.getText(); // Update UI // TODO: we need to repaint the entryeditor if fields that are not displayed have been added panel.updateEntryEditorIfShowing(); lastSourceAccepted = true; updateSource = true; // TODO: does updating work properly after source stored? panel.markBaseChanged(); SwingUtilities.invokeLater(() -> { final int row = panel.getMainTable().findEntry(entry); if (row >= 0) { panel.getMainTable().ensureVisible(row); } }); return true; } catch (IllegalStateException | IOException ex) { // The source couldn't be parsed, so the user is given an // error message, and the choice to keep or revert the contents // of the source text field. updateSource = false; lastSourceAccepted = false; tabbed.setSelectedComponent(srcPanel); Object[] options = {Localization.lang("Edit"), Localization.lang("Revert to original source")}; int answer = JOptionPane.showOptionDialog(frame, Localization.lang("Error") + ": " + ex.getMessage(), Localization.lang("Problem with parsing entry"), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, options, options[0]); if (answer != 0) { updateSource = true; updateSource(); } LOGGER.debug("Incorrect source", ex); return false; } } private void setField(String fieldName, String newFieldData) { for (Object tab : tabs) { if (tab instanceof EntryEditorTab) { ((EntryEditorTab) tab).updateField(fieldName, newFieldData); } } } /** * Sets all the text areas according to the shown entry. */ public void updateAllFields() { for (Object tab : tabs) { if (tab instanceof EntryEditorTab) { ((EntryEditorTab) tab).setEntry(entry); } } } /** * Removes the "invalid field" color from all text areas. */ public void validateAllFields() { for (Object tab : tabs) { if (tab instanceof EntryEditorTab) { ((EntryEditorTab) tab).validateAllFields(); } } } public void updateAllContentSelectors() { if (!contentSelectors.isEmpty()) { for (FieldContentSelector contentSelector : contentSelectors) { contentSelector.rebuildComboBox(); } } } /** * Update the JTextArea when a field has changed. */ @Subscribe public void listen(FieldChangedEvent fieldChangedEvent) { String newValue = fieldChangedEvent.getNewValue() == null ? "" : fieldChangedEvent.getNewValue(); setField(fieldChangedEvent.getFieldName(), newValue); } public void updateField(final Object sourceObject) { getStoreFieldAction().actionPerformed(new ActionEvent(sourceObject, 0, "")); } public void setMovingToDifferentEntry() { movingToDifferentEntry = true; } private class TypeButton extends JButton { public TypeButton() { super(IconTheme.JabRefIcon.EDIT.getIcon()); setToolTipText(Localization.lang("Change entry type")); addActionListener(e -> showChangeEntryTypePopupMenu()); } } private void showChangeEntryTypePopupMenu() { JPopupMenu typeMenu = new ChangeEntryTypeMenu().getChangeentryTypePopupMenu(panel); typeMenu.show(this, 0, 0); } private class TypeLabel extends JLabel { public TypeLabel(String type) { super(type); setUI(new VerticalLabelUI(false)); setForeground(GUIGlobals.ENTRY_EDITOR_LABEL_COLOR); setHorizontalAlignment(SwingConstants.RIGHT); setFont(new Font("dialog", Font.ITALIC + Font.BOLD, 18)); // Add a mouse listener so the user can right-click the type label to change the entry type: addMouseListener(new MouseAdapter() { @Override public void mouseReleased(MouseEvent e) { if (e.isPopupTrigger() || (e.getButton() == MouseEvent.BUTTON3)) { handleTypeChange(); } } @Override public void mouseClicked(MouseEvent e) { if (e.isPopupTrigger() || (e.getButton() == MouseEvent.BUTTON3)) { handleTypeChange(); } } private void handleTypeChange() { showChangeEntryTypePopupMenu(); } }); } @Override public void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); super.paintComponent(g2); } } private class FieldListener extends FocusAdapter { /* * Focus listener that fires the storeFieldAction when a TextArea * loses focus. */ @Override public void focusGained(FocusEvent e) { // Do nothing } @Override public void focusLost(FocusEvent event) { if (!event.isTemporary()) { updateField(event.getSource()); } } } private class TabListener implements ChangeListener { @Override public void stateChanged(ChangeEvent event) { // We tell the editor tab to update all its fields. // This makes sure they are updated even if the tab we // just left contained one // or more of the same fields as this one: SwingUtilities.invokeLater(() -> { Object activeTab = tabs.get(tabbed.getSelectedIndex()); if (activeTab instanceof EntryEditorTab) { ((EntryEditorTab) activeTab).updateAll(); activateVisible(); } }); } } class DeleteAction extends AbstractAction { public DeleteAction() { super(Localization.lang("Delete"), IconTheme.JabRefIcon.DELETE_ENTRY.getIcon()); putValue(Action.SHORT_DESCRIPTION, Localization.lang("Delete entry")); } @Override public void actionPerformed(ActionEvent e) { // Show confirmation dialog if not disabled: boolean goOn = panel.showDeleteConfirmationDialog(1); if (!goOn) { return; } panel.entryEditorClosing(EntryEditor.this); panel.getDatabase().removeEntry(entry); panel.markBaseChanged(); panel.getUndoManager().addEdit(new UndoableRemoveEntry(panel.getDatabase(), entry, panel)); panel.output(Localization.lang("Deleted entry")); } } class CloseAction extends AbstractAction { public CloseAction() { super(Localization.lang("Close window"), IconTheme.JabRefIcon.CLOSE.getSmallIcon()); putValue(Action.SHORT_DESCRIPTION, Localization.lang("Close window")); } @Override public void actionPerformed(ActionEvent e) { if (tabbed.getSelectedComponent() == srcPanel) { updateField(source); if (lastSourceAccepted) { panel.entryEditorClosing(EntryEditor.this); } } else { panel.entryEditorClosing(EntryEditor.this); } } } public class StoreFieldAction extends AbstractAction { public StoreFieldAction() { super("Store field value"); putValue(Action.SHORT_DESCRIPTION, "Store field value"); } @Override public void actionPerformed(ActionEvent event) { boolean movingAway = movingToDifferentEntry; movingToDifferentEntry = false; if (event.getSource() instanceof TextField) { // Storage from bibtex key field. TextField textField = (TextField) event.getSource(); String oldValue = entry.getCiteKey(); String newValue = textField.getText(); if (newValue.isEmpty()) { newValue = null; } if (((oldValue == null) && (newValue == null)) || (Objects.equals(oldValue, newValue))) { return; // No change. } String cleaned = LabelPatternUtil.checkLegalKey(newValue, Globals.prefs.getBoolean(JabRefPreferences.ENFORCE_LEGAL_BIBTEX_KEY)); if ((cleaned == null) || cleaned.equals(newValue)) { textField.setValidBackgroundColor(); } else { JOptionPane.showMessageDialog(frame, Localization.lang("Invalid BibTeX key"), Localization.lang("Error setting field"), JOptionPane.ERROR_MESSAGE); textField.setInvalidBackgroundColor(); return; } boolean isDuplicate = panel.getDatabase().setCiteKeyForEntry(entry, newValue); if (newValue == null) { warnEmptyBibtexkey(); } else { if (isDuplicate) { warnDuplicateBibtexkey(); } else { panel.output(Localization.lang("BibTeX key is unique.")); } } // Add an UndoableKeyChange to the baseframe's undoManager. UndoableKeyChange undoableKeyChange = new UndoableKeyChange(panel.getDatabase(), entry, oldValue, newValue); if (TimeStamp.updateTimeStampIsSet(Globals.prefs)) { NamedCompound ce = new NamedCompound(undoableKeyChange.getPresentationName()); ce.addEdit(undoableKeyChange); TimeStamp.doUpdateTimeStamp(entry, Globals.prefs) .ifPresent(fieldChange -> ce.addEdit(new UndoableFieldChange(fieldChange))); ce.end(); panel.getUndoManager().addEdit(ce); } else { panel.getUndoManager().addEdit(undoableKeyChange); } textField.setValidBackgroundColor(); if (textField.getTextComponent().hasFocus()) { textField.setActiveBackgroundColor(); } updateSource(); panel.markBaseChanged(); } else if (event.getSource() instanceof FieldEditor) { String toSet = null; FieldEditor fieldEditor = (FieldEditor) event.getSource(); boolean set; // Trim the whitespace off this value String currentText = fieldEditor.getText(); String trim = currentText.trim(); if (!trim.isEmpty()) { toSet = trim; } // We check if the field has changed, since we don't want to // mark the base as changed unless we have a real change. if (toSet == null) { set = entry.hasField(fieldEditor.getFieldName()); } else { set = !((entry.hasField(fieldEditor.getFieldName())) && toSet.equals(entry.getField(fieldEditor.getFieldName()))); } if (set) { try { // The following statement attempts to write the // new contents into a StringWriter, and this will // cause an IOException if the field is not // properly formatted. If that happens, the field // is not stored and the textarea turns red. if (toSet != null) { new LatexFieldFormatter(LatexFieldFormatterPreferences.fromPreferences(Globals.prefs)) .format(toSet, fieldEditor.getFieldName()); } String oldValue = entry.getField(fieldEditor.getFieldName()); if (toSet == null) { entry.clearField(fieldEditor.getFieldName()); } else { entry.setField(fieldEditor.getFieldName(), toSet); } fieldEditor.setValidBackgroundColor(); // See if we need to update an AutoCompleter instance: AutoCompleter<String> aComp = panel.getAutoCompleters().get(fieldEditor.getFieldName()); if (aComp != null) { aComp.addBibtexEntry(entry); } // Add an UndoableFieldChange to the baseframe's undoManager. UndoableFieldChange undoableFieldChange = new UndoableFieldChange(entry, fieldEditor.getFieldName(), oldValue, toSet); if (TimeStamp.updateTimeStampIsSet(Globals.prefs)) { NamedCompound ce = new NamedCompound(undoableFieldChange.getPresentationName()); ce.addEdit(undoableFieldChange); TimeStamp.doUpdateTimeStamp(entry, Globals.prefs) .ifPresent(fieldChange -> ce.addEdit(new UndoableFieldChange(fieldChange))); ce.end(); panel.getUndoManager().addEdit(ce); } else { panel.getUndoManager().addEdit(undoableFieldChange); } updateSource(); panel.markBaseChanged(); } catch (IllegalArgumentException ex) { JOptionPane.showMessageDialog(frame, Localization.lang("Error") + ": " + ex.getMessage(), Localization.lang("Error setting field"), JOptionPane.ERROR_MESSAGE); fieldEditor.setInvalidBackgroundColor(); LOGGER.debug("Error setting field", ex); } } else { // set == false // We set the field and label color. fieldEditor.setValidBackgroundColor(); } if (fieldEditor.getTextComponent().hasFocus()) { fieldEditor.setBackground(GUIGlobals.ACTIVE_EDITOR_COLOR); } } else if (source.isEditable() && !source.getText().equals(lastSourceStringAccepted)) { validEntry = storeSource(); } // Make sure we scroll to the entry if it moved in the table. // Should only be done if this editor is currently showing: if (!movingAway && isShowing()) { SwingUtilities.invokeLater(() -> { final int row = panel.getMainTable().findEntry(entry); if (row >= 0) { panel.getMainTable().ensureVisible(row); } }); } } } class SwitchLeftAction extends AbstractAction { public SwitchLeftAction() { super("Switch to the panel to the left"); } @Override public void actionPerformed(ActionEvent e) { int i = tabbed.getSelectedIndex(); tabbed.setSelectedIndex(i > 0 ? i - 1 : tabbed.getTabCount() - 1); activateVisible(); } } class SwitchRightAction extends AbstractAction { public SwitchRightAction() { super("Switch to the panel to the right"); } @Override public void actionPerformed(ActionEvent e) { int i = tabbed.getSelectedIndex(); tabbed.setSelectedIndex(i < (tabbed.getTabCount() - 1) ? i + 1 : 0); activateVisible(); } } class NextEntryAction extends AbstractAction { public NextEntryAction() { super(Localization.lang("Next entry"), IconTheme.JabRefIcon.DOWN.getIcon()); putValue(Action.SHORT_DESCRIPTION, Localization.lang("Next entry")); } @Override public void actionPerformed(ActionEvent e) { int thisRow = panel.getMainTable().findEntry(entry); int newRow; if ((thisRow + 1) < panel.getDatabase().getEntryCount()) { newRow = thisRow + 1; } else if (thisRow > 0) { newRow = 0; } else { return; // newRow is still -1, so we can assume the database has // only one entry. } scrollTo(newRow); panel.getMainTable().setRowSelectionInterval(newRow, newRow); } } class PrevEntryAction extends AbstractAction { public PrevEntryAction() { super(Localization.lang("Previous entry"), IconTheme.JabRefIcon.UP.getIcon()); putValue(Action.SHORT_DESCRIPTION, Localization.lang("Previous entry")); } @Override public void actionPerformed(ActionEvent e) { int thisRow = panel.getMainTable().findEntry(entry); int newRow; if ((thisRow - 1) >= 0) { newRow = thisRow - 1; } else if (thisRow != (panel.getDatabase().getEntryCount() - 1)) { newRow = panel.getDatabase().getEntryCount() - 1; } else { return; // newRow is still -1, so we can assume the database has // only one entry. } scrollTo(newRow); panel.getMainTable().setRowSelectionInterval(newRow, newRow); } } class GenerateKeyAction extends AbstractAction { public GenerateKeyAction() { super(Localization.lang("Generate BibTeX key"), IconTheme.JabRefIcon.MAKE_KEY.getIcon()); putValue(Action.SHORT_DESCRIPTION, Localization.lang("Generate BibTeX key")); } @Override public void actionPerformed(ActionEvent e) { // 1. get BibEntry for selected index (already have) // 2. update label // Store the current edit in case this action is called during the // editing of a field: storeCurrentEdit(); // This is a partial clone of net.sf.jabref.gui.BasePanel.setupActions().new AbstractWorker() {...}.run() // this updates the table automatically, on close, but not // within the tab String oldValue = entry.getCiteKey(); if (oldValue != null) { if (Globals.prefs.getBoolean(JabRefPreferences.AVOID_OVERWRITING_KEY)) { panel.output(Localization.lang("Not overwriting existing key. To change this setting, open Options -> Prefererences -> BibTeX key generator")); return; } else if (Globals.prefs.getBoolean(JabRefPreferences.WARN_BEFORE_OVERWRITING_KEY)) { CheckBoxMessage cbm = new CheckBoxMessage(Localization.lang("The current BibTeX key will be overwritten. Continue?"), Localization.lang("Disable this confirmation dialog"), false); int answer = JOptionPane.showConfirmDialog(frame, cbm, Localization.lang("Overwrite key"), JOptionPane.YES_NO_OPTION); if (cbm.isSelected()) { Globals.prefs.putBoolean(JabRefPreferences.WARN_BEFORE_OVERWRITING_KEY, false); } if (answer == JOptionPane.NO_OPTION) { // Ok, break off the operation. return; } } } LabelPatternUtil.makeLabel(panel.getBibDatabaseContext().getMetaData(), panel.getDatabase(), entry, LabelPatternPreferences.fromPreferences(Globals.prefs)); // Store undo information: panel.getUndoManager().addEdit(new UndoableKeyChange(panel.getDatabase(), entry, oldValue, entry.getCiteKey())); // here we update the field String bibtexKeyData = entry.getCiteKey(); setField(BibEntry.KEY_FIELD, bibtexKeyData); updateSource(); panel.markBaseChanged(); } } class UndoAction extends AbstractAction { public UndoAction() { super("Undo", IconTheme.JabRefIcon.UNDO.getIcon()); putValue(Action.SHORT_DESCRIPTION, "Undo"); } @Override public void actionPerformed(ActionEvent e) { panel.runCommand(Actions.UNDO); } } class RedoAction extends AbstractAction { public RedoAction() { super("Redo", IconTheme.JabRefIcon.REDO.getIcon()); putValue(Action.SHORT_DESCRIPTION, "Redo"); } @Override public void actionPerformed(ActionEvent e) { panel.runCommand(Actions.REDO); } } class SaveDatabaseAction extends AbstractAction { public SaveDatabaseAction() { super("Save database"); } @Override public void actionPerformed(ActionEvent e) { Object activeTab = tabs.get(tabbed.getSelectedIndex()); if (activeTab instanceof EntryEditorTab) { // Normal panel. EntryEditorTab tab = (EntryEditorTab) activeTab; FieldEditor fieldEditor = tab.getActive(); fieldEditor.clearAutoCompleteSuggestion(); updateField(fieldEditor); } else { // Source panel. updateField(activeTab); } if (validEntry) { panel.runCommand(Actions.SAVE); } } } private void warnDuplicateBibtexkey() { panel.output(Localization.lang("Duplicate BibTeX key") + ". " + Localization.lang("Grouping may not work for this entry.")); } private void warnEmptyBibtexkey() { panel.output(Localization.lang("Empty BibTeX key") + ". " + Localization.lang("Grouping may not work for this entry.")); } public AbstractAction getNextEntryAction() { return nextEntryAction; } public AbstractAction getPrevEntryAction() { return prevEntryAction; } public SwitchLeftAction getSwitchLeftAction() { return switchLeftAction; } public SwitchRightAction getSwitchRightAction() { return switchRightAction; } public SaveDatabaseAction getSaveDatabaseAction() { return saveDatabaseAction; } public HelpAction getHelpAction() { return helpAction; } public GenerateKeyAction getGenerateKeyAction() { return generateKeyAction; } public StoreFieldAction getStoreFieldAction() { return storeFieldAction; } private class AutoLinkAction extends AbstractAction { public AutoLinkAction() { putValue(Action.SMALL_ICON, IconTheme.JabRefIcon.AUTO_FILE_LINK.getIcon()); putValue(Action.SHORT_DESCRIPTION, Localization.lang("Automatically set file links for this entry") + " (Alt-F)"); } @Override public void actionPerformed(ActionEvent event) { FileListEditor localFileListEditor = EntryEditor.this.fileListEditor; if (localFileListEditor == null) { LOGGER.warn("No file list editor found."); } else { localFileListEditor.autoSetLinks(); } } } }
package org.broad.igv.sam.cram; import htsjdk.samtools.SAMSequenceRecord; import htsjdk.samtools.cram.ref.CRAMReferenceSource; import org.apache.log4j.Logger; import org.broad.igv.feature.Chromosome; import org.broad.igv.feature.genome.Genome; import org.broad.igv.feature.genome.GenomeManager; import org.broad.igv.prefs.Constants; import org.broad.igv.prefs.PreferencesManager; import org.broad.igv.ui.IGV; import org.broad.igv.event.GenomeChangeEvent; import org.broad.igv.event.IGVEventBus; import org.broad.igv.event.IGVEventObserver; import org.broad.igv.util.ObjectCache; import java.io.IOException; /** * Provide a reference sequence for CRAM decompression. Note the rule for MD5 calculation. * <p> * M5 (sequence MD5 checksum) field of @SQ sequence record in the BAM header is required and UR (URI * for the sequence fasta optionally gzipped file) field is strongly advised. The rule for calculating MD5 is * to remove any non-base symbols (like \n, sequence name or length and spaces) and upper case the rest. */ public class IGVReferenceSource implements CRAMReferenceSource { private static Logger log = Logger.getLogger(IGVReferenceSource.class); static ObjectCache<String, byte[]> cachedSequences = new ObjectCache<String, byte[]>(5); static GenomeChangeListener genomeChangeListener; @Override public synchronized byte[] getReferenceBases(SAMSequenceRecord record, boolean tryNameVariants) { final String name = record.getSequenceName(); //System.out.println("Get ref " + name + " " + Thread.currentThread().getName()); final Genome currentGenome = GenomeManager.getInstance().getCurrentGenome(); String chrName = currentGenome.getCanonicalChrName(name); Chromosome chromosome = currentGenome.getChromosome(chrName); byte[] bases = cachedSequences.get(chrName); if (bases == null) { try { if (bases == null) { if (IGV.hasInstance()) IGV.getInstance().setStatusBarMessage("Loading sequence"); bases = currentGenome.getSequence(chrName, 0, chromosome.getLength(), false); // CRAM spec requires upper case for (int i = 0; i < bases.length; i++) { if (bases[i] >= 97) bases[i] -= 32; } } cachedSequences.put(chrName, bases); } finally { if (IGV.hasInstance()) IGV.getInstance().setStatusBarMessage(""); } } return bases; } public static class GenomeChangeListener implements IGVEventObserver { @Override public void receiveEvent(Object event) { cachedSequences.clear(); } } static { genomeChangeListener = new GenomeChangeListener(); IGVEventBus.getInstance().subscribe(GenomeChangeEvent.class, genomeChangeListener); } }
package org.gertje.abacus.nodevisitors; import org.gertje.abacus.*; import org.gertje.abacus.nodes.*; import org.gertje.abacus.symboltable.SymbolTable; import java.math.BigDecimal; import java.math.BigInteger; public class Simplifier extends AbstractNodeVisitor<AbstractNode, SimplificationException> { /** * De symboltable met de variabelen en de functies. */ private SymbolTable symbolTable; /** * De nodefactory die we gebruiken om nodes aan te maken. */ private NodeFactory nodeFactory; /** * De evaluator die we gebruiken om nodes te vereenvoudigen waar mogelijk. */ private Evaluator evaluator; /** * Constructor. */ public Simplifier(SymbolTable symbolTable, NodeFactory nodeFactory) { this.symbolTable = symbolTable; this.nodeFactory = nodeFactory; // Maak een evaluator aan om de nodes te vereenvoudigen. evaluator = new Evaluator(symbolTable); } public AbstractNode simplify(AbstractNode node) throws SimplificationException { return node.accept(this); } @Override public AbstractNode visit(AddNode node) throws SimplificationException { AbstractNode lhs = node.getLhs(); AbstractNode rhs = node.getRhs(); // Vereenvoudig de nodes indien mogelijk. lhs = lhs.accept(this); node.setLhs(lhs); rhs = rhs.accept(this); node.setRhs(rhs); // Wanneer een van beide zijden niet constant is kunnen we de node niet verder vereenvoudigen. Geef de huidige // instantie terug. if (!lhs.getIsConstant() || !rhs.getIsConstant()) { return node; } // Wanneer we hier komen zijn beide zijden constant. Vereenvoudig de node. Object result; try { result = evaluator.evaluate(node); } catch (EvaluationException e) { throw new SimplificationException(e.getMessage(), node); } if (node.getType().equals(BigDecimal.class)) { return nodeFactory.createFloatNode((BigDecimal) result, node.getToken()); } else if (node.getType().equals(BigInteger.class)) { return nodeFactory.createIntegerNode((BigInteger) result, node.getToken()); } else { return nodeFactory.createStringNode((String) result, node.getToken()); } } @Override public AbstractNode visit(AndNode node) throws SimplificationException { AbstractNode lhs = node.getLhs(); AbstractNode rhs = node.getRhs(); // Vereenvoudig de nodes indien mogelijk. lhs = lhs.accept(this); node.setLhs(lhs); rhs = rhs.accept(this); node.setRhs(rhs); try { // Wanneer beide zijden constant zijn kunnen we de node vereenvoudigen. if (lhs.getIsConstant() && rhs.getIsConstant()) { return nodeFactory.createBooleanNode((Boolean)evaluator.evaluate(node), node.getToken()); } // Wanneer slechts de linker zijde of de rechter zijde constant is en deze naar 'false' evalueert, evalueert // de hele expressie naar false en kunnen we de node vereenvoudigen. if (lhs.getIsConstant() && !((Boolean)evaluator.evaluate(lhs)).booleanValue() || rhs.getIsConstant() && !((Boolean)evaluator.evaluate(rhs)).booleanValue()) { return nodeFactory.createBooleanNode(Boolean.FALSE, node.getToken()); } // Wanneer slechts de linker zijde of de rechter zijde constant is en deze naar 'true' evalueert, evalueert // de huidige expressie naar de niet constante expressie. if (lhs.getIsConstant() && ((Boolean)evaluator.evaluate(lhs)).booleanValue()) { return rhs; } else if (rhs.getIsConstant() && ((Boolean)evaluator.evaluate(rhs)).booleanValue()) { return lhs; } } catch (EvaluationException e) { throw new SimplificationException(e.getMessage(), node); } return node; } @Override public AbstractNode visit(AssignmentNode node) throws SimplificationException { AbstractNode lhs = node.getLhs(); AbstractNode rhs = node.getRhs(); // Vereenvoudig de nodes indien mogelijk. lhs = lhs.accept(this); node.setLhs(lhs); rhs = rhs.accept(this); node.setRhs(rhs); // We kunnen deze node niet verder vereenvoudigen, geef de node terug. return node; } @Override public AbstractNode visit(BooleanNode node) throws SimplificationException { return node; } @Override public AbstractNode visit(DateNode node) throws SimplificationException { return node; } @Override public AbstractNode visit(DivideNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(EqNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(FactorNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(FloatNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(FunctionNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(GeqNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(GtNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(IfNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(IntegerNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(LeqNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(LtNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(ModuloNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(MultiplyNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(NegativeNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(NeqNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(NotNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(NullNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(OrNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(PositiveNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(PowerNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(StatementListNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(StringNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(SubstractNode node) throws SimplificationException { return null; } @Override public AbstractNode visit(VariableNode node) throws SimplificationException { return null; } }
package org.jboss.remoting3.remote; import java.io.IOException; import java.nio.ByteBuffer; import org.jboss.remoting3.MessageCancelledException; import org.jboss.remoting3.MessageInputStream; import org.xnio.Pooled; import org.xnio.streams.BufferPipeInputStream; import static org.jboss.remoting3.remote.RemoteLogger.log; import static java.lang.Thread.holdsLock; /** * @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a> */ final class InboundMessage { final short messageId; final RemoteConnectionChannel channel; int inboundWindow; boolean streamClosed; boolean closeSent; boolean eofReceived; boolean cancelled; long remaining; static final IntIndexer<InboundMessage> INDEXER = new IntIndexer<InboundMessage>() { public int getKey(final InboundMessage argument) { return argument.messageId & 0xffff; } public boolean equals(final InboundMessage argument, final int index) { return (argument.messageId & 0xffff) == index; } }; InboundMessage(final short messageId, final RemoteConnectionChannel channel, int inboundWindow, final long maxInboundMessageSize) { this.messageId = messageId; this.channel = channel; this.inboundWindow = inboundWindow; remaining = maxInboundMessageSize; } final BufferPipeInputStream inputStream = new BufferPipeInputStream(new BufferPipeInputStream.InputHandler() { public void acknowledge(final Pooled<ByteBuffer> acked) throws IOException { doAcknowledge(acked); } public void close() throws IOException { doClose(); } }); private void doClose() { assert holdsLock(inputStream); if (streamClosed) { // idempotent return; } streamClosed = true; // on close, send close message doSendCloseMessage(); // but keep the mapping around until we receive our EOF // else just keep discarding data until the EOF comes in. } private void doSendCloseMessage() { assert holdsLock(inputStream); if (closeSent || ! channel.getConnectionHandler().isMessageClose()) { // we don't send a MESSAGE_CLOSE because broken versions will simply stop sending packets, and we won't know when the message is really gone. // the risk is that the remote side could have started a new message in the meantime, and our MESSAGE_CLOSE would kill the wrong message. // so this behavior is better than the alternative. return; } Pooled<ByteBuffer> pooled = allocate(Protocol.MESSAGE_CLOSE); boolean ok = false; try { ByteBuffer buffer = pooled.getResource(); buffer.flip(); channel.getRemoteConnection().send(pooled); ok = true; closeSent = true; } finally { if (! ok) pooled.free(); } } private void doAcknowledge(final Pooled<ByteBuffer> acked) { assert holdsLock(inputStream); if (eofReceived) { // no ack needed; also a best-effort to work around broken peers return; } final boolean badMsgSize = channel.getConnectionHandler().isFaultyMessageSize(); int consumed = acked.getResource().position(); if (! badMsgSize) consumed -= 8; // position minus header length (not including framing size) inboundWindow += consumed; Pooled<ByteBuffer> pooled = allocate(Protocol.MESSAGE_WINDOW_OPEN); boolean ok = false; try { ByteBuffer buffer = pooled.getResource(); buffer.putInt(consumed); // Open window by buffer size buffer.flip(); channel.getRemoteConnection().send(pooled); ok = true; } finally { if (! ok) pooled.free(); } } final MessageInputStream messageInputStream = new MessageInputStream() { public int read() throws IOException { synchronized (inputStream) { if (cancelled) { throw new MessageCancelledException(); } return inputStream.read(); } } public int read(final byte[] bytes, final int offs, final int length) throws IOException { synchronized (inputStream) { if (cancelled) { throw new MessageCancelledException(); } return inputStream.read(bytes, offs, length); } } public long skip(final long l) throws IOException { synchronized (inputStream) { if (cancelled) { throw new MessageCancelledException(); } return inputStream.skip(l); } } public int available() throws IOException { synchronized (inputStream) { if (cancelled) { throw new MessageCancelledException(); } return inputStream.available(); } } public void close() throws IOException { synchronized (inputStream) { if (cancelled) { throw new MessageCancelledException(); } inputStream.close(); } } }; Pooled<ByteBuffer> allocate(byte protoId) { Pooled<ByteBuffer> pooled = channel.allocate(protoId); ByteBuffer buffer = pooled.getResource(); buffer.putShort(messageId); return pooled; } void handleIncoming(Pooled<ByteBuffer> pooledBuffer) { boolean eof; boolean free = true; try { synchronized (inputStream) { ByteBuffer buffer = pooledBuffer.getResource(); final int bufRemaining = buffer.remaining(); if ((inboundWindow -= bufRemaining) < 0) { channel.getRemoteConnection().handleException(new IOException("Input overrun")); return; } if (log.isTraceEnabled()) { log.tracef("Received message (chan %08x msg %04x) (%d-%d=%d remaining)", Integer.valueOf(channel.getChannelId()), Short.valueOf(messageId), Integer.valueOf(inboundWindow + bufRemaining), Integer.valueOf(bufRemaining), Integer.valueOf(inboundWindow)); } buffer.position(buffer.position() - 1); byte flags = buffer.get(); eof = (flags & Protocol.MSG_FLAG_EOF) != 0; boolean cancelled = (flags & Protocol.MSG_FLAG_CANCELLED) != 0; if (bufRemaining > remaining) { cancelled = true; doClose(); } if (cancelled) { this.cancelled = true; // make sure it goes through inputStream.pushException(new MessageCancelledException()); } if (streamClosed) { // ignore, but keep the bits flowing if (! eof && ! closeSent) { // we don't need to acknowledge if it's EOF or if we sent a close msg since no more data is coming anyway buffer.position(buffer.limit()); // "consume" everything doAcknowledge(pooledBuffer); } } else if (! cancelled) { remaining -= bufRemaining; free = false; inputStream.push(pooledBuffer); } if (eof) { eofReceived = true; if (!streamClosed) { inputStream.pushEof(); } channel.freeInboundMessage(messageId); // if the peer is old, they might reuse the ID now regardless of us; if new, we have to send the close message to acknowledge the remainder doSendCloseMessage(); } } } finally { if (free) pooledBuffer.free(); } } void handleDuplicate() { // this method is called when the remote side forgot about us. Our mapping will have been already replaced. // We must not send anything to the peer from here on because things may be in a broken state. // Though this is a best-effort strategy as everything is screwed up in this case anyway. RemoteLogger.conn.duplicateMessageId(messageId, channel.getRemoteConnection().getChannel().getPeerAddress()); synchronized (inputStream) { if (! streamClosed) { eofReceived = true; // it wasn't really, but we should act like it was closeSent = true; // we didn't really, but we should act like we did cancelled = true; // just not the usual way... inputStream.pushException(RemoteLogger.conn.duplicateMessageIdException()); } } } void dumpState(final StringBuilder b) { b.append(" ").append(String.format("Inbound message ID %04x, window %d\n", messageId & 0xFFFF, inboundWindow)); b.append(" ").append("* flags: "); if (cancelled) b.append("cancelled "); if (closeSent) b.append("close-sent "); if (streamClosed) b.append("stream-closed "); if (eofReceived) b.append("eof-received "); b.append('\n'); } }
package org.jtrfp.trcl.coll; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.Collection; import java.util.Iterator; import java.util.Map; import java.util.Set; import java.util.WeakHashMap; import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength; import org.apache.commons.collections4.map.ReferenceMap; public final class ObjectTallyCollection<T> implements Collection<T>, Decorator<Collection<T>>{ //PROPERTIES public static final String OBJECT_TALLY = "objectTally"; private final Collection<T> delegate; private final Map<T,Integer> tallies = new ReferenceMap<T,Integer>(ReferenceStrength.WEAK,ReferenceStrength.HARD); private Map<T,WeakHashMap<PropertyChangeListener,Object>> objectTallyListeners = new ReferenceMap<T,WeakHashMap<PropertyChangeListener,Object>>(ReferenceStrength.WEAK,ReferenceStrength.HARD); public ObjectTallyCollection(Collection<T> delegate){ this.delegate = delegate; } public int getTallyOf(T objectToTally){ final Integer result = tallies.get(objectToTally); return result==null?0:result; } private void increment(T e){ Integer tally = tallies.get(e); tally = tally==null?0:tally; fireObjectTallyChange(e, tally, tally+1); tally++; tallies.put(e,tally); }//end increment private void decrement(T e){ Integer tally = tallies.get(e); tally = tally==null?0:tally; fireObjectTallyChange(e, tally, tally-1); tally if(tally<0) throw new NegativeTallyException(e); if(tally == 0) tallies.remove(e); else tallies.put(e,tally); }//end decrement private WeakHashMap<PropertyChangeListener,Object> getObjectTallyListeners(T object){ WeakHashMap<PropertyChangeListener,Object> listenerSet = objectTallyListeners.get(object); if(listenerSet == null) objectTallyListeners.put(object, listenerSet = new WeakHashMap<PropertyChangeListener,Object>()); return listenerSet; } private void fireObjectTallyChange(T object, int oldValue, int newValue){ final Set<PropertyChangeListener> listenerSet = getObjectTallyListeners(object).keySet(); final PropertyChangeEvent evt = new PropertyChangeEvent(this, OBJECT_TALLY, oldValue, newValue); for(PropertyChangeListener l:listenerSet) l.propertyChange(evt); }//end fireObjectTallyChange public boolean add(T e) { increment(e); return delegate.add(e); } public boolean addAll(Collection<? extends T> c) { for(T e:c) increment(e); return delegate.addAll(c); } public void clear() { for(T e:delegate) increment(e); delegate.clear(); } public boolean contains(Object o) { return delegate.contains(o); } public boolean containsAll(Collection<?> c) { return delegate.containsAll(c); } /* public boolean equals(Object o) { return delegate.equals(o); } */ public int hashCode() { return delegate.hashCode(); } public boolean isEmpty() { return delegate.isEmpty(); } public Iterator<T> iterator() { return delegate.iterator(); } public boolean remove(Object o) { decrement((T)o);//TODO: Risky business here. return delegate.remove(o); } public boolean removeAll(Collection<?> c) { for(Object e : c) tallies.remove(e); return delegate.removeAll(c); } public boolean retainAll(Collection<?> c) { throw new UnsupportedOperationException(); } public int size() { return delegate.size(); } public Object[] toArray() { return delegate.toArray(); } public <T> T[] toArray(T[] a) { return delegate.toArray(a); } @Override public Collection<T> getDelegate() { return delegate; } public void addObjectTallyListener(T object, PropertyChangeListener listener){ getObjectTallyListeners(object).put(listener,Void.class); } public void removeObjectTallyListener(T object, PropertyChangeListener listener){ getObjectTallyListeners(object).remove(listener); } public static final class NegativeTallyException extends IllegalStateException{ public NegativeTallyException(){super();} public NegativeTallyException(Object e) { super("Element in question: "+e); } } }//end ObjectTallyList
package org.lightmare.jpa.datasource; /** * Configuration of jdbc driver classes and database names * * @author levan * */ public class DriverConfig { // Driver class names private static final String ORACLE_DRIVER = "oracle.jdbc.OracleDriver"; private static final String MYSQL_DRIVER = "com.mysql.jdbc.Driver"; private static final String MSSQL_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; private static final String DB2_DRIVER = "com.ibm.db2.jcc.DB2Driver"; private static final String H2_DRIVER = "org.h2.Driver"; private static final String DERBY_DRIVER = "org.apache.derby.jdbc.EmbeddedDriver"; // Database names private static final String ORACLE_NAME = "oracle"; private static final String MYSQL_NAME = "mysql"; private static final String DB2_NAME = "db2"; private static final String MSSQL_NAME = "mssql"; private static final String H2_NAME = "h2"; private static final String DERBY_NAME = "derby"; /** * Caches database driver names and classes * * @author levan * */ public static enum Drivers { ORACLE("oracle", "oracle.jdbc.OracleDriver"), // Oracle MYSQL("mysql", "com.mysql.jdbc.Driver"), // MYSQL MSSQL("mssql", "com.microsoft.sqlserver.jdbc.SQLServerDriver"), // MSSQL DB2("db2", "com.ibm.db2.jcc.DB2Driver"), // DB2 H2("h2", "org.h2.Driver"), DERBY("derby", "org.apache.derby.jdbc.EmbeddedDriver"); // DERBY public String name; public String driver; private Drivers(String name, String driver) { this.name = name; this.driver = driver; } } /** * Resolves appropriate jdbc driver class name by database name * * @param name * @return {@link String} */ public static String getDriverName(String name) { if (ORACLE_NAME.equals(name)) { return ORACLE_DRIVER; } else if (MYSQL_NAME.equals(name)) { return MYSQL_DRIVER; } else if (DB2_NAME.equals(name)) { return DB2_DRIVER; } else if (MSSQL_NAME.equals(name)) { return MSSQL_DRIVER; } else if (H2_NAME.equals(name)) { return H2_DRIVER; } else if (DERBY_NAME.equals(name)) { return DERBY_DRIVER; } else { return null; } } public static boolean isOracle(String name) { return ORACLE_DRIVER.equals(name); } public static boolean isMySQL(String name) { return MYSQL_DRIVER.equals(name); } public static boolean isDB2(String name) { return DB2_DRIVER.equals(name); } public static boolean isMsSQL(String name) { return MSSQL_DRIVER.equals(name); } public static boolean isH2(String name) { return H2_DRIVER.equals(name); } public static boolean isDerby(String name) { return DERBY_DRIVER.equals(name); } }
package org.lightmare.rest.providers; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import javax.ws.rs.container.ContainerRequestContext; import javax.ws.rs.core.Cookie; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.UriInfo; import javax.ws.rs.ext.MessageBodyReader; import org.glassfish.jersey.internal.util.collection.MultivaluedStringMap; import org.glassfish.jersey.message.MessageBodyWorkers; import org.glassfish.jersey.server.model.Parameter; import org.lightmare.utils.CollectionUtils; import org.lightmare.utils.IOUtils; import org.lightmare.utils.ObjectUtils; import org.lightmare.utils.reflect.MetaUtils; import org.lightmare.utils.rest.RequestUtils; /** * Translates REST request parameters to java objects * * @author Levan Tsinadze * @since 0.0.75-SNAPSHOT */ public class ParamBuilder { // Consumption media type private MediaType mediaType; // Parameters of request private List<Parameter> parameters; // Message body initializer provided by framework private MessageBodyWorkers workers; // Request context from framework private ContainerRequestContext request; // HTTP headers of request private MultivaluedMap<String, String> httpHeaders; // URI parameters of request private MultivaluedMap<String, String> uriParams; // Message decoder provided by framework private MessageBodyReader<?> reader; // Check flag of message stream private boolean check; // List of parameters private List<Object> paramsList; // Default length of parameters list (used for MultivaluedMap) private static final int PARAM_VALIES_LENGTH = 1; /** * Private constructor to avoid class initialization from outside */ private ParamBuilder() { } public ParamBuilder(MediaType mediaType, List<Parameter> parameters, MessageBodyWorkers workers, ContainerRequestContext request) { this.mediaType = mediaType; this.parameters = parameters; this.workers = workers; this.request = request; } /** * Creates error message if one of the necessary fields in null * * @return String * @throws IOException */ private String errorOnBuild() throws IOException { String errorMessage; String errorPrefix = "Could not initialize "; String errorClass = this.getClass().getName(); String errorReasonPrefix = " caouse"; String errorReasonSuffix = "is null"; String errorMessageBody; if (mediaType == null) { errorMessageBody = "mediaType"; } else if (parameters == null) { errorMessageBody = "parameters"; } else if (workers == null) { errorMessageBody = "workers"; } else if (request == null) { errorMessageBody = "request"; } else { throw new IOException("Could not find null value"); } errorMessage = new StringBuilder().append(errorPrefix) .append(errorClass).append(errorReasonPrefix) .append(errorMessageBody).append(errorReasonSuffix).toString(); return errorMessage; } /** * Check if one of the necessary fields in null and if it is throws * {@link IOException} with generated error message * * @return <code>boolean</code> * @throws IOException */ private boolean checkOnBuild() throws IOException { boolean valid = ObjectUtils.notNullAll(mediaType, parameters, workers, request); if (ObjectUtils.notTrue(valid)) { String errorMessage = errorOnBuild(); throw new IOException(errorMessage); } return valid; } /** * Checks if {@link ContainerRequestContext} has not entity and has not * available {@link InputStream} (entity stream) * * @return <code>boolean</code> * @throws IOException */ private boolean check() throws IOException { return ObjectUtils.notTrue(request.hasEntity()) && IOUtils.notAvailable(request.getEntityStream()); } /** * Copies content of passed {@link MultivaluedMap} "from" to the * {@link MultivaluedMap} "to" * * @param from * @param to */ private void copyAll(MultivaluedMap<String, String> from, MultivaluedMap<String, String> to) { for (Map.Entry<String, List<String>> entry : from.entrySet()) { to.addAll(entry.getKey(), entry.getValue()); } } /** * Adds all elements from passed {@link MultivaluedMap} "from" to * {@link MultivaluedMap} "to" * * @param from * @param to */ private void addAll(MultivaluedMap<String, String> from, MultivaluedMap<String, String> to) { if (CollectionUtils.valid(from)) { copyAll(from, to); } } /** * Extracts all parameters from {@link ContainerRequestContext} object * * @param request * @return {@link MultivaluedMap}<String, String> */ private MultivaluedMap<String, String> extractParameters( ContainerRequestContext request) { MultivaluedMap<String, String> params = new MultivaluedStringMap(); MultivaluedMap<String, String> exts; boolean decode = Boolean.TRUE; UriInfo uriInfo = request.getUriInfo(); exts = request.getHeaders(); addAll(exts, params); exts = uriInfo.getPathParameters(decode); addAll(exts, params); exts = uriInfo.getQueryParameters(decode); addAll(exts, params); Map<String, Cookie> cookies = request.getCookies(); if (CollectionUtils.valid(cookies)) { for (Map.Entry<String, Cookie> entry : cookies.entrySet()) { params.putSingle(entry.getKey(), entry.getValue().toString()); } } return params; } /** * Converts {@link Parameter} to {@link InputStream} or {@link List} of * {@link InputStream} by {@link Parameter} nature * * @param parameter * @return {@link Object} */ private Object getEntityStream(Parameter parameter) { Object stream; List<String> paramValues = uriParams.get(parameter.getSourceName()); String value; if (CollectionUtils.valid(paramValues)) { if (paramValues.size() == PARAM_VALIES_LENGTH) { value = CollectionUtils.getFirst(paramValues); stream = RequestUtils.textToStream(value); } else { stream = RequestUtils.textsToStreams(paramValues); } } else { stream = null; } return stream; } /** * Reads {@link InputStream} from passed {@link ContainerRequestContext} for * associated {@link Parameter} instance * * @param request * @param parameter * @return {@link Object} */ private Object getEntityStream(ContainerRequestContext request, Parameter parameter) { Object entityStream; if (check) { entityStream = getEntityStream(parameter); } else { entityStream = request.getEntityStream(); } return entityStream; } /** * Checks availability of passed request {@link InputStream} and * {@link Parameter} instances * * @param entityStream * @param parameter * @return <code>boolean</code> */ private boolean available(InputStream entityStream, Parameter parameter) { return ObjectUtils.notNullAll(reader, entityStream) && reader.isReadable(parameter.getRawType(), parameter.getType(), parameter.getAnnotations(), mediaType); } /** * Closes passed entity {@link InputStream} if reading is finished * * @param entityStream * @throws IOException */ private void close(InputStream entityStream) throws IOException { if (check) { IOUtils.close(entityStream); } } /** * Extracts parameter from passed {@link InputStream} (writes appropriate * value to {@link Object} instance) * * @param parameter * @param entityStream * @return {@link Object} * @throws IOException */ @SuppressWarnings("unchecked") private Object extractParam(Parameter parameter, InputStream entityStream) throws IOException { Object param; try { param = reader.readFrom( ObjectUtils.cast(parameter.getRawType(), Class.class), parameter.getType(), parameter.getAnnotations(), mediaType, httpHeaders, entityStream); } finally { close(entityStream); } return param; } private void addParam(Object param) { if (ObjectUtils.notNull(param)) { paramsList.add(param); } } /** * Initializes and adds null parameter to {@link List} of parameters * * @param parameter */ private void addNullParam(Parameter parameter) { Class<?> paramType = parameter.getRawType(); Object nullParam; if (paramType.isPrimitive()) { nullParam = MetaUtils.getDefault(paramType); } else { nullParam = null; } paramsList.add(nullParam); } /** * Reads from {@link InputStream} to java {@link Object} instance * * @param entityStream * @param parameter * @throws IOException */ private void readFromStream(InputStream entityStream, Parameter parameter) throws IOException { boolean valid = available(entityStream, parameter); if (valid) { Object param = extractParam(parameter, entityStream); addParam(param); } } /** * Reads from {@link InputStream} or {@link List} of {@link InputStream} in * case that parameters are multi valued * * @param stream * @param parameter * @throws IOException */ private void fillParamList(Object stream, Parameter parameter) throws IOException { InputStream entityStream; if (stream instanceof InputStream) { entityStream = ObjectUtils.cast(stream, InputStream.class); readFromStream(entityStream, parameter); } else if (stream instanceof List) { List<InputStream> streamsList = ObjectUtils.cast(stream); Iterator<InputStream> streams = streamsList.iterator(); while (streams.hasNext()) { entityStream = streams.next(); readFromStream(entityStream, parameter); } } } /** * Extracts parameters from {@link ContainerRequestContext} instance * * @return {@link List}<Object> * @throws IOException */ public List<Object> extractParams() throws IOException { paramsList = new ArrayList<Object>(); check = check(); httpHeaders = request.getHeaders(); uriParams = extractParameters(request); Object stream; for (Parameter parameter : parameters) { reader = RequestUtils.getReader(workers, parameter, mediaType); stream = getEntityStream(request, parameter); if (ObjectUtils.notNull(stream)) { fillParamList(stream, parameter); } else { addNullParam(parameter); } } return paramsList; } /** * Builder class to configure and initialize {@link ParamBuilder} instance * * @author Levan Tsinadze * @since 0.0.75-SNAPSHOT */ public static final class Builder { // Instance of initialized ParamBuilder class for configuration private ParamBuilder target; public Builder() { target = new ParamBuilder(); } /** * Adds {@link MediaType} necessary parameter * * @param mediaType * @return {@link Builder} */ public ParamBuilder.Builder setMediaType(MediaType mediaType) { target.mediaType = mediaType; return this; } /** * Adds {@link List}<Parameter> necessary parameter * * @param parameters * @return {@link Builder} */ public ParamBuilder.Builder setParameters(List<Parameter> parameters) { target.parameters = parameters; return this; } /** * Adds {@link MessageBodyWorkers} necessary parameter * * @param workers * @return {@link Builder} */ public ParamBuilder.Builder setWorkers(MessageBodyWorkers workers) { target.workers = workers; return this; } /** * Adds {@link ContainerRequestContext} necessary parameter * * @param request * @return {@link Builder} */ public ParamBuilder.Builder setRequest(ContainerRequestContext request) { target.request = request; return this; } public ParamBuilder build() throws IOException { // TODO Check if there is a another way to create ParamBuilder // instance or // checks all parameters not to be null target.checkOnBuild(); return target; } } }
package org.realityforge.tarrabah; import javax.inject.Inject; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.ChannelPipelineFactory; import org.jboss.netty.channel.Channels; import org.jboss.netty.handler.codec.frame.DelimiterBasedFrameDecoder; import org.jboss.netty.handler.codec.frame.Delimiters; public class SyslogTCPServer extends AbstractTCPServer { private boolean _nullTerminate; @Inject private SyslogHandler _syslogHandler; protected ChannelPipelineFactory newPipelineFactory() { return new ChannelPipelineFactory() { public ChannelPipeline getPipeline() throws Exception { final ChannelBuffer[] delimiter = _nullTerminate ? Delimiters.nulDelimiter() : Delimiters.lineDelimiter(); _syslogHandler = new SyslogHandler(); return Channels.pipeline( new DelimiterBasedFrameDecoder( 2 * 1024 * 1024, delimiter ), _syslogHandler ); } }; } }
package org.robolectric.res; public class PackageResourceLoader extends XResourceLoader { private final ResourcePath resourcePath; public PackageResourceLoader(ResourcePath resourcePath) { this(resourcePath, new ResourceExtractor(resourcePath)); } public PackageResourceLoader(ResourcePath resourcePath, ResourceIndex resourceIndex) { super(resourceIndex); this.resourcePath = resourcePath; } void doInitialize() { try { loadEverything(); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } } private void loadEverything() throws Exception { System.out.println("DEBUG: Loading resources for " + resourcePath.getPackageName() + " from " + resourcePath.resourceBase + "..."); DocumentLoader documentLoader = new DocumentLoader(resourcePath); documentLoader.load("values", new ValueResourceLoader(data, "/resources/bool", "bool", ResType.BOOLEAN), new ValueResourceLoader(data, "/resources/color", "color", ResType.COLOR), new ValueResourceLoader(data, "/resources/dimen", "dimen", ResType.DIMEN), new ValueResourceLoader(data, "/resources/item[@type='dimen']", "dimen", ResType.DIMEN), new ValueResourceLoader(data, "/resources/integer", "integer", ResType.INTEGER), new ValueResourceLoader(data, "/resources/integer-array", "array", ResType.INTEGER_ARRAY), new ValueResourceLoader(data, "/resources/item", "layout", ResType.LAYOUT), new PluralResourceLoader(pluralsData), new ValueResourceLoader(data, "/resources/string", "string", ResType.CHAR_SEQUENCE), new ValueResourceLoader(data, "/resources/item[@type='string']", "string", ResType.CHAR_SEQUENCE), new ValueResourceLoader(data, "/resources/string-array", "array", ResType.CHAR_SEQUENCE_ARRAY), new AttrResourceLoader(data), new StyleResourceLoader(data) ); documentLoader.load("layout", new OpaqueFileLoader(data, "layout"), new XmlFileLoader(xmlDocuments, "layout")); documentLoader.load("menu", new MenuLoader(menuData), new XmlFileLoader(xmlDocuments, "menu")); documentLoader.load("drawable", new OpaqueFileLoader(data, "drawable"), new XmlFileLoader(xmlDocuments, "drawable")); documentLoader.load("anim", new OpaqueFileLoader(data, "anim"), new XmlFileLoader(xmlDocuments, "anim")); documentLoader.load("animator", new OpaqueFileLoader(data, "animator"), new XmlFileLoader(xmlDocuments, "animator")); documentLoader.load("color", new ColorResourceLoader(data), new XmlFileLoader(xmlDocuments, "color")); documentLoader.load("xml", new PreferenceLoader(preferenceData), new XmlFileLoader(xmlDocuments, "xml")); new DrawableResourceLoader(drawableData).findDrawableResources(resourcePath); new RawResourceLoader(resourcePath).loadTo(rawResources); loadOtherResources(resourcePath); } protected void loadOtherResources(ResourcePath resourcePath) { } @Override public String toString() { return "PackageResourceLoader{" + "resourcePath=" + resourcePath + '}'; } @Override public boolean providesFor(String namespace) { return resourcePath.getPackageName().equals(namespace); } }
package org.semanticweb.yars2.rdfxml; import java.io.BufferedWriter; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.URISyntaxException; import java.net.URL; import java.util.Iterator; import java.util.NoSuchElementException; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.TimeUnit; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.semanticweb.yars.nx.Node; import org.semanticweb.yars.nx.Nodes; import org.semanticweb.yars.nx.Resource; import org.semanticweb.yars.nx.parser.Callback; import org.semanticweb.yars.nx.parser.ParseException; import org.semanticweb.yars.nx.util.NxUtil; import org.semanticweb.yars.util.CallbackBlockingQueue; import org.semanticweb.yars.util.CallbackNxBufferedWriter; import org.xml.sax.SAXException; /** * RDFXMLParser... for... you guessed it... parsing RDF/XML * Based on SAXParser. Default behaviour creates a parsing thread * which fills a BlockingQueue and is consumed externally through the * iterator model. * * Can use custom CallBack which will not use a seperate thread for * parsing and which does not use iterator methods. * * @author aidhog * */ public class RDFXMLParser implements Iterator<Node[]> { private BlockingQueue<Node[]> _q = null; private boolean _done = false; private Exception _e = null; private ParserThread _pt = null; private Node[] _current = null; private Resource _con = null; public static final int DEFAULT_BUFFER = 1000; public static final int TIME_OUT = 1000; //1 sec // private static final Header[] _headers = { // new Header("Accept", "application/rdf+xml"), // new Header("User-Agent", "nxparser/java"), private SAXParser _parser; { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(true); factory.setValidating(false); try { _parser = factory.newSAXParser(); } catch (ParserConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } } /** * Short default constructor. * */ public RDFXMLParser(InputStream in, String baseURI) throws ParseException, IOException { this(in, false, true, baseURI, DEFAULT_BUFFER); } /** * Short default constructor. * */ public RDFXMLParser(InputStream in, boolean strict, boolean skolemise, String baseURI) throws ParseException, IOException { this(in, strict, skolemise, baseURI, DEFAULT_BUFFER); } /** * Default constructor. Creates a BlockingCallBack instance, whose buffer is filled * by a parser thread and consumed by this instance using the iterator model. */ public RDFXMLParser(InputStream in, boolean strict, boolean skolemise, String baseURI, int buffer) throws ParseException, IOException { // SAXParserFactory factory = SAXParserFactory.newInstance(); // factory.setNamespaceAware(true); // factory.setValidating(strict); try { // SAXParser saxParser = factory.newSAXParser(); _q = new ArrayBlockingQueue<Node[]>(buffer); CallbackBlockingQueue bcb = new CallbackBlockingQueue(_q); _pt = new ParserThread(_parser, in, new RDFXMLParserBase(baseURI, bcb, skolemise),_q); _pt.start(); } catch (Throwable err) { err.printStackTrace (); } } /** * Constructor given Callback. * Interaction outside of iterator model but analagous to NxParser :(. * */ public RDFXMLParser(InputStream in, boolean strict, boolean skolemise, String baseURI, Callback c) throws ParseException, IOException { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(true); factory.setValidating(strict); try { SAXParser saxParser = factory.newSAXParser(); saxParser.parse(in, new RDFXMLParserBase(baseURI, c, skolemise)); } catch (Throwable err) { err.printStackTrace (); } } /** * Constructor given Callback. * Interaction outside of iterator model but analagous to NxParser :(. * Produces quadruples using the provided context. * */ public RDFXMLParser(InputStream in, boolean strict, boolean skolemise, String baseURI, Callback c, Resource con) throws ParseException, IOException { _con = con; SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(true); factory.setValidating(strict); try { SAXParser saxParser = factory.newSAXParser(); saxParser.parse(in, new RDFXMLParserBase(baseURI, c, skolemise, con)); } catch (Throwable err) { err.printStackTrace (); } } /** * Constructor given Callback and URL. * Interaction outside of iterator model but analogous to NxParser :(. * */ // public RDFXMLParser(URL u, boolean strict, boolean skolemise, Callback c) throws ParseException, IOException { // this(u, strict, skolemise,u.toString(), c, false, TIME_OUT); // /** // * Constructor given Callback and URL. // * Interaction outside of iterator model but analogous to NxParser :(. // * // */ // public RDFXMLParser(URL u, boolean strict, boolean skolemise, String baseURI, Callback c, boolean writeQuads) throws ParseException, IOException { // this(u, strict, skolemise,u.toString(), c, writeQuads, TIME_OUT); // /** // * Constructor given Callback and URL if baseURI different from URL. // * Interaction outside of iterator model but analogous to NxParser :(. // * @throws SAXException // * @throws ParserConfigurationException // * // * @TODO doesn't parse my bloody file, UTF error // */ // public RDFXMLParser(URL u, boolean strict, boolean skolemise, String baseURI, Callback c, boolean writeQuads, int timeOut) throws ParseException, IOException { // this(u, strict, skolemise, baseURI, c, writeQuads, timeOut, Long.MAX_VALUE); // /** // * Constructor given Callback and URL if baseURI different from URL. // * Interaction outside of iterator model but analogous to NxParser :(. // * @throws SAXException // * @throws ParserConfigurationException // * // * @TODO doesn't parse my bloody file, UTF error // */ // public RDFXMLParser(URL u, boolean strict, boolean skolemise, String baseURI, Callback c, boolean writeQuads, int timeOut, long maxLength) throws ParseException, IOException { // //took Andreas' code from NxParser // //could use saxParer.parse(String url, DefaultHandler blah) // _con = new Resource(u.toString()); // HttpClient http = new HttpClient(); // if (System.getProperty("http.proxyHost") != null && System.getProperty("http.proxyPort") != null) { // HostConfiguration hc = http.getHostConfiguration(); // hc.setProxy(System.getProperty("http.proxyHost"), Integer.parseInt(System.getProperty("http.proxyPort"))); // http.getHttpConnectionManager().getParams().setConnectionTimeout(timeOut); // http.getHttpConnectionManager().getParams().setSoTimeout(timeOut); // GetMethod gm = new GetMethod(u.toString()); // InputStream is = null; // int status = -1; // boolean rdfxml = false; // for (Header h: _headers) { // gm.setRequestHeader(h); //// try { // http.executeMethod(gm); // String furi = gm.getURI().toString(); // if(baseURI==null) // baseURI = furi; // _con = new Resource(gm.getURI().toString()); // status = gm.getStatusCode(); // Header[] head = gm.getResponseHeaders("Content-Type"); // for (Header h : head) { // String tmp = h.getValue(); // if (tmp.contains("application/rdf+xml")) { // rdfxml = true; // Header[] length = gm.getResponseHeaders("Content-Length"); // if(length!=null) for (Header h : length) { // String tmp = h.getValue(); // try{ // long len = Long.parseLong(tmp); // if(len>maxLength){ // throw new IOException("Content-Length "+tmp+" exceeds internal max specified length of "+maxLength+"."); // }catch(NumberFormatException nfe){ // if (status == 200 && rdfxml) { // is = gm.getResponseBodyAsStream(); // SAXParserFactory factory = SAXParserFactory.newInstance(); // factory.setNamespaceAware(true); // factory.setValidating(strict); // try { // SAXParser saxParser = factory.newSAXParser(); // saxParser.parse(is, new RDFXMLParserBase(baseURI, c, skolemise, strict, _con)); // } catch (ParserConfigurationException e1) { // throw new RuntimeException(e1.getLocalizedMessage()); // } catch (SAXParseException e1) { // throw new ParseException(e1.getMessage()+" Line "+e1.getLineNumber()+" column "+e1.getColumnNumber()+"."); // } catch (SAXException e1) { // throw new ParseException(e1); // } else{ // gm.releaseConnection(); // if(status!=200) // throw new IOException(u+" returned response code " + status + " " + gm.getStatusLine()); // else if(!rdfxml) // throw new IOException(u+" did not return Content-Type application/rdf+xml"); //// catch (Exception ex) { //// e = ex; //// ex.printStackTrace (); //// } finally { //// try { //// if (is != null) { //// is.close(); //// } catch (IOException ex) { //// ex.printStackTrace(); //// if (status != 200 && status != 204) { //// gm.releaseConnection(); //// throw new IOException("returned response code " + status + " " + gm.getStatusLine()); //// if (!rdfxml) { //// gm.releaseConnection(); //// throw new IOException("not rdfxml"); //// if(strict) //// gm.releaseConnection(); public Resource getContext(){ return _con; } public boolean hasNext() { if(_q==null){ return false; } else if(_done){ return false; } else if(_current!=null){ //if(NodeComparator.NC.equals(_current,BlockingCallBack.POISON_TOKEN)){ //faster hack :( :) if(_current.length==0){ _done = true; _e = _pt.getException(); return false; } else return true; } else if(_q.size()>0){ _current = _q.poll(); return hasNext(); } else{ try { _current = _q.poll(1000, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { e.printStackTrace(); _done = true; return false; } return hasNext(); } } public Node[] next() { if(_current==null){ if(!hasNext()){ throw new NoSuchElementException(); } } Node[] result = new Node[_current.length]; System.arraycopy(_current, 0, result, 0, _current.length); _current = null; return result; } public void remove() { throw new UnsupportedOperationException(); } public boolean isSuccess(){ return _e == null; } public Exception getException(){ return _e; } // public static void main(String args[]) throws FileNotFoundException, ParseException, IOException{ // String in = "../saor0.0.1/test/data/lubm/University0_0.owl"; // String out = "../saor0.0.1/test/data/lubm/University0_0.nt"; // FileInputStream fis = new FileInputStream(in); // FileOutputStream fos = new FileOutputStream(out); // CallbackNxOutputStream cb = new CallbackNxOutputStream(fos); // new RDFXMLParser(fis, false, false, baseURI, cb); // fis.close(); // fos.close(); public static void main(String args[]) throws FileNotFoundException, ParseException, IOException, URISyntaxException{ // String out = "../saor0.0.1/test/data/lubm/University0_0.nt"; // FileInputStream fis = new FileInputStream(in); // CallbackNxOutputStream cb = new CallbackNxOutputStream(System.out, true); // System.err.println("checking data"); // BufferedReader fr = new BufferedReader(new InputStreamReader(u.openStream())); // String line; // while((line = fr.readLine())!=null){ // System.err.println(line); // URI u = new URI("http://blah.org/A_%28Secret%29.xml#blah"); // System.out.println(u); // // prints "http://blah.org/A_%28Secret%29.xml#blah" // String path1 = u.getPath(); //gives "A_(Secret).xml" // String path2 = u.getRawPath(); //gives "A_%28Secret%29.xml" // URI norm1 = new URI(u.getScheme().toLowerCase(), // u.getUserInfo(), u.getHost().toLowerCase(), u.getPort(), // path1, u.getQuery(), null); // System.out.println(norm1.toASCIIString()); // URI norm2 = new URI(u.getScheme().toLowerCase(), // u.getUserInfo(), u.getHost().toLowerCase(), u.getPort(), // path2, u.getQuery(), null); // System.out.println(norm2); String baseUri = "http://sw.deri.org/~aidanh/foaf/foaf.rdf"; URL u = new URL(baseUri); HttpURLConnection uc = (HttpURLConnection) u.openConnection(); // uc.setInstanceFollowRedirects(true); System.err.println("opening parser"); CallbackNxBufferedWriter cb = new CallbackNxBufferedWriter(new BufferedWriter(new OutputStreamWriter(System.out))); RDFXMLParser rxp = new RDFXMLParser(uc.getInputStream(), false, false, baseUri, cb, new Resource(NxUtil.escapeForNx(baseUri))); System.err.println("reading data"); while(rxp.hasNext()){ System.err.println(Nodes.toN3(rxp.next())); } // System.err.println("opening parser"); // CallbackNxBufferedWriter cb = new CallbackNxBufferedWriter(new BufferedWriter(new OutputStreamWriter(System.out))); // RDFXMLParser rxp = new RDFXMLParser(u.openStream(), false, false, baseURI, cb, new Resource(baseURI)); // System.err.println("reading data"); // while(rxp.hasNext()){ // System.err.println(Nodes.toN3(rxp.next())); } }
package org.spongepowered.api.item; /** * A class containing known {@link FireworkShape}s. */ public final class FireworkShapes { public static final FireworkShape BALL = null; public static final FireworkShape LARGE_BALL = null; public static final FireworkShape STAR = null; public static final FireworkShape CREEPER = null; public static final FireworkShape BURST = null; private FireworkShapes() { } /** * Checks if this is a flowerpot. * * @return Whether this is a flowerpot */ public static boolean isFlowerPot() { return false; } }
package org.zalando.pazuzu.api; import java.net.URI; import java.util.function.Function; import java.util.stream.Collectors; import javax.annotation.security.RolesAllowed; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Service; import org.springframework.web.servlet.support.ServletUriComponentsBuilder; import org.zalando.pazuzu.feature.FeatureService; import org.zalando.pazuzu.feature.FeatureStatus; import org.zalando.pazuzu.feature.FeaturesPage; import org.zalando.pazuzu.model.Feature; import org.zalando.pazuzu.model.FeatureList; import org.zalando.pazuzu.model.FeatureListLinks; import org.zalando.pazuzu.model.FeatureMeta; import org.zalando.pazuzu.model.Link; import org.zalando.pazuzu.model.Review; import org.zalando.pazuzu.security.Roles; @Service public class FeatureServiceImpl { public static final int DEFAULT_OFFSET = 0; private static final Integer DEFAULT_LIMIT = 50; private final FeatureService featureService; @Autowired public FeatureServiceImpl(FeatureService featureService) { this.featureService = featureService; } @RolesAllowed({Roles.ANONYMOUS, Roles.USER}) public ResponseEntity<FeatureList> featuresGet(String q, String author, String fields, String status, Integer offset, Integer limit) { //TODO add validation base on role. //TODO add limitation of author if non admin and asking for non approved feature FeatureStatus featureStatus = (status == null) ? FeatureStatus.APPROVED : FeatureStatus.fromJsonValue(status); FeatureFields featureFields = FeatureFields.getFields(fields); Function<org.zalando.pazuzu.feature.Feature, Feature> converter = FeatureConverter.forFields(featureFields); FeaturesPage<?, Feature> featuresPage = featureService.searchFeatures(sanitizeQuery(q), sanitizeQuery(author), featureStatus, sanitizeOffset(offset), sanitizeLimit(limit), converter); HttpHeaders responseHeaders = new HttpHeaders(); responseHeaders.set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON.toString()); FeatureList ret = new FeatureList(); ret.setFeatures(featuresPage.getContent()); ret.setTotalCount((int) featuresPage.getTotalElements()); addLinks(ret, featuresPage, sanitizeOffset(offset), sanitizeLimit(limit)); return new ResponseEntity<>(ret, responseHeaders, HttpStatus.OK); } private Integer sanitizeLimit(Integer limit) { return limit == null ? DEFAULT_LIMIT : limit; } private Integer sanitizeOffset(Integer offset) { return offset == null ? DEFAULT_OFFSET : offset; } private String sanitizeQuery(String q) { return q == null ? null : q.trim(); } private void addLinks(FeatureList features, FeaturesPage<?, Feature> page, Integer offset, Integer limit) { FeatureListLinks links = new FeatureListLinks(); URI relative = ServletUriComponentsBuilder.fromCurrentContextPath().replacePath("").build().toUri(); if (page.hasNext()) { Link next = new Link(); next.setHref("/" + relative.relativize(ServletUriComponentsBuilder.fromCurrentRequest() .replaceQueryParam("offset", offset + limit) .build().toUri()).toString()); links.setNext(next); } if (page.hasPrevious()) { Link previous = new Link(); previous.setHref("/" + relative.relativize(ServletUriComponentsBuilder.fromCurrentRequest() .replaceQueryParam("offset", offset - limit) .build().toUri()).toString()); links.setPrev(previous); } features.setLinks(links); } @RolesAllowed({Roles.USER}) public ResponseEntity<Feature> featuresPost(Feature feature) { if (feature.getMeta() == null) feature.setMeta(new FeatureMeta()); ServletUriComponentsBuilder servletUriComponentsBuilder = ServletUriComponentsBuilder.fromCurrentContextPath(); Feature newFeature = featureService.createFeature( feature.getMeta().getName(), feature.getMeta().getDescription(), getAuthenticatedUserName(), feature.getSnippet(), feature.getTestSnippet(), feature.getMeta().getDependencies(), FeatureConverter::asDto); URI uri = servletUriComponentsBuilder.path("/api/features/{featureName}").buildAndExpand(newFeature.getMeta().getName()).toUri(); HttpHeaders responseHeaders = new HttpHeaders(); responseHeaders.set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON.toString()); responseHeaders.setLocation(uri); return new ResponseEntity<>(newFeature, responseHeaders, HttpStatus.CREATED); } private String getAuthenticatedUserName() { return SecurityContextHolder.getContext() != null && SecurityContextHolder.getContext().getAuthentication() != null ? SecurityContextHolder.getContext().getAuthentication().getName() : "anonymous"; } @RolesAllowed({Roles.USER}) public ResponseEntity<Review> featuresNameReviewsPost(String name, Review review) { org.zalando.pazuzu.feature.Feature feature = featureService.getFeature(name, t -> t); Review newReview = featureService.updateFeature(feature.getName(), feature.getName(), feature.getDescription(), feature.getAuthor(), feature.getSnippet(), feature.getTestSnippet(), feature.getDependencies().stream().map(org.zalando.pazuzu.feature.Feature::getName).collect(Collectors.toList()), FeatureStatus.fromJsonValue(review.getReviewStatus().name()), FeatureConverter::asReviewDto); HttpHeaders responseHeaders = new HttpHeaders(); responseHeaders.set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON.toString()); return new ResponseEntity<>(newReview, responseHeaders, HttpStatus.CREATED); } @RolesAllowed({Roles.ANONYMOUS, Roles.USER}) public ResponseEntity<Feature> featuresNameGet(String name) { Feature feature = featureService.getFeature(name, FeatureConverter::asDto); HttpHeaders responseHeaders = new HttpHeaders(); responseHeaders.set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON.toString()); return new ResponseEntity<>(feature, responseHeaders, HttpStatus.OK); } }
package pl.grzeslowski.smarthome.rf24; import pl.grzeslowski.smarthome.rf24.exceptions.*; import pl.grzeslowski.smarthome.rf24.generated.RF24; import pl.grzeslowski.smarthome.rf24.helpers.Payload; import pl.grzeslowski.smarthome.rf24.helpers.Pins; import pl.grzeslowski.smarthome.rf24.helpers.Pipe; import pl.grzeslowski.smarthome.rf24.helpers.Retry; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; import java.util.function.Function; import java.util.stream.Collectors; import static java.lang.String.format; /** * <p>Adapter that delegates everything to {@link RF24} and do dome small login.</p> * <p> * <p>Watch out! All class methods are synchronized (on this)!</p> */ public class Rf24Adapter implements BasicRf24 { public static final int MAX_NUMBER_OF_READING_PIPES = 5; private static final long DELAY_AFTER_STARTING_LISTENING = TimeUnit.SECONDS.convert(1, TimeUnit.MILLISECONDS); private static final String RF24_LIB_NAME = "rf24bcmjava"; private final Pins pins; private final Retry retry; private final Payload payload; private RF24 rf24; private List<Pipe> actualReadPipes; public static void loadLibrary() { try { System.loadLibrary(RF24_LIB_NAME); } catch (UnsatisfiedLinkError e) { throw new NoNativeLibException("Native code library (" + RF24_LIB_NAME + ") failed to load.", e); } } public Rf24Adapter(Pins pins, Retry retry, Payload payload) { if (pins == null) throw new NullPointerException("Pins cannot be null!"); this.pins = pins; if (retry == null) throw new NullPointerException("Retry cannot be null!"); this.retry = retry; if (payload == null) throw new NullPointerException("Payload cannot be null!"); this.payload = payload; } /** * <p>Instead of allowing inheriting classes to directly uses RF24 object, this method * allows to use it with proper synchronization and boundaries (do not use this if Rf34Adapter is not * {@link Rf24Adapter#init()}.</p> * * @param function piece of code to execute with {@link RF24} * @param <ReturnClass> class of what will be returned * @return result of {@link Function#apply(Object)} */ protected synchronized <ReturnClass> ReturnClass mapRf24(Function<RF24, ReturnClass> function) { if (function == null) { throw new NullPointerException("Function cannot be null!"); } try { return function.apply(rf24); } catch (Exception e) { throw new Rf24Exception("mapRf24 thrown an Exception!", e); } } /** * <p>Instead of allowing inheriting classes to directly uses RF24 object, this method * allows to use it with proper synchronization and boundaries (do not use this if Rf34Adapter is not * {@link Rf24Adapter#init()}.</p> * * @param consumer piece of code to execute with {@link RF24} */ protected synchronized void consumeRf24(Consumer<RF24> consumer) { if (consumer == null) { throw new NullPointerException("Consumer cannot be null!"); } try { consumer.accept(rf24); } catch (Exception e) { throw new Rf24Exception("consumeRf24 thrown an Exception!", e); } } @Override public synchronized void init() { if (rf24 != null) { throw new IllegalStateException(format("RF24 is already initialized! You need to call close() first! RF24: [%s]", rf24)); } try { rf24 = new RF24(pins.getCePin(), pins.getCsPin(), pins.getClockSpeed()); rf24.setPayloadSize(payload.getSize()); rf24.begin(); rf24.setRetries(retry.getRetryDelay(), retry.getRetryNumber()); startListening(); } catch (Exception e) { throw new InitRf24Exception(e); } } private void startListening() { assert rf24 != null; rf24.startListening(); try { TimeUnit.MILLISECONDS.sleep(DELAY_AFTER_STARTING_LISTENING); } catch (InterruptedException ignored) { // Ignore } } @Override public synchronized void close() { if (rf24 == null) { throw new IllegalStateException("RF24 was not initialized! Please call init() before calling close()."); } try { rf24.delete(); } catch (Error e) { throw new CloseRf24Exception(e); } finally { rf24 = null; } } @Override public synchronized boolean read(List<Pipe> readPipes, ByteBuffer buffer) { if (readPipes == null) throw new NullPointerException("Read pipes cannot be null!!"); if (buffer == null) throw new NullPointerException("Buffer cannot be null!!"); if (readPipes.isEmpty()) throw new IllegalArgumentException("There need to be at least 1 pipe to read from!"); if (readPipes.size() > MAX_NUMBER_OF_READING_PIPES) { throw new IllegalArgumentException(format("There are too much reading pipes! Max: %s, was: %s.", MAX_NUMBER_OF_READING_PIPES, readPipes.size())); } try { trySetNewReadingPipes(readPipes); if (rf24.available()) { rf24.read(buffer.array(), (short) (buffer.capacity())); return true; } else { return false; } } catch (Error e) { throw new ReadRf24Exception(readPipes, e); } } private void trySetNewReadingPipes(List<Pipe> readPipes) { if (isNewReadingPipes(readPipes)) { rf24.stopListening(); actualReadPipes = new ArrayList<>(readPipes.size()); for (short i = 1; i <= readPipes.size(); i++) { final Pipe pipe = readPipes.get(i - 1); rf24.openReadingPipe(i, pipe.getBinaryPipe()); actualReadPipes.add(i - 1, pipe); } startListening(); } } private boolean isNewReadingPipes(List<Pipe> readPiped) { if (actualReadPipes == null) return true; if (actualReadPipes.size() != readPiped.size()) return true; for (int i = 0; i < actualReadPipes.size(); i++) { final Pipe actual = actualReadPipes.get(i); final Pipe pipe = readPiped.get(i); if (!actual.equals(pipe)) { return true; } } return false; } @Override public synchronized boolean write(Pipe write, byte[] toSend) { if (write == null) throw new NullPointerException("Write pipe cannot nbe null!"); if (toSend.length > rf24.getPayloadSize()) { throw new IllegalArgumentException(format("Bytes to send exceeds max payload size! Bytes size: %s, max payload size: %s", toSend.length, rf24.getPayloadSize())); } try { rf24.stopListening(); rf24.openWritingPipe(write.getBinaryPipe()); return rf24.write(toSend, (short) toSend.length); } catch (Exception e) { throw new WriteRf24Exception(write, e); } finally { startListening(); } } @Override public Payload getPayload() { return payload; } @Override public String toString() { final String readPipes = String.join(",", actualReadPipes.stream() .map(Pipe::getPipe) .map(l -> Long.toString(l)) .collect(Collectors.toList()) ); return String.format("%s[init: %s, readPipes: %s, pins: %s, retry: %s, payload: %s]", this.getClass().getSimpleName(), rf24 != null, readPipes, pins, retry, payload); } }
package pro.beam.api.resource.channel; import java.util.Date; import java.util.List; import com.google.gson.annotations.SerializedName; public class BeamChannel { public CostreamPreference allowCostream; public AudienceRating audience; public String description; public Date createdAt; public boolean featured; public boolean hidden; public int id; public String name; public boolean online; public boolean partnered; public int numSubscribers; public int numFollowers; public boolean suspended; public String token; public boolean transcodingEnabled; public Type type; public Date updatedAt; public int userId; public Status status; public int viewersCurrent; public int viewersTotal; public static class Type { public int id; public String name; public String parent; public String description; public String source; public int viewersCurrent; public int online; } public static class Status { public List<String> roles; public boolean follows; } public static enum CostreamPreference { @SerializedName("all") ALL, @SerializedName("following") FOLOWING, @SerializedName("none") NONE } public static enum AudienceRating { G, PG, PG13, R } }
package reborncore.mixin.client; import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.font.TextRenderer; import net.minecraft.client.render.BufferBuilder; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.item.ItemRenderer; import net.minecraft.item.ItemStack; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import reborncore.common.util.ItemDurabilityExtensions; import javax.annotation.Nullable; //Not too happy with this, need to find and get a better solution into fabric soon @Mixin(ItemRenderer.class) public abstract class MixinItemRenderer { @Shadow protected abstract void renderGuiQuad(BufferBuilder bufferBuilder_1, int int_1, int int_2, int int_3, int int_4, int int_5, int int_6, int int_7, int int_8); @Inject(method = "renderGuiItemOverlay(Lnet/minecraft/client/font/TextRenderer;Lnet/minecraft/item/ItemStack;IILjava/lang/String;)V", at = @At("HEAD")) private void renderGuiItemOverlay(TextRenderer textRenderer, ItemStack stack, int x, int y, @Nullable String string, CallbackInfo info) { if (stack.getItem() instanceof ItemDurabilityExtensions) { ItemDurabilityExtensions durabilityExtensions = (ItemDurabilityExtensions) stack.getItem(); if(!durabilityExtensions.showDurability(stack)){ return; } RenderSystem.disableDepthTest(); RenderSystem.disableTexture(); RenderSystem.disableAlphaTest(); RenderSystem.disableBlend(); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferBuilder = tessellator.getBuffer(); int durability = (int) (13 * (1 - Math.max(0.0F, durabilityExtensions.getDurability(stack)))); int color = durabilityExtensions.getDurabilityColor(stack); this.renderGuiQuad(bufferBuilder, x + 2, y + 13, 13, 2, 0, 0, 0, 255); this.renderGuiQuad(bufferBuilder, x + 2, y + 13, durability, 1, color >> 16 & 255, color >> 8 & 255, color & 255, 255); RenderSystem.enableBlend(); RenderSystem.enableAlphaTest(); RenderSystem.enableTexture(); RenderSystem.enableDepthTest(); } } }
package reciter.utils; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.PropertySource; import org.springframework.stereotype.Component; import lombok.Data; import lombok.NoArgsConstructor; import reciter.engine.StrategyParameters; import reciter.model.article.ReCiterArticle; import reciter.model.article.ReCiterAuthor; import reciter.model.identity.AuthorName; import reciter.model.identity.Identity; /** * @author szd2013 * <p>This class sanitizes author names for both Identity and Article. * Preprocess identity.firstName, identity.middleName, and article.firstName If any names are in quotes or parentheses in identity.firstName or identity.middleName, pull them out so they can be matched against. Wing Tak "Jack" --> add "Jack" to identity.firstName, add "Wing Tak" to identity.firstName Qihui (Jim) --> add Jim to identity.firstName, add Qihui to identity.firstName Remove any periods, spaces, or dashes from both identity.firstName, identity.middleName, and article.firstName. For example: "Chi-chao" --> "Chichao" "Minh-Nhut Yvonne" --> "MinhNhutYvonne" "Eliot A." --> "EliotA" Disregard any cases where one variant of identity.firstName is a substring of another case of identity.firstName. Disregard any cases where one variant of identity.middleName is a substring of another case of identity.middleName. For example: "Cary" (keep) vs "C" (disregard) Null for middle name should only be included as possible value if none of the names or aliases contain a middle name A given target author might have N different first names and M different middle names. Go to D Retrieve article.lastName where targetAuthor=TRUE and all distinct cases of identity.lastName for our target author from identity. Preprocess identity.lastName and article.lastName. Remove any periods from both identity.lastName and article.lastName Remove any of the following endings from identity.lastName: ", Jr" ", MD PhD" ", MD-PhD" ", PhD" ", MD" ", III" ", II" ", Sr" " Jr" " MD PhD" " MD-PhD" " PhD" " MD" " III" " II" " Sr" Remove any periods, spaces, dashes, or quotes. For example: "Del Cole" --> "Delcole" "Garcia-Marquez" --> ""GarciaMarquez" "Capetillo Gonzalez de Zarate" --> "CapetilloGonzalezdeZarate"<p> * */ @NoArgsConstructor public class AuthorNameSanitizationUtils { private StrategyParameters strategyParameters; private List<String> nameExcludedSuffixes; public AuthorNameSanitizationUtils(StrategyParameters strategyParameters) { this.strategyParameters = strategyParameters; } /** * @author szd2013 * @param reCiterArticle * @return * Sanitize Article Authors */ public Map<ReCiterAuthor, ReCiterAuthor> sanitizeArticleAuthorNames(ReCiterArticle reCiterArticle) { Map<ReCiterAuthor, ReCiterAuthor> sanitizeArticleAuthors = new LinkedHashMap<ReCiterAuthor, ReCiterAuthor>(); if(reCiterArticle.getArticleCoAuthors() != null && reCiterArticle.getArticleCoAuthors().getAuthors() != null) { for(ReCiterAuthor authorName: reCiterArticle.getArticleCoAuthors().getAuthors()) { AuthorName articleAuthor = new AuthorName(); if(authorName.getAuthorName().getFirstName() != null) { articleAuthor.setFirstName(ReCiterStringUtil.deAccent(authorName.getAuthorName().getFirstName().replaceAll("[-.\"() ]", ""))); } if(authorName.getAuthorName().getLastName() != null) { articleAuthor.setLastName(ReCiterStringUtil.deAccent(authorName.getAuthorName().getLastName().replaceAll("[-.\",()\\s]|(" + generateSuffixRegex() + ")$", ""))); } ReCiterAuthor sanitizedReCiterAuthor = new ReCiterAuthor(articleAuthor, authorName.getAffiliation()); sanitizedReCiterAuthor.setRank(authorName.getRank()); sanitizedReCiterAuthor.setTargetAuthor(authorName.isTargetAuthor()); sanitizedReCiterAuthor.setValidEmail(authorName.getValidEmail()); sanitizeArticleAuthors.put(authorName, sanitizedReCiterAuthor); } } return sanitizeArticleAuthors; } /** * Sanitize Identity Author Names and also derive author names if there is double code (") in the first name * @param identity * @return Sanitized Map of Identity primary names, alternate names and derived names */ public Map<AuthorName, AuthorName> sanitizeIdentityAuthorNames(Identity identity) { Map<AuthorName, AuthorName> sanitizedIdentityAuthorName = null; if(identity != null) { sanitizedIdentityAuthorName = new HashMap<AuthorName, AuthorName>(); AuthorName identityPrimaryName = new AuthorName(); AuthorName additionalName = new AuthorName(); String firstName = null; String lastName = null; String middleName = null; //Sanitize Identity Names if(identity.getPrimaryName() != null) { if(identity.getPrimaryName().getFirstName() != null) { if(identity.getPrimaryName().getFirstName().contains("\"") || (identity.getPrimaryName().getFirstName().contains("(") && identity.getPrimaryName().getFirstName().contains(")"))) { firstName = identity.getPrimaryName().getFirstName().replaceAll("[-.,()\\s]", "").replaceAll("\"([^\"]*)\"|(\"([^\"]*)\")|(([a-z]*))/i/g", ""); if(firstName !=null) { additionalName.setFirstName(ReCiterStringUtil.deAccent(firstName)); } Pattern pattern = Pattern.compile("\"([^\"]*)\"|(\"([^\"]*)\")|(([a-z]*))/i/g"); Matcher matcher = pattern.matcher(identity.getPrimaryName().getFirstName()); while(matcher.find()) { identityPrimaryName.setFirstName(ReCiterStringUtil.deAccent(matcher.group().replaceAll("\"", ""))); } } else { identityPrimaryName.setFirstName(ReCiterStringUtil.deAccent(identity.getPrimaryName().getFirstName().replaceAll("[-.,()\\s]", ""))); } } if(identity.getPrimaryName().getMiddleName() != null) { if(identity.getPrimaryName().getMiddleName().contains("\"") || (identity.getPrimaryName().getMiddleName().contains("(") && identity.getPrimaryName().getMiddleName().contains(")"))) { middleName = identity.getPrimaryName().getMiddleName().replaceAll("[-.,()\\s]", "").replaceAll("\"([^\"]*)\"|(\"([^\"]*)\")|(([a-z]*))/i/g", ""); if(middleName !=null) { additionalName.setMiddleName(ReCiterStringUtil.deAccent(middleName)); } Pattern pattern = Pattern.compile("\"([^\"]*)\"|(\"([^\"]*)\")|(([a-z]*))/i/g"); Matcher matcher = pattern.matcher(identity.getPrimaryName().getMiddleName()); while(matcher.find()) { identityPrimaryName.setMiddleName(ReCiterStringUtil.deAccent(matcher.group().replaceAll("\"", ""))); } } else { identityPrimaryName.setMiddleName(ReCiterStringUtil.deAccent(identity.getPrimaryName().getMiddleName().replaceAll("[-.,()\\s]", ""))); } } if(identity.getPrimaryName().getLastName() != null) { //lastName = identity.getPrimaryName().getLastName().replaceAll("[-.,,()\\s]|(,Jr|, Jr|, MD PhD|,MD PhD|, MD-PhD|,MD-PhD|, PhD|,PhD|, MD|,MD|, III|,III|, II|,II|, Sr|,Sr|Jr|MD PhD|MD-PhD|PhD|MD|III|II|Sr)$", ""); lastName = identity.getPrimaryName().getLastName().replaceAll("[-.,,()\\s]|(" + generateSuffixRegex() + ")$", ""); identityPrimaryName.setLastName(ReCiterStringUtil.deAccent(lastName)); if(additionalName.getFirstName() != null) { additionalName.setLastName(ReCiterStringUtil.deAccent(lastName)); } } if(identityPrimaryName.getLastName() != null) { sanitizedIdentityAuthorName.put(identity.getPrimaryName(), identityPrimaryName); } } if(identity.getAlternateNames() != null && identity.getAlternateNames().size() > 0) { for(AuthorName aliasAuthorName: identity.getAlternateNames()) { AuthorName identityAliasAuthorName = new AuthorName(); if(aliasAuthorName.getFirstName() != null) { identityAliasAuthorName.setFirstName(ReCiterStringUtil.deAccent(aliasAuthorName.getFirstName().replaceAll("[-.\",()\\s]", ""))); } if(aliasAuthorName.getMiddleName() != null) { identityAliasAuthorName.setMiddleName(ReCiterStringUtil.deAccent(aliasAuthorName.getMiddleName().replaceAll("[-.\",()\\s]", ""))); } if(aliasAuthorName.getLastName() != null) { identityAliasAuthorName.setLastName(ReCiterStringUtil.deAccent(aliasAuthorName.getLastName().replaceAll("[-.\",()\\s]|(" + generateSuffixRegex() + ")$", ""))); } if(identityAliasAuthorName.getLastName() != null) { sanitizedIdentityAuthorName.put(aliasAuthorName, identityAliasAuthorName); } } } if(additionalName != null && additionalName.getLastName() != null) { sanitizedIdentityAuthorName.put(additionalName, additionalName); } if(sanitizedIdentityAuthorName.size() > 1) { checkToIgnoreNameVariants(sanitizedIdentityAuthorName); } } return sanitizedIdentityAuthorName; } /** * This function checks for if there is other name variant if another complete name exists in Identity * @param idenityAuthorNames */ public void checkToIgnoreNameVariants(Map<AuthorName, AuthorName> idenityAuthorNames) { Set<Entry<AuthorName, AuthorName>> sanitizedIdentityAuthorNames = idenityAuthorNames.entrySet(); Set<Entry<AuthorName, AuthorName>> sanitizedIdentityAuthorNamesCopy = new HashSet<>(sanitizedIdentityAuthorNames); for(Map.Entry<AuthorName,AuthorName> i : sanitizedIdentityAuthorNamesCopy) { Iterator<Map.Entry<AuthorName,AuthorName>> iterator = idenityAuthorNames.entrySet().iterator(); while(iterator.hasNext()) { Map.Entry<AuthorName,AuthorName> j = iterator.next(); //for(Map.Entry<AuthorName,AuthorName> j : sanitizedIdentityAuthorNames) { if(!i.getKey().equals(j.getKey())) { if(sanitizedIdentityAuthorNames.size() > 1 && i.getValue() != null && j.getValue() != null && i.getValue().getFirstName() != null && j.getValue() != null && j.getValue().getFirstName() != null && j.getValue().getLastName() != null) { if(StringUtils.equalsIgnoreCase(i.getValue().getLastName(), j.getValue().getLastName()) && i.getValue().getFirstName().toLowerCase().startsWith(j.getValue().getFirstName().toLowerCase())) { if(j.getValue().getMiddleName() == null) { iterator.remove(); if(iterator.hasNext()) { j = iterator.next(); } } if(j.getValue().getMiddleName() != null && j.getValue().getMiddleName().trim().isEmpty()) { iterator.remove(); if(iterator.hasNext()) { j = iterator.next(); } } } //Case - ajdannen - Throw away Andrew J Dannenberg because Andrew Jess Dannenberg exists if(sanitizedIdentityAuthorNames.size() > 1) { if(i.getValue() != null && j.getValue() != null && i.getValue().getLastName() != null && j.getValue().getLastName() != null && i.getValue().getFirstName() != null && j.getValue().getFirstName() != null && i.getValue().getMiddleName() != null && j.getValue().getMiddleName() != null && StringUtils.equalsIgnoreCase(i.getValue().getLastName(), j.getValue().getLastName()) && StringUtils.equalsIgnoreCase(i.getValue().getFirstName(), j.getValue().getFirstName()) && i.getValue().getMiddleName().toLowerCase().startsWith(j.getValue().getMiddleName().toLowerCase())) { iterator.remove(); } } } } } } } /** * This function generates regex of suffix from application.properties file * @return regex string */ public String generateSuffixRegex() { nameExcludedSuffixes = Arrays.asList(strategyParameters.getNameExcludedSuffixes().trim().split("\\s*,\\s*")); String suffixRegex = ""; String suffixTogether = ""; for(String suffix: nameExcludedSuffixes) { suffixRegex = suffixRegex + "," + suffix + "|, " + suffix + "|"; suffixTogether = suffixTogether + suffix + "|"; } if(suffixTogether.endsWith("|")) { suffixTogether = suffixTogether.substring(0, suffixTogether.length() - 1); } return suffixRegex + "," + suffixTogether; } }
package se.kits.gakusei.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import se.kits.gakusei.content.model.Lesson; import se.kits.gakusei.content.model.Quiz; import se.kits.gakusei.content.repository.LessonRepository; import se.kits.gakusei.content.repository.QuizRepository; import se.kits.gakusei.util.QuestionHandler; import se.kits.gakusei.util.QuizHandler; import java.util.HashMap; import java.util.List; @RestController public class QuizController { @Autowired LessonRepository lessonRepository; @Autowired QuestionHandler questionHandler; @Autowired QuizRepository quizRepository; @Autowired QuizHandler quizHandler; @RequestMapping( value = "/api/quiz", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE ) public ResponseEntity<List<HashMap<String, Object>>> getQuizQuestions(@RequestParam(value = "lessonName") String lessonName) { Quiz quiz = quizRepository.findByName(lessonName); if (quiz == null) { return new ResponseEntity<> (HttpStatus.INTERNAL_SERVER_ERROR); } final List<HashMap<String, Object>> correctFormat = quizHandler.getQuizNuggetsForGakusei(quiz.getId()); return new ResponseEntity<>(correctFormat, HttpStatus.OK); } @RequestMapping( value = "/api/quizes", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE ) public ResponseEntity<Iterable<Quiz>> getQuizzes() { return new ResponseEntity<>(quizRepository.findAll(), HttpStatus.OK); } @RequestMapping( value = "/api/quiz/{quizId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE ) public ResponseEntity<Quiz> getQuiz(@PathVariable(value="quizId") Long quizId) { return ResponseEntity.ok(quizRepository.findOne(quizId)); } @RequestMapping( value = "/api/quizes/{offset}/{name}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE ) public ResponseEntity<Iterable<Quiz>> getQuizzesByName(@PathVariable(value="name") String name, @PathVariable(value="offset") int offset) { Pageable pageRequest; if (offset < 0) pageRequest = new PageRequest(0, 10); else pageRequest = new PageRequest(offset, 10); return new ResponseEntity<>(quizRepository.findByNameContainingIgnoreCase(name, pageRequest), HttpStatus.OK); } @RequestMapping( value = "/api/quizes/{offset}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE ) public ResponseEntity<Iterable<Quiz>> getQuizzesPage(@PathVariable(value="offset") int offset) { Pageable pageRequest; if (offset < 0) pageRequest = new PageRequest(0, 10); else pageRequest = new PageRequest(offset, 10); return new ResponseEntity<>(quizRepository.findAll(pageRequest).getContent(), HttpStatus.OK); } @RequestMapping( value = "/api/quizes/{quizId}/nuggets", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE ) public ResponseEntity<List<HashMap<String, Object>>> getQuizNuggets(@PathVariable(value="quizId") Long quizId) { List<HashMap<String, Object>> quizNuggets = quizHandler.getQuizNuggets(quizId); return new ResponseEntity<>(quizNuggets, HttpStatus.OK); } @RequestMapping( value = "/api/quiz/nugget/{quizNuggetId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE ) public HashMap<String, Object> getQuizNugget(@PathVariable(value="quizNuggetId") Long quizNuggetId) { return quizHandler.getQuizNugget(quizNuggetId); } }
package seedu.address.logic.commands; import seedu.address.model.AddressBook; /** * Clears the address book. */ public class ClearCommand extends Command { public static final String COMMAND_WORD = "clear"; public static final String MESSAGE_SUCCESS = "Lifekeeper has been cleared!"; public ClearCommand() {} @Override public CommandResult execute() { assert model != null; model.resetData(AddressBook.getEmptyAddressBook()); return new CommandResult(MESSAGE_SUCCESS); } }
package seedu.taskitty.logic.parser; import seedu.taskitty.commons.exceptions.IllegalValueException; import seedu.taskitty.commons.util.StringUtil; import seedu.taskitty.logic.commands.*; import seedu.taskitty.model.tag.Tag; import seedu.taskitty.model.task.Task; import seedu.taskitty.model.task.TaskDate; import seedu.taskitty.model.task.TaskTime; import static seedu.taskitty.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT; import static seedu.taskitty.commons.core.Messages.MESSAGE_UNKNOWN_COMMAND; import java.text.SimpleDateFormat; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; import com.joestelmach.natty.DateGroup; import com.joestelmach.natty.Parser; /** * Parses user input. */ public class CommandParser { public static final String COMMAND_QUOTE_SYMBOL = "\""; public static final String EMPTY_STRING = ""; public static final int NOT_FOUND = -1; public static final int STRING_START = 0; /** * Used for initial separation of command word and args. */ private static final Pattern BASIC_COMMAND_FORMAT = Pattern.compile("(?<commandWord>\\S+)(?<arguments>.*)"); private static final Pattern TASK_INDEX_ARGS_FORMAT = Pattern.compile("(?<targetIndex>.+)"); //Used for checking for number date formats in arguments private static final Pattern LOCAL_DATE_FORMAT = Pattern.compile(".* (?<arguments>\\d(\\d)?[/-]\\d(\\d)?).*"); private static final Pattern KEYWORDS_ARGS_FORMAT = Pattern.compile("(?<keywords>\\S+(?:\\s+\\S+)*)"); // one or more keywords separated by whitespace private static final Pattern TASK_DATA_ARGS_FORMAT = //Tags must be at the end Pattern.compile("(?<arguments>[\\p{Graph} ]+)"); // \p{Graph} is \p{Alnum} or \p{Punct} public CommandParser() {} /** * Parses user input into command for execution. * * @param userInput full user input string * @return the command based on the user input */ public Command parseCommand(String userInput) { final Matcher matcher = BASIC_COMMAND_FORMAT.matcher(userInput.trim()); if (!matcher.matches()) { return new IncorrectCommand(String.format(MESSAGE_INVALID_COMMAND_FORMAT, HelpCommand.MESSAGE_USAGE)); } final String commandWord = matcher.group("commandWord"); final String arguments = matcher.group("arguments"); switch (commandWord) { case AddCommand.COMMAND_WORD: return prepareAdd(arguments); case SelectCommand.COMMAND_WORD: return prepareSelect(arguments); case DeleteCommand.COMMAND_WORD: return prepareDelete(arguments); case EditCommand.COMMAND_WORD: return prepareEdit(arguments); case ClearCommand.COMMAND_WORD: return new ClearCommand(); case FindCommand.COMMAND_WORD: return prepareFind(arguments); case ListCommand.COMMAND_WORD: return new ListCommand(); case ExitCommand.COMMAND_WORD: return new ExitCommand(); case HelpCommand.COMMAND_WORD: return new HelpCommand(); case UndoCommand.COMMAND_WORD: return new UndoCommand(); case DoneCommand.COMMAND_WORD: return prepareDone(arguments); case ViewDoneCommand.COMMAND_WORD: return new ViewDoneCommand(); case ViewCommand.COMMAND_WORD: if (userInput.equals("view")) { return prepareView(null); } return prepareView(arguments); default: return new IncorrectCommand(MESSAGE_UNKNOWN_COMMAND); } } /** * Parses arguments in the context of the view command. * * @param args full command args string * @return the prepared command */ private Command prepareView(String arguments) { if (arguments == null) { return new ViewCommand(); // view events today, and all deadlines and todos } if (arguments.trim().equals("done")) { return new ViewDoneCommand(); // defaults to viewDone command } String[] details = extractTaskDetailsNatty(arguments); if (details.length!= 3) { // no date was successfully extracted return new IncorrectCommand(String.format(MESSAGE_INVALID_COMMAND_FORMAT, ViewCommand.MESSAGE_USAGE)); } else { assert details[1] != null; // contains date return new ViewCommand(details[1]); } } //@@author A0139930B /** * Parses arguments in the context of the add task command. * * @param args full command args string * @return the prepared command */ private Command prepareAdd(String args){ final Matcher matcher = TASK_DATA_ARGS_FORMAT.matcher(args.trim()); // Validate arg string format if (!matcher.matches()) { return new IncorrectCommand(String.format(MESSAGE_INVALID_COMMAND_FORMAT, AddCommand.MESSAGE_USAGE)); } try { String arguments = matcher.group("arguments"); String taskDetailArguments = getTaskDetailArguments(arguments); String tagArguments = getTagArguments(arguments); return new AddCommand( extractTaskDetailsNatty(taskDetailArguments), getTagsFromArgs(tagArguments) ); } catch (IllegalValueException ive) { return new IncorrectCommand(ive.getMessage()); } } /** * Parses the argument to get a string of all the relevant details of the task * * @param arguments command args string without command word */ private String getTaskDetailArguments(String arguments) { int detailLastIndex = arguments.indexOf(Tag.TAG_VALIDATION_REGEX_PREFIX); if (detailLastIndex == NOT_FOUND) { detailLastIndex = arguments.length(); } return arguments.substring(STRING_START, detailLastIndex).trim(); } /** * Parses the argument to get a string of all tags, including the Tag prefix * * @param arguments command args string without command word */ private String getTagArguments(String arguments) { //This line is exactly the same as the 1st line of getTaskDetailArguments.. how? int tagStartIndex = arguments.indexOf(Tag.TAG_VALIDATION_REGEX_PREFIX); if (tagStartIndex == NOT_FOUND) { tagStartIndex = arguments.length(); } return arguments.substring(tagStartIndex); } /** * Extracts the task details into a String array representing the name, date, time. * Details are arranged according to index shown in Task * * @param dataArguments command args string with only name, date, time arguments */ private String[] extractTaskDetailsNatty(String dataArguments) { dataArguments = convertToNattyDateFormat(dataArguments); int nameEndIndex = dataArguments.length(); ArrayList<String> details = new ArrayList<String>(); //Attempt to extract name out if it is surrounded by quotes nameEndIndex = dataArguments.lastIndexOf(COMMAND_QUOTE_SYMBOL); boolean isNameExtracted = false; if (nameEndIndex != NOT_FOUND) { int nameStartIndex = dataArguments.indexOf(COMMAND_QUOTE_SYMBOL); if (nameStartIndex == NOT_FOUND) { nameStartIndex = STRING_START; } //+1 because we want the quote included in the string String nameDetail = dataArguments.substring(nameStartIndex, nameEndIndex + 1); //remove name from dataArguments dataArguments = dataArguments.replace(nameDetail, EMPTY_STRING); //remove quotes from nameDetail nameDetail = nameDetail.replaceAll(COMMAND_QUOTE_SYMBOL, EMPTY_STRING); details.add(Task.TASK_COMPONENT_INDEX_NAME, nameDetail); isNameExtracted = true; } Parser dateTimeParser = new Parser(); List<DateGroup> dateGroups = dateTimeParser.parse(dataArguments); nameEndIndex = dataArguments.length(); for (DateGroup group : dateGroups) { List<Date> dates = group.getDates(); //Natty's getPosition returns 1 based position //-1 because we want the 0 based position nameEndIndex = Math.min(nameEndIndex, group.getPosition() - 1); for (Date date : dates) { details.add(extractLocalDate(date)); details.add(extractLocalTime(date)); } } if (!isNameExtracted) { details.add(Task.TASK_COMPONENT_INDEX_NAME, dataArguments.substring(STRING_START, nameEndIndex).trim()); } String[] returnDetails = new String[details.size()]; details.toArray(returnDetails); return returnDetails; } //@@author /** * Converts any number formats of date from the local format to one which can be parsed by natty * @param arguments * @return arguments with converted dates if any */ private String convertToNattyDateFormat(String arguments) { Matcher matchDate = LOCAL_DATE_FORMAT.matcher(arguments); if (matchDate.matches()) { String localDateString = matchDate.group("arguments"); String dateSeparator = getDateSeparator(localDateString); return convertToNattyFormat(arguments, localDateString, dateSeparator); } else { return arguments; } } /** * Get the separator between day month and year in a date * @param localDateString the string representing the date * @return the separator character used in localDateString */ private String getDateSeparator(String localDateString) { // if 2nd char in string is an integer, then the 3rd char must be the separator // else 2nd char is the separator if (StringUtil.isInteger(localDateString.substring(1,2))) { return localDateString.substring(2, 3); } else { return localDateString.substring(1, 2); } } /** * Convert the local date format inside arguments into a format * which can be parsed by natty * @param arguments the full argument string * @param localDateString the localDate extracted out from arguments * @param dateSeparator the separator for the date extracted out * @return converted string where the date format has been converted from local to natty format */ private String convertToNattyFormat(String arguments, String localDateString, String dateSeparator) { String[] dateComponents = localDateString.split(dateSeparator); int indexOfDate = arguments.indexOf(localDateString); StringBuilder nattyDateStringBuilder = new StringBuilder(); nattyDateStringBuilder.append(dateComponents[1]); nattyDateStringBuilder.append(dateSeparator); nattyDateStringBuilder.append(dateComponents[0]); StringBuilder convertDateStringBuilder = new StringBuilder(arguments); convertDateStringBuilder.replace(indexOfDate, indexOfDate + localDateString.length(), nattyDateStringBuilder.toString()); String stringFromConvertedDate = convertDateStringBuilder.substring(indexOfDate); String stringUpToConvertedDate = convertDateStringBuilder.substring(0, indexOfDate); return convertToNattyDateFormat(stringUpToConvertedDate) + stringFromConvertedDate; } //@@author A0139930B /** * Takes in a date from Natty and converts it into a string representing date * Format of date returned is according to TaskDate * * @param date retrieved using Natty */ private String extractLocalDate(Date date) { SimpleDateFormat dateFormat = new SimpleDateFormat(TaskDate.DATE_FORMAT_STRING); return dateFormat.format(date); } /** * Takes in a date from Natty and converts it into a string representing time * Format of time returned is according to TaskTime * * @param date retrieved using Natty */ private String extractLocalTime(Date date) { SimpleDateFormat timeFormat = new SimpleDateFormat(TaskTime.TIME_FORMAT_STRING); String currentTime = timeFormat.format(new Date()); String inputTime = timeFormat.format(date); if (currentTime.equals(inputTime)) { //Natty parses the current time if string does not include time. //We want to ignore input when current time equal input time return null; } return inputTime; } //@@author /** * Extracts the new person's tags from the add command's tag arguments string. * Merges duplicate tag strings. */ private static Set<String> getTagsFromArgs(String tagArguments) throws IllegalValueException { // no tags if (tagArguments.isEmpty()) { return Collections.emptySet(); } // replace first delimiter prefix, then split final Collection<String> tagStrings = Arrays.asList(tagArguments.replaceFirst(" t/", "").split(" t/")); return new HashSet<>(tagStrings); } /** * Parses arguments in the context of the delete person command. * * @param args full command args string * @return the prepared command */ private Command prepareDelete(String args) { String[] splitArgs = args.trim().split(" "); if (splitArgs.length == 0 || splitArgs.length > 2) { return new IncorrectCommand( String.format(MESSAGE_INVALID_COMMAND_FORMAT, DeleteCommand.MESSAGE_USAGE)); } //takes the last argument given for parsing index Optional<Integer> index = parseIndex(splitArgs[splitArgs.length - 1]); if(!index.isPresent()){ return new IncorrectCommand( String.format(MESSAGE_INVALID_COMMAND_FORMAT, DeleteCommand.MESSAGE_USAGE)); } if (splitArgs.length == 1) { return new DeleteCommand(index.get()); } else { return new DeleteCommand(index.get(), StringUtil.getCategoryIndex(splitArgs[0])); } } /** * Parses arguments in the context of the mark as done command. * * @param args full command args string * @return the prepared command */ private Command prepareDone(String args) { String[] splitArgs = args.trim().split(" "); if (splitArgs.length == 0 || splitArgs.length > 2) { return new IncorrectCommand( String.format(MESSAGE_INVALID_COMMAND_FORMAT, DoneCommand.MESSAGE_USAGE)); } //takes the last argument given for parsing index Optional<Integer> index = parseIndex(splitArgs[splitArgs.length - 1]); if (!index.isPresent()){ return new IncorrectCommand( String.format(MESSAGE_INVALID_COMMAND_FORMAT, DoneCommand.MESSAGE_USAGE)); } if (splitArgs.length == 1) { return new DoneCommand(index.get()); } else { return new DoneCommand(index.get(), StringUtil.getCategoryIndex(splitArgs[0])); } } /** * Parses arguments in the context of the edit task command. * * @param args full command args string * @return the prepared command */ private Command prepareEdit(String args) { String[] splitArgs = args.trim().split(" "); if (splitArgs.length <3) { return new IncorrectCommand( String.format(MESSAGE_INVALID_COMMAND_FORMAT, EditCommand.MESSAGE_USAGE)); } Optional<Integer> index = parseIndex(splitArgs[1]); int categoryIndex = StringUtil.getCategoryIndex(splitArgs[0]); if(!index.isPresent()){ return new IncorrectCommand( String.format(MESSAGE_INVALID_COMMAND_FORMAT, EditCommand.MESSAGE_USAGE)); } try { String arguments = ""; for (int i=2; i<splitArgs.length; i++){ arguments = arguments + splitArgs[i] + " "; } arguments.substring(0, arguments.length()-1); String taskDetailArguments = getTaskDetailArguments(arguments); String tagArguments = getTagArguments(arguments); return new EditCommand( extractTaskDetailsNatty(taskDetailArguments), getTagsFromArgs(tagArguments), index.get(), categoryIndex ); } catch (IllegalValueException ive) { return new IncorrectCommand(ive.getMessage()); } } /** * Parses arguments in the context of the select person command. * * @param args full command args string * @return the prepared command */ private Command prepareSelect(String args) { Optional<Integer> index = parseIndex(args); if(!index.isPresent()){ return new IncorrectCommand( String.format(MESSAGE_INVALID_COMMAND_FORMAT, SelectCommand.MESSAGE_USAGE)); } return new SelectCommand(index.get()); } /** * Returns the specified index in the {@code command} IF a positive unsigned integer is given as the index. * Returns an {@code Optional.empty()} otherwise. */ private Optional<Integer> parseIndex(String command) { final Matcher matcher = TASK_INDEX_ARGS_FORMAT.matcher(command.trim()); if (!matcher.matches()) { return Optional.empty(); } String index = matcher.group("targetIndex"); if(!StringUtil.isUnsignedInteger(index)){ return Optional.empty(); } return Optional.of(Integer.parseInt(index)); } /** * Parses arguments in the context of the find person command. * * @param args full command args string * @return the prepared command */ private Command prepareFind(String args) { final Matcher matcher = KEYWORDS_ARGS_FORMAT.matcher(args.trim()); if (!matcher.matches()) { return new IncorrectCommand(String.format(MESSAGE_INVALID_COMMAND_FORMAT, FindCommand.MESSAGE_USAGE)); } /* TODO: don't check natty twice. Maybe we shouldn't allow them to use find/view interchangably. //check if the keyword given is a single date, if so give a view command String[] date = extractTaskDetailsNatty(args); if (containsOnlyOneDate(date)) { return new ViewCommand(date[1]); }*/ // keywords delimited by whitespace final String[] keywords = matcher.group("keywords").split("\\s+"); final Set<String> keywordSet = new HashSet<>(Arrays.asList(keywords)); return new FindCommand(keywordSet); } /** * checks if the array obtained from extractTaskDetailsNatty obtains only a single date * @param args the string array obtain from extractTaskDetailsNatty * @return true if arguments contains only 1 date in it */ private boolean containsOnlyOneDate(String[] args) { return args.length == 3 && args[2] == null && args[0].equals(""); } }
package seedu.taskitty.logic.parser; import seedu.taskitty.commons.exceptions.IllegalValueException; import seedu.taskitty.commons.util.StringUtil; import seedu.taskitty.logic.commands.*; import seedu.taskitty.model.tag.Tag; import seedu.taskitty.model.task.Task; import seedu.taskitty.model.task.TaskDate; import seedu.taskitty.model.task.TaskTime; import static seedu.taskitty.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT; import static seedu.taskitty.commons.core.Messages.MESSAGE_UNKNOWN_COMMAND; import java.text.SimpleDateFormat; import java.time.LocalDateTime; import java.time.LocalTime; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; import com.joestelmach.natty.DateGroup; import com.joestelmach.natty.Parser; /** * Parses user input. */ public class CommandParser { /** * Used for initial separation of command word and args. */ private static final Pattern BASIC_COMMAND_FORMAT = Pattern.compile("(?<commandWord>\\S+)(?<arguments>.*)"); private static final Pattern TASK_INDEX_ARGS_FORMAT = Pattern.compile("(?<targetIndex>.+)"); private static final Pattern KEYWORDS_ARGS_FORMAT = Pattern.compile("(?<keywords>\\S+(?:\\s+\\S+)*)"); // one or more keywords separated by whitespace private static final Pattern TASK_DATA_ARGS_FORMAT = //Tags must be at the end Pattern.compile("(?<arguments>[\\p{Graph} ]+)"); // \p{Graph} is \p{Alnum} or \p{Punct} private static final Pattern EDIT_TASK_DATA_ARGS_FORMAT = // '/' forward slashes are reserved for delimiter prefixes Pattern.compile("(?<targetIndex>.)" + "(?<name>[^/]+)" + "(?<tagArguments>(?: t/[^/]+)*)"); // variable number of tags public CommandParser() {} /** * Parses user input into command for execution. * * @param userInput full user input string * @return the command based on the user input */ public Command parseCommand(String userInput) { final Matcher matcher = BASIC_COMMAND_FORMAT.matcher(userInput.trim()); if (!matcher.matches()) { return new IncorrectCommand(String.format(MESSAGE_INVALID_COMMAND_FORMAT, HelpCommand.MESSAGE_USAGE)); } final String commandWord = matcher.group("commandWord"); final String arguments = matcher.group("arguments"); switch (commandWord) { case AddCommand.COMMAND_WORD: return prepareAdd(arguments); case SelectCommand.COMMAND_WORD: return prepareSelect(arguments); case DeleteCommand.COMMAND_WORD: return prepareDelete(arguments); case EditCommand.COMMAND_WORD: return prepareEdit(arguments); case ClearCommand.COMMAND_WORD: return new ClearCommand(); case FindCommand.COMMAND_WORD: return prepareFind(arguments); case ListCommand.COMMAND_WORD: return new ListCommand(); case ExitCommand.COMMAND_WORD: return new ExitCommand(); case HelpCommand.COMMAND_WORD: return new HelpCommand(); case DoneCommand.COMMAND_WORD: return prepareDone(arguments); default: return new IncorrectCommand(MESSAGE_UNKNOWN_COMMAND); } } /** * Parses arguments in the context of the add task command. * * @param args full command args string * @return the prepared command */ private Command prepareAdd(String args){ final Matcher matcher = TASK_DATA_ARGS_FORMAT.matcher(args.trim()); // Validate arg string format if (!matcher.matches()) { return new IncorrectCommand(String.format(MESSAGE_INVALID_COMMAND_FORMAT, AddCommand.MESSAGE_USAGE)); } try { String arguments = matcher.group("arguments"); String taskDetailArguments = getTaskDetailArguments(arguments); String tagArguments = getTagArguments(arguments); return new AddCommand( extractTaskDetailsNatty(taskDetailArguments), getTagsFromArgs(tagArguments) ); } catch (IllegalValueException ive) { return new IncorrectCommand(ive.getMessage()); } } /** * Parses the argument to get a string of all the relevant details of the task * * @param arguments command args string without command word */ private String getTaskDetailArguments(String arguments) { //Have 2 magic numbers.. where should I put them.. //-1 is NOT_FOUND //0 is START_OF_ARGUMENT int detailLastIndex = arguments.indexOf(Tag.TAG_VALIDATION_REGEX_PREFIX); if (detailLastIndex == -1) { detailLastIndex = arguments.length(); } return arguments.substring(0, detailLastIndex).trim(); } /** * Parses the argument to get a string of all tags, including the Tag prefix * * @param arguments command args string without command word */ private String getTagArguments(String arguments) { //This line is exactly the same as the 1st line of getTaskDetailArguments.. how? int tagStartIndex = arguments.indexOf(Tag.TAG_VALIDATION_REGEX_PREFIX); if (tagStartIndex == -1) { tagStartIndex = arguments.length(); } return arguments.substring(tagStartIndex); } /** * Extracts the task details into a String array representing the name, date, time. * Details are arranged according to index shown in Task * * @param dataArguments command args string with only name, date, time arguments */ private String[] extractTaskDetailsNatty(String dataArguments) { Parser dateTimeParser = new Parser(); List<DateGroup> dateGroups = dateTimeParser.parse(dataArguments); int nameEndIndex = dataArguments.length(); ArrayList<String> details = new ArrayList<String>(); for (DateGroup group : dateGroups) { List<Date> dates = group.getDates(); nameEndIndex = Math.min(nameEndIndex, group.getPosition() - 1); for (Date date : dates) { details.add(extractLocalDate(date)); details.add(extractLocalTime(date)); } } details.add(0, dataArguments.substring(0, nameEndIndex).trim()); String[] returnDetails = new String[details.size()]; details.toArray(returnDetails); return returnDetails; } /** * Takes in a date from Natty and converts it into a string representing date * Format of date returned is according to TaskDate * * @param date retrieved using Natty */ private String extractLocalDate(Date date) { SimpleDateFormat dateFormat = new SimpleDateFormat(TaskDate.DATE_FORMAT); return dateFormat.format(date); } /** * Takes in a date from Natty and converts it into a string representing time * Format of time returned is according to TaskTime * * @param date retrieved using Natty */ private String extractLocalTime(Date date) { SimpleDateFormat timeFormat = new SimpleDateFormat(TaskTime.TIME_FORMAT); String currentTime = timeFormat.format(new Date()); String inputTime = timeFormat.format(date); if (currentTime.equals(inputTime)) { //Natty parses the current time if string does not include time. //We want to ignore input when current time equal input time return null; } return inputTime; } /** * Extracts the new person's tags from the add command's tag arguments string. * Merges duplicate tag strings. */ private static Set<String> getTagsFromArgs(String tagArguments) throws IllegalValueException { // no tags if (tagArguments.isEmpty()) { return Collections.emptySet(); } // replace first delimiter prefix, then split final Collection<String> tagStrings = Arrays.asList(tagArguments.replaceFirst(" t/", "").split(" t/")); return new HashSet<>(tagStrings); } /** * Parses arguments in the context of the delete person command. * * @param args full command args string * @return the prepared command */ private Command prepareDelete(String args) { String[] splitArgs = args.trim().split(" "); if (splitArgs.length == 0 || splitArgs.length > 2) { return new IncorrectCommand( String.format(MESSAGE_INVALID_COMMAND_FORMAT, DeleteCommand.MESSAGE_USAGE)); } //takes the last argument given for parsing index Optional<Integer> index = parseIndex(splitArgs[splitArgs.length - 1]); if(!index.isPresent()){ return new IncorrectCommand( String.format(MESSAGE_INVALID_COMMAND_FORMAT, DeleteCommand.MESSAGE_USAGE)); } if (splitArgs.length == 1) { return new DeleteCommand(index.get()); } else { return new DeleteCommand(index.get(), StringUtil.getCategoryIndex(splitArgs[0])); } } /** * Parses arguments in the context of the mark as done command. * * @param args full command args string * @return the prepared command */ private Command prepareDone(String args) { Optional<Integer> index = parseIndex(args); if (!index.isPresent()){ return new IncorrectCommand( String.format(MESSAGE_INVALID_COMMAND_FORMAT, DoneCommand.MESSAGE_USAGE)); } return new DoneCommand(index.get()); } /** * Parses arguments in the context of the edit task command. * * @param args full command args string * @return the prepared command */ private Command prepareEdit(String args) { final Matcher matcher = EDIT_TASK_DATA_ARGS_FORMAT.matcher(args.trim()); // Validate arg string format if (!matcher.matches()) { return new IncorrectCommand(String.format(MESSAGE_INVALID_COMMAND_FORMAT, EditCommand.MESSAGE_USAGE)); } String index = matcher.group("targetIndex"); Optional<Integer> index1 = parseIndex(index); if(!index1.isPresent()){ return new IncorrectCommand( String.format(MESSAGE_INVALID_COMMAND_FORMAT, DeleteCommand.MESSAGE_USAGE)); } try { return new EditCommand( matcher.group("name"), getTagsFromArgs(matcher.group("tagArguments")), index1.get() ); } catch (IllegalValueException ive) { return new IncorrectCommand(ive.getMessage()); } } /** * Parses arguments in the context of the select person command. * * @param args full command args string * @return the prepared command */ private Command prepareSelect(String args) { Optional<Integer> index = parseIndex(args); if(!index.isPresent()){ return new IncorrectCommand( String.format(MESSAGE_INVALID_COMMAND_FORMAT, SelectCommand.MESSAGE_USAGE)); } return new SelectCommand(index.get()); } /** * Returns the specified index in the {@code command} IF a positive unsigned integer is given as the index. * Returns an {@code Optional.empty()} otherwise. */ private Optional<Integer> parseIndex(String command) { final Matcher matcher = TASK_INDEX_ARGS_FORMAT.matcher(command.trim()); if (!matcher.matches()) { return Optional.empty(); } String index = matcher.group("targetIndex"); if(!StringUtil.isUnsignedInteger(index)){ return Optional.empty(); } return Optional.of(Integer.parseInt(index)); } /** * Parses arguments in the context of the find person command. * * @param args full command args string * @return the prepared command */ private Command prepareFind(String args) { final Matcher matcher = KEYWORDS_ARGS_FORMAT.matcher(args.trim()); if (!matcher.matches()) { return new IncorrectCommand(String.format(MESSAGE_INVALID_COMMAND_FORMAT, FindCommand.MESSAGE_USAGE)); } // keywords delimited by whitespace final String[] keywords = matcher.group("keywords").split("\\s+"); final Set<String> keywordSet = new HashSet<>(Arrays.asList(keywords)); return new FindCommand(keywordSet); } /** * Returns an array of String representing * * @param args full command args String */ //Should return an object instead of String[].. but how? private String[] extractTaskDetails(String args) { ArrayList<String> details = new ArrayList<String>(); Pattern datePattern = Pattern.compile(TaskDate.DATE_VALIDATION_REGEX_FORMAT); Pattern timePattern = Pattern.compile(TaskTime.TIME_VALIDATION_REGEX_FORMAT); //default name is the entire argument up til the first tag unless there are no tags int startOfTags = args.indexOf(Tag.TAG_VALIDATION_REGEX_PREFIX); int nameLastIndex = args.length(); if (startOfTags != -1) { //What should this -1 be called? nameLastIndex = args.indexOf(Tag.TAG_VALIDATION_REGEX_PREFIX); } Matcher dateMatcher = datePattern.matcher(args); //Max only have 1 date if (dateMatcher.find()) { nameLastIndex = Math.min(nameLastIndex, dateMatcher.start()); details.add(dateMatcher.group()); } Matcher timeMatcher = timePattern.matcher(args); //Max only have 2 times while (timeMatcher.find()) { nameLastIndex = Math.min(nameLastIndex, timeMatcher.start()); details.add(timeMatcher.group()); } //Do I need to declare the 0 as START_OF_ALL_STRINGS_IN_THE_WORLD? details.add(Task.TASK_COMPONENT_INDEX_NAME, args.substring(0, nameLastIndex)); String[] returnDetails = new String[details.size()]; details.toArray(returnDetails); return returnDetails; } /** * Returns the date found from the arguments as a String or null if no date is found * * @param args full command args string */ private String findDate(String args) { Pattern datePattern = Pattern.compile(TaskDate.DATE_VALIDATION_REGEX_FORMAT); Matcher dateMatcher = datePattern.matcher(args); //Max of 2 dates String date = null; if (dateMatcher.find()) { date = dateMatcher.group(); } return date; } /** * Returns the times found from the arguments as a String array * The length of the array represents the number of times found * * @param args full command args string */ private String[] findTimes(String args) { Pattern timePattern = Pattern.compile(TaskTime.TIME_VALIDATION_REGEX_FORMAT); Matcher timeMatcher = timePattern.matcher(args); //Max of 2 dates int timesArraySize = 0; String firstTime = null; if (timeMatcher.find()) { timesArraySize++; firstTime = timeMatcher.group(); } String secondTime = null; if (timeMatcher.find()) { timesArraySize++; secondTime = timeMatcher.group(); } String[] times = new String[timesArraySize]; if (timesArraySize == 1) { times[0] = firstTime; } else if (timesArraySize == 2){ times[0] = firstTime; times[1] = secondTime; } return times; } }
package seedu.todo.ui.components; import javafx.fxml.FXML; import javafx.scene.layout.Pane; import javafx.scene.text.Text; import javafx.stage.Stage; import seedu.todo.models.Task; import seedu.todo.ui.UiPartLoader; public class TaskListTaskItem extends MultiComponent { private static final String FXML_PATH = "components/TaskListTaskItem.fxml"; // Props public Task task; public int displayIndex; // FXML @FXML private Text taskText; public static TaskListTaskItem load(Stage primaryStage, Pane placeholderPane) { return UiPartLoader.loadUiPart(primaryStage, placeholderPane, new TaskListTaskItem()); } @Override public String getFxmlPath() { return FXML_PATH; } @Override public void componentDidMount() { taskText.setText(formatTaskText(displayIndex, task.getName())); } private String formatTaskText(int index, String taskName) { return String.format("%s. %s", index, taskName); } }
package seedu.unburden.logic.commands; import seedu.unburden.commons.core.Messages; import seedu.unburden.commons.core.UnmodifiableObservableList; import seedu.unburden.model.task.ReadOnlyTask; /** * Deletes a person identified using it's last displayed index from the address * book. * * @@author A0143095H */ // @@Gauri Joshi A0143095H public class DoneCommand extends Command { public static final String COMMAND_WORD = "done"; public static final String MESSAGE_USAGE = COMMAND_WORD + ": Marks the task identified by the index number used in the last task listing as done.\n" + "Parameters: INDEX (must be a positive integer)\n" + "Example: " + COMMAND_WORD + " 1"; public static final String MESSAGE_DONE_TASK_SUCCESS = "Well done! Task Done!"; public final int targetIndex; public DoneCommand() { this.targetIndex = Integer.MIN_VALUE; // Dummy variable for the index } public DoneCommand(int targetIndex) { this.targetIndex = targetIndex; } @Override public CommandResult execute() { assert model != null; UnmodifiableObservableList<ReadOnlyTask> lastShownList = model.getFilteredTaskList(); if (targetIndex == Integer.MIN_VALUE) { model.saveToPrevLists(); while(lastShownList.size() != 0){ ReadOnlyTask task = lastShownList.get(0); model.doneTask(task, true); } return new CommandResult(MESSAGE_DONE_TASK_SUCCESS); } else { if (lastShownList.size() < targetIndex) { //Check for out of bounds indicateAttemptToExecuteIncorrectCommand(); return new CommandResult(Messages.MESSAGE_INVALID_TASK_DISPLAYED_INDEX); } ReadOnlyTask taskToDone = lastShownList.get(targetIndex - 1); if(taskToDone.getDone()){ return new CommandResult(Messages.MESSAGE_TASK_IS_ALREADY_DONE); } model.saveToPrevLists(); model.doneTask(taskToDone, true); return new CommandResult(String.format(MESSAGE_DONE_TASK_SUCCESS, taskToDone)); } } }
package seedu.unburden.logic.commands; import java.text.ParseException; import java.util.Date; import java.util.List; import java.util.Set; import seedu.unburden.commons.exceptions.IllegalValueException; import seedu.unburden.model.tag.UniqueTagList.DuplicateTagException; import seedu.unburden.model.task.ReadOnlyTask; import seedu.unburden.model.task.Task; /** * Finds and lists all persons in address book whose name contains any of the * argument keywords. Keyword matching is case sensitive. * @@author A0139678J */ //@@Nathanael Chan A0139678J public class FindCommand extends Command { public static final String COMMAND_WORD = "find"; public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds all persons whose names contain any of " + "the specified keywords (case-sensitive) and displays them as a list with index numbers.\n" + "Parameters: KEYWORD [MORE_KEYWORDS]...\n" + "Example: " + COMMAND_WORD + " alice bob charlie"; private final Set<String> keywords; private final String date; private final String modeOfSearch; public FindCommand(Set<String> keywords, String modeOfSearch) { this.keywords = keywords; this.date = null; this.modeOfSearch = modeOfSearch; } public FindCommand(String date, String modeOfSearch) { this.keywords = null; this.date = date; this.modeOfSearch = modeOfSearch; } private java.util.function.Predicate<? super Task> getTasksWithSameNameOrTags(Set<String> args) { return t -> { try { return t.getName().contains(args) || t.getTags().contains(args); } catch (IllegalValueException e) { return false; } }; } private java.util.function.Predicate<? super Task> getDates(String date) { return t -> { return t.getDate().getFullDate().equals(date); }; } @Override public CommandResult execute() throws DuplicateTagException, IllegalValueException { switch (modeOfSearch) { case "date": model.updateFilteredTaskList(getDates(date)); break; case "name": model.updateFilteredTaskList(getTasksWithSameNameOrTags(keywords)); } overdueOrNot(); return new CommandResult(getMessageForTaskListShownSummary(model.getFilteredTaskList().size())); } //This method checks the entire list to check for overdue tasks private void overdueOrNot() throws IllegalValueException, DuplicateTagException { List<ReadOnlyTask> currentTaskList= model.getListOfTask().getTaskList(); for(ReadOnlyTask task : currentTaskList){ if(((Task) task).checkOverDue()){ ((Task) task).setOverdue(); } else{ ((Task) task).setNotOverdue(); } } } }
package technology.tabula; import java.awt.geom.Rectangle2D; import java.awt.geom.Line2D; /** * Implements the well known Cohen Sutherland line * clipping algorithm (line against clip rectangle). */ public final class CohenSutherlandClipping { private double xMin; private double yMin; private double xMax; private double yMax; private static final int INSIDE = 0; private static final int LEFT = 1; private static final int RIGHT = 2; private static final int BOTTOM = 4; private static final int TOP = 8; private final static float MINIMUM_DELTA = 0.01f; /** * Creates a Cohen Sutherland clipper with clip window (0, 0, 0, 0). */ public CohenSutherlandClipping() {} /** * Creates a Cohen Sutherland clipper with the given clip window. * @param clipWindow the clip window to use. */ public CohenSutherlandClipping(Rectangle2D clipWindow) { setClip(clipWindow); } /** * Sets the clip rectangle. * @param clipWindow the clip window. */ public void setClip(Rectangle2D clipWindow) { xMin = clipWindow.getX(); xMax = xMin + clipWindow.getWidth(); yMin = clipWindow.getY(); yMax = yMin + clipWindow.getHeight(); } /** * Clips a given line against the clip window. * The modification (if needed) is done in place. * @param line the line to clip. * @return true if line is clipped, false if line is * totally outside the clip window. */ public boolean clip(Line2D.Float line) { Point point1 = new Point(line.getX1(), line.getY1()); Point point2 = new Point(line.getX2(), line.getY2()); Point outsidePoint = new Point(0d, 0d); boolean lineIsVertical = (point1.x == point2.x); double lineSlope = lineIsVertical ? 0d : (point2.y-point1.y)/(point2.x-point1.x); while (point1.region != INSIDE || point2.region != INSIDE) { if ((point1.region & point2.region) != 0) return false; outsidePoint.region = (point1.region == INSIDE) ? point2.region : point1.region; if ((outsidePoint.region & LEFT) != 0) { outsidePoint.x = xMin; outsidePoint.y = delta(outsidePoint.x, point1.x)*lineSlope + point1.y; } else if ((outsidePoint.region & RIGHT) != 0) { outsidePoint.x = xMax; outsidePoint.y = delta(outsidePoint.x, point1.x)*lineSlope + point1.y; } else if ((outsidePoint.region & BOTTOM) != 0) { outsidePoint.y = yMin; outsidePoint.x = lineIsVertical ? point1.x : delta(outsidePoint.y, point1.y)/lineSlope + point1.x; } else if ((outsidePoint.region & TOP) != 0) { outsidePoint.y = yMax; outsidePoint.x = lineIsVertical ? point1.x : delta(outsidePoint.y, point1.y)/lineSlope + point1.x; } if (outsidePoint.isInTheSameRegionAs(point1)) { point1.setPositionAndRegion(outsidePoint.x, outsidePoint.y); } else { point2.setPositionAndRegion(outsidePoint.x, outsidePoint.y); } } line.setLine(point1.x, point1.y, point2.x, point2.y); return true; } private static double delta(double value1, double value2) { return (Math.abs(value1 - value2) < MINIMUM_DELTA) ? 0 : (value1 - value2); } class Point { double x, y; int region; Point(double x, double y) { setPositionAndRegion(x, y); } void setPositionAndRegion(double x, double y) { this.x = x; this.y = y; region = (x < xMin) ? LEFT : (x > xMax) ? RIGHT : INSIDE; if (y < yMin) region |= BOTTOM; else if (y > yMax) region |= TOP; } boolean isInTheSameRegionAs(Point otherPoint) { return this.region == otherPoint.region; } } }
// jTDS JDBC Driver for Microsoft SQL Server and Sybase // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // This library is distributed in the hope that it will be useful, // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // You should have received a copy of the GNU Lesser General Public // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA package net.sourceforge.jtds.jdbc.cache; import java.util.Collection; /** * Interface for a statement cache. Abstraction of the caching mechanism by use * of this interface will allow developers to create custom caching schemes * that are optimal for their specific applications. Any synchronization * required by an implementation should utilize the implementing object for the * lock. * <p> * There are two types of attributes that the cache is concerned with: * <dl> * <dt>statement key</dt> * <dd><code>String</code> generated from the SQL query for which the * prepared statement was created, the database name and the parameter * types; this key uniquely identifies a server-side preparation of the * statement and is used to retrieve the handle of the statement when it * needs to be executed</dd> * <dt>temporary procedure name or <code>sp_prepare</code> or * <code>sp_cursorprepare</code> handle on the server</dt> * <dd>One <code>PreparedStatement</code> can map to multiple handles, depending on * the types of the parameters it is called with (hence the need to be able * to map both keys and SQL strings to handles)</dd> * </dl> * The cache can retrieve statement handles using statement keys. * <p> * The caching types provided by jTDS should be: * <ul> * <li>Arbitrary first un-latched (initial default until other caches are * implemented)</li> * <li>Fast caching (never latches and never releases handles)</li> * <li>FIFO</li> * <li>LRU</li> * <li>No caching</li> * <li>Touch Count / Most Frequently Used</li> * </ul> * * @author Brian Heineman * @version $Id: StatementCache.java,v 1.6 2007-07-11 19:57:06 bheineman Exp $ */ public interface StatementCache { /** * Returns a statement handle associated with the specified key or * <code>null</code> if the key specified does not have an associated * statement handle. * * @param key the statement key whose associated handle is to be returned * @return statement handle */ Object get(String key); /** * Places the specified statement handle in the cache for the given key. If * a key already exists in the cache, the handle will be overwritten. * * @param key the statement key to associated with the handle * @param handle the statement handle */ void put(String key, Object handle); /** * Removes a statement key and handle from the cache for the specified key. * * @param key the statement key whose associated handle is to be removed * from the cache */ void remove(String key); /** * Returns a <code>Collection</code> of obsolete statement handles that may * be released, or <code>null</code> if no statement handles are obsolete. * * @param handles the statement handles that are no longer being used * @return <code>Collection</code> of obsolete statement handles to be * removed */ Collection getObsoleteHandles(Collection handles); }
/* This file is automatically generated. Do not edit. */ package net.runelite.api; public final class ObjectID { public static final int CRATE = 1; public static final int CAVE_ENTRANCE = 2; public static final int DOOR = 3; public static final int DOOR_4 = 4; public static final int BROKEN_MULTICANNON = 5; public static final int DWARF_MULTICANNON = 6; public static final int CANNON_BASE = 7; public static final int CANNON_STAND = 8; public static final int CANNON_BARRELS = 9; public static final int LADDER = 10; public static final int LADDER_11 = 11; public static final int ROCK_PILE = 12; public static final int MUD_PILE = 13; public static final int RAILING = 14; public static final int RAILING_15 = 15; public static final int RAILING_16 = 16; public static final int RAILING_17 = 17; public static final int RAILING_18 = 18; public static final int RAILING_19 = 19; public static final int RAILING_20 = 20; public static final int MYSTERIOUS_STATUE = 21; public static final int DOOR_22 = 22; public static final int SACKS = 23; public static final int DOOR_24 = 24; public static final int CLOCK_SPINDLE = 25; public static final int CLOCK_SPINDLE_26 = 26; public static final int CLOCK_SPINDLE_27 = 27; public static final int CLOCK_SPINDLE_28 = 28; public static final int CLOCK_SPINDLE_29 = 29; public static final int CLOCK_SPINDLE_30 = 30; public static final int CLOCK_SPINDLE_31 = 31; public static final int CLOCK_SPINDLE_32 = 32; public static final int LEVER = 33; public static final int LEVER_34 = 34; public static final int LEVER_35 = 35; public static final int LEVER_36 = 36; public static final int GATE = 37; public static final int GATE_38 = 38; public static final int GATE_39 = 39; public static final int FOOD_TROUGH = 40; public static final int WALL_PIPE = 41; public static final int FISHING_SPOT = 42; public static final int WATER = 43; public static final int FISHING_SPOT_44 = 44; public static final int FISHING_SPOT_45 = 45; public static final int FISHING_SPOT_46 = 46; public static final int GATE_47 = 47; public static final int GATE_48 = 48; public static final int GATE_49 = 49; public static final int GATE_50 = 50; public static final int LOOSE_RAILING = 51; public static final int GATE_52 = 52; public static final int GATE_53 = 53; public static final int STAIRS = 54; public static final int STAIRS_55 = 55; public static final int STAIRS_56 = 56; public static final int STAIRS_57 = 57; public static final int VINE = 58; public static final int DOOR_59 = 59; public static final int LADDER_60 = 60; public static final int CHAOS_ALTAR = 61; public static final int GIANT_CRYSTAL = 62; public static final int CRATE_63 = 63; public static final int CRATE_64 = 64; public static final int CRATE_67 = 67; public static final int BEEHIVE = 68; public static final int GANGPLANK = 69; public static final int GANGPLANK_70 = 70; public static final int LARGE_DOOR = 71; public static final int LARGE_DOOR_72 = 72; public static final int LARGE_DOOR_73 = 73; public static final int LARGE_DOOR_74 = 74; public static final int CHEST = 75; public static final int CHEST_76 = 76; public static final int DOOR_77 = 77; public static final int DOOR_78 = 78; public static final int PRISON_DOOR = 79; public static final int PRISON_DOOR_80 = 80; public static final int DOOR_81 = 81; public static final int DOOR_82 = 82; public static final int LEVER_BRACKET = 86; public static final int LEVER_87 = 87; public static final int GATE_89 = 89; public static final int GATE_90 = 90; public static final int LEVER_91 = 91; public static final int DOOR_92 = 92; public static final int DOOR_93 = 93; public static final int GATE_94 = 94; public static final int GATE_95 = 95; public static final int STAIRS_96 = 96; public static final int STAIRS_98 = 98; public static final int DOOR_99 = 99; public static final int TRAPDOOR = 100; public static final int LADDER_101 = 101; public static final int DOOR_102 = 102; public static final int CLOSED_CHEST = 103; public static final int OPEN_CHEST = 104; public static final int TRAPDOOR_105 = 105; public static final int TRAPDOOR_106 = 106; public static final int COOKING_RANGE = 114; public static final int PARTY_BALLOON = 115; public static final int PARTY_BALLOON_116 = 116; public static final int PARTY_BALLOON_117 = 117; public static final int PARTY_BALLOON_118 = 118; public static final int PARTY_BALLOON_119 = 119; public static final int PARTY_BALLOON_120 = 120; public static final int PARTY_BALLOON_121 = 121; public static final int PARTY_BALLOON_122 = 122; public static final int PARTY_BALLOON_123 = 123; public static final int PARTY_BALLOON_124 = 124; public static final int PARTY_BALLOON_125 = 125; public static final int PARTY_BALLOON_126 = 126; public static final int PARTY_BALLOON_127 = 127; public static final int PARTY_BALLOON_128 = 128; public static final int PARTY_BALLOON_129 = 129; public static final int PARTY_BALLOON_130 = 130; public static final int DOOR_131 = 131; public static final int LADDER_132 = 132; public static final int LADDER_133 = 133; public static final int LARGE_DOOR_134 = 134; public static final int LARGE_DOOR_135 = 135; public static final int DOOR_136 = 136; public static final int COMPOST_HEAP = 152; public static final int FOUNTAIN = 153; public static final int ROCKS = 154; public static final int BOOKCASE = 155; public static final int BOOKCASE_156 = 156; public static final int BOOKCASE_157 = 157; public static final int WALL = 158; public static final int WALL_159 = 159; public static final int LEVER_160 = 160; public static final int STRANGE_MACHINE = 162; public static final int STRANGE_MACHINE_163 = 163; public static final int STRANGE_MACHINE_164 = 164; public static final int INCINERATOR = 165; public static final int GATE_166 = 166; public static final int GATE_167 = 167; public static final int CLOSED_CHEST_170 = 170; public static final int OPEN_CHEST_171 = 171; public static final int CLOSED_CHEST_172 = 172; public static final int OPEN_CHEST_173 = 173; public static final int GNOME_GLIDER = 187; public static final int CRASHED_GLIDER = 188; public static final int BLURBERRY_BAR = 189; public static final int GATE_190 = 190; public static final int HOLLOWED_ROCK = 194; public static final int LADDER_195 = 195; public static final int LAMP = 200; public static final int LAMP_201 = 201; public static final int CANDLES = 202; public static final int CANDLES_203 = 203; public static final int CANDLES_204 = 204; public static final int CANDLES_208 = 208; public static final int CHANDELIER = 209; public static final int ICE_LIGHT = 210; public static final int CANDLES_211 = 211; public static final int SAIL = 212; public static final int SAIL_218 = 218; public static final int FIGUREHEAD = 221; public static final int FIGUREHEAD_222 = 222; public static final int SAIL_225 = 225; public static final int SAIL_226 = 226; public static final int PILE_OF_ROPE = 227; public static final int SHIPS_LADDER = 245; public static final int SHIPS_LADDER_246 = 246; public static final int SHIPS_WHEEL = 252; public static final int FIGUREHEAD_254 = 254; public static final int WINCH = 255; public static final int FIGUREHEAD_260 = 260; public static final int SAIL_265 = 265; public static final int SAIL_266 = 266; public static final int SAIL_267 = 267; public static final int SAIL_268 = 268; public static final int ANCHOR = 271; public static final int SHIPS_LADDER_272 = 272; public static final int SHIPS_LADDER_273 = 273; public static final int HOISTED_SAIL = 274; public static final int HOISTED_SAIL_275 = 275; public static final int HOISTED_SAIL_276 = 276; public static final int HOISTED_SAIL_277 = 277; public static final int HOISTED_SAIL_278 = 278; public static final int HOISTED_SAIL_279 = 279; public static final int LADDER_287 = 287; public static final int PLOUGH = 296; public static final int SCARECROW = 297; public static final int HAY_BALES = 298; public static final int HAY_BALES_299 = 299; public static final int HAYSTACK = 300; public static final int FOOD_TROUGH_301 = 301; public static final int EGGS = 302; public static final int COMPOST = 303; public static final int HAY_BALE = 304; public static final int BEEHIVE_305 = 305; public static final int BROKEN_CART = 306; public static final int CART = 307; public static final int CART_308 = 308; public static final int LOG_PILE = 309; public static final int MUD_PATCH = 310; public static final int MUDPILE = 311; public static final int POTATO = 312; public static final int WHEAT = 313; public static final int BROKEN_CART_WHEEL = 327; public static final int CABINET = 346; public static final int CABINET_347 = 347; public static final int DRAWERS = 348; public static final int DRAWERS_349 = 349; public static final int DRAWERS_350 = 350; public static final int DRAWERS_351 = 351; public static final int DRAWERS_352 = 352; public static final int DRAWERS_353 = 353; public static final int CRATE_354 = 354; public static final int CRATE_355 = 355; public static final int CRATE_356 = 356; public static final int CRATE_357 = 357; public static final int CRATE_358 = 358; public static final int BOXES = 359; public static final int BOXES_360 = 360; public static final int BOXES_361 = 361; public static final int BARREL = 362; public static final int BARREL_363 = 363; public static final int BARREL_364 = 364; public static final int SACKS_365 = 365; public static final int CRATE_366 = 366; public static final int CUPBOARD = 367; public static final int CUPBOARD_368 = 368; public static final int LARGE_CUPBOARD = 369; public static final int OPEN_CUPBOARD = 370; public static final int CUPBOARD_371 = 371; public static final int LARGE_OPEN_CUPBOARD = 372; public static final int DRESSER = 373; public static final int HAT_STAND = 374; public static final int CLOSED_CHEST_375 = 375; public static final int CLOSED_CHEST_376 = 376; public static final int CLOSED_CHEST_377 = 377; public static final int OPEN_CHEST_378 = 378; public static final int OPEN_CHEST_379 = 379; public static final int BOOKCASE_380 = 380; public static final int BOOKCASE_381 = 381; public static final int BASKET = 383; public static final int BASKET_384 = 384; public static final int BASKET_385 = 385; public static final int LARGE_URN = 386; public static final int BOOKSHELVES = 387; public static final int WARDROBE = 388; public static final int WARDROBE_389 = 389; public static final int WARDROBE_390 = 390; public static final int FULL_FISHING_NET = 392; public static final int BOOKCASE_393 = 393; public static final int BOOKCASE_394 = 394; public static final int POT = 395; public static final int POTS = 396; public static final int CABINET_397 = 397; public static final int COFFIN = 398; public static final int SMALL_GRAVESTONE = 400; public static final int GRAVE_MARKER = 401; public static final int TOMBSTONE = 402; public static final int LARGE_GRAVE_STONE = 403; public static final int GRAVESTONE = 404; public static final int GRAVESTONE_405 = 405; public static final int LARGE_GRAVE = 406; public static final int HENGE = 407; public static final int HENGE_408 = 408; public static final int ALTAR = 409; public static final int ALTAR_OF_GUTHIX = 410; public static final int CHAOS_ALTAR_411 = 411; public static final int CHAOS_ALTAR_412 = 412; public static final int DOLMEN = 413; public static final int COFFIN_414 = 414; public static final int COFFIN_415 = 415; public static final int CHURCH_ORGAN = 416; public static final int BED = 417; public static final int BED_418 = 418; public static final int BED_419 = 419; public static final int BED_420 = 420; public static final int BED_421 = 421; public static final int BED_422 = 422; public static final int BED_423 = 423; public static final int BED_424 = 424; public static final int BED_425 = 425; public static final int BED_426 = 426; public static final int BED_427 = 427; public static final int BED_428 = 428; public static final int BED_429 = 429; public static final int HAMMOCK = 430; public static final int CHAISE_LOUNGE = 431; public static final int BED_432 = 432; public static final int BED_433 = 433; public static final int BED_434 = 434; public static final int BED_435 = 435; public static final int DOOR_438 = 438; public static final int DOOR_532 = 532; public static final int CREVICE = 534; public static final int CREVICE_535 = 535; public static final int CREVICE_536 = 536; public static final int CREVICE_537 = 537; public static final int CREVICE_538 = 538; public static final int CURTAIN = 539; public static final int RED_SPICE_4 = 540; public static final int ORANGE_SPICE_4 = 541; public static final int BROWN_SPICE_4 = 542; public static final int YELLOW_SPICE_4 = 543; public static final int BROKEN_FENCE = 544; public static final int DOOR_553 = 553; public static final int ICICLE = 554; public static final int ICICLE_555 = 555; public static final int ICICLE_556 = 556; public static final int ICICLE_557 = 557; public static final int CAVE_ENTRANCE_558 = 558; public static final int STATUE_OF_A_WARRIOR = 562; public static final int STATUE_OF_A_KING = 563; public static final int STATUE_OF_A_QUEEN = 564; public static final int STATUE_OF_A_KING_565 = 565; public static final int STATUE_OF_A_WARRIOR_566 = 566; public static final int TRIBAL_STATUE = 567; public static final int DWARF_STATUE = 568; public static final int GNOME_STATUE = 569; public static final int GNOME_STATUE_570 = 570; public static final int GNOME_STATUE_571 = 571; public static final int GNOME_STATUE_572 = 572; public static final int GNOME_STATUE_573 = 573; public static final int STATUE = 574; public static final int STATUE_575 = 575; public static final int STATUE_576 = 576; public static final int STATUE_579 = 579; public static final int STATUE_580 = 580; public static final int STATUE_581 = 581; public static final int STATUE_582 = 582; public static final int VASE = 583; public static final int STATUE_584 = 584; public static final int STATUE_OF_SARADOMIN = 585; public static final int STATUE_OF_SARADOMIN_586 = 586; public static final int STATUE_OF_ZAMORAK = 587; public static final int STATUE_STEPS = 588; public static final int CRYSTAL_BALL = 589; public static final int BANK_TABLE = 590; public static final int BANK_TABLE_591 = 591; public static final int BATHROOM_TABLE = 592; public static final int TABLE = 593; public static final int TABLE_594 = 594; public static final int TABLE_595 = 595; public static final int TABLE_596 = 596; public static final int TABLE_597 = 597; public static final int TABLE_598 = 598; public static final int TABLE_599 = 599; public static final int TABLE_600 = 600; public static final int TABLE_601 = 601; public static final int TABLE_602 = 602; public static final int TABLE_603 = 603; public static final int TABLE_604 = 604; public static final int TABLE_605 = 605; public static final int TABLE_606 = 606; public static final int TABLE_607 = 607; public static final int STUDY_DESK = 608; public static final int WORKBENCH = 609; public static final int WORKBENCH_610 = 610; public static final int PICNIC_BENCH = 611; public static final int COUNTER = 612; public static final int TABLE_613 = 613; public static final int TABLE_614 = 614; public static final int SMALL_TABLE = 615; public static final int TABLE_616 = 616; public static final int COUNTER_617 = 617; public static final int CHEMISTRY_TABLE = 618; public static final int CHEMISTRY_TABLE_619 = 619; public static final int TABLE_620 = 620; public static final int TABLE_621 = 621; public static final int TABLE_622 = 622; public static final int TABLE_623 = 623; public static final int TABLE_624 = 624; public static final int SILVER_STALL = 628; public static final int SILK_STALL = 629; public static final int BAKERY_STALL = 630; public static final int GEM_STALL = 631; public static final int FUR_STALL = 632; public static final int SPICE_STALL = 633; public static final int MARKET_STALL = 634; public static final int TEA_STALL = 635; public static final int BUFFERS = 636; public static final int MINE_CART = 637; public static final int RACK = 647; public static final int STOCKS = 648; public static final int GALLOWS = 649; public static final int BURIED_SKELETON = 651; public static final int PILE_OF_SKULLS = 658; public static final int CHARRED_BONES = 659; public static final int CORPSE = 660; public static final int CORPSE_661 = 661; public static final int CORPSE_662 = 662; public static final int CORPSE_663 = 663; public static final int CORPSE_664 = 664; public static final int CORPSE_665 = 665; public static final int CORPSE_666 = 666; public static final int CORPSE_667 = 667; public static final int PILE_OF_SKULLS_668 = 668; public static final int CATAPULT = 671; public static final int BROKEN_BARREL = 672; public static final int SMALL_FISHING_NET = 674; public static final int PASSAGE = 677; public static final int CAVE = 678; public static final int CAVE_EXIT = 679; public static final int PIANO = 680; public static final int PIANO_681 = 681; public static final int PIANO_STOOL = 682; public static final int GRANDFATHER_CLOCK = 683; public static final int SWAMP_BUBBLES = 684; public static final int WEATHER_VANE = 685; public static final int MIRROR = 689; public static final int BATH_SCREEN = 690; public static final int SCREEN = 691; public static final int CAULDRON = 692; public static final int BROOM = 693; public static final int CLOTHES_MODEL = 694; public static final int CLOTHES_MODEL_695 = 695; public static final int HOLE = 696; public static final int ANIMAL_SKULL = 697; public static final int BIG_EGG = 698; public static final int CARCASS = 699; public static final int CURVED_BONE = 700; public static final int CURVED_BONE_701 = 701; public static final int LARGE_BONE = 702; public static final int LARGE_BONE_703 = 703; public static final int BELL = 707; public static final int BELL_MECHANISM = 708; public static final int BELL_ROPE = 709; public static final int HOLE_IN_WALL = 710; public static final int CRYSTAL_CLUSTER = 711; public static final int CRYSTAL_CLUSTER_712 = 712; public static final int CRYSTAL_CLUSTER_713 = 713; public static final int FIRE_REMAINS = 714; public static final int BARREL_718 = 718; public static final int SHAKING_BOX = 721; public static final int BURIED_SKELETON_723 = 723; public static final int STANDING_TORCH = 724; public static final int CAVE_WEB = 727; public static final int WEB = 733; public static final int SLASHED_WEB = 734; public static final int SWAMP_BUBBLES_735 = 735; public static final int ANIMAL_SKULL_736 = 736; public static final int CARCASS_737 = 737; public static final int BROKEN_LADDER = 741; public static final int LADDER_743 = 743; public static final int SCAFFOLD = 744; public static final int CAVE_ENTRANCE_748 = 748; public static final int DOOR_777 = 777; public static final int DOOR_778 = 778; public static final int BAMBOO_DOOR = 779; public static final int LOOM = 787; public static final int CITY_GATE = 788; public static final int CITY_GATE_789 = 789; public static final int SUIT_OF_ARMOUR = 817; public static final int SUIT_OF_ARMOUR_818 = 818; public static final int SUIT_OF_ARMOUR_819 = 819; public static final int SUIT_OF_ARMOUR_820 = 820; public static final int CANNON = 821; public static final int CANNONBALLS = 822; public static final int DUMMY = 823; public static final int WOODEN_DEFENCE = 824; public static final int TARGET = 829; public static final int SWORD_CABINET = 834; public static final int SWORD_CABINET_835 = 835; public static final int BOW_CABINET = 836; public static final int AXE_CABINET = 837; public static final int AXE_CABINET_838 = 838; public static final int BOW_CABINET_839 = 839; public static final int SPEAR_WALL = 848; public static final int SPEAR_WALL_849 = 849; public static final int STANDARD = 851; public static final int STANDARD_852 = 852; public static final int STANDARD_853 = 853; public static final int STANDARD_854 = 854; public static final int STANDARD_855 = 855; public static final int STANDARD_856 = 856; public static final int STANDARD_857 = 857; public static final int STANDARD_858 = 858; public static final int STANDARD_859 = 859; public static final int FLAGPOLE = 860; public static final int FLAGPOLE_861 = 861; public static final int FLAGPOLE_862 = 862; public static final int STANDARD_863 = 863; public static final int STANDARD_864 = 864; public static final int STANDARD_865 = 865; public static final int STANDARD_866 = 866; public static final int STANDARD_867 = 867; public static final int STANDARD_868 = 868; public static final int FLAGPOLE_869 = 869; public static final int TOTEM_POLE = 870; public static final int BATH_PIPES = 871; public static final int LARGE_SEWER_PIPE = 872; public static final int SINK = 873; public static final int SINK_874 = 874; public static final int BATH = 875; public static final int WELL = 878; public static final int FOUNTAIN_879 = 879; public static final int FOUNTAIN_880 = 880; public static final int MANHOLE = 881; public static final int MANHOLE_882 = 882; public static final int GATE_883 = 883; public static final int WELL_884 = 884; public static final int BAR_PUMPS = 885; public static final int BAR_PUMPS_886 = 886; public static final int PORTRAIT = 887; public static final int PAINTING = 888; public static final int PAINTING_889 = 889; public static final int PORTRAIT_890 = 890; public static final int LANDSCAPE = 891; public static final int PAINTING_892 = 892; public static final int PAINTING_893 = 893; public static final int LANDSCAPE_894 = 894; public static final int PAINTING_895 = 895; public static final int STAR_CHART = 896; public static final int STAR_CHART_897 = 897; public static final int CROSS = 898; public static final int HANGING_BANNER = 899; public static final int HANGING_BANNER_900 = 900; public static final int HANGING_BANNER_901 = 901; public static final int HANGING_BANNER_902 = 902; public static final int UNICORNS_HEAD = 903; public static final int DRAGONS_HEAD = 904; public static final int DRAGONS_HEAD_905 = 905; public static final int BULLS_HEAD = 906; public static final int CHARMS = 907; public static final int MAGICAL_SYMBOL = 908; public static final int PLAQUE = 909; public static final int EVIL_EYE_DECORATION = 910; public static final int GLYPHS = 911; public static final int FONT = 915; public static final int DOOR_954 = 954; public static final int SPOOKY_PICTURE = 955; public static final int CLOCK_FACE = 959; public static final int CLOCK_FACE_960 = 960; public static final int BANK_NOTICE_BOARD = 961; public static final int NOTICEBOARD = 962; public static final int CLOTHES_EQUIPMENT = 963; public static final int STUFFED_SWORDFISH = 964; public static final int STUFFED_SWORDFISH_965 = 965; public static final int JOLLY_ROGER = 966; public static final int HANGING_WHEEL = 967; public static final int PIRATE_MAP = 968; public static final int FISHING_NET = 969; public static final int PLAQUE_970 = 970; public static final int BOW_AND_ARROW = 971; public static final int ARROWS = 972; public static final int JAVELIN = 973; public static final int STUDDED_LEATHER = 974; public static final int DRAGONHIDE_LEATHER = 975; public static final int STILE = 993; public static final int BROKEN_RAILING = 1004; public static final int BROKEN_RAILING_1005 = 1005; public static final int BROKEN_RAILING_1006 = 1006; public static final int SHELVES = 1010; public static final int SHELVES_1011 = 1011; public static final int SHELVES_1012 = 1012; public static final int COOKING_SHELVES = 1013; public static final int SHELVES_1014 = 1014; public static final int SHELVES_1015 = 1015; public static final int SHELVES_1016 = 1016; public static final int SHELVES_1017 = 1017; public static final int SHELVES_1018 = 1018; public static final int SHELF = 1019; public static final int SHELF_1020 = 1020; public static final int SHELF_1021 = 1021; public static final int SHELVES_1024 = 1024; public static final int CLOTHING_SHELVES = 1025; public static final int TANNING_LINE = 1027; public static final int VAT = 1028; public static final int VAT_1029 = 1029; public static final int MANGLE = 1030; public static final int MANGLE_1031 = 1031; public static final int DANGER_SIGN = 1032; public static final int SIGNPOST = 1033; public static final int SIGNPOST_1034 = 1034; public static final int SIGNPOST_1035 = 1035; public static final int SIGN = 1057; public static final int SIGN_1068 = 1068; public static final int SIGN_1069 = 1069; public static final int SIGN_1070 = 1070; public static final int SIGN_1071 = 1071; public static final int SIGN_1072 = 1072; public static final int SIGN_1073 = 1073; public static final int SIGN_1074 = 1074; public static final int SIGN_1075 = 1075; public static final int SIGN_1076 = 1076; public static final int SIGN_1077 = 1077; public static final int SIGN_1078 = 1078; public static final int SIGNPOST_1079 = 1079; public static final int SIGNPOST_1080 = 1080; public static final int SIGNPOST_1081 = 1081; public static final int SIGNPOST_1082 = 1082; public static final int SIGNPOST_1083 = 1083; public static final int SIGNPOST_1084 = 1084; public static final int SIGNPOST_1085 = 1085; public static final int SIGNPOST_1086 = 1086; public static final int SIGNPOST_1087 = 1087; public static final int CHAIR = 1088; public static final int SMASHED_CHAIR = 1089; public static final int CHAIR_1090 = 1090; public static final int CHAIR_1091 = 1091; public static final int CHAIR_1092 = 1092; public static final int CHAIR_1093 = 1093; public static final int CHAIR_1094 = 1094; public static final int STOOL = 1095; public static final int ROCKING_CHAIR = 1096; public static final int THRONE = 1097; public static final int THRONE_1098 = 1098; public static final int THRONE_1099 = 1099; public static final int BARSTOOL = 1100; public static final int BARSTOOL_1101 = 1101; public static final int STOOL_1102 = 1102; public static final int STOOL_1103 = 1103; public static final int BENCH = 1104; public static final int THRONE_1105 = 1105; public static final int BENCH_1106 = 1106; public static final int THRONE_1108 = 1108; public static final int THRONE_1109 = 1109; public static final int CHAIR_1110 = 1110; public static final int CHAIR_1111 = 1111; public static final int PEW = 1112; public static final int STOOL_1113 = 1113; public static final int ICE_THRONE = 1114; public static final int CHAIR_1115 = 1115; public static final int HEDGE = 1116; public static final int HEDGE_1117 = 1117; public static final int BUSH = 1118; public static final int BUSH_1119 = 1119; public static final int BUSH_1120 = 1120; public static final int BUSH_1121 = 1121; public static final int BUSH_1122 = 1122; public static final int BUSH_1123 = 1123; public static final int BUSH_1124 = 1124; public static final int BUSH_1125 = 1125; public static final int ROSEBUSH = 1126; public static final int FAIRY_HOUSE = 1147; public static final int FAIRY_HOUSE_1148 = 1148; public static final int FAIRY_HOUSE_1149 = 1149; public static final int FAIRY_BANK = 1150; public static final int FAIRY_MARKET_STALL = 1151; public static final int POTTED_FERN = 1152; public static final int POTTED_FERN_1153 = 1153; public static final int POTTED_FERN_1154 = 1154; public static final int POTTED_FERN_1155 = 1155; public static final int POTTED_FLOWER = 1156; public static final int POTTED_FLOWER_1157 = 1157; public static final int POTTED_PLANT = 1158; public static final int POTTED_PLANT_1160 = 1160; public static final int CABBAGE = 1161; public static final int BULLRUSHES = 1162; public static final int MUSHROOM = 1163; public static final int MUSHROOM_1164 = 1164; public static final int MUSHROOM_1165 = 1165; public static final int MUSHROOMS = 1166; public static final int MUSHROOM_1167 = 1167; public static final int MUSHROOMS_1168 = 1168; public static final int MUSHROOM_1169 = 1169; public static final int FUNGUS = 1170; public static final int FUNGUS_1171 = 1171; public static final int FUNGUS_1172 = 1172; public static final int SMALL_FERN = 1173; public static final int THISTLE = 1174; public static final int WATERLILY = 1175; public static final int WATERLILY_1176 = 1176; public static final int WATERLILY_1177 = 1177; public static final int HEATHER = 1178; public static final int HEATHER_1179 = 1179; public static final int HEATHER_1180 = 1180; public static final int NETTLES = 1181; public static final int CREEPING_PLANT = 1184; public static final int ROCKERY = 1185; public static final int CURLING_PLANT = 1186; public static final int FLOWER = 1187; public static final int FLOWER_1188 = 1188; public static final int DAISIES = 1189; public static final int SUNFLOWER = 1190; public static final int SUNFLOWERS = 1191; public static final int FLOWERS = 1192; public static final int FLOWERS_1193 = 1193; public static final int TULIPS = 1194; public static final int FLOWERS_1195 = 1195; public static final int FLOWERS_1196 = 1196; public static final int FLOWER_1197 = 1197; public static final int FLOWERS_1198 = 1198; public static final int FLOWERBED = 1199; public static final int FLOWERBED_1200 = 1200; public static final int FLOWERBED_1201 = 1201; public static final int JUNGLE_FLOWER = 1202; public static final int ORCHID = 1203; public static final int JUNGLE_PLANT = 1204; public static final int VINE_1205 = 1205; public static final int VINE_1206 = 1206; public static final int VINE_1207 = 1207; public static final int VINE_1208 = 1208; public static final int VINE_1231 = 1231; public static final int TREE = 1276; public static final int TREE_1277 = 1277; public static final int TREE_1278 = 1278; public static final int TREE_1279 = 1279; public static final int TREE_1280 = 1280; public static final int CAGE_DOOR = 1281; public static final int DEAD_TREE = 1282; public static final int DEAD_TREE_1283 = 1283; public static final int DEAD_TREE_1284 = 1284; public static final int DEAD_TREE_1285 = 1285; public static final int DEAD_TREE_1286 = 1286; public static final int DEAD_TREE_1287 = 1287; public static final int DEAD_TREE_1288 = 1288; public static final int DEAD_TREE_1289 = 1289; public static final int DEAD_TREE_1290 = 1290; public static final int DEAD_TREE_1291 = 1291; public static final int DRAMEN_TREE = 1292; public static final int FALLEN_TREE = 1296; public static final int FALLEN_TREE_1297 = 1297; public static final int FERN = 1298; public static final int FERN_1299 = 1299; public static final int FERN_1300 = 1300; public static final int TREE_1301 = 1301; public static final int LEAFY_TREE = 1302; public static final int TREE_1303 = 1303; public static final int TREE_1304 = 1304; public static final int CAGE_DOOR_1306 = 1306; public static final int PALM = 1311; public static final int PALM_1312 = 1312; public static final int PLANT = 1313; public static final int PLANT_1314 = 1314; public static final int EVERGREEN = 1318; public static final int EVERGREEN_1319 = 1319; public static final int MOSSY_BRANCH = 1320; public static final int MOSSY_BRANCH_1321 = 1321; public static final int HOLLOW_TREE = 1322; public static final int ROOTS = 1323; public static final int ROOTS_1324 = 1324; public static final int ROOTS_1325 = 1325; public static final int TROPICAL_TREE = 1326; public static final int TROPICAL_TREE_1327 = 1327; public static final int TROPICAL_TREE_1328 = 1328; public static final int TROPICAL_LEAVES = 1329; public static final int TREE_1330 = 1330; public static final int TREE_1331 = 1331; public static final int TREE_1332 = 1332; public static final int DEAD_TREE_1333 = 1333; public static final int HOLLOW_LOG = 1334; public static final int HOLLOW_LOG_1335 = 1335; public static final int HOLLOW_LOG_1336 = 1336; public static final int HOLLOW_LOG_1337 = 1337; public static final int HOLLOW_LOG_1338 = 1338; public static final int ROOTS_1339 = 1339; public static final int ROOTS_1340 = 1340; public static final int TREE_STUMP = 1341; public static final int TREE_STUMP_1342 = 1342; public static final int TREE_STUMP_1343 = 1343; public static final int TREE_STUMP_1344 = 1344; public static final int TREE_STUMP_1345 = 1345; public static final int TREE_STUMP_1346 = 1346; public static final int TREE_STUMP_1347 = 1347; public static final int TREE_STUMP_1348 = 1348; public static final int TREE_STUMP_1349 = 1349; public static final int TREE_STUMP_1350 = 1350; public static final int TREE_STUMP_1351 = 1351; public static final int TREE_STUMP_1352 = 1352; public static final int TREE_STUMP_1353 = 1353; public static final int TREE_STUMP_1354 = 1354; public static final int TREE_STUMP_1355 = 1355; public static final int TREE_STUMP_1356 = 1356; public static final int TREE_STUMP_1357 = 1357; public static final int TREE_STUMP_1358 = 1358; public static final int TREE_STUMP_1359 = 1359; public static final int TROPICAL_TREE_1360 = 1360; public static final int TROPICAL_TREE_1361 = 1361; public static final int TROPICAL_TREE_1362 = 1362; public static final int ROOTS_1363 = 1363; public static final int ROOTS_1364 = 1364; public static final int DEAD_TREE_1365 = 1365; public static final int ROOTS_1366 = 1366; public static final int ROOTS_1367 = 1367; public static final int ROOTS_1368 = 1368; public static final int PLANT_1369 = 1369; public static final int HOLLOW_LOG_1370 = 1370; public static final int TROPICAL_TREE_1371 = 1371; public static final int TROPICAL_TREE_1372 = 1372; public static final int TROPICAL_TREE_1373 = 1373; public static final int TROPICAL_TREE_1374 = 1374; public static final int TROPICAL_TREE_1375 = 1375; public static final int TROPICAL_TREE_1376 = 1376; public static final int TROPICAL_TREE_1377 = 1377; public static final int HOLLOW_LOG_1378 = 1378; public static final int HOLLOW_LOG_1379 = 1379; public static final int ROOTS_1380 = 1380; public static final int ROOTS_1381 = 1381; public static final int ROOTS_1382 = 1382; public static final int DEAD_TREE_1383 = 1383; public static final int DEAD_TREE_1384 = 1384; public static final int ROOTS_1386 = 1386; public static final int ROOTS_1387 = 1387; public static final int ROOTS_1388 = 1388; public static final int ROOTS_1389 = 1389; public static final int JUNGLE_PLANT_1390 = 1390; public static final int PLANT_1391 = 1391; public static final int PLANT_1392 = 1392; public static final int PLANT_1393 = 1393; public static final int PLANT_1394 = 1394; public static final int FLY_TRAP = 1395; public static final int CACTUS = 1396; public static final int CACTUS_1397 = 1397; public static final int JUNGLE_PLANT_1398 = 1398; public static final int JUNGLE_PLANT_1399 = 1399; public static final int JUNGLE_PLANT_1400 = 1400; public static final int JUNGLE_PLANT_1401 = 1401; public static final int JUNGLE_PLANT_1402 = 1402; public static final int CACTUS_1403 = 1403; public static final int CACTUS_1404 = 1404; public static final int CACTUS_1405 = 1405; public static final int CACTUS_1406 = 1406; public static final int WHIPPING_PLANT = 1407; public static final int PINEAPPLE_PLANT = 1408; public static final int PINEAPPLE_PLANT_1409 = 1409; public static final int PINEAPPLE_PLANT_1410 = 1410; public static final int PINEAPPLE_PLANT_1411 = 1411; public static final int PINEAPPLE_PLANT_1412 = 1412; public static final int PINEAPPLE_PLANT_1413 = 1413; public static final int DOOR_1509 = 1509; public static final int DOOR_1510 = 1510; public static final int LARGE_DOOR_1511 = 1511; public static final int LARGE_DOOR_1512 = 1512; public static final int LARGE_DOOR_1513 = 1513; public static final int LARGE_DOOR_1516 = 1516; public static final int LARGE_DOOR_1517 = 1517; public static final int LARGE_DOOR_1518 = 1518; public static final int LARGE_DOOR_1519 = 1519; public static final int LARGE_DOOR_1520 = 1520; public static final int LARGE_DOOR_1521 = 1521; public static final int LARGE_DOOR_1522 = 1522; public static final int LARGE_DOOR_1524 = 1524; public static final int LARGE_DOOR_1525 = 1525; public static final int CURTAIN_1531 = 1531; public static final int CURTAIN_1533 = 1533; public static final int CURTAIN_1534 = 1534; public static final int DOOR_1535 = 1535; public static final int DOOR_1536 = 1536; public static final int DOOR_1537 = 1537; public static final int DOOR_1538 = 1538; public static final int DOOR_1540 = 1540; public static final int DOOR_1541 = 1541; public static final int DOOR_1543 = 1543; public static final int DOOR_1544 = 1544; public static final int DOOR_1546 = 1546; public static final int DOOR_1547 = 1547; public static final int DOOR_1549 = 1549; public static final int DOOR_1550 = 1550; public static final int DOOR_1551 = 1551; public static final int DOOR_1552 = 1552; public static final int GATE_1558 = 1558; public static final int GATE_1559 = 1559; public static final int GATE_1560 = 1560; public static final int GATE_1561 = 1561; public static final int GATE_1562 = 1562; public static final int GATE_1563 = 1563; public static final int GATE_1564 = 1564; public static final int GATE_1567 = 1567; public static final int GATE_1568 = 1568; public static final int GATE_1569 = 1569; public static final int GATE_1570 = 1570; public static final int GATE_1571 = 1571; public static final int GATE_1572 = 1572; public static final int TRAPDOOR_1579 = 1579; public static final int TRAPDOOR_1580 = 1580; public static final int TRAPDOOR_1581 = 1581; public static final int TRAPDOOR_1582 = 1582; public static final int BOARDEDUP_DOOR = 1583; public static final int DOORS = 1584; public static final int DOORS_1585 = 1585; public static final int DOORS_1586 = 1586; public static final int DOORS_1587 = 1587; public static final int DOORWAY = 1588; public static final int DOORWAY_1589 = 1589; public static final int DOORWAY_1590 = 1590; public static final int DOORWAY_1591 = 1591; public static final int DOORWAY_1592 = 1592; public static final int WALL_1594 = 1594; public static final int WALL_1595 = 1595; public static final int WALL_1597 = 1597; public static final int WALL_1598 = 1598; public static final int GATE_1600 = 1600; public static final int GATE_1601 = 1601; public static final int SCAFFOLD_1609 = 1609; public static final int SCAFFOLD_1610 = 1610; public static final int SCAFFOLD_1611 = 1611; public static final int SCAFFOLD_1612 = 1612; public static final int TIMBER = 1613; public static final int TIMBER_1614 = 1614; public static final int BRICKS = 1661; public static final int BRICKS_1662 = 1662; public static final int BRICKS_1663 = 1663; public static final int DOOR_1722 = 1722; public static final int ODD_LOOKING_WALL = 1723; public static final int DUNGEON_DOOR = 1725; public static final int DOOR_1726 = 1726; public static final int GATE_1727 = 1727; public static final int GATE_1728 = 1728; public static final int GATE_1730 = 1730; public static final int GATE_1731 = 1731; public static final int MAGIC_GUILD_DOOR = 1732; public static final int MAGIC_GUILD_DOOR_1733 = 1733; public static final int ODD_LOOKING_WALL_1734 = 1734; public static final int ODD_LOOKING_WALL_1735 = 1735; public static final int ODD_LOOKING_WALL_1736 = 1736; public static final int ODD_LOOKING_WALL_1737 = 1737; public static final int TRAPDOOR_1738 = 1738; public static final int GATE_1739 = 1739; public static final int GATE_1740 = 1740; public static final int DOOR_1741 = 1741; public static final int DOOR_1742 = 1742; public static final int DOOR_1743 = 1743; public static final int DOOR_1749 = 1749; public static final int GRAPEVINE = 1753; public static final int GRAPEVINE_1754 = 1754; public static final int GLASS_DOOR = 1762; public static final int PUMP_AND_DRAIN = 1763; public static final int DUMMY_1764 = 1764; public static final int LEAFLETS = 1767; public static final int CHEST_1768 = 1768; public static final int MILLSTONES = 1778; public static final int SAILS = 1779; public static final int SAILS_1780 = 1780; public static final int FLOUR_BIN = 1782; public static final int WATERFALL_ROCKS = 1797; public static final int DOOR_1804 = 1804; public static final int DOOR_1805 = 1805; public static final int WEB_1810 = 1810; public static final int SLICED_WEB = 1811; public static final int PORTAL = 1812; public static final int STONE_STAND = 1813; public static final int LEVER_1814 = 1814; public static final int LEVER_1816 = 1816; public static final int LEVER_1817 = 1817; public static final int BAY_WINDOW = 1852; public static final int TIMBER_DEFENCE = 1864; public static final int ALTAR_SLAB = 1876; public static final int THRONE_1896 = 1896; public static final int CANDLESTICK_HOLDER = 1897; public static final int CHAIR_1898 = 1898; public static final int CHAIR_1899 = 1899; public static final int SUIT_OF_ARMOUR_1900 = 1900; public static final int TABLE_1901 = 1901; public static final int TOWER = 1939; public static final int CRUMBLING_WALL = 1947; public static final int CRUMBLING_WALL_1948 = 1948; public static final int BRICKS_1949 = 1949; public static final int BRICKS_1950 = 1950; public static final int BRICKS_1951 = 1951; public static final int TREE_DOOR = 1967; public static final int TREE_DOOR_1968 = 1968; public static final int ROOT = 1985; public static final int ROOT_1986 = 1986; public static final int LOG_RAFT = 1987; public static final int BROKEN_LOG_RAFT = 1988; public static final int BOOKCASE_1989 = 1989; public static final int CRATE_1990 = 1990; public static final int DOOR_1991 = 1991; public static final int GLARIALS_TOMBSTONE = 1992; public static final int GLARIALS_TOMB = 1993; public static final int CLOSED_CHEST_1994 = 1994; public static final int OPEN_CHEST_1995 = 1995; public static final int ROCK = 1996; public static final int ROCK_1997 = 1997; public static final int ROPE = 1998; public static final int CRATE_1999 = 1999; public static final int DOOR_2000 = 2000; public static final int DOOR_2002 = 2002; public static final int PILLAR = 2004; public static final int STATUE_OF_BAXTORIAN = 2005; public static final int STATUE_OF_GLARIAL = 2006; public static final int LEDGE = 2010; public static final int LEDGE_2011 = 2011; public static final int LEDGE_2012 = 2012; public static final int VINE_2013 = 2013; public static final int CHALICE_OF_ETERNITY = 2014; public static final int CHALICE_OF_ETERNITY_2015 = 2015; public static final int WHIRLPOOL = 2019; public static final int DEAD_TREE_2020 = 2020; public static final int BARREL_2022 = 2022; public static final int ACHEY_TREE = 2023; public static final int CAULDRON_2024 = 2024; public static final int BOX_TRAP = 2025; public static final int BOX_TRAP_2026 = 2026; public static final int BOX_TRAP_2028 = 2028; public static final int BOX_TRAP_2029 = 2029; public static final int FURNACE = 2030; public static final int ANVIL = 2031; public static final int BEDROOM_DOOR = 2032; public static final int BEDROOM_DOOR_2033 = 2033; public static final int DOOR_2034 = 2034; public static final int DOOR_2035 = 2035; public static final int DOOR_2036 = 2036; public static final int DOOR_2037 = 2037; public static final int DUMMY_2038 = 2038; public static final int GATE_2039 = 2039; public static final int GATE_2041 = 2041; public static final int CAULDRON_2043 = 2043; public static final int TROUGH = 2044; public static final int DOOR_2048 = 2048; public static final int DOOR_2049 = 2049; public static final int GATE_2050 = 2050; public static final int GATE_2051 = 2051; public static final int DOOR_2054 = 2054; public static final int CUPBOARD_2056 = 2056; public static final int CUPBOARD_2057 = 2057; public static final int GATE_2058 = 2058; public static final int GATE_2060 = 2060; public static final int CUPBOARD_2062 = 2062; public static final int CUPBOARD_2063 = 2063; public static final int CRATE_2064 = 2064; public static final int ROPE_LADDER = 2065; public static final int WALL_2066 = 2066; public static final int WATCHTOWER = 2067; public static final int FENCE = 2068; public static final int DOOR_2069 = 2069; public static final int CRATE_2071 = 2071; public static final int CRATE_2072 = 2072; public static final int BANANA_TREE = 2073; public static final int BANANA_TREE_2074 = 2074; public static final int BANANA_TREE_2075 = 2075; public static final int BANANA_TREE_2076 = 2076; public static final int BANANA_TREE_2077 = 2077; public static final int BANANA_TREE_2078 = 2078; public static final int CHEST_2079 = 2079; public static final int GANGPLANK_2081 = 2081; public static final int GANGPLANK_2082 = 2082; public static final int GANGPLANK_2083 = 2083; public static final int GANGPLANK_2084 = 2084; public static final int GANGPLANK_2085 = 2085; public static final int GANGPLANK_2086 = 2086; public static final int GANGPLANK_2087 = 2087; public static final int GANGPLANK_2088 = 2088; public static final int ROCKERY_2089 = 2089; public static final int CHEST_2090 = 2090; public static final int EVERGREEN_2091 = 2091; public static final int EVERGREEN_2092 = 2092; public static final int BANK_TABLE_2094 = 2094; public static final int GOLD = 2095; public static final int ANVIL_2097 = 2097; public static final int BLACKSMITHS_TOOLS = 2098; public static final int DOOR_2100 = 2100; public static final int DOOR_2101 = 2101; public static final int DOOR_2102 = 2102; public static final int DOOR_2103 = 2103; public static final int DOOR_2104 = 2104; public static final int DOOR_2105 = 2105; public static final int ARCHWAY = 2106; public static final int DANGER_SIGN_2107 = 2107; public static final int DOOR_2108 = 2108; public static final int DOOR_2111 = 2111; public static final int DOOR_2112 = 2112; public static final int DOOR_2113 = 2113; public static final int STAIRCASE = 2114; public static final int GATE_2115 = 2115; public static final int GATE_2116 = 2116; public static final int OLD_WALL = 2117; public static final int STAIRCASE_2118 = 2118; public static final int STAIRCASE_2119 = 2119; public static final int STAIRCASE_2120 = 2120; public static final int STAIRCASE_2121 = 2121; public static final int STAIRCASE_2122 = 2122; public static final int CAVE_ENTRANCE_2123 = 2123; public static final int STATUE_2124 = 2124; public static final int CHANDELIER_2127 = 2127; public static final int SAFE = 2133; public static final int RACK_2134 = 2134; public static final int BARREL_2135 = 2135; public static final int TABLE_2136 = 2136; public static final int BARREL_2137 = 2137; public static final int RACK_2138 = 2138; public static final int TUNNEL = 2141; public static final int CAULDRON_OF_THUNDER = 2142; public static final int PRISON_DOOR_2143 = 2143; public static final int PRISON_DOOR_2144 = 2144; public static final int COFFIN_2145 = 2145; public static final int LADDER_2147 = 2147; public static final int LADDER_2148 = 2148; public static final int OBELISK = 2149; public static final int OBELISK_OF_EARTH = 2150; public static final int OBELISK_OF_WATER = 2151; public static final int OBELISK_OF_AIR = 2152; public static final int OBELISK_OF_FIRE = 2153; public static final int GATE_2154 = 2154; public static final int GATE_2155 = 2155; public static final int MAGIC_PORTAL = 2156; public static final int MAGIC_PORTAL_2157 = 2157; public static final int MAGIC_PORTAL_2158 = 2158; public static final int HEAP_OF_BRICKS = 2171; public static final int CORPSE_2176 = 2176; public static final int TRAWLER_NET = 2177; public static final int TRAWLER_NET_2178 = 2178; public static final int TRAWLER_NET_2179 = 2179; public static final int CATAPULT_2180 = 2180; public static final int BALLISTA = 2181; public static final int OPEN_CHEST_2182 = 2182; public static final int CLOSED_CHEST_2183 = 2183; public static final int DOOR_2184 = 2184; public static final int CRUMBLED_WALL = 2185; public static final int LOOSE_RAILING_2186 = 2186; public static final int STAIRS_2187 = 2187; public static final int BELLOWS = 2188; public static final int STAIRS_2190 = 2190; public static final int CHEST_2191 = 2191; public static final int CHEST_2194 = 2194; public static final int METAL_PIECES = 2195; public static final int TRAWLER_NET_2196 = 2196; public static final int TRAWLER_NET_2197 = 2197; public static final int TRAWLER_NET_2198 = 2198; public static final int KITCHEN_GATE = 2199; public static final int KITCHEN_GATE_2200 = 2200; public static final int TELESCOPE = 2210; public static final int GRAVE_OF_SCORPIUS = 2211; public static final int TRAWLER_NET_2212 = 2212; public static final int TRAWLER_NET_2213 = 2213; public static final int MOUND_OF_EARTH = 2217; public static final int FISSURE = 2218; public static final int FISSURE_2219 = 2219; public static final int CAVE_IN = 2220; public static final int STRANGE_LOOKING_STONE = 2221; public static final int LOOSE_ROCKS = 2222; public static final int OLD_SACKS = 2223; public static final int ANCIENT_GALLOWS = 2224; public static final int WATERFALL_ROCKS_2225 = 2225; public static final int SMASHED_TABLE = 2226; public static final int CRUDE_RAFT = 2227; public static final int TRIBAL_STATUE_2229 = 2229; public static final int TRAVEL_CART = 2230; public static final int ROCKS_2231 = 2231; public static final int WELL_STACKED_ROCKS = 2234; public static final int TOMB_DOLMEN = 2235; public static final int CLIMBING_ROCKS = 2236; public static final int PALM_TREE = 2237; public static final int CARVED_DOORS = 2240; public static final int CARVED_DOORS_2241 = 2241; public static final int TOMB_EXIT = 2242; public static final int TOMB_EXIT_2243 = 2243; public static final int JUNGLE_PLANT_2244 = 2244; public static final int JUNGLE_PLANT_2245 = 2245; public static final int TOMB_DOORS = 2246; public static final int TOMB_DOORS_2247 = 2247; public static final int TOMB_DOORS_2248 = 2248; public static final int TOMB_DOORS_2249 = 2249; public static final int TOMB_DOORS_2250 = 2250; public static final int TOMB_EXIT_2253 = 2253; public static final int TOMB_EXIT_2254 = 2254; public static final int ANCIENT_METAL_GATE = 2255; public static final int ANCIENT_METAL_GATE_2256 = 2256; public static final int ROCKS_2257 = 2257; public static final int TOMB_DOLMEN_2258 = 2258; public static final int METAL_GATE = 2259; public static final int METAL_GATE_2260 = 2260; public static final int WOODEN_GATE = 2261; public static final int WOODEN_GATE_2262 = 2262; public static final int TRAVEL_CART_2265 = 2265; public static final int LADDER_2268 = 2268; public static final int LADDER_2269 = 2269; public static final int PLANT_2270 = 2270; public static final int CUPBOARD_2271 = 2271; public static final int CUPBOARD_2272 = 2272; public static final int CHIMNEY = 2274; public static final int WORKBENCH_2279 = 2279; public static final int LATHE = 2280; public static final int DRILL = 2281; public static final int HEARTH = 2282; public static final int MOULD = 2283; public static final int POSTER = 2284; public static final int SIGN_2286 = 2286; public static final int SIGN_2287 = 2287; public static final int SIGN_2288 = 2288; public static final int TRAWLER_NET_2289 = 2289; public static final int SIGN_2290 = 2290; public static final int SIGN_2292 = 2292; public static final int SIGN_2294 = 2294; public static final int SIGN_2297 = 2297; public static final int SIGN_2298 = 2298; public static final int SIGN_2300 = 2300; public static final int SIGN_2302 = 2302; public static final int MARKET_STALL_2303 = 2303; public static final int MARKET_STALL_2304 = 2304; public static final int MARKET_STALL_2305 = 2305; public static final int MARKET_STALL_2306 = 2306; public static final int MARKET_STALL_2307 = 2307; public static final int SCUTTLE = 2308; public static final int POKERS = 2309; public static final int TREE_STUMP_2310 = 2310; public static final int BAR = 2314; public static final int BAR_2315 = 2315; public static final int BAR_2316 = 2316; public static final int BAR_2317 = 2317; public static final int BAR_2318 = 2318; public static final int BAR_2319 = 2319; public static final int BAR_2320 = 2320; public static final int BAR_2321 = 2321; public static final int BAR_2322 = 2322; public static final int TABLE_2332 = 2332; public static final int TABLE_2333 = 2333; public static final int TABLE_2334 = 2334; public static final int TABLE_2335 = 2335; public static final int HOLE_2336 = 2336; public static final int STURDY_DOOR = 2337; public static final int DOOR_2338 = 2338; public static final int STURDY_DOOR_2339 = 2339; public static final int WALL_2341 = 2341; public static final int GRILL = 2342; public static final int BRICK = 2343; public static final int BRICK_2344 = 2344; public static final int BRICK_2345 = 2345; public static final int BRICK_2346 = 2346; public static final int BRICK_2347 = 2347; public static final int BRICK_2348 = 2348; public static final int BRICK_2349 = 2349; public static final int WINCH_2350 = 2350; public static final int WINCH_2351 = 2351; public static final int ROPE_2352 = 2352; public static final int ROPE_2353 = 2353; public static final int SACKS_2354 = 2354; public static final int SACKS_2355 = 2355; public static final int SACKS_2356 = 2356; public static final int BUSH_2357 = 2357; public static final int BUSH_2358 = 2358; public static final int CHEST_2360 = 2360; public static final int CHEST_2361 = 2361; public static final int BRICK_2362 = 2362; public static final int PANNING_POINT = 2363; public static final int CRATE_2364 = 2364; public static final int CRATE_2365 = 2365; public static final int SIGNPOST_2366 = 2366; public static final int SIGNPOST_2367 = 2367; public static final int SIGNPOST_2368 = 2368; public static final int SIGNPOST_2369 = 2369; public static final int SIGNPOST_2370 = 2370; public static final int SIGNPOST_2371 = 2371; public static final int BOOKCASE_2372 = 2372; public static final int CUPBOARD_2373 = 2373; public static final int CUPBOARD_2374 = 2374; public static final int SPECIMEN_TRAY = 2375; public static final int SOIL = 2376; public static final int SOIL_2377 = 2377; public static final int SOIL_2378 = 2378; public static final int CAMPSITE_BED = 2379; public static final int CHEST_2380 = 2380; public static final int SOIL_2381 = 2381; public static final int SOIL_2382 = 2382; public static final int SOIL_2383 = 2383; public static final int GATE_2391 = 2391; public static final int GATE_2392 = 2392; public static final int GNOME_GOAL = 2393; public static final int GATE_2394 = 2394; public static final int BED_2396 = 2396; public static final int DOOR_2397 = 2397; public static final int DOOR_2398 = 2398; public static final int DOOR_2399 = 2399; public static final int CUPBOARD_2400 = 2400; public static final int CUPBOARD_2401 = 2401; public static final int BOOKCASE_2402 = 2402; public static final int CHEST_2403 = 2403; public static final int CHEST_2404 = 2404; public static final int LADDER_2405 = 2405; public static final int DOOR_2406 = 2406; public static final int MAGIC_DOOR = 2407; public static final int LADDER_2408 = 2408; public static final int TREE_2409 = 2409; public static final int LADDER_2410 = 2410; public static final int STURDY_DOOR_2411 = 2411; public static final int GANGPLANK_2412 = 2412; public static final int GANGPLANK_2413 = 2413; public static final int GANGPLANK_2414 = 2414; public static final int GANGPLANK_2415 = 2415; public static final int LARGE_DOOR_2416 = 2416; public static final int LARGE_DOOR_2417 = 2417; public static final int CHEST_2418 = 2418; public static final int LEVER_2421 = 2421; public static final int LEVER_2422 = 2422; public static final int LEVER_2423 = 2423; public static final int LEVER_2424 = 2424; public static final int LEVER_2425 = 2425; public static final int LEVER_2426 = 2426; public static final int DOOR_2427 = 2427; public static final int DOOR_2428 = 2428; public static final int DOOR_2429 = 2429; public static final int DOOR_2430 = 2430; public static final int DOOR_2431 = 2431; public static final int GATE_2432 = 2432; public static final int GATE_2433 = 2433; public static final int CUPBOARD_2434 = 2434; public static final int CUPBOARD_2435 = 2435; public static final int CLOSED_CHEST_2436 = 2436; public static final int GATE_2438 = 2438; public static final int GATE_2439 = 2439; public static final int PILLAR_2440 = 2440; public static final int PILLAR_2441 = 2441; public static final int PILLAR_2442 = 2442; public static final int PILLAR_2443 = 2443; public static final int TRAPDOOR_2445 = 2445; public static final int TRAPDOOR_2446 = 2446; public static final int TREE_2447 = 2447; public static final int TREE_2448 = 2448; public static final int DACONIA_ROCKS = 2449; public static final int DACONIA_ROCKS_2450 = 2450; public static final int ROOTS_2451 = 2451; public static final int WINE_RACK = 2453; public static final int ORNATE_CANDLE = 2458; public static final int CRYSTAL_BALL_2459 = 2459; public static final int TRAWLER_NET_2465 = 2465; public static final int TRAWLER_NET_2466 = 2466; public static final int TRAWLER_NET_2467 = 2467; public static final int TRAWLER_NET_2468 = 2468; public static final int TRAWLER_NET_2469 = 2469; public static final int TRAWLER_NET_2470 = 2470; public static final int TRAWLER_NET_2471 = 2471; public static final int TRAWLER_NET_2472 = 2472; public static final int TRAWLER_NET_2473 = 2473; public static final int TRAWLER_NET_2474 = 2474; public static final int TRAWLER_NET_2475 = 2475; public static final int BARREL_2476 = 2476; public static final int BARREL_2477 = 2477; public static final int BARREL_2478 = 2478; public static final int TRAWLER_NET_2479 = 2479; public static final int TRAWLER_NET_2480 = 2480; public static final int TRAWLER_NET_2481 = 2481; public static final int TRAWLER_NET_2482 = 2482; public static final int TRAWLER_NET_2483 = 2483; public static final int LEAK = 2484; public static final int REPAIRED_LEAK = 2485; public static final int SPRAY = 2486; public static final int SPRAY_2487 = 2487; public static final int LAMP_2491 = 2491; public static final int LANTERN = 2492; public static final int MIRROR_2493 = 2493; public static final int HANGER = 2494; public static final int SEWING_MACHINE = 2495; public static final int TABLE_2496 = 2496; public static final int CLOTHES = 2498; public static final int CLOTH = 2499; public static final int OIL_LAMP = 2501; public static final int FABRIC = 2502; public static final int FABRIC_2503 = 2503; public static final int BED_2511 = 2511; public static final int CLOTHES_2512 = 2512; public static final int CLOTHES_2513 = 2513; public static final int CLOTHES_2514 = 2514; public static final int ROW_BOAT = 2515; public static final int ROW_BOAT_2516 = 2516; public static final int LADDER_2517 = 2517; public static final int LOOSE_PANEL = 2518; public static final int CRATES = 2519; public static final int CRANE = 2520; public static final int CRANE_2521 = 2521; public static final int SPOOKY_STAIRS = 2522; public static final int SPOOKY_STAIRS_2523 = 2523; public static final int CUPBOARD_2524 = 2524; public static final int CUPBOARD_2525 = 2525; public static final int DOOR_2526 = 2526; public static final int DOOR_2527 = 2527; public static final int DOOR_2528 = 2528; public static final int DOOR_2529 = 2529; public static final int BARREL_2530 = 2530; public static final int MUD_PATCH_2531 = 2531; public static final int MUD_PILE_2533 = 2533; public static final int DOOR_2534 = 2534; public static final int DOOR_2535 = 2535; public static final int DOOR_2536 = 2536; public static final int DOOR_2537 = 2537; public static final int DOOR_2538 = 2538; public static final int STAIRS_2539 = 2539; public static final int STAIRS_2540 = 2540; public static final int SEWER_PIPE = 2541; public static final int PIPE = 2542; public static final int MANHOLE_2543 = 2543; public static final int MANHOLE_2544 = 2544; public static final int MANHOLE_COVER = 2545; public static final int DOOR_2546 = 2546; public static final int DOOR_2547 = 2547; public static final int DOOR_2548 = 2548; public static final int DOOR_2549 = 2549; public static final int CLOTHES_2550 = 2550; public static final int CLOTHES_2551 = 2551; public static final int CLOTHES_2552 = 2552; public static final int CLOTHES_2553 = 2553; public static final int BRONZE_PICKAXE = 2559; public static final int SAILS_2569 = 2569; public static final int MILL = 2570; public static final int MILL_2571 = 2571; public static final int MILL_2572 = 2572; public static final int MILL_2573 = 2573; public static final int FLOUR_BIN_2574 = 2574; public static final int MARSHY_JUNGLE_VINE = 2575; public static final int MARSHY_JUNGLE_VINE_2576 = 2576; public static final int PALM_TREE_2577 = 2577; public static final int PALM_TREE_2578 = 2578; public static final int SCORCHED_EARTH = 2579; public static final int SCORCHED_EARTH_2580 = 2580; public static final int ROCK_2581 = 2581; public static final int ROCK_2582 = 2582; public static final int FUNGUS_COVERED_CAVERN_WALL = 2583; public static final int ROCKS_2584 = 2584; public static final int HAND_HOLDS = 2585; public static final int HOPPER = 2586; public static final int CHEST_2587 = 2587; public static final int CHEST_2588 = 2588; public static final int HOLE_2589 = 2589; public static final int LADDER_2590 = 2590; public static final int LADDER_2591 = 2591; public static final int LADDER_2592 = 2592; public static final int GANGPLANK_2593 = 2593; public static final int GANGPLANK_2594 = 2594; public static final int DOOR_2595 = 2595; public static final int RED_DOOR = 2596; public static final int ORANGE_DOOR = 2597; public static final int YELLOW_DOOR = 2598; public static final int BLUE_DOOR = 2599; public static final int MAGENTA_DOOR = 2600; public static final int GREEN_DOOR = 2601; public static final int EXIT_DOOR = 2602; public static final int CHEST_2603 = 2603; public static final int CHEST_2604 = 2604; public static final int LADDER_2605 = 2605; public static final int WALL_2606 = 2606; public static final int HOPPER_CONTROLS = 2607; public static final int STAIRCASE_2608 = 2608; public static final int STAIRCASE_2609 = 2609; public static final int STAIRCASE_2610 = 2610; public static final int TABLE_2611 = 2611; public static final int CUPBOARD_2612 = 2612; public static final int CUPBOARD_2613 = 2613; public static final int COFFIN_2614 = 2614; public static final int COFFIN_2615 = 2615; public static final int STAIRS_2616 = 2616; public static final int STAIRS_2617 = 2617; public static final int BROKEN_FENCE_2618 = 2618; public static final int BARREL_2619 = 2619; public static final int CRATE_2620 = 2620; public static final int DOOR_2621 = 2621; public static final int DOOR_2622 = 2622; public static final int GATE_2623 = 2623; public static final int DOOR_2624 = 2624; public static final int DOOR_2625 = 2625; public static final int DOOR_2626 = 2626; public static final int DOOR_2627 = 2627; public static final int DOOR_2628 = 2628; public static final int WALL_2629 = 2629; public static final int DOOR_2631 = 2631; public static final int CHEST_2632 = 2632; public static final int CHEST_2633 = 2633; public static final int ROCK_SLIDE = 2634; public static final int CUPBOARD_2635 = 2635; public static final int CUPBOARD_2636 = 2636; public static final int ALTAR_2640 = 2640; public static final int LADDER_2641 = 2641; public static final int SHELVES_2644 = 2644; public static final int SHELVES_2645 = 2645; public static final int PICTURE = 2646; public static final int PICTURE_2647 = 2647; public static final int PICTURE_2648 = 2648; public static final int TABLE_2649 = 2649; public static final int TABLE_2650 = 2650; public static final int SINCLAIR_MANSION_DRAIN = 2652; public static final int SINCLAIR_FAMILY_FOUNTAIN = 2654; public static final int SINCLAIR_FAMILY_CREST = 2655; public static final int ANNAS_BARREL = 2656; public static final int BOBS_BARREL = 2657; public static final int CAROLS_BARREL = 2658; public static final int DAVIDS_BARREL = 2659; public static final int ELIZABETHS_BARREL = 2660; public static final int FRANKS_BARREL = 2661; public static final int SACKS_2663 = 2663; public static final int STURDY_WOODEN_GATE = 2664; public static final int STURDY_WOODEN_GATE_2665 = 2665; public static final int WINCH_2667 = 2667; public static final int WINCH_BUCKET = 2668; public static final int KHARIDIAN_CACTUS_HEALTHY = 2670; public static final int KHARIDIAN_CACTUS_DRY = 2671; public static final int AN_EXPERIMENTAL_ANVIL = 2672; public static final int GATE_2673 = 2673; public static final int GATE_2674 = 2674; public static final int MINE_DOOR_ENTRANCE = 2675; public static final int MINE_DOOR_ENTRANCE_2676 = 2676; public static final int CHEST_2677 = 2677; public static final int BOOKCASE_2678 = 2678; public static final int BARREL_2680 = 2680; public static final int BARREL_2681 = 2681; public static final int WINDOW = 2683; public static final int MINE_CART_2684 = 2684; public static final int GATE_2685 = 2685; public static final int GATE_2686 = 2686; public static final int GATE_2687 = 2687; public static final int GATE_2688 = 2688; public static final int PRISON_DOOR_2689 = 2689; public static final int MINE_DOOR_ENTRANCE_2690 = 2690; public static final int MINE_DOOR_ENTRANCE_2691 = 2691; public static final int PRISON_DOOR_2692 = 2692; public static final int BANK_CHEST = 2693; public static final int ROCK_2694 = 2694; public static final int ROCK_2695 = 2695; public static final int ROCK_2696 = 2696; public static final int ROCK_2697 = 2697; public static final int MINE_CAVE = 2698; public static final int MINE_CAVE_2699 = 2699; public static final int TENT_DOOR = 2700; public static final int TRACKS = 2702; public static final int TRACKS_2703 = 2703; public static final int ROCKS_2704 = 2704; public static final int DOOR_2705 = 2705; public static final int DOOR_2706 = 2706; public static final int CRATE_2707 = 2707; public static final int CRATE_2708 = 2708; public static final int CHEST_2709 = 2709; public static final int CHEST_2710 = 2710; public static final int STAIRS_2711 = 2711; public static final int SHELVES_2712 = 2712; public static final int SHELVES_2713 = 2713; public static final int STUDY_DESK_2714 = 2714; public static final int HELLHOUND = 2715; public static final int TABLE_2716 = 2716; public static final int DEAD_BAT = 2718; public static final int HERBS = 2720; public static final int CABINET_2721 = 2721; public static final int CABINET_2722 = 2722; public static final int SWINGS = 2723; public static final int WASHING_LINE = 2724; public static final int TOY_BRICKS = 2725; public static final int TOY_WEAPONS = 2726; public static final int CAT_BASKET = 2727; public static final int BUNKBED = 2728; public static final int DOLLS_AND_BALLS = 2729; public static final int FLOWERBED_2730 = 2730; public static final int FLOWERBED_2731 = 2731; public static final int TABLE_2783 = 2783; public static final int SWORD_CABINET_2784 = 2784; public static final int SWORD_IN_STONE = 2785; public static final int CITY_GATE_2786 = 2786; public static final int CITY_GATE_2787 = 2787; public static final int CITY_GATE_2788 = 2788; public static final int CITY_GATE_2789 = 2789; public static final int CHEST_2790 = 2790; public static final int COUNTER_2791 = 2791; public static final int COUNTER_2792 = 2792; public static final int COUNTER_2793 = 2793; public static final int LEVER_2794 = 2794; public static final int LEVER_2795 = 2795; public static final int LADDER_2796 = 2796; public static final int LADDER_2797 = 2797; public static final int BUSH_2798 = 2798; public static final int BUSH_2799 = 2799; public static final int BUSH_2800 = 2800; public static final int BUSH_2801 = 2801; public static final int BUSH_2802 = 2802; public static final int BUSH_2803 = 2803; public static final int CAVE_ENTRANCE_2804 = 2804; public static final int CAVE_ENTRANCE_2805 = 2805; public static final int CAVE_ENTRANCE_2806 = 2806; public static final int CAVE_ENTRANCE_2807 = 2807; public static final int CAVE_ENTRANCE_2808 = 2808; public static final int CAVE_ENTRANCE_2809 = 2809; public static final int CAVE_ENTRANCE_2810 = 2810; public static final int CAVE_ENTRANCE_2811 = 2811; public static final int LADDER_2812 = 2812; public static final int CAVE_ENTRANCE_2813 = 2813; public static final int GATE_2814 = 2814; public static final int GATE_2815 = 2815; public static final int ROCK_OF_DALGROTH = 2816; public static final int CAVE_EXIT_2817 = 2817; public static final int CAVE_EXIT_2818 = 2818; public static final int CAVE_EXIT_2819 = 2819; public static final int CAVE_EXIT_2820 = 2820; public static final int CAVE_EXIT_2821 = 2821; public static final int CAVE_EXIT_2822 = 2822; public static final int HOLE_2823 = 2823; public static final int HOLE_2824 = 2824; public static final int CLIMBING_ROPE = 2825; public static final int CHEST_2826 = 2826; public static final int CHEST_2827 = 2827; public static final int GAP = 2830; public static final int GAP_2831 = 2831; public static final int BATTLEMENT = 2832; public static final int LADDER_2833 = 2833; public static final int BATTLEMENT_2834 = 2834; public static final int ROCK_2835 = 2835; public static final int ROCK_2836 = 2836; public static final int ROCK_2837 = 2837; public static final int MAGICAL_SHIELD = 2842; public static final int SEWER_VALVE = 2844; public static final int SEWER_VALVE_2845 = 2845; public static final int SEWER_VALVE_2846 = 2846; public static final int SEWER_VALVE_2847 = 2847; public static final int SEWER_VALVE_2848 = 2848; public static final int RAFT = 2849; public static final int CUPBOARD_2850 = 2850; public static final int CUPBOARD_2851 = 2851; public static final int CAVE_ENTRANCE_2852 = 2852; public static final int STAIRS_2853 = 2853; public static final int WALL_2854 = 2854; public static final int CHEST_2856 = 2856; public static final int CHEST_2857 = 2857; public static final int CRATE_2858 = 2858; public static final int RANGE = 2859; public static final int HAZEELS_COFFIN = 2860; public static final int DOOR_2861 = 2861; public static final int DOOR_2862 = 2862; public static final int DOOR_2863 = 2863; public static final int FOUNTAIN_2864 = 2864; public static final int GATE_2865 = 2865; public static final int GATE_2866 = 2866; public static final int POTTED_PLANT_2867 = 2867; public static final int CUPBOARD_2868 = 2868; public static final int CUPBOARD_2869 = 2869; public static final int LADDER_2871 = 2871; public static final int LADDER_2872 = 2872; public static final int STATUE_OF_SARADOMIN_2873 = 2873; public static final int STATUE_OF_ZAMORAK_2874 = 2874; public static final int STATUE_OF_GUTHIX = 2875; public static final int COUNTER_2876 = 2876; public static final int BARREL_2877 = 2877; public static final int SPARKLING_POOL = 2878; public static final int SPARKLING_POOL_2879 = 2879; public static final int MYSTIC_PORTAL = 2880; public static final int PRISON_DOOR_2881 = 2881; public static final int GATE_2882 = 2882; public static final int GATE_2883 = 2883; public static final int LADDER_2884 = 2884; public static final int CUPBOARD_2885 = 2885; public static final int OPEN_CUPBOARD_2886 = 2886; public static final int JUNGLE_TREE = 2887; public static final int JUNGLE_PALM = 2888; public static final int JUNGLE_TREE_2889 = 2889; public static final int JUNGLE_TREE_2890 = 2890; public static final int TREE_STUMP_2891 = 2891; public static final int JUNGLE_BUSH = 2892; public static final int JUNGLE_BUSH_2893 = 2893; public static final int SLASHED_BUSH = 2894; public static final int SLASHED_BUSH_2895 = 2895; public static final int LEGENDS_GUILD_DOOR = 2896; public static final int LEGENDS_GUILD_DOOR_2897 = 2897; public static final int MOSSY_ROCK = 2900; public static final int MOSSY_ROCK_2901 = 2901; public static final int ROCKS_2902 = 2902; public static final int CAVE_ENTRANCE_2903 = 2903; public static final int CAVE_ENTRANCE_2904 = 2904; public static final int CRATE_2905 = 2905; public static final int TABLE_2906 = 2906; public static final int BED_2907 = 2907; public static final int FIRE_WALL = 2908; public static final int FIRE_WALL_2909 = 2909; public static final int DESK = 2910; public static final int BOOKCASE_2911 = 2911; public static final int ANCIENT_GATE = 2912; public static final int ANCIENT_GATE_2913 = 2913; public static final int CREVICE_2918 = 2918; public static final int BOULDER = 2919; public static final int BOULDER_2920 = 2920; public static final int BOULDER_2921 = 2921; public static final int ANCIENT_GATE_2922 = 2922; public static final int ANCIENT_GATE_2923 = 2923; public static final int ANCIENT_GATE_2924 = 2924; public static final int ANCIENT_GATE_2925 = 2925; public static final int JAGGED_WALL = 2926; public static final int MARKED_WALL = 2927; public static final int CARVED_ROCK = 2928; public static final int BURIED_SKELETON_2929 = 2929; public static final int ANCIENT_GATE_2930 = 2930; public static final int ANCIENT_GATE_2931 = 2931; public static final int BARREL_2932 = 2932; public static final int WINCH_2934 = 2934; public static final int WINCH_2935 = 2935; public static final int TOTEM_POLE_2936 = 2936; public static final int TOTEM_POLE_2937 = 2937; public static final int TOTEM_POLE_2938 = 2938; public static final int TABLE_2940 = 2940; public static final int SACRED_WATER = 2941; public static final int WATER_POOL = 2942; public static final int POLLUTED_WATER = 2943; public static final int TALL_REEDS = 2944; public static final int YOMMI_TREE_BABY = 2945; public static final int YOMMI_TREE_SAPLING = 2946; public static final int DEAD_YOMMI_SAPLING = 2947; public static final int ADULT_YOMMI_TREE = 2948; public static final int DEAD_YOMMI = 2949; public static final int FELLED_YOMMI_TREE = 2950; public static final int ROTTEN_YOMMI = 2951; public static final int TRIMMED_YOMMI = 2952; public static final int ROTTEN_YOMMI_TREE = 2953; public static final int TOTEM_POLE_2954 = 2954; public static final int ROTTEN_TOTEM_POLE = 2955; public static final int FERTILE_SOIL = 2956; public static final int DAMAGED_EARTH = 2957; public static final int CLIMBING_ROPE_2958 = 2958; public static final int ROCKY_LEDGE = 2959; public static final int ROCKY_LEDGE_2960 = 2960; public static final int ROCKY_LEDGE_2961 = 2961; public static final int ROCKS_2962 = 2962; public static final int ROCKS_2963 = 2963; public static final int ROCKS_2964 = 2964; public static final int MOSSY_ROCK_2965 = 2965; public static final int FURNACE_2966 = 2966; public static final int RECESS = 2969; public static final int FILLED_RECESS = 2970; public static final int SHIMMERING_FIELD = 2971; public static final int BOULDER_2972 = 2972; public static final int BOULDER_2973 = 2973; public static final int BOULDER_2974 = 2974; public static final int LEAFY_PALM_TREE = 2975; public static final int LEAFY_PALM_TREE_2976 = 2976; public static final int SWORD_CASE = 2978; public static final int SWORD_CASE_2979 = 2979; public static final int FLOWERS_2980 = 2980; public static final int FLOWERS_2981 = 2981; public static final int FLOWERS_2982 = 2982; public static final int FLOWERS_2983 = 2983; public static final int FLOWERS_2984 = 2984; public static final int FLOWERS_2985 = 2985; public static final int FLOWERS_2986 = 2986; public static final int FLOWERS_2987 = 2987; public static final int FLOWERS_2988 = 2988; public static final int VINE_2989 = 2989; public static final int VINE_2990 = 2990; public static final int VINE_2991 = 2991; public static final int VINE_2992 = 2992; public static final int VINE_2993 = 2993; public static final int VINE_2994 = 2994; public static final int CLOSED_CHEST_2995 = 2995; public static final int CLOSED_CHEST_2996 = 2996; public static final int SWORD_CASE_2997 = 2997; public static final int TABLE_2998 = 2998; public static final int TIMBER_DEFENCE_3000 = 3000; public static final int SINK_3014 = 3014; public static final int DISHES = 3015; public static final int DISHES_3016 = 3016; public static final int DISHES_3017 = 3017; public static final int SWORD_CASE_3018 = 3018; public static final int POSTER_3019 = 3019; public static final int POSTER_3020 = 3020; public static final int POSTER_3021 = 3021; public static final int STEPLADDER = 3024; public static final int SHELF_3026 = 3026; public static final int SHELF_3027 = 3027; public static final int SHELF_3028 = 3028; public static final int SHOP_COUNTER = 3029; public static final int NOTICES = 3032; public static final int ARCTIC_PINE = 3037; public static final int BOW_CABINET_3040 = 3040; public static final int WORKBENCH_3041 = 3041; public static final int BOW_CASE = 3044; public static final int CRATE_3045 = 3045; public static final int TIMBER_DEFENCE_3046 = 3046; public static final int WALL_3077 = 3077; public static final int WALL_3078 = 3078; public static final int WALL_3079 = 3079; public static final int WALL_3082 = 3082; public static final int WALL_3083 = 3083; public static final int ENTRANCE = 3108; public static final int ENTRANCE_3109 = 3109; public static final int ENTRANCE_3111 = 3111; public static final int ENTRANCE_3112 = 3112; public static final int ENTRANCE_3113 = 3113; public static final int ENTRANCE_3114 = 3114; public static final int BED_3159 = 3159; public static final int CHAIR_3182 = 3182; public static final int HOSPITAL_SHELVES = 3183; public static final int HOSPITAL_SHELVES_3184 = 3184; public static final int HOSPITAL_SHELVES_3185 = 3185; public static final int OPERATING_TABLE = 3186; public static final int OPERATING_TABLE_3187 = 3187; public static final int DRAWERS_3190 = 3190; public static final int DRAWERS_3191 = 3191; public static final int SCOREBOARD = 3192; public static final int OPEN_CHEST_3194 = 3194; public static final int CRATE_3195 = 3195; public static final int DAMAGED_ARMOUR = 3196; public static final int TRAWLER_NET_3197 = 3197; public static final int TRAWLER_NET_3198 = 3198; public static final int BED_3199 = 3199; public static final int TRAPDOOR_3203 = 3203; public static final int CRATE_3205 = 3205; public static final int BARREL_3206 = 3206; public static final int WOOD = 3209; public static final int BARREL_3210 = 3210; public static final int POSTER_3212 = 3212; public static final int CAVE_ENTRANCE_3213 = 3213; public static final int UNDERGROUND_PASS_EXIT = 3214; public static final int MUD = 3216; public static final int CAVE_3217 = 3217; public static final int TUNNEL_3218 = 3218; public static final int TUNNEL_3219 = 3219; public static final int DOOR_3220 = 3220; public static final int DOOR_3221 = 3221; public static final int CAVE_STAIRS = 3222; public static final int CAVE_STAIRS_3223 = 3223; public static final int CAVE_3224 = 3224; public static final int TRAP = 3227; public static final int TRAP_3228 = 3228; public static final int TRAP_3229 = 3229; public static final int FLAT_ROCK = 3230; public static final int PLANK = 3231; public static final int STALAGMITES = 3232; public static final int TRAP_3233 = 3233; public static final int ODD_MARKINGS = 3234; public static final int OBSTACLE_PIPE = 3235; public static final int OBSTACLE_PIPE_3236 = 3236; public static final int OBSTACLE_PIPE_3237 = 3237; public static final int LEDGE_3238 = 3238; public static final int BRIDGE = 3239; public static final int BRIDGE_3240 = 3240; public static final int LEVER_3241 = 3241; public static final int LEVER_3242 = 3242; public static final int PLATFORM = 3243; public static final int PLATFORM_3244 = 3244; public static final int PLATFORM_3245 = 3245; public static final int PLATFORM_3246 = 3246; public static final int BRIDGE_3247 = 3247; public static final int BRIDGE_3248 = 3248; public static final int BRIDGE_3249 = 3249; public static final int BRIDGE_3250 = 3250; public static final int BRIDGE_3254 = 3254; public static final int BRIDGE_3255 = 3255; public static final int PLATFORM_3257 = 3257; public static final int BRIDGE_3258 = 3258; public static final int BRIDGE_3259 = 3259; public static final int BRIDGE_3260 = 3260; public static final int SWAMP = 3263; public static final int WELL_3264 = 3264; public static final int PILE_OF_ROCKS = 3265; public static final int CAGE = 3266; public static final int CAGE_3267 = 3267; public static final int CAGE_3268 = 3268; public static final int DOOR_3270 = 3270; public static final int DOOR_3271 = 3271; public static final int CHEST_3272 = 3272; public static final int CHEST_3273 = 3273; public static final int CHEST_3274 = 3274; public static final int STONE_BRIDGE = 3276; public static final int FURNACE_3294 = 3294; public static final int STONE_TABLET = 3295; public static final int STONE_TABLET_3296 = 3296; public static final int STONE_TABLET_3297 = 3297; public static final int STONE_TABLET_3298 = 3298; public static final int STONE_TABLET_3299 = 3299; public static final int STONE_TABLET_3300 = 3300; public static final int STONE_TABLET_3301 = 3301; public static final int STONE_TABLET_3302 = 3302; public static final int PORTCULLIS = 3303; public static final int PORTCULLIS_3304 = 3304; public static final int WELL_3305 = 3305; public static final int ROCKPILE = 3307; public static final int SMASHED_CAGE = 3308; public static final int ROCKSLIDE = 3309; public static final int EERIE_STATUE = 3327; public static final int DWARF_STATUE_3328 = 3328; public static final int TEMPLE_DOOR = 3332; public static final int DOOR_3333 = 3333; public static final int DOOR_3334 = 3334; public static final int DOOR_3335 = 3335; public static final int DOOR_3336 = 3336; public static final int LEVER_3337 = 3337; public static final int HANGING_LOG = 3338; public static final int FLAT_ROCK_3339 = 3339; public static final int GUIDE_ROPE = 3340; public static final int GUIDE_ROPE_3341 = 3341; public static final int ROCK_PILE_3343 = 3343; public static final int BARREL_3344 = 3344; public static final int IBANS_THRONE = 3348; public static final int CAGE_3351 = 3351; public static final int CAGE_3352 = 3352; public static final int TOMB = 3353; public static final int TOMB_3354 = 3354; public static final int WELL_3359 = 3359; public static final int CRATE_3360 = 3360; public static final int ORB_OF_LIGHT = 3361; public static final int WINDOW_3362 = 3362; public static final int ROCK_3364 = 3364; public static final int PROTRUDING_ROCKS = 3365; public static final int ONION = 3366; public static final int PRISON_DOOR_3367 = 3367; public static final int ACHEY_TREE_STUMP = 3371; public static final int OGRE_SPITROAST = 3372; public static final int OGRE_SPITROAST_3373 = 3373; public static final int OGRE_SPITROAST_3374 = 3374; public static final int OGRE_SPITROAST_3375 = 3375; public static final int OGRE_BENCH = 3376; public static final int LOCKED_OGRE_CHEST = 3377; public static final int UNLOCKED_OGRE_CHEST = 3378; public static final int CAVE_ENTRANCE_3379 = 3379; public static final int CAVE_EXIT_3380 = 3380; public static final int CAVE_EXIT_3381 = 3381; public static final int OGRE_SPITROAST_3382 = 3382; public static final int OGRE_SPITROAST_3383 = 3383; public static final int CRATE_3394 = 3394; public static final int CRATE_3395 = 3395; public static final int BOXES_3396 = 3396; public static final int BOXES_3397 = 3397; public static final int CRATE_3398 = 3398; public static final int CRATE_3399 = 3399; public static final int CRATE_3400 = 3400; public static final int CRATE_3401 = 3401; public static final int WORKBENCH_3402 = 3402; public static final int LEVER_3406 = 3406; public static final int WATER_WHEEL = 3408; public static final int LEVER_3409 = 3409; public static final int STAIRCASE_3415 = 3415; public static final int STAIRCASE_3416 = 3416; public static final int LEVER_3417 = 3417; public static final int MACHINERY = 3422; public static final int POSTER_3431 = 3431; public static final int TRAPDOOR_3432 = 3432; public static final int TRAPDOOR_3433 = 3433; public static final int STAIRS_3440 = 3440; public static final int STAIRS_3441 = 3441; public static final int HOLY_BARRIER = 3443; public static final int GATE_3444 = 3444; public static final int GATE_3445 = 3445; public static final int CELL_DOOR = 3463; public static final int HANGING_MEAT = 3466; public static final int HANGING_MEAT_3467 = 3467; public static final int STATUE_3479 = 3479; public static final int COFFIN_3480 = 3480; public static final int WELL_3485 = 3485; public static final int LARGE_DOOR_3489 = 3489; public static final int LARGE_DOOR_3490 = 3490; public static final int MONUMENT = 3493; public static final int MONUMENT_3494 = 3494; public static final int MONUMENT_3495 = 3495; public static final int MONUMENT_3496 = 3496; public static final int MONUMENT_3497 = 3497; public static final int MONUMENT_3498 = 3498; public static final int MONUMENT_3499 = 3499; public static final int CHURCH_ORGAN_3500 = 3500; public static final int GATE_3506 = 3506; public static final int GATE_3507 = 3507; public static final int ROTTING_LOG = 3508; public static final int FUNGI_ON_LOG = 3509; public static final int ROTTING_BRANCH = 3510; public static final int BUDDING_BRANCH = 3511; public static final int A_SMALL_BUSH = 3512; public static final int A_GOLDEN_PEAR_BUSH = 3513; public static final int ROTTING_TREE = 3514; public static final int GROTTO = 3516; public static final int GROTTO_TREE = 3517; public static final int GROTTO_3520 = 3520; public static final int ALTAR_OF_NATURE = 3521; public static final int BRIDGE_3522 = 3522; public static final int BENCH_3523 = 3523; public static final int GROTTO_3525 = 3525; public static final int GROTTO_3526 = 3526; public static final int STONE = 3527; public static final int STONE_3528 = 3528; public static final int STONE_3529 = 3529; public static final int OLD_WELL = 3546; public static final int BALANCING_ROPE = 3551; public static final int BALANCING_ROPE_3552 = 3552; public static final int LOG_BALANCE = 3553; public static final int LOG_BALANCE_3554 = 3554; public static final int LOG_BALANCE_3555 = 3555; public static final int LOG_BALANCE_3556 = 3556; public static final int LOG_BALANCE_3557 = 3557; public static final int LOG_BALANCE_3558 = 3558; public static final int BALANCING_LEDGE = 3559; public static final int BALANCING_LEDGE_3560 = 3560; public static final int BALANCING_LEDGE_3561 = 3561; public static final int BALANCING_LEDGE_3562 = 3562; public static final int MONKEY_BARS = 3563; public static final int MONKEY_BARS_3564 = 3564; public static final int LOW_WALL = 3565; public static final int ROPE_SWING = 3566; public static final int BLADE = 3567; public static final int BLADE_3568 = 3568; public static final int BLADE_3569 = 3569; public static final int PLANK_3570 = 3570; public static final int PLANK_3571 = 3571; public static final int PLANK_3572 = 3572; public static final int PLANK_3573 = 3573; public static final int PLANK_3574 = 3574; public static final int PLANK_3575 = 3575; public static final int PLANK_3576 = 3576; public static final int COFFIN_3577 = 3577; public static final int PILLAR_3578 = 3578; public static final int PILLAR_3579 = 3579; public static final int SPINNING_BLADES = 3580; public static final int TICKET_DISPENSER = 3581; public static final int FLOOR_SPIKES = 3582; public static final int HAND_HOLDS_3583 = 3583; public static final int HAND_HOLDS_3584 = 3584; public static final int PRESSURE_PAD = 3585; public static final int TICKET_DISPENSER_3608 = 3608; public static final int CLIMBING_ROPE_3610 = 3610; public static final int LADDER_3617 = 3617; public static final int LADDER_3618 = 3618; public static final int MANNEQUIN = 3624; public static final int BOOKCASE_3625 = 3625; public static final int SHELF_3627 = 3627; public static final int SHELF_3628 = 3628; public static final int BENCH_3632 = 3632; public static final int CART_3633 = 3633; public static final int WATERPUMP = 3640; public static final int FOUNTAIN_3641 = 3641; public static final int STATUE_3642 = 3642; public static final int STATUE_3643 = 3643; public static final int TROUGH_3644 = 3644; public static final int PLOUGH_3645 = 3645; public static final int WELL_3646 = 3646; public static final int SPEAR_WALL_3647 = 3647; public static final int DYING_TREE = 3648; public static final int DYING_TREE_STUMP = 3649; public static final int CAVE_ENTRANCE_3650 = 3650; public static final int CAVE_ENTRANCE_3651 = 3651; public static final int CAVE_3652 = 3652; public static final int COOKING_POT = 3662; public static final int BONES = 3665; public static final int STONE_MECHANISM = 3676; public static final int STONE_MECHANISM_3677 = 3677; public static final int STANDARD_3679 = 3679; public static final int FLAGPOLE_3680 = 3680; public static final int SIGNPOST_3681 = 3681; public static final int BOXES_3685 = 3685; public static final int BOXES_3686 = 3686; public static final int BOXES_3687 = 3687; public static final int CLIMBING_ROPE_3692 = 3692; public static final int CRATE_3694 = 3694; public static final int SUIT_OF_ARMOUR_3696 = 3696; public static final int BARREL_3697 = 3697; public static final int ROCKS_3722 = 3722; public static final int ROCKS_3723 = 3723; public static final int GATE_3725 = 3725; public static final int GATE_3726 = 3726; public static final int GATE_3727 = 3727; public static final int GATE_3728 = 3728; public static final int STILE_3730 = 3730; public static final int CAVE_ENTRANCE_3735 = 3735; public static final int CAVE_EXIT_3736 = 3736; public static final int DANGER_SIGN_3741 = 3741; public static final int DANGER_SIGN_3742 = 3742; public static final int LARGE_DOOR_3743 = 3743; public static final int DOOR_3745 = 3745; public static final int DOOR_3746 = 3746; public static final int DOOR_3747 = 3747; public static final int ROCKS_3748 = 3748; public static final int CAVE_3752 = 3752; public static final int BOULDERS = 3753; public static final int BOULDERS_3754 = 3754; public static final int RUINS = 3755; public static final int SLAB = 3756; public static final int CAVE_ENTRANCE_3757 = 3757; public static final int CAVE_EXIT_3758 = 3758; public static final int CAVE_ENTRANCE_3759 = 3759; public static final int CAVE_EXIT_3760 = 3760; public static final int EXIT = 3761; public static final int SECRET_DOOR = 3762; public static final int CELL_DOOR_3763 = 3763; public static final int CELL_DOOR_3764 = 3764; public static final int CELL_DOOR_3765 = 3765; public static final int CELL_DOOR_3767 = 3767; public static final int FIRE = 3769; public static final int WINDOW_3770 = 3770; public static final int STRONGHOLD = 3771; public static final int EXIT_3772 = 3772; public static final int EXIT_3773 = 3773; public static final int EXIT_3774 = 3774; public static final int FIRE_3775 = 3775; public static final int DOOR_3776 = 3776; public static final int DOOR_3777 = 3777; public static final int PRISON_DOOR_3780 = 3780; public static final int ARENA_ENTRANCE = 3782; public static final int ARENA_ENTRANCE_3783 = 3783; public static final int ARENA_EXIT = 3785; public static final int ARENA_EXIT_3786 = 3786; public static final int STONE_STAIRCASE = 3788; public static final int STONE_STAIRCASE_3789 = 3789; public static final int ROCKS_3790 = 3790; public static final int ROCKS_3791 = 3791; public static final int GRASS = 3794; public static final int GRASS_3795 = 3795; public static final int CORPSE_3797 = 3797; public static final int CORPSE_3798 = 3798; public static final int CORPSE_3799 = 3799; public static final int COUNTER_3800 = 3800; public static final int CHAIR_3801 = 3801; public static final int SMASHED_CHAIR_3802 = 3802; public static final int ROCKS_3803 = 3803; public static final int ROCKS_3804 = 3804; public static final int ROCKS_3805 = 3805; public static final int ROCKS_3806 = 3806; public static final int ROCKS_3807 = 3807; public static final int ROCKS_3808 = 3808; public static final int STOREROOM_DOOR = 3810; public static final int CRATE_3813 = 3813; public static final int CRATES_3814 = 3814; public static final int CRATES_3815 = 3815; public static final int KITCHEN_DRAWERS = 3816; public static final int KITCHEN_DRAWERS_3817 = 3817; public static final int FOOD_TROUGH_3820 = 3820; public static final int RACK_3821 = 3821; public static final int GOUTWEED_CRATE = 3822; public static final int SIGN_3823 = 3823; public static final int TROLL_STEW = 3824; public static final int STALAGMITE = 3825; public static final int STALAGMITES_3826 = 3826; public static final int TUNNEL_ENTRANCE = 3828; public static final int ROPE_3829 = 3829; public static final int COMPOST_BIN = 3830; public static final int TUNNEL_ENTRANCE_3831 = 3831; public static final int ROPE_3832 = 3832; public static final int COCOON = 3833; public static final int COMPOST_BIN_3835 = 3835; public static final int COMPOST_BIN_3836 = 3836; public static final int COMPOST_BIN_3837 = 3837; public static final int COMPOST_BIN_3838 = 3838; public static final int COMPOST_BIN_3839 = 3839; public static final int COMPOST_BIN_3840 = 3840; public static final int COMPOST_BIN_3841 = 3841; public static final int COMPOST_BIN_3842 = 3842; public static final int COMPOST_BIN_3843 = 3843; public static final int COMPOST_BIN_3844 = 3844; public static final int COMPOST_BIN_3845 = 3845; public static final int COMPOST_BIN_3846 = 3846; public static final int COMPOST_BIN_3847 = 3847; public static final int COMPOST_BIN_3848 = 3848; public static final int COMPOST_BIN_3849 = 3849; public static final int COMPOST_BIN_3850 = 3850; public static final int COMPOST_BIN_3851 = 3851; public static final int COMPOST_BIN_3852 = 3852; public static final int COMPOST_BIN_3853 = 3853; public static final int COMPOST_BIN_3854 = 3854; public static final int CRATE_3856 = 3856; public static final int CRATE_3857 = 3857; public static final int FISHING_ROD = 3858; public static final int FISHING_ROD_3859 = 3859; public static final int BARREL_3860 = 3860; public static final int CRATE_3861 = 3861; public static final int BURNING_BONES = 3862; public static final int TRIBAL_STATUE_3863 = 3863; public static final int TREE_3879 = 3879; public static final int TREE_STUMP_3880 = 3880; public static final int TREE_3881 = 3881; public static final int TREE_3882 = 3882; public static final int TREE_3883 = 3883; public static final int TREE_STUMP_3884 = 3884; public static final int TREE_3885 = 3885; public static final int TREE_3886 = 3886; public static final int TREE_3887 = 3887; public static final int TREE_3888 = 3888; public static final int TREE_3889 = 3889; public static final int TREE_3890 = 3890; public static final int TREE_3891 = 3891; public static final int TREE_3892 = 3892; public static final int TREE_3893 = 3893; public static final int FLOWERS_3901 = 3901; public static final int FLOWERS_3902 = 3902; public static final int FLOWERS_3903 = 3903; public static final int FLOWERS_3904 = 3904; public static final int FLOWERS_3905 = 3905; public static final int FLOWERS_3906 = 3906; public static final int MUSHROOM_3912 = 3912; public static final int MUSHROOMS_3913 = 3913; public static final int MUSHROOM_3914 = 3914; public static final int MUSHROOM_3915 = 3915; public static final int MUSHROOMS_3916 = 3916; public static final int MUSHROOM_3917 = 3917; public static final int ELVEN_LAMP = 3918; public static final int TWIGS = 3919; public static final int TRIPWIRE = 3921; public static final int STICKS = 3922; public static final int LEAVES = 3923; public static final int LEAVES_3924 = 3924; public static final int LEAVES_3925 = 3925; public static final int PROTRUDING_ROCKS_3927 = 3927; public static final int TREE_3928 = 3928; public static final int LOG_BALANCE_3929 = 3929; public static final int LOG_BALANCE_3930 = 3930; public static final int LOG_BALANCE_3931 = 3931; public static final int LOG_BALANCE_3932 = 3932; public static final int LOG_BALANCE_3933 = 3933; public static final int DENSE_FOREST = 3937; public static final int DENSE_FOREST_3938 = 3938; public static final int DENSE_FOREST_3939 = 3939; public static final int TRACKS_3941 = 3941; public static final int HUGE_GATE = 3944; public static final int HUGE_GATE_3945 = 3945; public static final int HUGE_GATE_3946 = 3946; public static final int HUGE_GATE_3947 = 3947; public static final int SULPHUR = 3962; public static final int SULPHUR_3963 = 3963; public static final int SULPHUR_3964 = 3964; public static final int TREE_3967 = 3967; public static final int TREE_3968 = 3968; public static final int PILE_OF_SKULLS_3969 = 3969; public static final int CHARRED_BONES_3970 = 3970; public static final int CORPSE_3971 = 3971; public static final int CORPSE_3972 = 3972; public static final int CORPSE_3973 = 3973; public static final int CORPSE_3974 = 3974; public static final int TAR = 3975; public static final int CATAPULT_3976 = 3976; public static final int CATAPULTWINCH = 3977; public static final int CATAPULTLEVER = 3978; public static final int TENT_FLAP = 3980; public static final int TENT = 3983; public static final int TENT_3984 = 3984; public static final int TENT_3985 = 3985; public static final int TENT_3986 = 3986; public static final int BARREL_3987 = 3987; public static final int STANDARD_3992 = 3992; public static final int STANDARD_3993 = 3993; public static final int SMALL_FURNACE = 3994; public static final int TENT_WALL = 3995; public static final int TENT_FLAP_3996 = 3996; public static final int TENT_WALL_3997 = 3997; public static final int DENSE_FOREST_3998 = 3998; public static final int DENSE_FOREST_3999 = 3999; public static final int TENT_ROOF = 4000; public static final int TENT_WALL_4001 = 4001; public static final int TENT_POLE = 4002; public static final int WELL_4004 = 4004; public static final int WELL_4005 = 4005; public static final int CAVE_ENTRANCE_4006 = 4006; public static final int CAVE_EXIT_4007 = 4007; public static final int ALTAR_4008 = 4008; public static final int BARREL_4024 = 4024; public static final int BARREL_4025 = 4025; public static final int FRACTIONALIZING_STILL = 4026; public static final int STUMP = 4027; public static final int TREE_4028 = 4028; public static final int TREE_4029 = 4029; public static final int TROPICAL_TREE_4030 = 4030; public static final int SHANTAY_PASS = 4031; public static final int DRUIDS_ROBES = 4035; public static final int DRUIDS_ROBES_4036 = 4036; public static final int LAUNDRY_BASKET = 4039; public static final int AVIARY_HATCH = 4043; public static final int STANDARD_4044 = 4044; public static final int TREE_4048 = 4048; public static final int TREE_4049 = 4049; public static final int TREE_4050 = 4050; public static final int TREE_4051 = 4051; public static final int TREE_4052 = 4052; public static final int TREE_4053 = 4053; public static final int TREE_4054 = 4054; public static final int HUGE_MUSHROOM = 4055; public static final int HUGE_MUSHROOM_4056 = 4056; public static final int HUGE_MUSHROOM_4057 = 4057; public static final int WASHING_LINE_4058 = 4058; public static final int WASHING_LINE_4059 = 4059; public static final int SHIPS_LADDER_4060 = 4060; public static final int TREE_STUMP_4061 = 4061; public static final int SHELF_4062 = 4062; public static final int SINK_4063 = 4063; public static final int SMASHED_TABLE_4064 = 4064; public static final int STONE_STAND_4065 = 4065; public static final int SIGNPOST_4066 = 4066; public static final int WARNING_SIGN = 4067; public static final int BROKEN_WALL = 4068; public static final int TEMPLE_WALL = 4069; public static final int TEMPLE_WALL_4070 = 4070; public static final int TEMPLE_WALL_4071 = 4071; public static final int TEMPLE_WALL_4072 = 4072; public static final int TEMPLE_WALL_4073 = 4073; public static final int TEMPLE_WALL_4074 = 4074; public static final int TEMPLE_WALL_4075 = 4075; public static final int TEMPLE_WALL_4076 = 4076; public static final int TEMPLE_WALL_4077 = 4077; public static final int TEMPLE_WALL_4078 = 4078; public static final int BROKEN_WALL_4079 = 4079; public static final int TEMPLE_WALL_4080 = 4080; public static final int TEMPLE_WALL_4081 = 4081; public static final int TEMPLE_WALL_4082 = 4082; public static final int TEMPLE_WALL_4083 = 4083; public static final int TEMPLE_WALL_4084 = 4084; public static final int TEMPLE_WALL_4085 = 4085; public static final int TEMPLE_WALL_4086 = 4086; public static final int TEMPLE_WALL_4087 = 4087; public static final int TEMPLE_WALL_4088 = 4088; public static final int TEMPLE_WALL_4089 = 4089; public static final int FLAMING_FIRE_ALTAR = 4090; public static final int FIRE_ALTAR = 4091; public static final int BROKEN_FIRE_ALTAR = 4092; public static final int FUNERAL_PYRE = 4093; public static final int FUNERAL_PYRE_4094 = 4094; public static final int FUNERAL_PYRE_4095 = 4095; public static final int FUNERAL_PYRE_4096 = 4096; public static final int FUNERAL_PYRE_4097 = 4097; public static final int FUNERAL_PYRE_4098 = 4098; public static final int FUNERAL_PYRE_4099 = 4099; public static final int FUNERAL_PYRE_4100 = 4100; public static final int FUNERAL_PYRE_4101 = 4101; public static final int FUNERAL_PYRE_4102 = 4102; public static final int FUNERAL_PYRE_4103 = 4103; public static final int FUNERAL_PYRE_4104 = 4104; public static final int FUNERAL_PYRE_4105 = 4105; public static final int SOLID_BRONZE_DOOR = 4106; public static final int SOLID_STEEL_DOOR = 4107; public static final int SOLID_BLACK_DOOR = 4108; public static final int SOLID_SILVER_DOOR = 4109; public static final int BRONZE_CHEST = 4111; public static final int BRONZE_CHEST_4112 = 4112; public static final int BRONZE_CHEST_4113 = 4113; public static final int BRONZE_CHEST_4114 = 4114; public static final int BRONZE_CHEST_4115 = 4115; public static final int STEEL_CHEST = 4116; public static final int STEEL_CHEST_4117 = 4117; public static final int STEEL_CHEST_4118 = 4118; public static final int STEEL_CHEST_4119 = 4119; public static final int STEEL_CHEST_4120 = 4120; public static final int BLACK_CHEST = 4121; public static final int BLACK_CHEST_4122 = 4122; public static final int BLACK_CHEST_4123 = 4123; public static final int BLACK_CHEST_4124 = 4124; public static final int BLACK_CHEST_4125 = 4125; public static final int SILVER_CHEST = 4126; public static final int SILVER_CHEST_4127 = 4127; public static final int SILVER_CHEST_4128 = 4128; public static final int SILVER_CHEST_4129 = 4129; public static final int SILVER_CHEST_4130 = 4130; public static final int BRONZE_CHEST_4131 = 4131; public static final int WOODEN_DOORS = 4132; public static final int WOODEN_DOORS_4133 = 4133; public static final int HILLSIDE_ENTRANCE = 4134; public static final int HILLSIDE_ENTRANCE_4135 = 4135; public static final int COUNTER_4138 = 4138; public static final int SHIPS_LADDER_4139 = 4139; public static final int HOLE_4140 = 4140; public static final int STRANGE_ALTAR = 4141; public static final int SWAYING_TREE = 4142; public static final int DANGER_SIGN_4143 = 4143; public static final int GOLDEN_TREE = 4144; public static final int CAVE_ENTRANCE_4147 = 4147; public static final int DOOR_4148 = 4148; public static final int LALLIS_STEW = 4149; public static final int PORTAL_4150 = 4150; public static final int PORTAL_4151 = 4151; public static final int PORTAL_4152 = 4152; public static final int PORTAL_4153 = 4153; public static final int PORTAL_4154 = 4154; public static final int PORTAL_4155 = 4155; public static final int PORTAL_4156 = 4156; public static final int PORTAL_4157 = 4157; public static final int LADDER_4158 = 4158; public static final int LADDER_4159 = 4159; public static final int LADDER_4160 = 4160; public static final int ESCAPE_ROPE = 4161; public static final int PIPE_4162 = 4162; public static final int LADDER_4163 = 4163; public static final int LADDER_4164 = 4164; public static final int DOOR_4165 = 4165; public static final int DOOR_4166 = 4166; public static final int CHEST_4167 = 4167; public static final int CHEST_4168 = 4168; public static final int FROZEN_TABLE = 4169; public static final int CHEST_4170 = 4170; public static final int BOOKCASE_4171 = 4171; public static final int COOKING_RANGE_4172 = 4172; public static final int TRAPDOOR_4173 = 4173; public static final int TRAPDOOR_4174 = 4174; public static final int DRAIN = 4175; public static final int TAP = 4176; public static final int CUPBOARD_4177 = 4177; public static final int CUPBOARD_4178 = 4178; public static final int ABSTRACT_MURAL = 4179; public static final int ABSTRACT_MURAL_4180 = 4180; public static final int UNICORNS_HEAD_4181 = 4181; public static final int BULLS_HEAD_4182 = 4182; public static final int BOXES_4183 = 4183; public static final int BOXES_4184 = 4184; public static final int CRATE_4185 = 4185; public static final int CRATE_4186 = 4186; public static final int LADDER_4187 = 4187; public static final int LADDER_4188 = 4188; public static final int LADDER_4189 = 4189; public static final int DOOR_4247 = 4247; public static final int DOOR_4248 = 4248; public static final int DOOR_4250 = 4250; public static final int DOOR_4251 = 4251; public static final int CHEST_4252 = 4252; public static final int CHEST_4253 = 4253; public static final int FIRE_4265 = 4265; public static final int FIRE_4266 = 4266; public static final int SPIT_ROAST = 4267; public static final int WOODEN_TABLE = 4269; public static final int WOODEN_TABLE_4270 = 4270; public static final int CHAIR_4271 = 4271; public static final int TABLE_4272 = 4272; public static final int BAR_PUMPS_4273 = 4273; public static final int BAR_4274 = 4274; public static final int BARREL_4275 = 4275; public static final int MARKET_STALL_4276 = 4276; public static final int FISH_STALL = 4277; public static final int FUR_STALL_4278 = 4278; public static final int DRAIN_4283 = 4283; public static final int TAP_4285 = 4285; public static final int KEG = 4286; public static final int BED_4287 = 4287; public static final int BED_4288 = 4288; public static final int ABANDONED_CART = 4296; public static final int BOXES_4297 = 4297; public static final int BOXES_4298 = 4298; public static final int BOXES_4299 = 4299; public static final int CRATE_4300 = 4300; public static final int CRATE_4301 = 4301; public static final int FURNACE_4304 = 4304; public static final int ANVIL_4306 = 4306; public static final int BLACKSMITHS_TOOLS_4307 = 4307; public static final int POTTERY_OVEN = 4308; public static final int SPINNING_WHEEL = 4309; public static final int POTTERS_WHEEL = 4310; public static final int GATE_4311 = 4311; public static final int GATE_4312 = 4312; public static final int GATE_4313 = 4313; public static final int TREE_STUMP_4328 = 4328; public static final int TREE_STUMP_4329 = 4329; public static final int SHELL = 4348; public static final int SHELL_4349 = 4349; public static final int SHELL_4350 = 4350; public static final int SHELL_4351 = 4351; public static final int BOWL = 4352; public static final int SHELF_4366 = 4366; public static final int SHELF_4367 = 4367; public static final int SHELF_4368 = 4368; public static final int SHELF_4369 = 4369; public static final int SHELF_4370 = 4370; public static final int SHELF_4371 = 4371; public static final int TABLE_4372 = 4372; public static final int SAND_PIT = 4373; public static final int STANDARD_STAND = 4377; public static final int STANDARD_STAND_4378 = 4378; public static final int IRON_LADDER = 4380; public static final int CATAPULT_4381 = 4381; public static final int CATAPULT_4382 = 4382; public static final int IRON_LADDER_4383 = 4383; public static final int CATAPULT_4385 = 4385; public static final int CATAPULT_4386 = 4386; public static final int SARADOMIN_PORTAL = 4387; public static final int ZAMORAK_PORTAL = 4388; public static final int PORTAL_4389 = 4389; public static final int PORTAL_4390 = 4390; public static final int PORTAL_4406 = 4406; public static final int PORTAL_4407 = 4407; public static final int GUTHIX_PORTAL = 4408; public static final int STEPPING_STONE = 4411; public static final int IRON_LADDER_4412 = 4412; public static final int IRON_LADDER_4413 = 4413; public static final int STAIRCASE_4414 = 4414; public static final int STAIRCASE_4415 = 4415; public static final int STAIRCASE_4416 = 4416; public static final int STAIRCASE_4417 = 4417; public static final int STAIRCASE_4418 = 4418; public static final int STAIRCASE_4419 = 4419; public static final int STAIRCASE_4420 = 4420; public static final int BARRICADE = 4421; public static final int BARRICADE_4422 = 4422; public static final int LARGE_DOOR_4423 = 4423; public static final int LARGE_DOOR_4424 = 4424; public static final int LARGE_DOOR_4425 = 4425; public static final int LARGE_DOOR_4426 = 4426; public static final int LARGE_DOOR_4427 = 4427; public static final int LARGE_DOOR_4428 = 4428; public static final int LARGE_DOOR_4429 = 4429; public static final int LARGE_DOOR_4430 = 4430; public static final int BROKEN_DOOR = 4431; public static final int BROKEN_DOOR_4432 = 4432; public static final int BROKEN_DOOR_4433 = 4433; public static final int BROKEN_DOOR_4434 = 4434; public static final int ROCKS_4437 = 4437; public static final int ROCKS_4438 = 4438; public static final int CLIMBING_ROPE_4444 = 4444; public static final int BATTLEMENTS = 4446; public static final int BATTLEMENTS_4447 = 4447; public static final int CAVE_WALL = 4448; public static final int STAIRCASE_4449 = 4449; public static final int STAIRCASE_4450 = 4450; public static final int TABLE_4458 = 4458; public static final int TABLE_4459 = 4459; public static final int TABLE_4460 = 4460; public static final int TABLE_4461 = 4461; public static final int TABLE_4462 = 4462; public static final int TABLE_4463 = 4463; public static final int TABLE_4464 = 4464; public static final int DOOR_4465 = 4465; public static final int DOOR_4466 = 4466; public static final int DOOR_4467 = 4467; public static final int DOOR_4468 = 4468; public static final int ENERGY_BARRIER = 4469; public static final int ENERGY_BARRIER_4470 = 4470; public static final int TRAPDOOR_4471 = 4471; public static final int TRAPDOOR_4472 = 4472; public static final int TAP_4482 = 4482; public static final int BANK_CHEST_4483 = 4483; public static final int SCOREBOARD_4484 = 4484; public static final int WASHING_LINE_4487 = 4487; public static final int PIGEON = 4488; public static final int PIGEON_4489 = 4489; public static final int KURASK_HEAD = 4490; public static final int MOUNTED_SWORDFISH = 4491; public static final int MOUNTED_SEA_BASS = 4492; public static final int SHELVES_4505 = 4505; public static final int CHAIR_SPACE = 4515; public static final int CHAIR_SPACE_4516 = 4516; public static final int CHAIR_SPACE_4517 = 4517; public static final int RUG_SPACE = 4518; public static final int RUG_SPACE_4519 = 4519; public static final int RUG_SPACE_4520 = 4520; public static final int BOOKCASE_SPACE = 4521; public static final int BOOKCASE_SPACE_4522 = 4522; public static final int FIREPLACE_SPACE = 4523; public static final int CURTAIN_SPACE = 4524; public static final int PORTAL_4525 = 4525; public static final int ROCK_4526 = 4526; public static final int POND = 4527; public static final int STATUE_4528 = 4528; public static final int DUNGEON_ENTRANCE = 4529; public static final int DEAD_TREE_4531 = 4531; public static final int TREE_4532 = 4532; public static final int OAK_TREE = 4533; public static final int WILLOW_TREE = 4534; public static final int MAPLE_TREE = 4535; public static final int YEW_TREE = 4536; public static final int MAGIC_TREE = 4537; public static final int DEAD_TREE_4538 = 4538; public static final int TREE_4539 = 4539; public static final int OAK_TREE_4540 = 4540; public static final int WILLOW_TREE_4541 = 4541; public static final int STRANGE_WALL = 4543; public static final int STRANGE_WALL_4544 = 4544; public static final int STRANGE_WALL_4545 = 4545; public static final int STRANGE_WALL_4546 = 4546; public static final int BEACH = 4550; public static final int BASALT_ROCK = 4551; public static final int BASALT_ROCK_4552 = 4552; public static final int BASALT_ROCK_4553 = 4553; public static final int BASALT_ROCK_4554 = 4554; public static final int BASALT_ROCK_4555 = 4555; public static final int BASALT_ROCK_4556 = 4556; public static final int BASALT_ROCK_4557 = 4557; public static final int BASALT_ROCK_4558 = 4558; public static final int ROCKY_SHORE = 4559; public static final int STAIRCASE_4568 = 4568; public static final int STAIRCASE_4569 = 4569; public static final int STAIRCASE_4570 = 4570; public static final int DOORWAY_4577 = 4577; public static final int LIGHTING_MECHANISM = 4587; public static final int LIGHTING_MECHANISM_4588 = 4588; public static final int LIGHTING_MECHANISM_4589 = 4589; public static final int LIGHTING_MECHANISM_4590 = 4590; public static final int SHELL_4610 = 4610; public static final int SHELL_4611 = 4611; public static final int SHELL_4612 = 4612; public static final int SHELL_4613 = 4613; public static final int BOWL_4614 = 4614; public static final int BROKEN_BRIDGE = 4615; public static final int BROKEN_BRIDGE_4616 = 4616; public static final int BOOKCASE_4617 = 4617; public static final int FIREPLACE = 4618; public static final int STAIRS_4620 = 4620; public static final int STAIRS_4621 = 4621; public static final int STAIRS_4622 = 4622; public static final int STAIRS_4623 = 4623; public static final int STAIRS_4624 = 4624; public static final int STAIRS_4625 = 4625; public static final int STAIRS_4626 = 4626; public static final int STAIRS_4627 = 4627; public static final int LARGE_DOOR_4629 = 4629; public static final int LARGE_DOOR_4630 = 4630; public static final int LARGE_DOOR_4631 = 4631; public static final int LARGE_DOOR_4632 = 4632; public static final int LARGE_DOOR_4633 = 4633; public static final int LARGE_DOOR_4634 = 4634; public static final int DOOR_4636 = 4636; public static final int DOOR_4637 = 4637; public static final int DOOR_4638 = 4638; public static final int DOOR_4639 = 4639; public static final int DOOR_4640 = 4640; public static final int STACKED_BARRELS = 4641; public static final int NOTICEBOARD_4642 = 4642; public static final int LADDER_4643 = 4643; public static final int LADDER_4644 = 4644; public static final int LADDER_4645 = 4645; public static final int LADDER_4646 = 4646; public static final int LADDER_4647 = 4647; public static final int LADDER_4648 = 4648; public static final int FIREPLACE_4650 = 4650; public static final int TABLE_4651 = 4651; public static final int TABLE_4652 = 4652; public static final int TABLE_4653 = 4653; public static final int STOOL_4656 = 4656; public static final int PLAQUE_4658 = 4658; public static final int PLAQUE_4659 = 4659; public static final int PLAQUE_4660 = 4660; public static final int PLAQUE_4661 = 4661; public static final int ARRAV = 4669; public static final int CAMORRA = 4670; public static final int BOOKCASE_4671 = 4671; public static final int THRONE_ROOM_DOOR = 4672; public static final int MAPLE_TREE_4674 = 4674; public static final int HERBS_4675 = 4675; public static final int ROCKS_4676 = 4676; public static final int HERBS_4677 = 4677; public static final int HERBS_4678 = 4678; public static final int HERBS_4679 = 4679; public static final int HARP = 4683; public static final int BARREL_4684 = 4684; public static final int HOLLOW_LOG_4685 = 4685; public static final int HOLLOW_LOG_4686 = 4686; public static final int CHAIR_4690 = 4690; public static final int FLAGPOLE_4692 = 4692; public static final int FLAGPOLE_4693 = 4693; public static final int DOOR_4696 = 4696; public static final int DOOR_4697 = 4697; public static final int DOOR_4701 = 4701; public static final int CHAIR_4702 = 4702; public static final int BED_4703 = 4703; public static final int BED_4704 = 4704; public static final int FISH_STALL_4705 = 4705; public static final int VEG_STALL = 4706; public static final int FISH_STALL_4707 = 4707; public static final int VEG_STALL_4708 = 4708; public static final int DOORWAY_4710 = 4710; public static final int TRAPDOOR_4712 = 4712; public static final int TRAPDOOR_4713 = 4713; public static final int CRATE_4714 = 4714; public static final int CRATE_4715 = 4715; public static final int CRATE_4716 = 4716; public static final int CRATE_4717 = 4717; public static final int CRATE_4718 = 4718; public static final int CRATE_4719 = 4719; public static final int CRATE_4720 = 4720; public static final int CRATE_4721 = 4721; public static final int CRATE_4722 = 4722; public static final int CRATE_4723 = 4723; public static final int CRATE_4724 = 4724; public static final int CRATE_4725 = 4725; public static final int CRATE_4726 = 4726; public static final int CRATE_4727 = 4727; public static final int CLIMBING_ROPE_4728 = 4728; public static final int BUSH_4729 = 4729; public static final int BAMBOO_LADDER = 4743; public static final int BAMBOO_LADDER_4744 = 4744; public static final int END_OF_BRIDGE = 4745; public static final int CRATE_4746 = 4746; public static final int BANANA_TREE_4749 = 4749; public static final int BANANA_TREE_4750 = 4750; public static final int BANANA_TREE_4751 = 4751; public static final int BANANA_TREE_4752 = 4752; public static final int BANANA_TREE_4753 = 4753; public static final int BANANA_TREE_4754 = 4754; public static final int STAIRS_4755 = 4755; public static final int STAIRS_4756 = 4756; public static final int BAMBOO_STOOL = 4764; public static final int WALL_OF_FLAME = 4765; public static final int WALL_OF_FLAME_4766 = 4766; public static final int SACRIFICIAL_PYRE = 4767; public static final int WALL_OF_BRICKS = 4768; public static final int PILE_OF_BRICKS = 4769; public static final int PILE_OF_BRICKS_4770 = 4770; public static final int AWOWOGEI = 4771; public static final int BAMBOO_LADDER_4772 = 4772; public static final int BAMBOO_LADDER_4773 = 4773; public static final int BAMBOO_LADDER_4774 = 4774; public static final int BAMBOO_LADDER_4775 = 4775; public static final int BAMBOO_LADDER_4776 = 4776; public static final int BAMBOO_LADDER_4777 = 4777; public static final int BAMBOO_LADDER_4778 = 4778; public static final int BAMBOO_LADDER_4779 = 4779; public static final int BAMBOO_LADDER_4780 = 4780; public static final int BAMBOO_LADDER_4781 = 4781; public static final int POTTED_PLANT_4786 = 4786; public static final int BAMBOO_GATE = 4787; public static final int BAMBOO_GATE_4788 = 4788; public static final int BAMBOO_BED = 4791; public static final int BAMBOO_BED_4792 = 4792; public static final int BAMBOO_BED_4793 = 4793; public static final int POT_4794 = 4794; public static final int POTS_4795 = 4795; public static final int BAMBOO_DESK = 4797; public static final int BAMBOO_BOOKCASE = 4798; public static final int JAIL_DOOR = 4799; public static final int JAIL_DOOR_4800 = 4800; public static final int BAMBOO_DOOR_4807 = 4807; public static final int JUNGLE_GRASS = 4812; public static final int JUNGLE_GRASS_4813 = 4813; public static final int JUNGLE_GRASS_4814 = 4814; public static final int LONG_GRASS = 4815; public static final int JUNGLE_TREE_4816 = 4816; public static final int JUNGLE_PALM_4817 = 4817; public static final int JUNGLE_TREE_4818 = 4818; public static final int JUNGLE_TREE_STUMP = 4819; public static final int JUNGLE_TREE_4820 = 4820; public static final int JUNGLE_TREE_STUMP_4821 = 4821; public static final int TREE_STUMP_4822 = 4822; public static final int JUNGLE_FLOWER_4823 = 4823; public static final int ORCHID_4824 = 4824; public static final int JUNGLE_PLANT_4825 = 4825; public static final int WHIPPING_PLANT_4826 = 4826; public static final int PINEAPPLE_PLANT_4827 = 4827; public static final int JUNGLE_PLANT_4828 = 4828; public static final int JUNGLE_PLANT_4829 = 4829; public static final int JUNGLE_PLANT_4830 = 4830; public static final int JUNGLE_PLANT_4831 = 4831; public static final int CREEPING_PLANT_4832 = 4832; public static final int JUNGLE_BUSH_4833 = 4833; public static final int JUNGLE_BUSH_4834 = 4834; public static final int SLASHED_BUSH_4835 = 4835; public static final int TROPICAL_TREE_4845 = 4845; public static final int TROPICAL_TREE_4846 = 4846; public static final int TROPICAL_TREE_4847 = 4847; public static final int TROPICAL_LEAVES_4848 = 4848; public static final int TROPICAL_TREE_4849 = 4849; public static final int TROPICAL_TREE_4850 = 4850; public static final int TROPICAL_TREE_4851 = 4851; public static final int HOLLOW_LOG_4852 = 4852; public static final int ROOTS_4853 = 4853; public static final int ROOTS_4854 = 4854; public static final int ROOTS_4855 = 4855; public static final int GLOWING_FUNGUS = 4856; public static final int GLOWING_FUNGUS_4857 = 4857; public static final int GORILLA_STATUE = 4858; public static final int GORILLA_STATUE_4859 = 4859; public static final int GORILLA_STATUE_4860 = 4860; public static final int MONKEY_STATUE = 4861; public static final int GLOWING_FUNGUS_4862 = 4862; public static final int WATCHTOWER_LEGS = 4863; public static final int WATCHTOWER_LEGS_4864 = 4864; public static final int WATCHTOWER_MIDDLE = 4865; public static final int GNOME_GLIDER_4866 = 4866; public static final int GNOME_GLIDER_4867 = 4867; public static final int TELEPORTATION_DEVICE = 4868; public static final int TELEPORTATION_DEVICE_4869 = 4869; public static final int TELEPORTATION_DEVICE_4870 = 4870; public static final int REINITIALISATION_PANEL = 4871; public static final int EXIT_SIGN = 4872; public static final int LEVER_4873 = 4873; public static final int CRAFTING_STALL = 4874; public static final int FOOD_STALL = 4875; public static final int GENERAL_STALL = 4876; public static final int MAGIC_STALL = 4877; public static final int SCIMITAR_STALL = 4878; public static final int TRAPDOOR_4879 = 4879; public static final int TRAPDOOR_4880 = 4880; public static final int CLIMBING_ROPE_4881 = 4881; public static final int SLIGHT_INDENTATIONS = 4882; public static final int A_ROCK = 4883; public static final int PLANK_4884 = 4884; public static final int STALAGMITES_4885 = 4885; public static final int FLOOR_SPIKES_4886 = 4886; public static final int A_ROCK_4887 = 4887; public static final int TRAPDOOR_4888 = 4888; public static final int CLIMBING_ROPE_4889 = 4889; public static final int SARADOMIN_STANDARD = 4900; public static final int ZAMORAK_STANDARD = 4901; public static final int SARADOMIN_STANDARD_4902 = 4902; public static final int ZAMORAK_STANDARD_4903 = 4903; public static final int CATAPULT_4904 = 4904; public static final int CATAPULT_4905 = 4905; public static final int BARREL_4910 = 4910; public static final int LADDER_4911 = 4911; public static final int LADDER_4912 = 4912; public static final int CART_TUNNEL = 4913; public static final int CART_TUNNEL_4914 = 4914; public static final int CART_TUNNEL_4915 = 4915; public static final int MINE_CART_4918 = 4918; public static final int STAIRS_4919 = 4919; public static final int CART_TUNNEL_4920 = 4920; public static final int CART_TUNNEL_4921 = 4921; public static final int CART_TUNNEL_4922 = 4922; public static final int STAIRS_4923 = 4923; public static final int WATER_VALVE = 4924; public static final int CRYSTAL_OUTCROP = 4926; public static final int CRYSTAL_OUTCROP_4927 = 4927; public static final int CRYSTAL_OUTCROP_4928 = 4928; public static final int DARK_TUNNEL = 4929; public static final int MINE_CART_4930 = 4930; public static final int GLOWING_FUNGUS_4932 = 4932; public static final int GLOWING_FUNGUS_4933 = 4933; public static final int CEILING_SUPPORT = 4935; public static final int WALL_SUPPORT = 4936; public static final int LIFT = 4937; public static final int LIFT_4938 = 4938; public static final int LIFT_4940 = 4940; public static final int LIFT_4942 = 4942; public static final int CRATE_4944 = 4944; public static final int MINE_CART_4945 = 4945; public static final int POINTS_SETTINGS = 4949; public static final int LEVER_4950 = 4950; public static final int LEVER_4951 = 4951; public static final int LEVER_4952 = 4952; public static final int LEVER_4953 = 4953; public static final int LEVER_4954 = 4954; public static final int LEVER_4955 = 4955; public static final int LEVER_4956 = 4956; public static final int LEVER_4957 = 4957; public static final int LEVER_4958 = 4958; public static final int LEVER_4959 = 4959; public static final int LEVER_4960 = 4960; public static final int LEVER_4961 = 4961; public static final int DOOR_4962 = 4962; public static final int LARGE_DOOR_4963 = 4963; public static final int LARGE_DOOR_4964 = 4964; public static final int LADDER_4965 = 4965; public static final int LADDER_4966 = 4966; public static final int LADDER_4967 = 4967; public static final int LADDER_4968 = 4968; public static final int LADDER_4969 = 4969; public static final int LADDER_4970 = 4970; public static final int STAIRS_4971 = 4971; public static final int STAIRS_4972 = 4972; public static final int STAIRS_4973 = 4973; public static final int MINE_CART_4974 = 4974; public static final int CRATE_4975 = 4975; public static final int HULL = 4976; public static final int GANGPLANK_4977 = 4977; public static final int GANGPLANK_4978 = 4978; public static final int HERBS_4979 = 4979; public static final int HERBS_4980 = 4980; public static final int HERBS_4981 = 4981; public static final int HERBS_4982 = 4982; public static final int CORPSE_4983 = 4983; public static final int CORPSE_4984 = 4984; public static final int WOODEN_BOARDS = 5001; public static final int ROPE_BRIDGE = 5002; public static final int TROPICAL_TREE_5005 = 5005; public static final int RARE_FLOWERS = 5006; public static final int CAVE_ENTRANCE_5007 = 5007; public static final int TUNNEL_5008 = 5008; public static final int TUNNEL_5009 = 5009; public static final int TUNNEL_5010 = 5010; public static final int TUNNEL_5011 = 5011; public static final int TUNNEL_5012 = 5012; public static final int TUNNEL_5013 = 5013; public static final int TUNNEL_5014 = 5014; public static final int SLOPE = 5015; public static final int SLOPE_5016 = 5016; public static final int CREVASSE = 5025; public static final int ICE_COVERED_BOULDER = 5037; public static final int ICE_COVERED_BOULDER_5038 = 5038; public static final int ICE_COVERED_BOULDER_5039 = 5039; public static final int ICE_GATE = 5043; public static final int ICE_GATE_5044 = 5044; public static final int TREE_5045 = 5045; public static final int CAVE_ENTRANCE_5046 = 5046; public static final int STALAGMITES_5047 = 5047; public static final int STALACTITE = 5048; public static final int STALAGMITE_5049 = 5049; public static final int STALAGMITE_5050 = 5050; public static final int SWAMP_BOATY = 5051; public static final int WALL_5052 = 5052; public static final int WALL_5053 = 5053; public static final int LADDER_5054 = 5054; public static final int TRAPDOOR_5055 = 5055; public static final int WOODEN_DOORS_5056 = 5056; public static final int WOODEN_DOORS_5057 = 5057; public static final int WOODEN_DOORS_5058 = 5058; public static final int WOODEN_DOORS_5059 = 5059; public static final int WOODEN_DOORS_5060 = 5060; public static final int WOODEN_DOORS_5061 = 5061; public static final int WOODEN_DOORS_5062 = 5062; public static final int WOODEN_DOORS_5063 = 5063; public static final int PILLAR_5072 = 5072; public static final int PAINTING_5083 = 5083; public static final int PAINTING_5084 = 5084; public static final int PAINTING_5085 = 5085; public static final int PAINTING_5086 = 5086; public static final int COMBAT_SCROLL = 5094; public static final int SMOKING_VENT = 5096; public static final int SMOKING_VENT_5097 = 5097; public static final int CHIMNEY_5098 = 5098; public static final int SHIELD = 5103; public static final int CRATE_5106 = 5106; public static final int CRATE_5107 = 5107; public static final int CLOSED_CHEST_5108 = 5108; public static final int OPEN_CHEST_5109 = 5109; public static final int CRATE_5110 = 5110; public static final int BOXES_5111 = 5111; public static final int BARREL_5112 = 5112; public static final int CRATE_5113 = 5113; public static final int BARREL_5114 = 5114; public static final int STATUE_5116 = 5116; public static final int STATUE_5117 = 5117; public static final int YEW_TREE_5121 = 5121; public static final int BARREL_5122 = 5122; public static final int BARREL_5123 = 5123; public static final int FOUNTAIN_5125 = 5125; public static final int MAPLE_TREE_5126 = 5126; public static final int MAGIC_TREE_5127 = 5127; public static final int FERN_5128 = 5128; public static final int BUSH_5129 = 5129; public static final int TALL_PLANT = 5130; public static final int SHORT_PLANT = 5131; public static final int LARGELEAF_PLANT = 5132; public static final int HUGE_PLANT = 5133; public static final int PLANT_5134 = 5134; public static final int SMALL_FERN_5135 = 5135; public static final int FERN_5136 = 5136; public static final int DOCK_LEAF = 5137; public static final int THISTLE_5138 = 5138; public static final int REEDS = 5139; public static final int ROSEMARY = 5140; public static final int DAFFODILS = 5141; public static final int BLUEBELLS = 5142; public static final int ROSEMARY_5143 = 5143; public static final int DAFFODILS_5144 = 5144; public static final int BLUEBELLS_5145 = 5145; public static final int SUNFLOWER_5146 = 5146; public static final int MARIGOLDS = 5147; public static final int ROSES = 5148; public static final int SUNFLOWERS_5149 = 5149; public static final int MARIGOLDS_5150 = 5150; public static final int ROSES_5151 = 5151; public static final int BOUNDARY_STONES = 5152; public static final int WOODEN_FENCE = 5153; public static final int STONE_WALL = 5154; public static final int IRON_RAILINGS = 5155; public static final int CUPBOARD_5156 = 5156; public static final int OPEN_CUPBOARD_5157 = 5157; public static final int PILE_OF_CANES = 5158; public static final int BRIDGE_5159 = 5159; public static final int BRIDGE_5160 = 5160; public static final int CLOCK = 5161; public static final int CHEST_5162 = 5162; public static final int CHEST_5163 = 5163; public static final int SIGNPOST_5164 = 5164; public static final int FIREPLACE_5165 = 5165; public static final int BOOKCASE_5166 = 5166; public static final int MEMORIAL = 5167; public static final int GRAVE = 5168; public static final int GRAVE_5169 = 5169; public static final int ENTRANCE_5170 = 5170; public static final int DOOR_5172 = 5172; public static final int DOOR_5174 = 5174; public static final int LIGHTNING_CONDUCTOR = 5176; public static final int LIGHTNING_CONDUCTOR_5177 = 5177; public static final int FIREPLACE_SURROUND = 5178; public static final int FIREPLACE_SURROUND_5179 = 5179; public static final int DOOR_5183 = 5183; public static final int DOOR_5186 = 5186; public static final int DOOR_5187 = 5187; public static final int DOOR_5188 = 5188; public static final int PILE_OF_BRICKS_5202 = 5202; public static final int STAIRCASE_5206 = 5206; public static final int STAIRCASE_5207 = 5207; public static final int COLUMN = 5228; public static final int COLUMN_5229 = 5229; public static final int COLUMN_5230 = 5230; public static final int STALAGMITE_5231 = 5231; public static final int STALAGMITE_5232 = 5232; public static final int DOOR_5244 = 5244; public static final int DOOR_5245 = 5245; public static final int BED_5246 = 5246; public static final int CRYSTAL_GROWTH = 5248; public static final int FIRE_5249 = 5249; public static final int LADDER_5250 = 5250; public static final int LADDER_5251 = 5251; public static final int FIRE_REMAINS_5252 = 5252; public static final int NETTLES_5253 = 5253; public static final int NETTLES_5254 = 5254; public static final int NETTLES_5255 = 5255; public static final int NETTLES_5256 = 5256; public static final int NETTLES_5257 = 5257; public static final int NETTLES_5258 = 5258; public static final int TROPICAL_TREE_5259 = 5259; public static final int TROPICAL_TREE_5260 = 5260; public static final int TROPICAL_TREE_5261 = 5261; public static final int TROPICAL_TREE_5262 = 5262; public static final int TROPICAL_TREE_5263 = 5263; public static final int LEAVES_5267 = 5267; public static final int LEAVES_5268 = 5268; public static final int STAIRCASE_5269 = 5269; public static final int STAIRCASE_5270 = 5270; public static final int BOAT = 5306; public static final int BOXES_5330 = 5330; public static final int PLANT_5331 = 5331; public static final int PLANT_5332 = 5332; public static final int PLANT_5333 = 5333; public static final int PLANT_5334 = 5334; public static final int CHAIR_5345 = 5345; public static final int CHAIR_5346 = 5346; public static final int CHAIR_5347 = 5347; public static final int SMASHED_CHAIR_5348 = 5348; public static final int TABLE_5349 = 5349; public static final int BAR_PUMPS_5350 = 5350; public static final int BAR_5351 = 5351; public static final int CART_5352 = 5352; public static final int WHEELBARROW = 5353; public static final int TROUGH_5354 = 5354; public static final int CRATE_5355 = 5355; public static final int CRATES_5356 = 5356; public static final int CRATES_5357 = 5357; public static final int SKELETON = 5358; public static final int SKELETON_5359 = 5359; public static final int SKELETON_5360 = 5360; public static final int FIGUREHEAD_5397 = 5397; public static final int SHIPS_WHEEL_5403 = 5403; public static final int MAST = 5404; public static final int SHIPS_LADDER_5415 = 5415; public static final int SHIPS_LADDER_5416 = 5416; public static final int CAPTAINS_TABLE = 5429; public static final int MARKET_STALL_5430 = 5430; public static final int MARKET_STALL_5431 = 5431; public static final int BROKEN_DOOR_5439 = 5439; public static final int DOOR_5453 = 5453; public static final int DOOR_5454 = 5454; public static final int LADDER_5488 = 5488; public static final int JEWELLERY_STALL = 5489; public static final int TRAPDOOR_5490 = 5490; public static final int TRAPDOOR_5491 = 5491; public static final int LADDER_5493 = 5493; public static final int STANDING_TORCH_5494 = 5494; public static final int BED_5495 = 5495; public static final int BED_5497 = 5497; public static final int BED_5498 = 5498; public static final int FIRE_5499 = 5499; public static final int DOOR_5501 = 5501; public static final int LECTERN = 5508; public static final int ONION_5538 = 5538; public static final int BULLRUSHES_5539 = 5539; public static final int BULLRUSHES_5540 = 5540; public static final int BULLRUSHES_5541 = 5541; public static final int BULLRUSHES_5542 = 5542; public static final int HEATHER_5543 = 5543; public static final int HEATHER_5544 = 5544; public static final int HEATHER_5545 = 5545; public static final int HEATHER_5546 = 5546; public static final int HEATHER_5547 = 5547; public static final int HEATHER_5548 = 5548; public static final int HEATHER_5549 = 5549; public static final int DOCK_LEAF_PLANT = 5550; public static final int CAVE_5553 = 5553; public static final int SUIT_OF_ARMOUR_5554 = 5554; public static final int HANGING_TAPESTRY = 5555; public static final int HANGING_TAPESTRY_5556 = 5556; public static final int AGGIES_CAULDRON = 5558; public static final int CHARMS_5559 = 5559; public static final int MIRROR_5560 = 5560; public static final int BROOM_5561 = 5561; public static final int CLOTH_5562 = 5562; public static final int BED_5564 = 5564; public static final int BED_5565 = 5565; public static final int DRY_STONE_WALL = 5569; public static final int COOP = 5571; public static final int COOP_5572 = 5572; public static final int COOP_5573 = 5573; public static final int SACK = 5574; public static final int TROUGH_5575 = 5575; public static final int TROUGH_5576 = 5576; public static final int TROUGH_5577 = 5577; public static final int CART_5578 = 5578; public static final int CART_5579 = 5579; public static final int WHEELBARROW_5580 = 5580; public static final int LOGS = 5581; public static final int LOGS_5582 = 5582; public static final int WHEAT_5583 = 5583; public static final int WHEAT_5584 = 5584; public static final int WHEAT_5585 = 5585; public static final int WATER_WHEEL_5589 = 5589; public static final int WATER_WHEEL_5590 = 5590; public static final int WATER_WHEEL_5591 = 5591; public static final int WATER_WHEEL_5594 = 5594; public static final int TOY_STALL = 5595; public static final int MARKET_STALL_5596 = 5596; public static final int WEATHER_VANE_5597 = 5597; public static final int WATER_BARREL = 5598; public static final int WATER_BARREL_5599 = 5599; public static final int ROCK_5604 = 5604; public static final int ROCK_5605 = 5605; public static final int ROCK_5606 = 5606; public static final int SPIT_ROAST_5608 = 5608; public static final int COOKING_POTS = 5609; public static final int COOKING_POTS_5610 = 5610; public static final int RATHOLE = 5613; public static final int CHAIR_5614 = 5614; public static final int BENCH_5615 = 5615; public static final int SIGNPOST_5616 = 5616; public static final int DRAWERS_5618 = 5618; public static final int DRAWERS_5619 = 5619; public static final int BIG_VASE = 5621; public static final int WARDROBE_5622 = 5622; public static final int WARDROBE_5623 = 5623; public static final int WARDROBE_5624 = 5624; public static final int NEDS_TABLE = 5625; public static final int STANDARD_5627 = 5627; public static final int STANDARD_5628 = 5628; public static final int STANDARD_5629 = 5629; public static final int PICKET_FENCE = 5631; public static final int GARDEN_FENCE = 5632; public static final int LARGE_DOOR_5667 = 5667; public static final int CHURCH_PEW = 5788; public static final int STATUE_5789 = 5789; public static final int STATUE_5790 = 5790; public static final int STATUE_5791 = 5791; public static final int FLOUR_BIN_5792 = 5792; public static final int CRACK = 5793; public static final int CRACK_5794 = 5794; public static final int CRACK_5795 = 5795; public static final int CRACK_5796 = 5796; public static final int CRACK_5797 = 5797; public static final int CRACK_5798 = 5798; public static final int TRAPDOOR_5799 = 5799; public static final int TRAPDOOR_5800 = 5800; public static final int TRAPDOOR_5801 = 5801; public static final int TRAPDOOR_5802 = 5802; public static final int TRAPDOOR_5803 = 5803; public static final int TRAPDOOR_5804 = 5804; public static final int TRAPDOOR_5805 = 5805; public static final int TRAPDOOR_5806 = 5806; public static final int SCULPTURE = 5808; public static final int WEATHERVANE = 5809; public static final int SEERS_WEATHERVANE = 5810; public static final int LADDER_5813 = 5813; public static final int GNOME_LANDING_LIGHT = 5815; public static final int FLASHING_LANDING_LIGHT = 5816; public static final int FLASHING_LANDING_LIGHT_5817 = 5817; public static final int FLASHING_LANDING_LIGHT_5818 = 5818; public static final int FLASHING_LANDING_LIGHT_5819 = 5819; public static final int GNOME_GLIDER_5825 = 5825; public static final int SWORDSHOP_SIGN = 5826; public static final int ANTIQUES_SHOP_STALL = 5831; public static final int BOULDER_5842 = 5842; public static final int BOULDER_5843 = 5843; public static final int ROCK_5844 = 5844; public static final int ROCK_5845 = 5845; public static final int ROPE_5846 = 5846; public static final int ROCKSLIDE_5847 = 5847; public static final int TALL_TREE = 5848; public static final int CLUMP_OF_ROCKS = 5849; public static final int FLAT_STONE = 5850; public static final int FLAT_STONE_5851 = 5851; public static final int FLAT_STONE_5852 = 5852; public static final int FLAT_STONE_5853 = 5853; public static final int FLAT_STONE_5854 = 5854; public static final int SHINING_POOL = 5855; public static final int THORNY_BUSHES = 5856; public static final int CAVE_ENTRANCE_5857 = 5857; public static final int CAVE_EXIT_5858 = 5858; public static final int CAVE_EXIT_5859 = 5859; public static final int STANDING_SPEARS = 5860; public static final int BURIAL_MOUND = 5862; public static final int BURIAL_CAIRN = 5863; public static final int WOODEN_TABLE_5878 = 5878; public static final int TABLE_5879 = 5879; public static final int STOOL_5880 = 5880; public static final int STANDING_TORCH_5881 = 5881; public static final int MUD_5883 = 5883; public static final int SWAMP_5884 = 5884; public static final int ROOTS_5885 = 5885; public static final int ROOTS_5886 = 5886; public static final int TENT_DOOR_5887 = 5887; public static final int TENT_DOOR_5888 = 5888; public static final int TENT_DOOR_5889 = 5889; public static final int TENT_DOOR_5890 = 5890; public static final int TENT_DOOR_5891 = 5891; public static final int TENT_DOOR_5893 = 5893; public static final int ANCIENT_ROCK = 5895; public static final int ANCIENT_ROCK_5896 = 5896; public static final int SHINING_POOL_5897 = 5897; public static final int DEAD_TREE_5902 = 5902; public static final int DEAD_TREE_5903 = 5903; public static final int DEAD_TREE_5904 = 5904; public static final int TREE_STUMP_5905 = 5905; public static final int MARBLE_WALL = 5907; public static final int LAMP_OIL_STILL = 5909; public static final int LAMP_OIL_STILL_5910 = 5910; public static final int GAS_HOLE = 5917; public static final int GAS_HOLE_5918 = 5918; public static final int CLIMBING_ROPE_5946 = 5946; public static final int DARK_HOLE = 5947; public static final int STEPPING_STONE_5948 = 5948; public static final int STEPPING_STONE_5949 = 5949; public static final int LEVER_5959 = 5959; public static final int LEVER_5960 = 5960; public static final int CANNONBALL = 5964; public static final int GOLD_CANNONBALL = 5965; public static final int PASSAGE_5966 = 5966; public static final int CANNONBALLS_5967 = 5967; public static final int CANNONBALLS_5968 = 5968; public static final int CANNONBALLS_5969 = 5969; public static final int CANNONBALLS_5970 = 5970; public static final int CANNONBALLS_5971 = 5971; public static final int CANNONBALLS_5972 = 5972; public static final int CAVE_ENTRANCE_5973 = 5973; public static final int DWARF_MULTICANNON_5975 = 5975; public static final int DWARF_MULTICANNON_5976 = 5976; public static final int WALL_OF_FLAME_5977 = 5977; public static final int WALL_OF_FLAME_5978 = 5978; public static final int WALL_OF_FLAME_5979 = 5979; public static final int WALL_OF_FLAME_5980 = 5980; public static final int FIRE_5981 = 5981; public static final int ROCK_5985 = 5985; public static final int SMALL_ROCK = 5986; public static final int ROCK_5987 = 5987; public static final int MINERAL_VEIN = 5989; public static final int MINERAL_VEIN_5990 = 5990; public static final int MINERAL_VEIN_5991 = 5991; public static final int ENTRANCE_5998 = 5998; public static final int BLUE_FIRE = 6009; public static final int BOILER = 6032; public static final int BOILER_6033 = 6033; public static final int SHIPS_LADDER_6036 = 6036; public static final int SHIPS_LADDER_6037 = 6037; public static final int SHIPS_WHEEL_6038 = 6038; public static final int BOILER_6043 = 6043; public static final int BOILER_6044 = 6044; public static final int MINE_CART_6045 = 6045; public static final int HAT_STAND_6064 = 6064; public static final int CLOTHES_6065 = 6065; public static final int WEAPON_RACK = 6066; public static final int WEAPON_RACK_6067 = 6067; public static final int WEAPON_RACK_6068 = 6068; public static final int WEAPON_RACK_6069 = 6069; public static final int CABINET_6070 = 6070; public static final int CABINET_6071 = 6071; public static final int CABINET_6072 = 6072; public static final int CABINET_6073 = 6073; public static final int CABINET_6074 = 6074; public static final int TABLE_6075 = 6075; public static final int DESK_6076 = 6076; public static final int DESK_6077 = 6077; public static final int DESK_6078 = 6078; public static final int DESK_6079 = 6079; public static final int SPINNING_MACHINE = 6080; public static final int BANK_TABLE_6081 = 6081; public static final int BANK_TABLE_6082 = 6082; public static final int CLOSED_BANK_BOOTH = 6083; public static final int BANK_BOOTH = 6084; public static final int STAIRS_6085 = 6085; public static final int STAIRS_6086 = 6086; public static final int STAIRS_6087 = 6087; public static final int STAIRS_6088 = 6088; public static final int STAIRS_6089 = 6089; public static final int STAIRS_6090 = 6090; public static final int BOOKCASE_6091 = 6091; public static final int BOOKCASE_6092 = 6092; public static final int FIREPLACE_6093 = 6093; public static final int FIREPLACE_6094 = 6094; public static final int FIREPLACE_6095 = 6095; public static final int FIREPLACE_6096 = 6096; public static final int WELL_6097 = 6097; public static final int DOOR_6100 = 6100; public static final int DOOR_6101 = 6101; public static final int DOOR_6102 = 6102; public static final int DOOR_6103 = 6103; public static final int DOOR_6104 = 6104; public static final int DOOR_6105 = 6105; public static final int DOOR_6106 = 6106; public static final int DOOR_6107 = 6107; public static final int DOOR_6108 = 6108; public static final int DOOR_6109 = 6109; public static final int DOOR_6110 = 6110; public static final int DOOR_6111 = 6111; public static final int DOOR_6112 = 6112; public static final int DOOR_6113 = 6113; public static final int DOOR_6114 = 6114; public static final int DOOR_6115 = 6115; public static final int BIRD_CAGE_STAND = 6146; public static final int COLUMN_6147 = 6147; public static final int COLUMN_6148 = 6148; public static final int COLUMN_6149 = 6149; public static final int ANVIL_6150 = 6150; public static final int SINK_6151 = 6151; public static final int BAR_6152 = 6152; public static final int BAR_6153 = 6153; public static final int SHELVES_6154 = 6154; public static final int SHELVES_6155 = 6155; public static final int SHELVES_6156 = 6156; public static final int SHELVES_6157 = 6157; public static final int RED_FUNGI = 6158; public static final int RED_FUNGI_6159 = 6159; public static final int RED_FUNGI_6160 = 6160; public static final int RED_FUNGI_6161 = 6161; public static final int GEM_STALL_6162 = 6162; public static final int BAKERY_STALL_6163 = 6163; public static final int SILVER_STALL_6164 = 6164; public static final int CLOTHES_STALL = 6165; public static final int CRAFTING_STALL_6166 = 6166; public static final int GIANT_DWARF = 6173; public static final int GIANT_DWARF_6174 = 6174; public static final int GIANT_DWARF_6175 = 6175; public static final int BOXES_6176 = 6176; public static final int CRATES_6178 = 6178; public static final int COOKING_POTS_6179 = 6179; public static final int COOKING_POTS_6180 = 6180; public static final int HANGING_MEAT_6181 = 6181; public static final int HANGING_MEAT_6182 = 6182; public static final int BED_6183 = 6183; public static final int BED_6184 = 6184; public static final int ARMOUR = 6185; public static final int ARMOUR_6186 = 6186; public static final int ARMOUR_6187 = 6187; public static final int BLACKSMITHS_TOOLS_6188 = 6188; public static final int FURNACE_6189 = 6189; public static final int FURNACE_6190 = 6190; public static final int WARHAMMER = 6191; public static final int PICKAXE = 6192; public static final int DWARF_MIRROR = 6193; public static final int CHAIR_6194 = 6194; public static final int CHAIR_6195 = 6195; public static final int TABLE_6196 = 6196; public static final int TABLE_6197 = 6197; public static final int TABLE_6198 = 6198; public static final int TABLE_6199 = 6199; public static final int TABLE_6200 = 6200; public static final int TABLE_6201 = 6201; public static final int LAMP_6202 = 6202; public static final int LAMP_6203 = 6203; public static final int POOR_BED = 6204; public static final int BED_6205 = 6205; public static final int DWARVEN_CONSORTIUM_TABLE = 6206; public static final int THRONE_6207 = 6207; public static final int THRONE_6208 = 6208; public static final int TABLE_6211 = 6211; public static final int TREE_STUMP_6212 = 6212; public static final int BARREL_6213 = 6213; public static final int MONEY_POT = 6230; public static final int TABLE_6231 = 6231; public static final int FOUNTAIN_6232 = 6232; public static final int STOP = 6236; public static final int PLANT_6237 = 6237; public static final int DOOR_6238 = 6238; public static final int DOOR_6239 = 6239; public static final int DOOR_6240 = 6240; public static final int DOOR_6241 = 6241; public static final int STAIRCASE_6242 = 6242; public static final int STAIRCASE_6243 = 6243; public static final int STAIRCASE_6244 = 6244; public static final int STAIRCASE_6245 = 6245; public static final int TABLE_6246 = 6246; public static final int WELL_6249 = 6249; public static final int BED_6250 = 6250; public static final int TROUGH_6255 = 6255; public static final int TROUGH_6256 = 6256; public static final int DUNG = 6257; public static final int DUNG_6258 = 6258; public static final int DUNG_6259 = 6259; public static final int LADDER_6260 = 6260; public static final int LADDER_6261 = 6261; public static final int LADDER_6262 = 6262; public static final int HUTCH = 6263; public static final int BIRD_CAGE_STAND_6264 = 6264; public static final int CAGE_6265 = 6265; public static final int CAGE_6266 = 6266; public static final int GOLDEN_CAGE = 6267; public static final int HUTCH_6268 = 6268; public static final int CAGES = 6269; public static final int BED_6274 = 6274; public static final int STUDY_DESK_6275 = 6275; public static final int LANDSCAPE_6276 = 6276; public static final int CACTUS_6277 = 6277; public static final int TRAPDOOR_6278 = 6278; public static final int SMOKEY_WELL = 6279; public static final int LADDER_6280 = 6280; public static final int LADDER_6281 = 6281; public static final int PORTAL_6282 = 6282; public static final int PILLAR_6283 = 6283; public static final int PILLAR_6284 = 6284; public static final int PILLAR_6285 = 6285; public static final int PILLAR_6286 = 6286; public static final int BOOKCASE_6292 = 6292; public static final int DISPLAY_CASE = 6294; public static final int DISPLAY_CASE_6295 = 6295; public static final int SKELETON_6296 = 6296; public static final int SKELETON_6297 = 6297; public static final int SKELETON_6298 = 6298; public static final int SKELETON_6299 = 6299; public static final int THRONE_6301 = 6301; public static final int THRONE_6302 = 6302; public static final int STATUETTE_IN_ALCOVE = 6307; public static final int STATUETTE_IN_ALCOVE_6308 = 6308; public static final int ALCOVE = 6309; public static final int BLACK_MUSHROOMS = 6311; public static final int STAIRCASE_6312 = 6312; public static final int STAIRCASE_6313 = 6313; public static final int GOLEM_ARM = 6323; public static final int GOLEM_FOOT = 6324; public static final int GOLEM_BODY = 6325; public static final int GOLEM_HEAD = 6326; public static final int BROKEN_KILN = 6327; public static final int BROKEN_KILN_6328 = 6328; public static final int BROKEN_KILN_6329 = 6329; public static final int BROKEN_KILN_6330 = 6330; public static final int STATUE_6331 = 6331; public static final int STATUE_6332 = 6332; public static final int STATUE_6333 = 6333; public static final int STATUE_6334 = 6334; public static final int PLINTH = 6335; public static final int PLINTH_6336 = 6336; public static final int PLINTH_6337 = 6337; public static final int PLINTH_6338 = 6338; public static final int DOOR_6363 = 6363; public static final int DOOR_6364 = 6364; public static final int STAIRCASE_6372 = 6372; public static final int STAIRCASE_6373 = 6373; public static final int CAVE_6381 = 6381; public static final int ROOT_6382 = 6382; public static final int STALAGMITES_6402 = 6402; public static final int STALAGMITE_6403 = 6403; public static final int STANDING_TORCH_6404 = 6404; public static final int STANDING_TORCH_6406 = 6406; public static final int STANDING_TORCH_6408 = 6408; public static final int STANDING_TORCH_6410 = 6410; public static final int STANDING_TORCH_6412 = 6412; public static final int STANDING_TORCH_6413 = 6413; public static final int STANDING_TORCH_6414 = 6414; public static final int STANDING_TORCH_6415 = 6415; public static final int STANDING_TORCH_6416 = 6416; public static final int LADDER_6418 = 6418; public static final int LADDER_6419 = 6419; public static final int BURNT_CHEST = 6420; public static final int MYSTICAL_MIRROR = 6423; public static final int MYSTICAL_MIRROR_6425 = 6425; public static final int MYSTICAL_MIRROR_6427 = 6427; public static final int MYSTICAL_MIRROR_6429 = 6429; public static final int MYSTICAL_MIRROR_6431 = 6431; public static final int MYSTICAL_MIRROR_6433 = 6433; public static final int TRAPDOOR_6434 = 6434; public static final int TRAPDOOR_6435 = 6435; public static final int LADDER_6436 = 6436; public static final int VAMPYRE_TOMB = 6437; public static final int VAMPYRE_TOMB_6438 = 6438; public static final int ROPE_6439 = 6439; public static final int CAVE_ENTRANCE_6441 = 6441; public static final int CAVE_ENTRANCE_6442 = 6442; public static final int CAVE_ENTRANCE_6443 = 6443; public static final int CAVE_ENTRANCE_6444 = 6444; public static final int CAVE_ENTRANCE_6445 = 6445; public static final int CAVE_ENTRANCE_6446 = 6446; public static final int CAVE_EXIT_6447 = 6447; public static final int SECURE_CHEST = 6448; public static final int LADDER_6450 = 6450; public static final int GATE_6451 = 6451; public static final int GATE_6452 = 6452; public static final int ICY_ROCK = 6454; public static final int ICE_LEDGE = 6455; public static final int ICE_LEDGE_6456 = 6456; public static final int ICE_GATE_6461 = 6461; public static final int ICE_GATE_6462 = 6462; public static final int ICE_CHUNKS = 6472; public static final int ICE_CHUNKS_6473 = 6473; public static final int ICE_CHUNKS_6474 = 6474; public static final int ICE_CHUNKS_6475 = 6475; public static final int ICE_CHUNKS_6476 = 6476; public static final int ICE_CHUNKS_6477 = 6477; public static final int TUNNEL_6481 = 6481; public static final int OBELISK_6483 = 6483; public static final int OBELISK_6484 = 6484; public static final int OBELISK_6486 = 6486; public static final int OBELISK_6487 = 6487; public static final int OBELISK_6489 = 6489; public static final int OBELISK_6490 = 6490; public static final int OBELISK_6492 = 6492; public static final int OBELISK_6493 = 6493; public static final int MYSTICAL_DOOR = 6494; public static final int LADDER_6497 = 6497; public static final int LADDER_6498 = 6498; public static final int LADDER_6499 = 6499; public static final int LADDER_6500 = 6500; public static final int LADDER_6501 = 6501; public static final int LADDER_6502 = 6502; public static final int LADDER_6503 = 6503; public static final int LADDER_6504 = 6504; public static final int SARCOPHAGUS = 6512; public static final int SARCOPHAGUS_6513 = 6513; public static final int SARCOPHAGUS_6514 = 6514; public static final int SARCOPHAGUS_6515 = 6515; public static final int SARCOPHAGUS_6516 = 6516; public static final int SARCOPHAGUS_6517 = 6517; public static final int PITFALL = 6521; public static final int LADDER_6523 = 6523; public static final int CRACK_6524 = 6524; public static final int SPHINX = 6538; public static final int PYRAMID_ENTRANCE = 6545; public static final int PYRAMID_ENTRANCE_6547 = 6547; public static final int WELL_6549 = 6549; public static final int PORTAL_6551 = 6551; public static final int ALTAR_6552 = 6552; public static final int DOORWAY_6553 = 6553; public static final int DOORWAY_6555 = 6555; public static final int LADDER_6561 = 6561; public static final int TREASURE_TRAIL_STATISTICS = 6567; public static final int SILK_STALL_6568 = 6568; public static final int BAKERY_STALL_6569 = 6569; public static final int GEM_STALL_6570 = 6570; public static final int FUR_STALL_6571 = 6571; public static final int SPICE_STALL_6572 = 6572; public static final int MARKET_STALL_6573 = 6573; public static final int TEA_STALL_6574 = 6574; public static final int CART_6575 = 6575; public static final int BANANA_TREE_6578 = 6578; public static final int BANANA_TREE_6579 = 6579; public static final int TENT_FLAP_6581 = 6581; public static final int WATER_6605 = 6605; public static final int CENTRE_PIECE = 6606; public static final int MIRROR_6607 = 6607; public static final int MIRROR_6608 = 6608; public static final int MIRROR_6609 = 6609; public static final int MIRROR_6610 = 6610; public static final int MIRROR_6611 = 6611; public static final int MIRROR_6612 = 6612; public static final int MIRROR_6613 = 6613; public static final int DOOR_6614 = 6614; public static final int PINBOARD = 6615; public static final int CRATE_6616 = 6616; public static final int HOLE_6620 = 6620; public static final int ROCK_6622 = 6622; public static final int ROCK_6623 = 6623; public static final int DOOR_6624 = 6624; public static final int DOOR_6625 = 6625; public static final int DOOR_6626 = 6626; public static final int DOOR_6627 = 6627; public static final int WALL_CRUSHER = 6629; public static final int SARCOPHAGUS_6630 = 6630; public static final int PIT = 6632; public static final int PIT_6633 = 6633; public static final int CANOPIC_JAR = 6635; public static final int CANOPIC_JAR_6637 = 6637; public static final int CANOPIC_JAR_6639 = 6639; public static final int CANOPIC_JAR_6641 = 6641; public static final int DOORWAY_6643 = 6643; public static final int CEREMONIAL_TABLE = 6644; public static final int LADDER_6645 = 6645; public static final int CLOSED_CHEST_6646 = 6646; public static final int OPEN_CHEST_6647 = 6647; public static final int STAIRCASE_6648 = 6648; public static final int STAIRCASE_6649 = 6649; public static final int BRIDGE_6650 = 6650; public static final int BRIDGE_6651 = 6651; public static final int BRIDGE_6652 = 6652; public static final int BRIDGE_6653 = 6653; public static final int BROKEN_LOGS = 6655; public static final int CLOTH_6656 = 6656; public static final int INCONSPICUOUS_BUSH_EASY = 6657; public static final int TUNNEL_6658 = 6658; public static final int TUNNEL_6659 = 6659; public static final int WEEPING_WALL = 6660; public static final int BLUE_TEARS = 6661; public static final int GREEN_TEARS = 6662; public static final int ABSENCE_OF_TEARS = 6663; public static final int BLUE_TEARS_6665 = 6665; public static final int GREEN_TEARS_6666 = 6666; public static final int ABSENCE_OF_TEARS_6667 = 6667; public static final int ROCKS_6669 = 6669; public static final int ROCKS_6670 = 6670; public static final int ROCKS_6671 = 6671; public static final int ROCKS_6672 = 6672; public static final int ROCKS_6673 = 6673; public static final int CAVE_6702 = 6702; public static final int BOULDERS_6703 = 6703; public static final int BOULDERS_6704 = 6704; public static final int MUSHROOMS_6705 = 6705; public static final int MUSHROOMS_6706 = 6706; public static final int ROCK_6707 = 6707; public static final int SMALL_ROCK_6708 = 6708; public static final int ROCK_6709 = 6709; public static final int HEDGE_6727 = 6727; public static final int HEDGE_6728 = 6728; public static final int HEDGE_6729 = 6729; public static final int HEDGE_6730 = 6730; public static final int HEDGE_6731 = 6731; public static final int HEDGE_6732 = 6732; public static final int HEDGE_6733 = 6733; public static final int HEDGE_6734 = 6734; public static final int HEDGE_6735 = 6735; public static final int HEDGE_6736 = 6736; public static final int HEDGE_6737 = 6737; public static final int HEDGE_6738 = 6738; public static final int HEDGE_6739 = 6739; public static final int HEDGE_6740 = 6740; public static final int HEDGE_6741 = 6741; public static final int HEDGE_6742 = 6742; public static final int HEDGE_6743 = 6743; public static final int HEDGE_6744 = 6744; public static final int HEDGE_6745 = 6745; public static final int HEDGE_6746 = 6746; public static final int HEDGE_6747 = 6747; public static final int GAZEBO = 6748; public static final int SMALL_FOUNTAIN = 6749; public static final int LARGE_FOUNTAIN = 6750; public static final int ORNAMENTAL_FOUNTAIN = 6751; public static final int CHAIR_6752 = 6752; public static final int CHAIR_6753 = 6753; public static final int CHAIR_6754 = 6754; public static final int CHAIR_6755 = 6755; public static final int CHAIR_6756 = 6756; public static final int CHAIR_6757 = 6757; public static final int CHAIR_6758 = 6758; public static final int RUG = 6759; public static final int RUG_6760 = 6760; public static final int RUG_6761 = 6761; public static final int RUG_6762 = 6762; public static final int RUG_6763 = 6763; public static final int RUG_6764 = 6764; public static final int RUG_6765 = 6765; public static final int RUG_6766 = 6766; public static final int RUG_6767 = 6767; public static final int BOOKCASE_6768 = 6768; public static final int BOOKCASE_6769 = 6769; public static final int BOOKCASE_6770 = 6770; public static final int SCROLL_RACK = 6771; public static final int SCROLL_RACK_6772 = 6772; public static final int SCROLL_RACK_6773 = 6773; public static final int CURTAINS = 6774; public static final int CURTAINS_6775 = 6775; public static final int CURTAINS_6776 = 6776; public static final int WALL_DECORATION = 6777; public static final int WALL_DECORATION_6778 = 6778; public static final int WALL_DECORATION_6779 = 6779; public static final int CLAY_FIREPLACE = 6780; public static final int CLAY_FIREPLACE_6781 = 6781; public static final int LIMESTONE_FIREPLACE = 6782; public static final int LIMESTONE_FIREPLACE_6783 = 6783; public static final int MARBLE_FIREPLACE = 6784; public static final int MARBLE_FIREPLACE_6785 = 6785; public static final int TOOLS = 6786; public static final int TOOLS_6787 = 6787; public static final int TOOLS_6788 = 6788; public static final int TOOLS_6789 = 6789; public static final int TOOLS_6790 = 6790; public static final int WORKBENCH_6791 = 6791; public static final int WORKBENCH_6792 = 6792; public static final int WORKBENCH_6793 = 6793; public static final int WORKBENCH_6794 = 6794; public static final int WORKBENCH_6795 = 6795; public static final int CLOCKMAKERS_BENCH = 6796; public static final int CLOCKMAKERS_BENCH_6797 = 6797; public static final int CLOCKMAKERS_BENCH_6798 = 6798; public static final int CLOCKMAKERS_BENCH_6799 = 6799; public static final int REPAIR_BENCH = 6800; public static final int WHETSTONE = 6801; public static final int ARMOUR_REPAIR_STAND = 6802; public static final int HELMET_PLUMING_STAND = 6803; public static final int PAINTING_STAND = 6804; public static final int BANNER_MAKING_STAND = 6805; public static final int STOOL_6806 = 6806; public static final int STOOL_6807 = 6807; public static final int STANDARD_6808 = 6808; public static final int STATUE_6830 = 6830; public static final int FUNGUS_PATTERN = 6840; public static final int STAIRS_6841 = 6841; public static final int STAIRS_6842 = 6842; public static final int OGRE_COFFIN = 6844; public static final int OGRE_COFFIN_6845 = 6845; public static final int BROKEN_LECTURN = 6846; public static final int BELL_6847 = 6847; public static final int OGRE_COFFIN_6848 = 6848; public static final int SIGNPOST_6849 = 6849; public static final int OGRE_COFFIN_6850 = 6850; public static final int OGRE_COFFIN_6851 = 6851; public static final int OGRE_COFFIN_6852 = 6852; public static final int OGRE_COFFIN_6853 = 6853; public static final int OGRE_COFFIN_6854 = 6854; public static final int OGRE_COFFIN_6855 = 6855; public static final int BARRICADE_6856 = 6856; public static final int BARRICADE_6857 = 6857; public static final int BARRICADE_6858 = 6858; public static final int AN_OGRE_STANDARD = 6865; public static final int OGRE_FIRE = 6866; public static final int OGRE_DRUMS = 6867; public static final int OGRE_DRUMS_6868 = 6868; public static final int OGRE_STONE_DOOR = 6871; public static final int OGRE_STONE_DOOR_6872 = 6872; public static final int DRAWERS_6875 = 6875; public static final int CUPBOARD_6876 = 6876; public static final int WARDROBE_6877 = 6877; public static final int OGRE_BARRICADE = 6880; public static final int CRUSHED_BARRICADE = 6881; public static final int CRUSHED_BARRICADE_6882 = 6882; public static final int OGRE_COFFIN_6883 = 6883; public static final int SITHIK_INTS = 6888; public static final int SITHIK_INTS_6889 = 6889; public static final int OGRE_COFFIN_6890 = 6890; public static final int OGRE_COFFIN_6891 = 6891; public static final int OGRE_COFFIN_6892 = 6892; public static final int SKELETON_6893 = 6893; public static final int BOOKCASE_6894 = 6894; public static final int STANDING_TORCH_6896 = 6896; public static final int STAND = 6897; public static final int RUBBLE = 6903; public static final int SHELVES_6904 = 6904; public static final int HOLE_6905 = 6905; public static final int WALL_6909 = 6909; public static final int CHEST_6910 = 6910; public static final int CRATE_6911 = 6911; public static final int HOLE_6912 = 6912; public static final int HOLE_6914 = 6914; public static final int RUBBLE_6915 = 6915; public static final int BOOKCASE_6916 = 6916; public static final int DOOR_6919 = 6919; public static final int DOOR_6920 = 6920; public static final int SYMBOL = 6921; public static final int SYMBOL_6922 = 6922; public static final int SYMBOL_6923 = 6923; public static final int SYMBOL_6924 = 6924; public static final int BIG_BIG_BOULDER = 6927; public static final int BONE_CRANE = 6928; public static final int BONE_SUPPORT = 6929; public static final int BONE_SUPPORT_6930 = 6930; public static final int BONE_ARCH = 6931; public static final int BONE_ARCH_6932 = 6932; public static final int BONE_ARCH_6933 = 6933; public static final int BONE_ARCH_6934 = 6934; public static final int BONE_ARCH_6935 = 6935; public static final int BONE_ARCH_6936 = 6936; public static final int BONE_ARCH_6937 = 6937; public static final int BONE_ARCH_6938 = 6938; public static final int BONE_ARCH_6939 = 6939; public static final int BONE_ARCH_6940 = 6940; public static final int GLASS_DOOR_6943 = 6943; public static final int EMPTY_STALL = 6944; public static final int BAKERS_STALL = 6945; public static final int UTENSIL_STALL = 6946; public static final int SEED_STALL = 6947; public static final int HERB_STALL = 6948; public static final int BOULDER_6950 = 6950; public static final int NOTHING = 6951; public static final int NOTHING_6952 = 6952; public static final int NOTHING_6953 = 6953; public static final int SWAMP_BOATY_6969 = 6969; public static final int SWAMP_BOATY_6970 = 6970; public static final int CART_TRACK = 6971; public static final int BOOKCASE_6972 = 6972; public static final int DOOR_6975 = 6975; public static final int DOOR_6976 = 6976; public static final int DOOR_6977 = 6977; public static final int DOOR_6978 = 6978; public static final int MARKET_STALL_6984 = 6984; public static final int CRUSHER = 6985; public static final int STATUE_7002 = 7002; public static final int STATUE_7003 = 7003; public static final int STATUE_7004 = 7004; public static final int STATUE_7005 = 7005; public static final int STATUE_7006 = 7006; public static final int STATUE_7007 = 7007; public static final int STATUE_7008 = 7008; public static final int STATUE_7009 = 7009; public static final int ALMOST_A_STATUE = 7010; public static final int PLANT_7011 = 7011; public static final int PLANT_7012 = 7012; public static final int PLANT_7013 = 7013; public static final int PLANT_7014 = 7014; public static final int PLANT_7015 = 7015; public static final int PILLAR_7016 = 7016; public static final int PILLAR_7017 = 7017; public static final int CUPBOARD_7018 = 7018; public static final int CABINET_7019 = 7019; public static final int CABINET_7020 = 7020; public static final int CABINET_7021 = 7021; public static final int TRACK = 7022; public static final int TRACK_7023 = 7023; public static final int TRACK_7026 = 7026; public static final int TRAIN_CART = 7027; public static final int TRAIN_CART_7028 = 7028; public static final int TRAIN_CART_7029 = 7029; public static final int TRAIN_CART_7030 = 7030; public static final int GIANT_DWARF_7032 = 7032; public static final int GIANT_DWARF_7033 = 7033; public static final int GIANT_DWARF_7034 = 7034; public static final int GIANT_DWARF_7035 = 7035; public static final int GIANT_DWARF_7036 = 7036; public static final int GIANT_DWARF_7037 = 7037; public static final int GIANT_DWARF_7038 = 7038; public static final int GIANT_DWARF_7039 = 7039; public static final int GIANT_DWARF_7041 = 7041; public static final int GIANT_DWARF_7043 = 7043; public static final int BUFFERS_7044 = 7044; public static final int SEED_STALL_7053 = 7053; public static final int NOTICE = 7054; public static final int OLD_BOOKSHELF = 7058; public static final int OLD_BOOKSHELF_7059 = 7059; public static final int OLD_BOOKSHELF_7060 = 7060; public static final int OLD_BOOKSHELF_7061 = 7061; public static final int OLD_BOOKSHELF_7062 = 7062; public static final int OLD_BOOKSHELF_7063 = 7063; public static final int OLD_BOOKSHELF_7064 = 7064; public static final int OLD_BOOKSHELF_7065 = 7065; public static final int OLD_BOOKSHELF_7066 = 7066; public static final int OLD_BOOKSHELF_7067 = 7067; public static final int OLD_BOOKSHELF_7068 = 7068; public static final int OLD_BOOKSHELF_7069 = 7069; public static final int OLD_BOOKSHELF_7070 = 7070; public static final int OLD_BOOKSHELF_7071 = 7071; public static final int OLD_BOOKSHELF_7072 = 7072; public static final int OLD_BOOKSHELF_7073 = 7073; public static final int OLD_BOOKSHELF_7074 = 7074; public static final int OLD_BOOKSHELF_7075 = 7075; public static final int OLD_BOOKSHELF_7076 = 7076; public static final int OLD_BOOKSHELF_7077 = 7077; public static final int OLD_BOOKSHELF_7078 = 7078; public static final int OLD_BOOKSHELF_7079 = 7079; public static final int OLD_BOOKSHELF_7080 = 7080; public static final int OLD_BOOKSHELF_7081 = 7081; public static final int OLD_BOOKSHELF_7082 = 7082; public static final int OLD_BOOKSHELF_7083 = 7083; public static final int OLD_BOOKSHELF_7084 = 7084; public static final int OLD_BOOKSHELF_7085 = 7085; public static final int OLD_BOOKSHELF_7086 = 7086; public static final int OLD_BOOKSHELF_7087 = 7087; public static final int OLD_BOOKSHELF_7088 = 7088; public static final int OLD_BOOKSHELF_7089 = 7089; public static final int GLOBE_OF_GIELINOR = 7090; public static final int STUDY_DESK_7091 = 7091; public static final int TELESCOPE_7092 = 7092; public static final int CHART = 7096; public static final int CHART_7097 = 7097; public static final int CHART_7098 = 7098; public static final int SCROLLS = 7099; public static final int SUIT_OF_ARMOUR_7100 = 7100; public static final int HANGING_CAPE = 7101; public static final int SARADOMIN_STAFF = 7102; public static final int PAPER = 7108; public static final int PAPER_7109 = 7109; public static final int DRAIN_7110 = 7110; public static final int DRAIN_7111 = 7111; public static final int DRAIN_7112 = 7112; public static final int CLAN_CUP_TROPHY = 7127; public static final int ROTTEN_FOOD = 7130; public static final int ROTTEN_FOOD_7131 = 7131; public static final int ROTTEN_FOOD_7132 = 7132; public static final int RAT = 7133; public static final int MUSHROOM_7134 = 7134; public static final int MUSHROOMS_7135 = 7135; public static final int MUSHROOM_7136 = 7136; public static final int CANNON_7137 = 7137; public static final int BANNER = 7138; public static final int SIGNPOST_7141 = 7141; public static final int HOLE_7142 = 7142; public static final int FOUNTAIN_7143 = 7143; public static final int BENCH_7165 = 7165; public static final int STOOL_7167 = 7167; public static final int STOOL_7168 = 7168; public static final int TABLE_7169 = 7169; public static final int SHELF_7170 = 7170; public static final int SHELF_7171 = 7171; public static final int TABLE_7175 = 7175; public static final int BOOKCASE_7176 = 7176; public static final int BOOKCASE_7177 = 7177; public static final int BOOKCASE_7178 = 7178; public static final int BOOKCASE_7179 = 7179; public static final int BOOKCASE_7180 = 7180; public static final int BOOKCASE_7181 = 7181; public static final int CHAIR_7182 = 7182; public static final int RANGE_7183 = 7183; public static final int RANGE_7184 = 7184; public static final int FIREPLACE_7185 = 7185; public static final int CHAIR_7187 = 7187; public static final int BED_7188 = 7188; public static final int BED_7189 = 7189; public static final int BED_7190 = 7190; public static final int BED_7191 = 7191; public static final int CHEST_7192 = 7192; public static final int WARDROBE_7193 = 7193; public static final int DRAWERS_7194 = 7194; public static final int DRAWERS_7195 = 7195; public static final int DRESSER_7196 = 7196; public static final int WARDROBE_7197 = 7197; public static final int WARDROBE_7198 = 7198; public static final int CORPSE_7206 = 7206; public static final int CORPSE_7207 = 7207; public static final int CORPSE_7208 = 7208; public static final int PASSAGEWAY = 7219; public static final int PASSAGEWAY_7220 = 7220; public static final int LADDER_7221 = 7221; public static final int DOOR_7222 = 7222; public static final int DOOR_7223 = 7223; public static final int SPINNING_BLADES_7224 = 7224; public static final int WALL_7225 = 7225; public static final int FLOOR = 7227; public static final int WALL_7228 = 7228; public static final int WALL_7229 = 7229; public static final int FLOOR_7230 = 7230; public static final int DOOR_7231 = 7231; public static final int DOOR_7232 = 7232; public static final int DOOR_7233 = 7233; public static final int DOOR_7234 = 7234; public static final int WALL_SAFE = 7236; public static final int WALL_SAFE_7237 = 7237; public static final int LEDGE_7239 = 7239; public static final int LEDGE_7240 = 7240; public static final int PENDULUM = 7241; public static final int WOODEN_OBSTRUCTION = 7242; public static final int WOODEN_OBSTRUCTION_7243 = 7243; public static final int WOODEN_OBSTRUCTION_7244 = 7244; public static final int FLOOR_7245 = 7245; public static final int DOOR_7246 = 7246; public static final int WALL_7248 = 7248; public static final int WALL_7249 = 7249; public static final int FLOOR_7250 = 7250; public static final int CONTORTION_BARS = 7251; public static final int BLADE_7252 = 7252; public static final int SPIN_BLADES = 7253; public static final int GRILL_7254 = 7254; public static final int GRILL_7255 = 7255; public static final int DOORWAY_7256 = 7256; public static final int TRAPDOOR_7257 = 7257; public static final int PASSAGEWAY_7258 = 7258; public static final int DOOR_7259 = 7259; public static final int DOOR_7260 = 7260; public static final int PORTAL_7272 = 7272; public static final int PORTAL_7273 = 7273; public static final int DOOR_7274 = 7274; public static final int FOX = 7277; public static final int FOX_7278 = 7278; public static final int CHICKEN = 7281; public static final int GRAIN = 7284; public static final int EMPTY_SACK = 7285; public static final int PRECARIOUS_BRIDGE = 7286; public static final int PRECARIOUS_BRIDGE_7287 = 7287; public static final int PORTAL_7288 = 7288; public static final int PORTAL_7289 = 7289; public static final int DOOR_7302 = 7302; public static final int STATUE_7303 = 7303; public static final int STATUE_7304 = 7304; public static final int STATUE_7305 = 7305; public static final int STATUE_7306 = 7306; public static final int STATUE_7307 = 7307; public static final int STATUE_7308 = 7308; public static final int STATUE_7309 = 7309; public static final int STATUE_7310 = 7310; public static final int STATUE_7311 = 7311; public static final int STATUE_7312 = 7312; public static final int STATUE_7313 = 7313; public static final int STATUE_7314 = 7314; public static final int PORTAL_7315 = 7315; public static final int PORTAL_7316 = 7316; public static final int DOOR_7317 = 7317; public static final int PORTAL_7318 = 7318; public static final int PORTAL_7319 = 7319; public static final int DOOR_7320 = 7320; public static final int PORTAL_7321 = 7321; public static final int PORTAL_7322 = 7322; public static final int DOOR_7323 = 7323; public static final int PORTAL_7324 = 7324; public static final int PORTAL_7325 = 7325; public static final int DOOR_7326 = 7326; public static final int OLD_BOOKSHELF_7327 = 7327; public static final int OLD_BOOKSHELF_7328 = 7328; public static final int OLD_BOOKSHELF_7329 = 7329; public static final int OLD_BOOKSHELF_7330 = 7330; public static final int TABLE_7331 = 7331; public static final int BUNSEN_BURNER = 7332; public static final int SHELVES_7333 = 7333; public static final int SHELVES_7334 = 7334; public static final int SHELVES_7335 = 7335; public static final int SHELVES_7336 = 7336; public static final int SHELVES_7337 = 7337; public static final int SHELVES_7338 = 7338; public static final int SHELVES_7339 = 7339; public static final int SHELVES_7340 = 7340; public static final int STONE_DOOR = 7343; public static final int STONE_DOOR_7344 = 7344; public static final int OPEN_DOOR = 7345; public static final int KEY = 7346; public static final int CRATE_7347 = 7347; public static final int CRATE_7348 = 7348; public static final int CRATE_7349 = 7349; public static final int CLOSED_CHEST_7350 = 7350; public static final int OPEN_CHEST_7351 = 7351; public static final int PORTAL_7352 = 7352; public static final int PORTAL_7353 = 7353; public static final int DOOR_7354 = 7354; public static final int WARNING_SIGN_7355 = 7355; public static final int DOOR_7373 = 7373; public static final int DOOR_7374 = 7374; public static final int CHAIR_7385 = 7385; public static final int BENCH_7388 = 7388; public static final int ROLLED_UP_RUG = 7391; public static final int ROLLED_UP_RUGS = 7392; public static final int LITTLE_TENT = 7393; public static final int RUG_7394 = 7394; public static final int CARPET_EXHIBIT = 7396; public static final int LEAFY_TREE_7397 = 7397; public static final int LEAFY_TREE_7398 = 7398; public static final int BED_7399 = 7399; public static final int BED_7400 = 7400; public static final int TABLE_7401 = 7401; public static final int TABLE_7402 = 7402; public static final int TABLE_7403 = 7403; public static final int CHAIR_7404 = 7404; public static final int TEAK_TABLE = 7405; public static final int TEAK_TABLE_7406 = 7406; public static final int TABLE_7407 = 7407; public static final int TABLE_7408 = 7408; public static final int VEGETABLE_STALL = 7409; public static final int TABLE_7417 = 7417; public static final int THRONE_7418 = 7418; public static final int CABINET_7419 = 7419; public static final int CABINET_7420 = 7420; public static final int OVEN = 7421; public static final int SINK_7422 = 7422; public static final int LARDER = 7423; public static final int DRESSER_7424 = 7424; public static final int MIRROR_7425 = 7425; public static final int BATH_SCREEN_7427 = 7427; public static final int BATHTUB = 7428; public static final int TABLE_7429 = 7429; public static final int BENCH_7430 = 7430; public static final int BOOKCASE_7431 = 7431; public static final int OAK_CHAIR = 7433; public static final int CLOCK_7434 = 7434; public static final int DESK_7438 = 7438; public static final int CHAIR_7439 = 7439; public static final int DESK_7440 = 7440; public static final int BED_7441 = 7441; public static final int DRAWERS_7442 = 7442; public static final int DRAWERS_7443 = 7443; public static final int PIANO_7444 = 7444; public static final int PIANO_STOOL_7445 = 7445; public static final int SMASHED_TABLE_7446 = 7446; public static final int DOOR_7452 = 7452; public static final int DOOR_7453 = 7453; public static final int LOCKED_DOOR = 7454; public static final int WHEAT_7463 = 7463; public static final int WHEAT_7464 = 7464; public static final int WHEAT_7465 = 7465; public static final int APPLE_TREE = 7466; public static final int STOOL_7482 = 7482; public static final int COOKING_POT_7483 = 7483; public static final int STONE_PILE = 7484; public static final int STONE_PILE_7485 = 7485; public static final int COUNTER_7496 = 7496; public static final int COUNTER_7497 = 7497; public static final int SHELVES_7498 = 7498; public static final int SHELVES_7499 = 7499; public static final int SHELVES_7500 = 7500; public static final int SHELVES_7501 = 7501; public static final int SHELVES_7502 = 7502; public static final int CHAIR_7504 = 7504; public static final int CHAIR_7505 = 7505; public static final int SHELVES_7506 = 7506; public static final int SHELVES_7507 = 7507; public static final int SHELVES_7508 = 7508; public static final int SHELVES_7509 = 7509; public static final int SHELVES_7510 = 7510; public static final int SHELVES_7511 = 7511; public static final int SACKS_7512 = 7512; public static final int CRATE_7513 = 7513; public static final int CRATE_7514 = 7514; public static final int TOOLS_7516 = 7516; public static final int STILE_7527 = 7527; public static final int FERMENTING_VAT = 7528; public static final int FERMENTING_VAT_7529 = 7529; public static final int FERMENTING_VAT_7530 = 7530; public static final int BARREL_7531 = 7531; public static final int VALVE = 7532; public static final int BELLADONNA_PATCH = 7557; public static final int BELLADONNA_PATCH_7558 = 7558; public static final int BELLADONNA_PATCH_7559 = 7559; public static final int BELLADONNA_PATCH_7560 = 7560; public static final int BELLADONNA = 7561; public static final int BELLADONNA_7562 = 7562; public static final int BELLADONNA_7563 = 7563; public static final int BELLADONNA_7564 = 7564; public static final int BELLADONNA_7565 = 7565; public static final int DISEASED_BELLADONNA = 7566; public static final int DISEASED_BELLADONNA_7567 = 7567; public static final int DISEASED_BELLADONNA_7568 = 7568; public static final int DEAD_BELLADONNA = 7569; public static final int DEAD_BELLADONNA_7570 = 7570; public static final int DEAD_BELLADONNA_7571 = 7571; public static final int BUSH_PATCH = 7573; public static final int BUSH_PATCH_7574 = 7574; public static final int BUSH_PATCH_7575 = 7575; public static final int BUSH_PATCH_7576 = 7576; public static final int CADAVABERRY_BUSH = 7581; public static final int CADAVABERRY_BUSH_7582 = 7582; public static final int CADAVABERRY_BUSH_7583 = 7583; public static final int CADAVABERRY_BUSH_7584 = 7584; public static final int CADAVABERRY_BUSH_7585 = 7585; public static final int CADAVABERRY_BUSH_7586 = 7586; public static final int CADAVABERRY_BUSH_7587 = 7587; public static final int CADAVABERRY_BUSH_7588 = 7588; public static final int CADAVABERRY_BUSH_7589 = 7589; public static final int CADAVABERRY_BUSH_7590 = 7590; public static final int CADAVABERRY_BUSH_7591 = 7591; public static final int CADAVABERRY_BUSH_7592 = 7592; public static final int DISEASED_CADAVABERRY_BUSH = 7593; public static final int DISEASED_CADAVABERRY_BUSH_7594 = 7594; public static final int DISEASED_CADAVABERRY_BUSH_7595 = 7595; public static final int DISEASED_CADAVABERRY_BUSH_7596 = 7596; public static final int DISEASED_CADAVABERRY_BUSH_7597 = 7597; public static final int DISEASED_CADAVABERRY_BUSH_7598 = 7598; public static final int DEAD_CADAVABERRY_BUSH = 7599; public static final int DEAD_CADAVABERRY_BUSH_7600 = 7600; public static final int DEAD_CADAVABERRY_BUSH_7601 = 7601; public static final int DEAD_CADAVABERRY_BUSH_7602 = 7602; public static final int DEAD_CADAVABERRY_BUSH_7603 = 7603; public static final int DEAD_CADAVABERRY_BUSH_7604 = 7604; public static final int DWELLBERRY_BUSH = 7605; public static final int DWELLBERRY_BUSH_7606 = 7606; public static final int DWELLBERRY_BUSH_7607 = 7607; public static final int DWELLBERRY_BUSH_7608 = 7608; public static final int DWELLBERRY_BUSH_7609 = 7609; public static final int DWELLBERRY_BUSH_7610 = 7610; public static final int DWELLBERRY_BUSH_7611 = 7611; public static final int DWELLBERRY_BUSH_7612 = 7612; public static final int DWELLBERRY_BUSH_7613 = 7613; public static final int DWELLBERRY_BUSH_7614 = 7614; public static final int DWELLBERRY_BUSH_7615 = 7615; public static final int DWELLBERRY_BUSH_7616 = 7616; public static final int DWELLBERRY_BUSH_7617 = 7617; public static final int DISEASED_DWELLBERRY_BUSH = 7618; public static final int DISEASED_DWELLBERRY_BUSH_7619 = 7619; public static final int DISEASED_DWELLBERRY_BUSH_7620 = 7620; public static final int DISEASED_DWELLBERRY_BUSH_7621 = 7621; public static final int DISEASED_DWELLBERRY_BUSH_7622 = 7622; public static final int DISEASED_DWELLBERRY_BUSH_7623 = 7623; public static final int DISEASED_DWELLBERRY_BUSH_7624 = 7624; public static final int DEAD_DWELLBERRY_BUSH = 7625; public static final int DEAD_DWELLBERRY_BUSH_7626 = 7626; public static final int DEAD_DWELLBERRY_BUSH_7627 = 7627; public static final int DEAD_DWELLBERRY_BUSH_7628 = 7628; public static final int DEAD_DWELLBERRY_BUSH_7629 = 7629; public static final int DEAD_DWELLBERRY_BUSH_7630 = 7630; public static final int DEAD_DWELLBERRY_BUSH_7631 = 7631; public static final int JANGERBERRY_BUSH = 7632; public static final int JANGERBERRY_BUSH_7633 = 7633; public static final int JANGERBERRY_BUSH_7634 = 7634; public static final int JANGERBERRY_BUSH_7635 = 7635; public static final int JANGERBERRY_BUSH_7636 = 7636; public static final int JANGERBERRY_BUSH_7637 = 7637; public static final int JANGERBERRY_BUSH_7638 = 7638; public static final int JANGERBERRY_BUSH_7639 = 7639; public static final int JANGERBERRY_BUSH_7640 = 7640; public static final int JANGERBERRY_BUSH_7641 = 7641; public static final int JANGERBERRY_BUSH_7642 = 7642; public static final int JANGERBERRY_BUSH_7643 = 7643; public static final int JANGERBERRY_BUSH_7644 = 7644; public static final int JANGERBERRY_BUSH_7645 = 7645; public static final int DISEASED_JANGERBERRY_BUSH = 7646; public static final int DISEASED_JANGERBERRY_BUSH_7647 = 7647; public static final int DISEASED_JANGERBERRY_BUSH_7648 = 7648; public static final int DISEASED_JANGERBERRY_BUSH_7649 = 7649; public static final int DISEASED_JANGERBERRY_BUSH_7650 = 7650; public static final int DISEASED_JANGERBERRY_BUSH_7651 = 7651; public static final int DISEASED_JANGERBERRY_BUSH_7652 = 7652; public static final int DISEASED_JANGERBERRY_BUSH_7653 = 7653; public static final int DEAD_JANGERBERRY_BUSH = 7654; public static final int DEAD_JANGERBERRY_BUSH_7655 = 7655; public static final int DEAD_JANGERBERRY_BUSH_7656 = 7656; public static final int DEAD_JANGERBERRY_BUSH_7657 = 7657; public static final int DEAD_JANGERBERRY_BUSH_7658 = 7658; public static final int DEAD_JANGERBERRY_BUSH_7659 = 7659; public static final int DEAD_JANGERBERRY_BUSH_7660 = 7660; public static final int DEAD_JANGERBERRY_BUSH_7661 = 7661; public static final int POISON_IVY_BUSH = 7662; public static final int POISON_IVY_BUSH_7663 = 7663; public static final int POISON_IVY_BUSH_7664 = 7664; public static final int POISON_IVY_BUSH_7665 = 7665; public static final int POISON_IVY_BUSH_7666 = 7666; public static final int POISON_IVY_BUSH_7667 = 7667; public static final int POISON_IVY_BUSH_7668 = 7668; public static final int POISON_IVY_BUSH_7669 = 7669; public static final int POISON_IVY_BUSH_7670 = 7670; public static final int POISON_IVY_BUSH_7671 = 7671; public static final int POISON_IVY_BUSH_7672 = 7672; public static final int POISON_IVY_BUSH_7673 = 7673; public static final int POISON_IVY_BUSH_7674 = 7674; public static final int POISON_IVY_BUSH_7675 = 7675; public static final int DISEASED_POISON_IVY_BUSH = 7676; public static final int DISEASED_POISON_IVY_BUSH_7677 = 7677; public static final int DISEASED_POISON_IVY_BUSH_7678 = 7678; public static final int DISEASED_POISON_IVY_BUSH_7679 = 7679; public static final int DISEASED_POISON_IVY_BUSH_7680 = 7680; public static final int DISEASED_POISON_IVY_BUSH_7681 = 7681; public static final int DISEASED_POISON_IVY_BUSH_7682 = 7682; public static final int DISEASED_POISON_IVY_BUSH_7683 = 7683; public static final int DEAD_POISON_IVY_BUSH = 7684; public static final int DEAD_POISON_IVY_BUSH_7685 = 7685; public static final int DEAD_POISON_IVY_BUSH_7686 = 7686; public static final int DEAD_POISON_IVY_BUSH_7687 = 7687; public static final int DEAD_POISON_IVY_BUSH_7688 = 7688; public static final int DEAD_POISON_IVY_BUSH_7689 = 7689; public static final int DEAD_POISON_IVY_BUSH_7690 = 7690; public static final int DEAD_POISON_IVY_BUSH_7691 = 7691; public static final int REDBERRY_BUSH = 7692; public static final int REDBERRY_BUSH_7693 = 7693; public static final int REDBERRY_BUSH_7694 = 7694; public static final int REDBERRY_BUSH_7695 = 7695; public static final int REDBERRY_BUSH_7696 = 7696; public static final int REDBERRY_BUSH_7697 = 7697; public static final int REDBERRY_BUSH_7698 = 7698; public static final int REDBERRY_BUSH_7699 = 7699; public static final int REDBERRY_BUSH_7700 = 7700; public static final int REDBERRY_BUSH_7701 = 7701; public static final int REDBERRY_BUSH_7702 = 7702; public static final int DISEASED_REDBERRY_BUSH = 7703; public static final int DISEASED_REDBERRY_BUSH_7704 = 7704; public static final int DISEASED_REDBERRY_BUSH_7705 = 7705; public static final int DISEASED_REDBERRY_BUSH_7706 = 7706; public static final int DISEASED_REDBERRY_BUSH_7707 = 7707; public static final int DEAD_REDBERRY_BUSH = 7708; public static final int DEAD_REDBERRY_BUSH_7709 = 7709; public static final int DEAD_REDBERRY_BUSH_7710 = 7710; public static final int DEAD_REDBERRY_BUSH_7711 = 7711; public static final int DEAD_REDBERRY_BUSH_7712 = 7712; public static final int WHITEBERRY_BUSH = 7713; public static final int WHITEBERRY_BUSH_7714 = 7714; public static final int WHITEBERRY_BUSH_7715 = 7715; public static final int WHITEBERRY_BUSH_7716 = 7716; public static final int WHITEBERRY_BUSH_7717 = 7717; public static final int WHITEBERRY_BUSH_7718 = 7718; public static final int WHITEBERRY_BUSH_7719 = 7719; public static final int WHITEBERRY_BUSH_7720 = 7720; public static final int WHITEBERRY_BUSH_7721 = 7721; public static final int WHITEBERRY_BUSH_7722 = 7722; public static final int WHITEBERRY_BUSH_7723 = 7723; public static final int WHITEBERRY_BUSH_7724 = 7724; public static final int WHITEBERRY_BUSH_7725 = 7725; public static final int WHITEBERRY_BUSH_7726 = 7726; public static final int DISEASED_WHITEBERRY_BUSH = 7727; public static final int DISEASED_WHITEBERRY_BUSH_7728 = 7728; public static final int DISEASED_WHITEBERRY_BUSH_7729 = 7729; public static final int DISEASED_WHITEBERRY_BUSH_7730 = 7730; public static final int DISEASED_WHITEBERRY_BUSH_7731 = 7731; public static final int DISEASED_WHITEBERRY_BUSH_7732 = 7732; public static final int DISEASED_WHITEBERRY_BUSH_7733 = 7733; public static final int DISEASED_WHITEBERRY_BUSH_7734 = 7734; public static final int DEAD_WHITEBERRY_BUSH = 7735; public static final int DEAD_WHITEBERRY_BUSH_7736 = 7736; public static final int DEAD_WHITEBERRY_BUSH_7737 = 7737; public static final int DEAD_WHITEBERRY_BUSH_7738 = 7738; public static final int DEAD_WHITEBERRY_BUSH_7739 = 7739; public static final int DEAD_WHITEBERRY_BUSH_7740 = 7740; public static final int DEAD_WHITEBERRY_BUSH_7741 = 7741; public static final int DEAD_WHITEBERRY_BUSH_7742 = 7742; public static final int CACTUS_PATCH = 7743; public static final int CACTUS_PATCH_7744 = 7744; public static final int CACTUS_PATCH_7745 = 7745; public static final int CACTUS_PATCH_7746 = 7746; public static final int CACTUS_7747 = 7747; public static final int CACTUS_7748 = 7748; public static final int CACTUS_7749 = 7749; public static final int CACTUS_7750 = 7750; public static final int CACTUS_7751 = 7751; public static final int CACTUS_7752 = 7752; public static final int CACTUS_7753 = 7753; public static final int CACTUS_7754 = 7754; public static final int CACTUS_7755 = 7755; public static final int CACTUS_7756 = 7756; public static final int CACTUS_7757 = 7757; public static final int CACTUS_7758 = 7758; public static final int DISEASED_CACTUS = 7759; public static final int DISEASED_CACTUS_7760 = 7760; public static final int DISEASED_CACTUS_7761 = 7761; public static final int DISEASED_CACTUS_7762 = 7762; public static final int DISEASED_CACTUS_7763 = 7763; public static final int DISEASED_CACTUS_7764 = 7764; public static final int DEAD_CACTUS = 7765; public static final int DEAD_CACTUS_7766 = 7766; public static final int DEAD_CACTUS_7767 = 7767; public static final int DEAD_CACTUS_7768 = 7768; public static final int DEAD_CACTUS_7769 = 7769; public static final int DEAD_CACTUS_7770 = 7770; public static final int CALQUAT_PATCH = 7772; public static final int CALQUAT_PATCH_7773 = 7773; public static final int CALQUAT_PATCH_7774 = 7774; public static final int CALQUAT_PATCH_7775 = 7775; public static final int CALQUAT_TREE = 7776; public static final int CALQUAT_TREE_7777 = 7777; public static final int CALQUAT_TREE_7778 = 7778; public static final int CALQUAT_TREE_7779 = 7779; public static final int CALQUAT_TREE_7780 = 7780; public static final int CALQUAT_TREE_7781 = 7781; public static final int CALQUAT_TREE_7782 = 7782; public static final int CALQUAT_TREE_7783 = 7783; public static final int CALQUAT_TREE_7784 = 7784; public static final int CALQUAT_TREE_7785 = 7785; public static final int CALQUAT_TREE_7786 = 7786; public static final int CALQUAT_TREE_7787 = 7787; public static final int CALQUAT_TREE_7788 = 7788; public static final int CALQUAT_TREE_7789 = 7789; public static final int CALQUAT_TREE_7790 = 7790; public static final int CALQUAT_TREE_7791 = 7791; public static final int DISEASED_CALQUAT = 7792; public static final int DISEASED_CALQUAT_7793 = 7793; public static final int DISEASED_CALQUAT_7794 = 7794; public static final int DISEASED_CALQUAT_7795 = 7795; public static final int DISEASED_CALQUAT_7796 = 7796; public static final int DISEASED_CALQUAT_7797 = 7797; public static final int DISEASED_CALQUAT_7798 = 7798; public static final int DEAD_CALQUAT = 7799; public static final int DEAD_CALQUAT_7800 = 7800; public static final int DEAD_CALQUAT_7801 = 7801; public static final int DEAD_CALQUAT_7802 = 7802; public static final int DEAD_CALQUAT_7803 = 7803; public static final int DEAD_CALQUAT_7804 = 7804; public static final int DEAD_CALQUAT_7805 = 7805; public static final int DEAD_CALQUAT_7806 = 7806; public static final int COMPOST_BIN_7808 = 7808; public static final int SUPPLIES = 7811; public static final int COMPOST_BIN_7813 = 7813; public static final int ALTAR_7814 = 7814; public static final int EXIT_PORTAL = 7819; public static final int EXIT_PORTAL_7820 = 7820; public static final int BARRIER = 7821; public static final int BARRIER_7822 = 7822; public static final int FLOWER_PATCH = 7840; public static final int FLOWER_PATCH_7841 = 7841; public static final int FLOWER_PATCH_7842 = 7842; public static final int FLOWER_PATCH_7843 = 7843; public static final int FLOWER_PATCH_7844 = 7844; public static final int FLOWER_PATCH_7845 = 7845; public static final int FLOWER_PATCH_7846 = 7846; public static final int LIMPWURT_PLANT = 7851; public static final int LIMPWURT_PLANT_7852 = 7852; public static final int LIMPWURT_PLANT_7853 = 7853; public static final int LIMPWURT_PLANT_7854 = 7854; public static final int LIMPWURT_PLANT_7855 = 7855; public static final int LIMPWURT_PLANT_7856 = 7856; public static final int LIMPWURT_PLANT_7857 = 7857; public static final int LIMPWURT_PLANT_7858 = 7858; public static final int LIMPWURT_PLANT_7859 = 7859; public static final int DISEASED_LIMPWURT_PLANT = 7860; public static final int DISEASED_LIMPWURT_PLANT_7861 = 7861; public static final int DISEASED_LIMPWURT_PLANT_7862 = 7862; public static final int DEAD_LIMPWURT_PLANT = 7863; public static final int DEAD_LIMPWURT_PLANT_7864 = 7864; public static final int DEAD_LIMPWURT_PLANT_7865 = 7865; public static final int DEAD_LIMPWURT_PLANT_7866 = 7866; public static final int MARIGOLD = 7867; public static final int MARIGOLD_7868 = 7868; public static final int MARIGOLD_7869 = 7869; public static final int MARIGOLD_7870 = 7870; public static final int MARIGOLD_7871 = 7871; public static final int MARIGOLD_7872 = 7872; public static final int MARIGOLD_7873 = 7873; public static final int MARIGOLD_7874 = 7874; public static final int MARIGOLD_7875 = 7875; public static final int DISEASED_MARIGOLD = 7876; public static final int DISEASED_MARIGOLD_7877 = 7877; public static final int DISEASED_MARIGOLD_7878 = 7878; public static final int DEAD_MARIGOLD = 7879; public static final int DEAD_MARIGOLD_7880 = 7880; public static final int DEAD_MARIGOLD_7881 = 7881; public static final int DEAD_MARIGOLD_7882 = 7882; public static final int NASTURTIUM = 7883; public static final int NASTURTIUM_7884 = 7884; public static final int NASTURTIUM_7885 = 7885; public static final int NASTURTIUM_7886 = 7886; public static final int NASTURTIUM_7887 = 7887; public static final int NASTURTIUM_7888 = 7888; public static final int NASTURTIUM_7889 = 7889; public static final int NASTURTIUM_7890 = 7890; public static final int NASTURTIUM_7891 = 7891; public static final int DISEASED_NASTURTIUM = 7892; public static final int DISEASED_NASTURTIUM_7893 = 7893; public static final int DISEASED_NASTURTIUM_7894 = 7894; public static final int DEAD_NASTURTIUM = 7895; public static final int DEAD_NASTURTIUM_7896 = 7896; public static final int DEAD_NASTURTIUM_7897 = 7897; public static final int DEAD_NASTURTIUM_7898 = 7898; public static final int ROSEMARY_7899 = 7899; public static final int ROSEMARY_7900 = 7900; public static final int ROSEMARY_7901 = 7901; public static final int ROSEMARY_7902 = 7902; public static final int ROSEMARY_7903 = 7903; public static final int ROSEMARY_7904 = 7904; public static final int ROSEMARY_7905 = 7905; public static final int ROSEMARY_7906 = 7906; public static final int ROSEMARY_7907 = 7907; public static final int DISEASED_ROSEMARY = 7908; public static final int DISEASED_ROSEMARY_7909 = 7909; public static final int DISEASED_ROSEMARY_7910 = 7910; public static final int DEAD_ROSEMARY = 7911; public static final int DEAD_ROSEMARY_7912 = 7912; public static final int DEAD_ROSEMARY_7913 = 7913; public static final int DEAD_ROSEMARY_7914 = 7914; public static final int SCARECROW_7915 = 7915; public static final int SCARECROW_7916 = 7916; public static final int SCARECROW_7917 = 7917; public static final int SCARECROW_7918 = 7918; public static final int WOAD_PLANT = 7919; public static final int WOAD_PLANT_7920 = 7920; public static final int WOAD_PLANT_7921 = 7921; public static final int WOAD_PLANT_7922 = 7922; public static final int WOAD_PLANT_7923 = 7923; public static final int WOAD_PLANT_7924 = 7924; public static final int WOAD_PLANT_7925 = 7925; public static final int WOAD_PLANT_7926 = 7926; public static final int WOAD_PLANT_7927 = 7927; public static final int DISEASED_WOAD_PLANT = 7928; public static final int DISEASED_WOAD_PLANT_7929 = 7929; public static final int DISEASED_WOAD_PLANT_7930 = 7930; public static final int DEAD_WOAD_PLANT = 7931; public static final int DEAD_WOAD_PLANT_7932 = 7932; public static final int DEAD_WOAD_PLANT_7933 = 7933; public static final int DEAD_WOAD_PLANT_7934 = 7934; public static final int APPLE_TREE_7935 = 7935; public static final int APPLE_TREE_7936 = 7936; public static final int APPLE_TREE_7937 = 7937; public static final int APPLE_TREE_7938 = 7938; public static final int APPLE_TREE_7939 = 7939; public static final int APPLE_TREE_7940 = 7940; public static final int APPLE_TREE_7941 = 7941; public static final int APPLE_TREE_7942 = 7942; public static final int APPLE_TREE_7943 = 7943; public static final int APPLE_TREE_7944 = 7944; public static final int APPLE_TREE_7945 = 7945; public static final int APPLE_TREE_7946 = 7946; public static final int APPLE_TREE_7947 = 7947; public static final int APPLE_TREE_7948 = 7948; public static final int DISEASED_APPLE_TREE = 7949; public static final int DISEASED_APPLE_TREE_7950 = 7950; public static final int DISEASED_APPLE_TREE_7951 = 7951; public static final int DISEASED_APPLE_TREE_7952 = 7952; public static final int DISEASED_APPLE_TREE_7953 = 7953; public static final int DISEASED_APPLE_TREE_7954 = 7954; public static final int DEAD_APPLE_TREE = 7955; public static final int DEAD_APPLE_TREE_7956 = 7956; public static final int DEAD_APPLE_TREE_7957 = 7957; public static final int DEAD_APPLE_TREE_7958 = 7958; public static final int DEAD_APPLE_TREE_7959 = 7959; public static final int DEAD_APPLE_TREE_7960 = 7960; public static final int APPLE_TREE_STUMP = 7961; public static final int PINEAPPLE_PLANT_7966 = 7966; public static final int PINEAPPLE_PLANT_7967 = 7967; public static final int PINEAPPLE_PLANT_7968 = 7968; public static final int PINEAPPLE_PLANT_7969 = 7969; public static final int PINEAPPLE_PLANT_7970 = 7970; public static final int PINEAPPLE_PLANT_7971 = 7971; public static final int PINEAPPLE_PLANT_7972 = 7972; public static final int PINEAPPLE_PLANT_7973 = 7973; public static final int PINEAPPLE_PLANT_7974 = 7974; public static final int PINEAPPLE_PLANT_7975 = 7975; public static final int PINEAPPLE_PLANT_7976 = 7976; public static final int PINEAPPLE_PLANT_7977 = 7977; public static final int PINEAPPLE_PLANT_7978 = 7978; public static final int PINEAPPLE_PLANT_7979 = 7979; public static final int DISEASED_PINEAPPLE_PLANT = 7980; public static final int DISEASED_PINEAPPLE_PLANT_7981 = 7981; public static final int DISEASED_PINEAPPLE_PLANT_7982 = 7982; public static final int DISEASED_PINEAPPLE_PLANT_7983 = 7983; public static final int DISEASED_PINEAPPLE_PLANT_7984 = 7984; public static final int DISEASED_PINEAPPLE_PLANT_7985 = 7985; public static final int DEAD_PINEAPPLE_PLANT = 7986; public static final int DEAD_PINEAPPLE_PLANT_7987 = 7987; public static final int DEAD_PINEAPPLE_PLANT_7988 = 7988; public static final int DEAD_PINEAPPLE_PLANT_7989 = 7989; public static final int DEAD_PINEAPPLE_PLANT_7990 = 7990; public static final int DEAD_PINEAPPLE_PLANT_7991 = 7991; public static final int PINEAPPLE_PLANT_STUMP = 7992; public static final int BANANA_TREE_7993 = 7993; public static final int BANANA_TREE_7994 = 7994; public static final int BANANA_TREE_7995 = 7995; public static final int BANANA_TREE_7996 = 7996; public static final int BANANA_TREE_7997 = 7997; public static final int BANANA_TREE_7998 = 7998; public static final int BANANA_TREE_7999 = 7999; public static final int BANANA_TREE_8000 = 8000; public static final int BANANA_TREE_8001 = 8001; public static final int BANANA_TREE_8002 = 8002; public static final int BANANA_TREE_8003 = 8003; public static final int BANANA_TREE_8004 = 8004; public static final int BANANA_TREE_8005 = 8005; public static final int BANANA_TREE_8006 = 8006; public static final int DISEASED_BANANA_TREE = 8007; public static final int DISEASED_BANANA_TREE_8008 = 8008; public static final int DISEASED_BANANA_TREE_8009 = 8009; public static final int DISEASED_BANANA_TREE_8010 = 8010; public static final int DISEASED_BANANA_TREE_8011 = 8011; public static final int DISEASED_BANANA_TREE_8012 = 8012; public static final int DEAD_BANANA_TREE = 8013; public static final int DEAD_BANANA_TREE_8014 = 8014; public static final int DEAD_BANANA_TREE_8015 = 8015; public static final int DEAD_BANANA_TREE_8016 = 8016; public static final int DEAD_BANANA_TREE_8017 = 8017; public static final int DEAD_BANANA_TREE_8018 = 8018; public static final int BANANA_TREE_STUMP = 8019; public static final int CURRY_TREE = 8020; public static final int CURRY_TREE_8021 = 8021; public static final int CURRY_TREE_8022 = 8022; public static final int CURRY_TREE_8023 = 8023; public static final int CURRY_TREE_8024 = 8024; public static final int CURRY_TREE_8025 = 8025; public static final int CURRY_TREE_8026 = 8026; public static final int CURRY_TREE_8027 = 8027; public static final int CURRY_TREE_8028 = 8028; public static final int CURRY_TREE_8029 = 8029; public static final int CURRY_TREE_8030 = 8030; public static final int CURRY_TREE_8031 = 8031; public static final int CURRY_TREE_8032 = 8032; public static final int CURRY_TREE_8033 = 8033; public static final int DISEASED_CURRY_TREE = 8034; public static final int DISEASED_CURRY_TREE_8035 = 8035; public static final int DISEASED_CURRY_TREE_8036 = 8036; public static final int DISEASED_CURRY_TREE_8037 = 8037; public static final int DISEASED_CURRY_TREE_8038 = 8038; public static final int DISEASED_CURRY_TREE_8039 = 8039; public static final int DEAD_CURRY_TREE = 8040; public static final int DEAD_CURRY_TREE_8041 = 8041; public static final int DEAD_CURRY_TREE_8042 = 8042; public static final int DEAD_CURRY_TREE_8043 = 8043; public static final int DEAD_CURRY_TREE_8044 = 8044; public static final int DEAD_CURRY_TREE_8045 = 8045; public static final int CURRY_TREE_STUMP = 8046; public static final int FRUIT_TREE_PATCH = 8047; public static final int FRUIT_TREE_PATCH_8048 = 8048; public static final int FRUIT_TREE_PATCH_8049 = 8049; public static final int FRUIT_TREE_PATCH_8050 = 8050; public static final int ORANGE_TREE = 8051; public static final int ORANGE_TREE_8052 = 8052; public static final int ORANGE_TREE_8053 = 8053; public static final int ORANGE_TREE_8054 = 8054; public static final int ORANGE_TREE_8055 = 8055; public static final int ORANGE_TREE_8056 = 8056; public static final int ORANGE_TREE_8057 = 8057; public static final int ORANGE_TREE_8058 = 8058; public static final int ORANGE_TREE_8059 = 8059; public static final int ORANGE_TREE_8060 = 8060; public static final int ORANGE_TREE_8061 = 8061; public static final int ORANGE_TREE_8062 = 8062; public static final int ORANGE_TREE_8063 = 8063; public static final int ORANGE_TREE_8064 = 8064; public static final int DISEASED_ORANGE_TREE = 8065; public static final int DISEASED_ORANGE_TREE_8066 = 8066; public static final int DISEASED_ORANGE_TREE_8067 = 8067; public static final int DISEASED_ORANGE_TREE_8068 = 8068; public static final int DISEASED_ORANGE_TREE_8069 = 8069; public static final int DISEASED_ORANGE_TREE_8070 = 8070; public static final int DEAD_ORANGE_TREE = 8071; public static final int DEAD_ORANGE_TREE_8072 = 8072; public static final int DEAD_ORANGE_TREE_8073 = 8073; public static final int DEAD_ORANGE_TREE_8074 = 8074; public static final int DEAD_ORANGE_TREE_8075 = 8075; public static final int DEAD_ORANGE_TREE_8076 = 8076; public static final int ORANGE_TREE_STUMP = 8077; public static final int PALM_TREE_8078 = 8078; public static final int PALM_TREE_8079 = 8079; public static final int PALM_TREE_8080 = 8080; public static final int PALM_TREE_8081 = 8081; public static final int PALM_TREE_8082 = 8082; public static final int PALM_TREE_8083 = 8083; public static final int PALM_TREE_8084 = 8084; public static final int PALM_TREE_8085 = 8085; public static final int PALM_TREE_8086 = 8086; public static final int PALM_TREE_8087 = 8087; public static final int PALM_TREE_8088 = 8088; public static final int PALM_TREE_8089 = 8089; public static final int PALM_TREE_8090 = 8090; public static final int PALM_TREE_8091 = 8091; public static final int DISEASED_PALM_TREE = 8092; public static final int DISEASED_PALM_TREE_8093 = 8093; public static final int DISEASED_PALM_TREE_8094 = 8094; public static final int DISEASED_PALM_TREE_8095 = 8095; public static final int DISEASED_PALM_TREE_8096 = 8096; public static final int DISEASED_PALM_TREE_8097 = 8097; public static final int DEAD_PALM_TREE = 8098; public static final int DEAD_PALM_TREE_8099 = 8099; public static final int DEAD_PALM_TREE_8100 = 8100; public static final int DEAD_PALM_TREE_8101 = 8101; public static final int DEAD_PALM_TREE_8102 = 8102; public static final int DEAD_PALM_TREE_8103 = 8103; public static final int PALM_TREE_STUMP = 8104; public static final int PAPAYA_TREE = 8105; public static final int PAPAYA_TREE_8106 = 8106; public static final int PAPAYA_TREE_8107 = 8107; public static final int PAPAYA_TREE_8108 = 8108; public static final int PAPAYA_TREE_8109 = 8109; public static final int PAPAYA_TREE_8110 = 8110; public static final int PAPAYA_TREE_8111 = 8111; public static final int PAPAYA_TREE_8112 = 8112; public static final int PAPAYA_TREE_8113 = 8113; public static final int PAPAYA_TREE_8114 = 8114; public static final int PAPAYA_TREE_8115 = 8115; public static final int PAPAYA_TREE_8116 = 8116; public static final int PAPAYA_TREE_8117 = 8117; public static final int PAPAYA_TREE_8118 = 8118; public static final int DISEASED_PAPAYA_TREE = 8119; public static final int DISEASED_PAPAYA_TREE_8120 = 8120; public static final int DISEASED_PAPAYA_TREE_8121 = 8121; public static final int DISEASED_PAPAYA_TREE_8122 = 8122; public static final int DISEASED_PAPAYA_TREE_8123 = 8123; public static final int DISEASED_PAPAYA_TREE_8124 = 8124; public static final int DEAD_PAPAYA_TREE = 8125; public static final int DEAD_PAPAYA_TREE_8126 = 8126; public static final int DEAD_PAPAYA_TREE_8127 = 8127; public static final int DEAD_PAPAYA_TREE_8128 = 8128; public static final int DEAD_PAPAYA_TREE_8129 = 8129; public static final int DEAD_PAPAYA_TREE_8130 = 8130; public static final int PAPAYA_TREE_STUMP = 8131; public static final int HERB_PATCH = 8132; public static final int HERB_PATCH_8133 = 8133; public static final int HERB_PATCH_8134 = 8134; public static final int HERB_PATCH_8135 = 8135; public static final int HERB_PATCH_8136 = 8136; public static final int HERB_PATCH_8137 = 8137; public static final int HERB_PATCH_8138 = 8138; public static final int HERBS_8139 = 8139; public static final int HERBS_8140 = 8140; public static final int HERBS_8141 = 8141; public static final int HERBS_8142 = 8142; public static final int HERBS_8143 = 8143; public static final int DISEASED_HERBS = 8144; public static final int DISEASED_HERBS_8145 = 8145; public static final int DISEASED_HERBS_8146 = 8146; public static final int DEAD_HERBS = 8147; public static final int DEAD_HERBS_8148 = 8148; public static final int DEAD_HERBS_8149 = 8149; public static final int ASGARNIAN_HOPS = 8154; public static final int ASGARNIAN_HOPS_8155 = 8155; public static final int ASGARNIAN_HOPS_8156 = 8156; public static final int ASGARNIAN_HOPS_8157 = 8157; public static final int ASGARNIAN_HOPS_8158 = 8158; public static final int ASGARNIAN_HOPS_8159 = 8159; public static final int ASGARNIAN_HOPS_8160 = 8160; public static final int ASGARNIAN_HOPS_8161 = 8161; public static final int ASGARNIAN_HOPS_8162 = 8162; public static final int ASGARNIAN_HOPS_8163 = 8163; public static final int ASGARNIAN_HOPS_8164 = 8164; public static final int DISEASED_ASGARNIAN_HOPS = 8165; public static final int DISEASED_ASGARNIAN_HOPS_8166 = 8166; public static final int DISEASED_ASGARNIAN_HOPS_8167 = 8167; public static final int DISEASED_ASGARNIAN_HOPS_8168 = 8168; public static final int DEAD_ASGARNIAN_HOPS = 8169; public static final int DEAD_ASGARNIAN_HOPS_8170 = 8170; public static final int DEAD_ASGARNIAN_HOPS_8171 = 8171; public static final int DEAD_ASGARNIAN_HOPS_8172 = 8172; public static final int HAMMERSTONE_HOPS = 8177; public static final int HAMMERSTONE_HOPS_8178 = 8178; public static final int HAMMERSTONE_HOPS_8179 = 8179; public static final int HAMMERSTONE_HOPS_8180 = 8180; public static final int HAMMERSTONE_HOPS_8181 = 8181; public static final int HAMMERSTONE_HOPS_8182 = 8182; public static final int HAMMERSTONE_HOPS_8183 = 8183; public static final int HAMMERSTONE_HOPS_8184 = 8184; public static final int HAMMERSTONE_HOPS_8185 = 8185; public static final int DISEASED_HAMMERSTONE_HOPS = 8186; public static final int DISEASED_HAMMERSTONE_HOPS_8187 = 8187; public static final int DISEASED_HAMMERSTONE_HOPS_8188 = 8188; public static final int DEAD_HAMMERSTONE_HOPS = 8189; public static final int DEAD_HAMMERSTONE_HOPS_8190 = 8190; public static final int DEAD_HAMMERSTONE_HOPS_8191 = 8191; public static final int BARLEY = 8192; public static final int BARLEY_8193 = 8193; public static final int BARLEY_8194 = 8194; public static final int BARLEY_8195 = 8195; public static final int BARLEY_8196 = 8196; public static final int BARLEY_8197 = 8197; public static final int BARLEY_8198 = 8198; public static final int BARLEY_8199 = 8199; public static final int BARLEY_8200 = 8200; public static final int DISEASED_BARLEY = 8201; public static final int DISEASED_BARLEY_8202 = 8202; public static final int DISEASED_BARLEY_8203 = 8203; public static final int DEAD_BARLEY = 8204; public static final int DEAD_BARLEY_8205 = 8205; public static final int DEAD_BARLEY_8206 = 8206; public static final int HOPS_PATCH = 8207; public static final int HOPS_PATCH_8208 = 8208; public static final int HOPS_PATCH_8209 = 8209; public static final int HOPS_PATCH_8210 = 8210; public static final int KRANDORIAN_HOPS = 8211; public static final int KRANDORIAN_HOPS_8212 = 8212; public static final int KRANDORIAN_HOPS_8213 = 8213; public static final int KRANDORIAN_HOPS_8214 = 8214; public static final int KRANDORIAN_HOPS_8215 = 8215; public static final int KRANDORIAN_HOPS_8216 = 8216; public static final int KRANDORIAN_HOPS_8217 = 8217; public static final int KRANDORIAN_HOPS_8218 = 8218; public static final int KRANDORIAN_HOPS_8219 = 8219; public static final int KRANDORIAN_HOPS_8220 = 8220; public static final int KRANDORIAN_HOPS_8221 = 8221; public static final int KRANDORIAN_HOPS_8222 = 8222; public static final int KRANDORIAN_HOPS_8223 = 8223; public static final int KRANDORIAN_HOPS_8224 = 8224; public static final int KRANDORIAN_HOPS_8225 = 8225; public static final int DISEASED_KRANDORIAN_HOPS = 8226; public static final int DISEASED_KRANDORIAN_HOPS_8227 = 8227; public static final int DISEASED_KRANDORIAN_HOPS_8228 = 8228; public static final int DISEASED_KRANDORIAN_HOPS_8229 = 8229; public static final int DISEASED_KRANDORIAN_HOPS_8230 = 8230; public static final int DISEASED_KRANDORIAN_HOPS_8231 = 8231; public static final int DEAD_KRANDORIAN_HOPS = 8232; public static final int DEAD_KRANDORIAN_HOPS_8233 = 8233; public static final int DEAD_KRANDORIAN_HOPS_8234 = 8234; public static final int DEAD_KRANDORIAN_HOPS_8235 = 8235; public static final int DEAD_KRANDORIAN_HOPS_8236 = 8236; public static final int DEAD_KRANDORIAN_HOPS_8237 = 8237; public static final int JUTE = 8238; public static final int JUTE_8239 = 8239; public static final int JUTE_8240 = 8240; public static final int JUTE_8241 = 8241; public static final int JUTE_8242 = 8242; public static final int JUTE_8243 = 8243; public static final int JUTE_8244 = 8244; public static final int JUTE_8245 = 8245; public static final int JUTE_8246 = 8246; public static final int JUTE_8247 = 8247; public static final int JUTE_8248 = 8248; public static final int DISEASED_JUTE = 8249; public static final int DISEASED_JUTE_8250 = 8250; public static final int DISEASED_JUTE_8251 = 8251; public static final int DISEASED_JUTE_8252 = 8252; public static final int DEAD_JUTE = 8253; public static final int DEAD_JUTE_8254 = 8254; public static final int DEAD_JUTE_8255 = 8255; public static final int DEAD_JUTE_8256 = 8256; public static final int WILDBLOOD_HOPS = 8257; public static final int WILDBLOOD_HOPS_8258 = 8258; public static final int WILDBLOOD_HOPS_8259 = 8259; public static final int WILDBLOOD_HOPS_8260 = 8260; public static final int WILDBLOOD_HOPS_8261 = 8261; public static final int WILDBLOOD_HOPS_8262 = 8262; public static final int WILDBLOOD_HOPS_8263 = 8263; public static final int WILDBLOOD_HOPS_8264 = 8264; public static final int WILDBLOOD_HOPS_8265 = 8265; public static final int WILDBLOOD_HOPS_8266 = 8266; public static final int WILDBLOOD_HOPS_8267 = 8267; public static final int WILDBLOOD_HOPS_8268 = 8268; public static final int WILDBLOOD_HOPS_8269 = 8269; public static final int WILDBLOOD_HOPS_8270 = 8270; public static final int WILDBLOOD_HOPS_8271 = 8271; public static final int WILDBLOOD_HOPS_8272 = 8272; public static final int WILDBLOOD_HOPS_8273 = 8273; public static final int DISEASED_WILDBLOOD_HOPS = 8274; public static final int DISEASED_WILDBLOOD_HOPS_8275 = 8275; public static final int DISEASED_WILDBLOOD_HOPS_8276 = 8276; public static final int DISEASED_WILDBLOOD_HOPS_8277 = 8277; public static final int DISEASED_WILDBLOOD_HOPS_8278 = 8278; public static final int DISEASED_WILDBLOOD_HOPS_8279 = 8279; public static final int DISEASED_WILDBLOOD_HOPS_8280 = 8280; public static final int DEAD_WILDBLOOD_HOPS = 8281; public static final int DEAD_WILDBLOOD_HOPS_8282 = 8282; public static final int DEAD_WILDBLOOD_HOPS_8283 = 8283; public static final int DEAD_WILDBLOOD_HOPS_8284 = 8284; public static final int DEAD_WILDBLOOD_HOPS_8285 = 8285; public static final int DEAD_WILDBLOOD_HOPS_8286 = 8286; public static final int DEAD_WILDBLOOD_HOPS_8287 = 8287; public static final int YANILLIAN_HOPS = 8288; public static final int YANILLIAN_HOPS_8289 = 8289; public static final int YANILLIAN_HOPS_8290 = 8290; public static final int YANILLIAN_HOPS_8291 = 8291; public static final int YANILLIAN_HOPS_8292 = 8292; public static final int YANILLIAN_HOPS_8293 = 8293; public static final int YANILLIAN_HOPS_8294 = 8294; public static final int YANILLIAN_HOPS_8295 = 8295; public static final int YANILLIAN_HOPS_8296 = 8296; public static final int YANILLIAN_HOPS_8297 = 8297; public static final int YANILLIAN_HOPS_8298 = 8298; public static final int YANILLIAN_HOPS_8299 = 8299; public static final int YANILLIAN_HOPS_8300 = 8300; public static final int DISEASED_YANILLIAN_HOPS = 8301; public static final int DISEASED_YANILLIAN_HOPS_8302 = 8302; public static final int DISEASED_YANILLIAN_HOPS_8303 = 8303; public static final int DISEASED_YANILLIAN_HOPS_8304 = 8304; public static final int DISEASED_YANILLIAN_HOPS_8305 = 8305; public static final int DEAD_YANILLIAN_HOPS = 8306; public static final int DEAD_YANILLIAN_HOPS_8307 = 8307; public static final int DEAD_YANILLIAN_HOPS_8308 = 8308; public static final int DEAD_YANILLIAN_HOPS_8309 = 8309; public static final int DEAD_YANILLIAN_HOPS_8310 = 8310; public static final int MUSHROOM_PATCH = 8311; public static final int MUSHROOM_PATCH_8312 = 8312; public static final int MUSHROOM_PATCH_8313 = 8313; public static final int MUSHROOM_PATCH_8314 = 8314; public static final int BITTERCAP_MUSHROOMS = 8315; public static final int BITTERCAP_MUSHROOMS_8316 = 8316; public static final int BITTERCAP_MUSHROOMS_8317 = 8317; public static final int BITTERCAP_MUSHROOMS_8318 = 8318; public static final int BITTERCAP_MUSHROOMS_8319 = 8319; public static final int BITTERCAP_MUSHROOMS_8320 = 8320; public static final int BITTERCAP_MUSHROOMS_8321 = 8321; public static final int BITTERCAP_MUSHROOMS_8322 = 8322; public static final int BITTERCAP_MUSHROOMS_8323 = 8323; public static final int BITTERCAP_MUSHROOMS_8324 = 8324; public static final int BITTERCAP_MUSHROOMS_8325 = 8325; public static final int BITTERCAP_MUSHROOMS_8326 = 8326; public static final int DISEASED_BITTERCAP_MUSHROOMS = 8327; public static final int DISEASED_BITTERCAP_MUSHROOMS_8328 = 8328; public static final int DISEASED_BITTERCAP_MUSHROOMS_8329 = 8329; public static final int DISEASED_BITTERCAP_MUSHROOMS_8330 = 8330; public static final int DISEASED_BITTERCAP_MUSHROOMS_8331 = 8331; public static final int DEAD_BITTERCAP_MUSHROOMS = 8332; public static final int DEAD_BITTERCAP_MUSHROOMS_8333 = 8333; public static final int DEAD_BITTERCAP_MUSHROOMS_8334 = 8334; public static final int DEAD_BITTERCAP_MUSHROOMS_8335 = 8335; public static final int DEAD_BITTERCAP_MUSHROOMS_8336 = 8336; public static final int SPIRIT_TREE_PATCH = 8339; public static final int SPIRIT_TREE_PATCH_8340 = 8340; public static final int SPIRIT_TREE_PATCH_8341 = 8341; public static final int SPIRIT_TREE_PATCH_8342 = 8342; public static final int SPIRIT_TREE = 8343; public static final int SPIRIT_TREE_8344 = 8344; public static final int SPIRIT_TREE_8345 = 8345; public static final int SPIRIT_TREE_8346 = 8346; public static final int SPIRIT_TREE_8347 = 8347; public static final int SPIRIT_TREE_8348 = 8348; public static final int SPIRIT_TREE_8349 = 8349; public static final int SPIRIT_TREE_8350 = 8350; public static final int SPIRIT_TREE_8351 = 8351; public static final int SPIRIT_TREE_8352 = 8352; public static final int SPIRIT_TREE_8353 = 8353; public static final int SPIRIT_TREE_8354 = 8354; public static final int SPIRIT_TREE_8355 = 8355; public static final int SPIRIT_TREE_8356 = 8356; public static final int SPIRIT_TREE_STUMP = 8357; public static final int DISEASED_SPIRIT_TREE = 8358; public static final int DISEASED_SPIRIT_TREE_8359 = 8359; public static final int DISEASED_SPIRIT_TREE_8360 = 8360; public static final int DISEASED_SPIRIT_TREE_8361 = 8361; public static final int DISEASED_SPIRIT_TREE_8362 = 8362; public static final int DISEASED_SPIRIT_TREE_8363 = 8363; public static final int DISEASED_SPIRIT_TREE_8364 = 8364; public static final int DISEASED_SPIRIT_TREE_8365 = 8365; public static final int DISEASED_SPIRIT_TREE_8366 = 8366; public static final int DISEASED_SPIRIT_TREE_8367 = 8367; public static final int DISEASED_SPIRIT_TREE_8368 = 8368; public static final int DISEASED_SPIRIT_TREE_8369 = 8369; public static final int DEAD_SPIRIT_TREE = 8370; public static final int DEAD_SPIRIT_TREE_8371 = 8371; public static final int DEAD_SPIRIT_TREE_8372 = 8372; public static final int DEAD_SPIRIT_TREE_8373 = 8373; public static final int DEAD_SPIRIT_TREE_8374 = 8374; public static final int DEAD_SPIRIT_TREE_8375 = 8375; public static final int DEAD_SPIRIT_TREE_8376 = 8376; public static final int DEAD_SPIRIT_TREE_8377 = 8377; public static final int DEAD_SPIRIT_TREE_8378 = 8378; public static final int DEAD_SPIRIT_TREE_8379 = 8379; public static final int DEAD_SPIRIT_TREE_8380 = 8380; public static final int DEAD_SPIRIT_TREE_8381 = 8381; public static final int TREE_PATCH = 8392; public static final int TREE_PATCH_8393 = 8393; public static final int TREE_PATCH_8394 = 8394; public static final int TREE_PATCH_8395 = 8395; public static final int MAGIC_TREE_8396 = 8396; public static final int MAGIC_TREE_8397 = 8397; public static final int MAGIC_TREE_8398 = 8398; public static final int MAGIC_TREE_8399 = 8399; public static final int MAGIC_TREE_8400 = 8400; public static final int MAGIC_TREE_8401 = 8401; public static final int MAGIC_TREE_8402 = 8402; public static final int MAGIC_TREE_8403 = 8403; public static final int MAGIC_TREE_8404 = 8404; public static final int MAGIC_TREE_8405 = 8405; public static final int MAGIC_TREE_8406 = 8406; public static final int MAGIC_TREE_8407 = 8407; public static final int MAGIC_TREE_8408 = 8408; public static final int MAGIC_TREE_8409 = 8409; public static final int MAGIC_TREE_STUMP = 8410; public static final int DISEASED_MAGIC_TREE = 8411; public static final int DISEASED_MAGIC_TREE_8412 = 8412; public static final int DISEASED_MAGIC_TREE_8413 = 8413; public static final int DISEASED_MAGIC_TREE_8414 = 8414; public static final int DISEASED_MAGIC_TREE_8415 = 8415; public static final int DISEASED_MAGIC_TREE_8416 = 8416; public static final int DISEASED_MAGIC_TREE_8417 = 8417; public static final int DISEASED_MAGIC_TREE_8418 = 8418; public static final int DISEASED_MAGIC_TREE_8419 = 8419; public static final int DISEASED_MAGIC_TREE_8420 = 8420; public static final int DISEASED_MAGIC_TREE_8421 = 8421; public static final int DISEASED_MAGIC_TREE_8422 = 8422; public static final int DEAD_MAGIC_TREE = 8423; public static final int DEAD_MAGIC_TREE_8424 = 8424; public static final int DEAD_MAGIC_TREE_8425 = 8425; public static final int DEAD_MAGIC_TREE_8426 = 8426; public static final int DEAD_MAGIC_TREE_8427 = 8427; public static final int DEAD_MAGIC_TREE_8428 = 8428; public static final int DEAD_MAGIC_TREE_8429 = 8429; public static final int DEAD_MAGIC_TREE_8430 = 8430; public static final int DEAD_MAGIC_TREE_8431 = 8431; public static final int DEAD_MAGIC_TREE_8432 = 8432; public static final int DEAD_MAGIC_TREE_8433 = 8433; public static final int DEAD_MAGIC_TREE_8434 = 8434; public static final int MAPLE_TREE_8435 = 8435; public static final int MAPLE_TREE_8436 = 8436; public static final int MAPLE_TREE_8437 = 8437; public static final int MAPLE_TREE_8438 = 8438; public static final int MAPLE_TREE_8439 = 8439; public static final int MAPLE_TREE_8440 = 8440; public static final int MAPLE_TREE_8441 = 8441; public static final int MAPLE_TREE_8442 = 8442; public static final int MAPLE_TREE_8443 = 8443; public static final int MAPLE_TREE_8444 = 8444; public static final int TREE_STUMP_8445 = 8445; public static final int DISEASED_MAPLE = 8446; public static final int DISEASED_MAPLE_8447 = 8447; public static final int DISEASED_MAPLE_8448 = 8448; public static final int DISEASED_MAPLE_8449 = 8449; public static final int DISEASED_MAPLE_8450 = 8450; public static final int DISEASED_MAPLE_8451 = 8451; public static final int DISEASED_MAPLE_8452 = 8452; public static final int DISEASED_MAPLE_8453 = 8453; public static final int DEAD_MAPLE = 8454; public static final int DEAD_MAPLE_8455 = 8455; public static final int DEAD_MAPLE_8456 = 8456; public static final int DEAD_MAPLE_8457 = 8457; public static final int DEAD_MAPLE_8458 = 8458; public static final int DEAD_MAPLE_8459 = 8459; public static final int DEAD_MAPLE_8460 = 8460; public static final int DEAD_MAPLE_8461 = 8461; public static final int OAK = 8462; public static final int OAK_8463 = 8463; public static final int OAK_8464 = 8464; public static final int OAK_8465 = 8465; public static final int OAK_8466 = 8466; public static final int OAK_8467 = 8467; public static final int OAK_TREE_STUMP = 8468; public static final int DISEASED_OAK = 8473; public static final int DISEASED_OAK_8474 = 8474; public static final int DISEASED_OAK_8475 = 8475; public static final int DISEASED_OAK_8476 = 8476; public static final int DEAD_OAK = 8477; public static final int DEAD_OAK_8478 = 8478; public static final int DEAD_OAK_8479 = 8479; public static final int DEAD_OAK_8480 = 8480; public static final int WILLOW_TREE_8481 = 8481; public static final int WILLOW_TREE_8482 = 8482; public static final int WILLOW_TREE_8483 = 8483; public static final int WILLOW_TREE_8484 = 8484; public static final int WILLOW_TREE_8485 = 8485; public static final int WILLOW_TREE_8486 = 8486; public static final int WILLOW_TREE_8487 = 8487; public static final int WILLOW_TREE_8488 = 8488; public static final int WILLOW_TREE_STUMP = 8489; public static final int DISEASED_WILLOW = 8490; public static final int DISEASED_WILLOW_8491 = 8491; public static final int DISEASED_WILLOW_8492 = 8492; public static final int DISEASED_WILLOW_8493 = 8493; public static final int DISEASED_WILLOW_8494 = 8494; public static final int DISEASED_WILLOW_8495 = 8495; public static final int DEAD_WILLOW = 8496; public static final int DEAD_WILLOW_8497 = 8497; public static final int DEAD_WILLOW_8498 = 8498; public static final int DEAD_WILLOW_8499 = 8499; public static final int DEAD_WILLOW_8500 = 8500; public static final int DEAD_WILLOW_8501 = 8501; public static final int YEW_SAPLING = 8502; public static final int YEW_TREE_8503 = 8503; public static final int YEW_TREE_8504 = 8504; public static final int YEW_TREE_8505 = 8505; public static final int YEW_TREE_8506 = 8506; public static final int YEW_TREE_8507 = 8507; public static final int YEW_TREE_8508 = 8508; public static final int YEW_TREE_8509 = 8509; public static final int YEW_TREE_8510 = 8510; public static final int YEW_TREE_8511 = 8511; public static final int YEW_TREE_8512 = 8512; public static final int YEW_TREE_8513 = 8513; public static final int YEW_TREE_STUMP = 8514; public static final int DISEASED_YEW = 8515; public static final int DISEASED_YEW_8516 = 8516; public static final int DISEASED_YEW_8517 = 8517; public static final int DISEASED_YEW_8518 = 8518; public static final int DISEASED_YEW_8519 = 8519; public static final int DISEASED_YEW_8520 = 8520; public static final int DISEASED_YEW_8521 = 8521; public static final int DISEASED_YEW_8522 = 8522; public static final int DISEASED_YEW_8523 = 8523; public static final int DISEASED_YEW_8524 = 8524; public static final int DEAD_YEW = 8525; public static final int DEAD_YEW_8526 = 8526; public static final int DEAD_YEW_8527 = 8527; public static final int DEAD_YEW_8528 = 8528; public static final int DEAD_YEW_8529 = 8529; public static final int DEAD_YEW_8530 = 8530; public static final int DEAD_YEW_8531 = 8531; public static final int DEAD_YEW_8532 = 8532; public static final int DEAD_YEW_8533 = 8533; public static final int DEAD_YEW_8534 = 8534; public static final int CABBAGES = 8535; public static final int CABBAGES_8536 = 8536; public static final int CABBAGES_8537 = 8537; public static final int CABBAGES_8538 = 8538; public static final int CABBAGES_8539 = 8539; public static final int CABBAGES_8540 = 8540; public static final int CABBAGES_8541 = 8541; public static final int CABBAGES_8542 = 8542; public static final int CABBAGES_8543 = 8543; public static final int DISEASED_CABBAGES = 8544; public static final int DISEASED_CABBAGES_8545 = 8545; public static final int DISEASED_CABBAGES_8546 = 8546; public static final int DEAD_CABBAGES = 8547; public static final int DEAD_CABBAGES_8548 = 8548; public static final int DEAD_CABBAGES_8549 = 8549; public static final int POTATO_SEED = 8558; public static final int POTATO_PLANT = 8559; public static final int POTATO_PLANT_8560 = 8560; public static final int POTATO_PLANT_8561 = 8561; public static final int POTATO_8562 = 8562; public static final int POTATO_SEED_8563 = 8563; public static final int POTATO_PLANT_8564 = 8564; public static final int POTATO_PLANT_8565 = 8565; public static final int POTATO_PLANT_8566 = 8566; public static final int DISEASED_POTATOES = 8567; public static final int DISEASED_POTATOES_8568 = 8568; public static final int DISEASED_POTATOES_8569 = 8569; public static final int DEAD_POTATOES = 8570; public static final int DEAD_POTATOES_8571 = 8571; public static final int DEAD_POTATOES_8572 = 8572; public static final int ALLOTMENT = 8573; public static final int ALLOTMENT_8574 = 8574; public static final int ALLOTMENT_8575 = 8575; public static final int ALLOTMENT_8576 = 8576; public static final int ALLOTMENT_8577 = 8577; public static final int ALLOTMENT_8578 = 8578; public static final int ALLOTMENT_8579 = 8579; public static final int ONION_SEEDS = 8580; public static final int ONION_PLANT = 8581; public static final int ONION_PLANT_8582 = 8582; public static final int ONION_PLANT_8583 = 8583; public static final int ONION_8584 = 8584; public static final int ONION_SEEDS_8585 = 8585; public static final int ONION_PLANT_8586 = 8586; public static final int ONION_PLANT_8587 = 8587; public static final int ONION_PLANT_8588 = 8588; public static final int DISEASED_ONIONS = 8589; public static final int DISEASED_ONIONS_8590 = 8590; public static final int DISEASED_ONIONS_8591 = 8591; public static final int DEAD_ONIONS = 8592; public static final int DEAD_ONIONS_8593 = 8593; public static final int DEAD_ONIONS_8594 = 8594; public static final int STRAWBERRY_SEED = 8595; public static final int STRAWBERRY_PLANT = 8596; public static final int STRAWBERRY_PLANT_8597 = 8597; public static final int STRAWBERRY_PLANT_8598 = 8598; public static final int STRAWBERRY_PLANT_8599 = 8599; public static final int STRAWBERRY_PLANT_8600 = 8600; public static final int STRAWBERRY = 8601; public static final int STRAWBERRY_SEED_8602 = 8602; public static final int STRAWBERRY_PLANT_8603 = 8603; public static final int STRAWBERRY_PLANT_8604 = 8604; public static final int STRAWBERRY_PLANT_8605 = 8605; public static final int STRAWBERRY_PLANT_8606 = 8606; public static final int STRAWBERRY_PLANT_8607 = 8607; public static final int DISEASED_STRAWBERRY_PLANT = 8608; public static final int DISEASED_STRAWBERRY_PLANT_8609 = 8609; public static final int DISEASED_STRAWBERRY_PLANT_8610 = 8610; public static final int DISEASED_STRAWBERRY_PLANT_8611 = 8611; public static final int DISEASED_STRAWBERRY_PLANT_8612 = 8612; public static final int DEAD_STRAWBERRY_PLANT = 8613; public static final int DEAD_STRAWBERRY_PLANT_8614 = 8614; public static final int DEAD_STRAWBERRY_PLANT_8615 = 8615; public static final int DEAD_STRAWBERRY_PLANT_8616 = 8616; public static final int DEAD_STRAWBERRY_PLANT_8617 = 8617; public static final int SWEETCORN_SEED = 8618; public static final int SWEETCORN_PLANT = 8619; public static final int SWEETCORN_PLANT_8620 = 8620; public static final int SWEETCORN_PLANT_8621 = 8621; public static final int SWEETCORN_PLANT_8622 = 8622; public static final int SWEETCORN_PLANT_8623 = 8623; public static final int SWEETCORN = 8624; public static final int SWEETCORN_SEED_8625 = 8625; public static final int SWEETCORN_PLANT_8626 = 8626; public static final int SWEETCORN_PLANT_8627 = 8627; public static final int SWEETCORN_PLANT_8628 = 8628; public static final int SWEETCORN_PLANT_8629 = 8629; public static final int SWEETCORN_PLANT_8630 = 8630; public static final int DISEASED_SWEETCORN_PLANT = 8631; public static final int DISEASED_SWEETCORN_PLANT_8632 = 8632; public static final int DISEASED_SWEETCORN_PLANT_8633 = 8633; public static final int DISEASED_SWEETCORN_PLANT_8634 = 8634; public static final int DISEASED_SWEETCORN_PLANT_8635 = 8635; public static final int DEAD_SWEETCORN_PLANT = 8636; public static final int DEAD_SWEETCORN_PLANT_8637 = 8637; public static final int DEAD_SWEETCORN_PLANT_8638 = 8638; public static final int DEAD_SWEETCORN_PLANT_8639 = 8639; public static final int DEAD_SWEETCORN_PLANT_8640 = 8640; public static final int TOMATO_PLANT = 8641; public static final int TOMATO_PLANT_8642 = 8642; public static final int TOMATO_PLANT_8643 = 8643; public static final int TOMATO_PLANT_8644 = 8644; public static final int TOMATO = 8645; public static final int TOMATO_PLANT_8646 = 8646; public static final int TOMATO_PLANT_8647 = 8647; public static final int TOMATO_PLANT_8648 = 8648; public static final int TOMATO_PLANT_8649 = 8649; public static final int DISEASED_TOMATO_PLANT = 8650; public static final int DISEASED_TOMATO_PLANT_8651 = 8651; public static final int DISEASED_TOMATO_PLANT_8652 = 8652; public static final int DEAD_TOMATO_PLANT = 8653; public static final int DEAD_TOMATO_PLANT_8654 = 8654; public static final int DEAD_TOMATO_PLANT_8655 = 8655; public static final int WATERMELON_SEED = 8656; public static final int WATERMELONS = 8657; public static final int WATERMELONS_8658 = 8658; public static final int WATERMELONS_8659 = 8659; public static final int WATERMELONS_8660 = 8660; public static final int WATERMELONS_8661 = 8661; public static final int WATERMELONS_8662 = 8662; public static final int WATERMELONS_8663 = 8663; public static final int WATERMELON = 8664; public static final int WATERMELON_SEED_8665 = 8665; public static final int WATERMELONS_8666 = 8666; public static final int WATERMELONS_8667 = 8667; public static final int WATERMELONS_8668 = 8668; public static final int WATERMELONS_8669 = 8669; public static final int WATERMELONS_8670 = 8670; public static final int WATERMELONS_8671 = 8671; public static final int WATERMELONS_8672 = 8672; public static final int DISEASED_WATERMELONS = 8673; public static final int DISEASED_WATERMELONS_8674 = 8674; public static final int DISEASED_WATERMELONS_8675 = 8675; public static final int DISEASED_WATERMELONS_8676 = 8676; public static final int DISEASED_WATERMELONS_8677 = 8677; public static final int DISEASED_WATERMELONS_8678 = 8678; public static final int DISEASED_WATERMELONS_8679 = 8679; public static final int DEAD_WATERMELONS = 8680; public static final int DEAD_WATERMELONS_8681 = 8681; public static final int DEAD_WATERMELONS_8682 = 8682; public static final int DEAD_WATERMELONS_8683 = 8683; public static final int DEAD_WATERMELONS_8684 = 8684; public static final int DEAD_WATERMELONS_8685 = 8685; public static final int DEAD_WATERMELONS_8686 = 8686; public static final int DRESSER_8688 = 8688; public static final int DAIRY_COW = 8689; public static final int MILK_URNS = 8690; public static final int MILK_URNS_8691 = 8691; public static final int DOOR_8695 = 8695; public static final int DOOR_8696 = 8696; public static final int SINK_8699 = 8699; public static final int TABLE_8700 = 8700; public static final int TABLE_8701 = 8701; public static final int WATER_BARREL_8702 = 8702; public static final int WATER_BARREL_8703 = 8703; public static final int FIREPLACE_8712 = 8712; public static final int HAY_BALE_8713 = 8713; public static final int HAYSTACK_8714 = 8714; public static final int HAY_BALE_8715 = 8715; public static final int HAYSTACK_8716 = 8716; public static final int LOOM_8717 = 8717; public static final int STEPS = 8729; public static final int YOUNG_TREE = 8730; public static final int NET_TRAP = 8731; public static final int YOUNG_TREE_8732 = 8732; public static final int YOUNG_TREE_8733 = 8733; public static final int NET_TRAP_8734 = 8734; public static final int BARREL_TAP = 8737; public static final int ARDOUGNE_WALL_DOOR = 8738; public static final int ARDOUGNE_WALL_DOOR_8739 = 8739; public static final int ARDOUGNE_WALL_DOOR_8740 = 8740; public static final int ARDOUGNE_WALL_DOOR_8741 = 8741; public static final int TREE_8742 = 8742; public static final int TREE_8743 = 8743; public static final int LADDER_8744 = 8744; public static final int LADDER_8745 = 8745; public static final int LADDER_8746 = 8746; public static final int WELL_8747 = 8747; public static final int SPINNING_WHEEL_8748 = 8748; public static final int ALTAR_8749 = 8749; public static final int COOKING_RANGE_8750 = 8750; public static final int TABLE_8751 = 8751; public static final int BOOKCASE_8752 = 8752; public static final int BOOKCASE_8753 = 8753; public static final int BOOKCASE_8754 = 8754; public static final int ELVEN_LAMP_8767 = 8767; public static final int TABLE_8768 = 8768; public static final int TABLE_8769 = 8769; public static final int CHAIR_8770 = 8770; public static final int PAINTING_8771 = 8771; public static final int BENCH_8772 = 8772; public static final int BOW_AND_ARROW_8773 = 8773; public static final int ARROWS_8775 = 8775; public static final int CLOTHING_SHELVES_8776 = 8776; public static final int CLOTHES_MODEL_8778 = 8778; public static final int CLOTHES_MODEL_8779 = 8779; public static final int TRAPDOOR_8783 = 8783; public static final int LADDER_8785 = 8785; public static final int DOOR_8786 = 8786; public static final int DOOR_8787 = 8787; public static final int DOOR_8788 = 8788; public static final int DOOR_8789 = 8789; public static final int DOOR_8790 = 8790; public static final int DOOR_8791 = 8791; public static final int DOOR_8792 = 8792; public static final int DOOR_8793 = 8793; public static final int GNOME_ON_A_RACK = 8795; public static final int AN_EMPTY_RACK = 8796; public static final int CLOSED_CHEST_8797 = 8797; public static final int OPEN_CHEST_8798 = 8798; public static final int DESK_8799 = 8799; public static final int CLOSED_CHEST_8800 = 8800; public static final int GRAIN_SACKS = 8801; public static final int GRAIN_SACKS_8802 = 8802; public static final int GRAIN_SACKS_8803 = 8803; public static final int GRAIN_SACKS_8804 = 8804; public static final int GRAIN_SACKS_8805 = 8805; public static final int GRAIN_SACKS_8806 = 8806; public static final int APPLE_BARREL = 8807; public static final int APPLE_BARREL_8808 = 8808; public static final int ROTTEN_APPLE_PILE = 8809; public static final int GATE_8810 = 8810; public static final int GATE_8811 = 8811; public static final int GATE_8812 = 8812; public static final int GATE_8813 = 8813; public static final int BED_8814 = 8814; public static final int BED_8815 = 8815; public static final int BED_8816 = 8816; public static final int BED_8817 = 8817; public static final int DOOR_8818 = 8818; public static final int DOOR_8819 = 8819; public static final int DOOR_8820 = 8820; public static final int DOOR_8821 = 8821; public static final int ROCKS_8828 = 8828; public static final int ROCKS_8829 = 8829; public static final int ROCKS_8830 = 8830; public static final int MINE_CART_8831 = 8831; public static final int STOCKS_8840 = 8840; public static final int APPLE_TREE_8842 = 8842; public static final int APPLE_TREE_8843 = 8843; public static final int KELDA_HOPS_PATCH = 8861; public static final int KELDA_HOPS_PATCH_8862 = 8862; public static final int KELDA_HOPS_PATCH_8863 = 8863; public static final int KELDA_HOPS_PATCH_8864 = 8864; public static final int KELDA_HOPS = 8865; public static final int KELDA_HOPS_8866 = 8866; public static final int KELDA_HOPS_8867 = 8867; public static final int KELDA_HOPS_8868 = 8868; public static final int KELDA_HOPS_8869 = 8869; public static final int KELDA_STOUT = 8870; public static final int FERMENTING_VAT_8871 = 8871; public static final int FERMENTING_VAT_8872 = 8872; public static final int FERMENTING_VAT_8873 = 8873; public static final int FERMENTING_VAT_8874 = 8874; public static final int DWARVEN_MACHINERY = 8878; public static final int BOX = 8879; public static final int BOX_8880 = 8880; public static final int CAVE_ENTRANCE_8881 = 8881; public static final int CAVE_ENTRANCE_8882 = 8882; public static final int CAVE_ENTRANCE_8883 = 8883; public static final int CAVE_ENTRANCE_8884 = 8884; public static final int BUFFERS_8886 = 8886; public static final int TRACK_8887 = 8887; public static final int TRACK_8888 = 8888; public static final int TRACK_8889 = 8889; public static final int TRACK_8890 = 8890; public static final int TRACK_8891 = 8891; public static final int TRACK_8892 = 8892; public static final int TRACK_8893 = 8893; public static final int TRACK_8894 = 8894; public static final int TRACK_8895 = 8895; public static final int TRACK_8896 = 8896; public static final int TRACK_8897 = 8897; public static final int TRACK_8898 = 8898; public static final int TRACK_SUPPORT = 8899; public static final int TRACK_SUPPORT_8900 = 8900; public static final int TRACK_SUPPORT_8901 = 8901; public static final int TRACK_SUPPORT_8902 = 8902; public static final int TRACK_SUPPORT_8903 = 8903; public static final int TRACK_SUPPORT_8904 = 8904; public static final int BOOKCASE_8910 = 8910; public static final int CRATE_8911 = 8911; public static final int CRATES_8912 = 8912; public static final int CRATE_8913 = 8913; public static final int CRATE_8914 = 8914; public static final int CRATE_8915 = 8915; public static final int CRATE_8916 = 8916; public static final int BANNER_8918 = 8918; public static final int TRAIN_CART_8924 = 8924; public static final int TRAIN_CART_8925 = 8925; public static final int FREMENNIK_BOAT = 8926; public static final int WELL_8927 = 8927; public static final int CAVE_ENTRANCE_8929 = 8929; public static final int CAVE_ENTRANCE_8930 = 8930; public static final int ROCK_8950 = 8950; public static final int ROCK_8951 = 8951; public static final int ROCK_8952 = 8952; public static final int FLAG = 8954; public static final int FLAG_8955 = 8955; public static final int IRON_LADDER_8956 = 8956; public static final int DOOR_8958 = 8958; public static final int DOOR_8959 = 8959; public static final int DOOR_8960 = 8960; public static final int TREBUCHET = 8961; public static final int BROKEN_MACE_TRAP = 8962; public static final int DOOR_8963 = 8963; public static final int STEPS_8966 = 8966; public static final int DOOR_8967 = 8967; public static final int BROKEN_MACE_TRAP_8968 = 8968; public static final int NET_TRAP_8972 = 8972; public static final int NET_TRAP_8973 = 8973; public static final int NET_TRAP_8974 = 8974; public static final int DENSE_RUNESTONE = 8975; public static final int DEPLETED_RUNESTONE = 8976; public static final int PINBALL_POST = 8982; public static final int PINBALL_POST_8983 = 8983; public static final int PINBALL_POST_8984 = 8984; public static final int NET_TRAP_8985 = 8985; public static final int NET_TRAP_8986 = 8986; public static final int NET_TRAP_8987 = 8987; public static final int NET_TRAP_8988 = 8988; public static final int YOUNG_TREE_8989 = 8989; public static final int YOUNG_TREE_8990 = 8990; public static final int YOUNG_TREE_8991 = 8991; public static final int NET_TRAP_8992 = 8992; public static final int NET_TRAP_8993 = 8993; public static final int PINBALL_POST_8994 = 8994; public static final int PINBALL_POST_8995 = 8995; public static final int NET_TRAP_8996 = 8996; public static final int NET_TRAP_8997 = 8997; public static final int NET_TRAP_8998 = 8998; public static final int YOUNG_TREE_8999 = 8999; public static final int YOUNG_TREE_9000 = 9000; public static final int YOUNG_TREE_9001 = 9001; public static final int NET_TRAP_9002 = 9002; public static final int NET_TRAP_9003 = 9003; public static final int NET_TRAP_9004 = 9004; public static final int NET_TRAP_9005 = 9005; public static final int FUNERAL_PYRE_9006 = 9006; public static final int FUNERAL_PYRE_9007 = 9007; public static final int FUNERAL_PYRE_9008 = 9008; public static final int FUNERAL_PYRE_9009 = 9009; public static final int LIGHT_JUNGLE = 9010; public static final int LIGHT_JUNGLE_9011 = 9011; public static final int LIGHT_JUNGLE_9012 = 9012; public static final int LIGHT_JUNGLE_9013 = 9013; public static final int LIGHT_JUNGLE_9014 = 9014; public static final int MEDIUM_JUNGLE = 9015; public static final int MEDIUM_JUNGLE_9016 = 9016; public static final int MEDIUM_JUNGLE_9017 = 9017; public static final int MEDIUM_JUNGLE_9018 = 9018; public static final int MEDIUM_JUNGLE_9019 = 9019; public static final int DENSE_JUNGLE = 9020; public static final int DENSE_JUNGLE_9021 = 9021; public static final int DENSE_JUNGLE_9022 = 9022; public static final int DENSE_JUNGLE_9023 = 9023; public static final int DENSE_JUNGLE_9024 = 9024; public static final int ROTTEN_VILLAGE_FENCE = 9025; public static final int PARTIAL_FENCE = 9026; public static final int SHORT_FENCE = 9027; public static final int MEDIUM_FENCE = 9028; public static final int VILLAGE_FENCE = 9029; public static final int GEM_ROCK = 9030; public static final int GEM_ROCK_9031 = 9031; public static final int GEM_ROCK_9032 = 9032; public static final int GOUT_TUBER_PLANT = 9033; public static final int MAHOGANY = 9034; public static final int TREE_STUMP_9035 = 9035; public static final int TEAK = 9036; public static final int TREE_STUMP_9037 = 9037; public static final int HARDWOOD_GROVE_DOORS = 9038; public static final int HARDWOOD_GROVE_DOORS_9039 = 9039; public static final int GOUTWEED = 9044; public static final int GOUTWEED_9045 = 9045; public static final int GOUTWEED_9046 = 9046; public static final int GOUTWEED_9047 = 9047; public static final int GOUTWEED_9048 = 9048; public static final int DISEASED_GOUTWEED = 9049; public static final int DISEASED_GOUTWEED_9050 = 9050; public static final int DISEASED_GOUTWEED_9051 = 9051; public static final int DEAD_GOUTWEED = 9052; public static final int DEAD_GOUTWEED_9053 = 9053; public static final int DEAD_GOUTWEED_9054 = 9054; public static final int ALI_MS_MARKET = 9058; public static final int ALI_MS_MARKET_9059 = 9059; public static final int ALI_MS_MARKET_9060 = 9060; public static final int ALI_MS_MARKET_9061 = 9061; public static final int ALI_MS_MARKET_9062 = 9062; public static final int ALI_MS_MARKET_9063 = 9063; public static final int CRATE_9064 = 9064; public static final int CRATE_OF_RUNE_CASKETS = 9066; public static final int CRATE_9068 = 9068; public static final int CRATE_9070 = 9070; public static final int CRATE_9071 = 9071; public static final int RUNE_CASKET = 9072; public static final int RUNE_CASKET_9073 = 9073; public static final int RUNE_CASKET_9074 = 9074; public static final int RUNE_CASKET_9075 = 9075; public static final int CLOTH_9076 = 9076; public static final int HANGING_DYE = 9077; public static final int HANGING_DYE_9078 = 9078; public static final int PINBALL_POST_9079 = 9079; public static final int PINBALL_POST_9080 = 9080; public static final int PINBALL_POST_9081 = 9081; public static final int TABLE_9082 = 9082; public static final int DYE_POTS = 9083; public static final int STAIRS_9084 = 9084; public static final int STOVE = 9085; public static final int STOVE_9086 = 9086; public static final int STOVE_9087 = 9087; public static final int COKE = 9088; public static final int TEMPERATURE_GAUGE = 9089; public static final int PUMP = 9090; public static final int BARS = 9091; public static final int BAR_DISPENSER = 9093; public static final int BAR_DISPENSER_9094 = 9094; public static final int BAR_DISPENSER_9095 = 9095; public static final int BAR_DISPENSER_9096 = 9096; public static final int PEDALS = 9097; public static final int MELTING_POT = 9098; public static final int SMOKE = 9099; public static final int CONVEYOR_BELT = 9100; public static final int CONVEYOR_BELT_9101 = 9101; public static final int DRIVE_BELT = 9102; public static final int DRIVE_BELT_9103 = 9103; public static final int COGS = 9104; public static final int COGS_9105 = 9105; public static final int GEAR_BOX = 9106; public static final int DRIVE_BELT_9107 = 9107; public static final int COGS_9108 = 9108; public static final int SMOKE_9115 = 9115; public static final int PIPES = 9116; public static final int PIPES_9117 = 9117; public static final int PIPES_9120 = 9120; public static final int PIPES_9121 = 9121; public static final int SMOKE_9123 = 9123; public static final int STAIRS_9138 = 9138; public static final int GATE_9140 = 9140; public static final int GATE_9141 = 9141; public static final int GATE_9142 = 9142; public static final int SINK_9143 = 9143; public static final int CANDELABRUM = 9144; public static final int GOLDEN_LANTERN = 9145; public static final int OLD_BOOKSHELF_9146 = 9146; public static final int OLD_BOOKSHELF_9147 = 9147; public static final int CHAIR_9148 = 9148; public static final int GOLD_SCREEN = 9149; public static final int WALL_9150 = 9150; public static final int HOLE_IN_THE_WALL = 9151; public static final int PATCHED_WALL = 9152; public static final int GLOBE_OF_GIELINOR_9155 = 9155; public static final int STUDY_DESK_9156 = 9156; public static final int SUIT_OF_ARMOUR_9157 = 9157; public static final int NET_TRAP_9158 = 9158; public static final int CANDLES_9159 = 9159; public static final int CANDLES_9160 = 9160; public static final int CANDLES_9161 = 9161; public static final int DELPHINIUM_PATCH = 9166; public static final int DELPHINIUM_PATCH_9167 = 9167; public static final int DELPHINIUM_PATCH_9168 = 9168; public static final int DELPHINIUM_PATCH_9169 = 9169; public static final int DELPHINIUMS = 9170; public static final int DELPHINIUMS_9171 = 9171; public static final int DELPHINIUMS_9172 = 9172; public static final int DELPHINIUMS_9173 = 9173; public static final int PINK_ROSE_BUSH_PATCH = 9177; public static final int PINK_ROSE_BUSH_PATCH_9178 = 9178; public static final int PINK_ROSE_BUSH_PATCH_9179 = 9179; public static final int PINK_ROSE_BUSH_PATCH_9180 = 9180; public static final int WHITE_ROSE_BUSH_PATCH = 9181; public static final int WHITE_ROSE_BUSH_PATCH_9182 = 9182; public static final int WHITE_ROSE_BUSH_PATCH_9183 = 9183; public static final int WHITE_ROSE_BUSH_PATCH_9184 = 9184; public static final int RED_ROSE_BUSH_PATCH = 9185; public static final int RED_ROSE_BUSH_PATCH_9186 = 9186; public static final int RED_ROSE_BUSH_PATCH_9187 = 9187; public static final int RED_ROSE_BUSH_PATCH_9188 = 9188; public static final int ROSE_BUSH = 9189; public static final int ROSE_BUSH_9190 = 9190; public static final int ROSE_BUSH_9191 = 9191; public static final int ROSE_BUSH_9192 = 9192; public static final int ROSE_BUSH_9193 = 9193; public static final int ROSE_BUSH_9194 = 9194; public static final int ROSE_BUSH_9195 = 9195; public static final int ROSE_BUSH_9196 = 9196; public static final int ORCHIDS = 9199; public static final int ORCHIDS_9200 = 9200; public static final int ORCHIDS_9201 = 9201; public static final int ORCHIDS_9202 = 9202; public static final int PLANTPOT = 9203; public static final int PLANTPOT_9204 = 9204; public static final int YELLOW_ORCHIDS = 9205; public static final int YELLOW_ORCHIDS_9206 = 9206; public static final int YELLOW_ORCHIDS_9207 = 9207; public static final int YELLOW_ORCHIDS_9208 = 9208; public static final int WHITE_TREE_PATCH = 9210; public static final int WHITE_TREE_PATCH_9211 = 9211; public static final int WHITE_TREE_PATCH_9212 = 9212; public static final int WHITE_TREE_PATCH_9213 = 9213; public static final int WHITE_TREE_PATCH_9214 = 9214; public static final int WHITE_TREE_PATCH_9215 = 9215; public static final int WHITE_TREE_PATCH_9216 = 9216; public static final int WHITE_TREE_PATCH_9217 = 9217; public static final int WHITE_TREE_PATCH_9218 = 9218; public static final int WHITE_TREE_PATCH_9219 = 9219; public static final int WHITE_TREE_PATCH_9220 = 9220; public static final int WHITE_TREE_PATCH_9221 = 9221; public static final int WHITE_TREE_PATCH_9222 = 9222; public static final int SNOWDROP_PATCH = 9224; public static final int SNOWDROP_PATCH_9225 = 9225; public static final int SNOWDROP_PATCH_9226 = 9226; public static final int SNOWDROP_PATCH_9227 = 9227; public static final int SNOWDROPS = 9228; public static final int SNOWDROPS_9229 = 9229; public static final int SNOWDROPS_9230 = 9230; public static final int SNOWDROPS_9231 = 9231; public static final int VINE_PATCH = 9233; public static final int VINE_PATCH_9234 = 9234; public static final int VINE_PATCH_9235 = 9235; public static final int VINE_PATCH_9236 = 9236; public static final int VINES = 9237; public static final int VINES_9238 = 9238; public static final int VINES_9239 = 9239; public static final int VINES_9240 = 9240; public static final int PLINTH_9241 = 9241; public static final int PLINTH_9242 = 9242; public static final int STATUE_OF_SARADOMIN_9243 = 9243; public static final int PLINTH_9244 = 9244; public static final int STATUE_9245 = 9245; public static final int STATUE_PLINTH = 9246; public static final int STATUE_OF_SARADOMIN_9247 = 9247; public static final int STATUE_PLINTH_9248 = 9248; public static final int STATUE_9249 = 9249; public static final int GRAPEVINES = 9255; public static final int DISEASED_GRAPEVINES = 9256; public static final int YOUNG_TREE_9257 = 9257; public static final int PINBALL_POST_9258 = 9258; public static final int PINBALL_POST_9259 = 9259; public static final int ROSES_9260 = 9260; public static final int ROSES_9261 = 9261; public static final int ROSES_9262 = 9262; public static final int WHITE_TREE = 9263; public static final int PICNIC_BENCH_9291 = 9291; public static final int STATUE_9292 = 9292; public static final int CAVE_EXIT_9293 = 9293; public static final int EXERCISE_MAT = 9313; public static final int DOOR_9316 = 9316; public static final int DOOR_9317 = 9317; public static final int DOOR_9318 = 9318; public static final int DOOR_9319 = 9319; public static final int TOY_CORNER = 9324; public static final int STUDENTS_ART = 9325; public static final int WORK_BOARD = 9326; public static final int WORK_BOARD_9327 = 9327; public static final int COAT_RACK = 9328; public static final int WARDROBE_9329 = 9329; public static final int DRAWERS_9330 = 9330; public static final int DRAWERS_9331 = 9331; public static final int RAT_WHEEL = 9332; public static final int ROCKING_UNICORN = 9333; public static final int BLACKBOARD = 9334; public static final int EMPTY_DESK = 9335; public static final int SCARECROW_9338 = 9338; public static final int SCARECROW_9339 = 9339; public static final int SCARECROW_9340 = 9340; public static final int YOUNG_TREE_9341 = 9341; public static final int YOUNG_TREE_9342 = 9342; public static final int NET_TRAP_9343 = 9343; public static final int BIRD_SNARE = 9344; public static final int BIRD_SNARE_9345 = 9345; public static final int BIRD_SNARE_9346 = 9346; public static final int BIRD_SNARE_9347 = 9347; public static final int BIRD_SNARE_9348 = 9348; public static final int BIRD_SNARE_9349 = 9349; public static final int GRAVE_9354 = 9354; public static final int GRAVE_9355 = 9355; public static final int GRAVE_9356 = 9356; public static final int GRAVE_9357 = 9357; public static final int GRAVE_9358 = 9358; public static final int GRAVESTONE_9359 = 9359; public static final int GRAVESTONE_9360 = 9360; public static final int GRAVESTONE_9361 = 9361; public static final int GRAVESTONE_9362 = 9362; public static final int GRAVESTONE_9363 = 9363; public static final int GRAVE_9364 = 9364; public static final int GRAVE_9365 = 9365; public static final int GRAVE_9366 = 9366; public static final int GRAVE_9367 = 9367; public static final int PRIVATE_PORTAL = 9368; public static final int PRIVATE_PORTAL_9369 = 9369; public static final int BIRD_SNARE_9373 = 9373; public static final int BIRD_SNARE_9374 = 9374; public static final int BIRD_SNARE_9375 = 9375; public static final int BIRD_SNARE_9376 = 9376; public static final int BIRD_SNARE_9377 = 9377; public static final int BIRD_SNARE_9378 = 9378; public static final int BIRD_SNARE_9379 = 9379; public static final int BOX_TRAP_9380 = 9380; public static final int BOX_TRAP_9381 = 9381; public static final int SHAKING_BOX_9382 = 9382; public static final int SHAKING_BOX_9383 = 9383; public static final int SHAKING_BOX_9384 = 9384; public static final int BOX_TRAP_9385 = 9385; public static final int BOX_TRAP_9386 = 9386; public static final int BOX_TRAP_9387 = 9387; public static final int BOX_TRAP_9388 = 9388; public static final int BOX_TRAP_9389 = 9389; public static final int BOX_TRAP_9390 = 9390; public static final int BOX_TRAP_9391 = 9391; public static final int BOX_TRAP_9392 = 9392; public static final int BOX_TRAP_9393 = 9393; public static final int BOX_TRAP_9394 = 9394; public static final int BOX_TRAP_9395 = 9395; public static final int BOX_TRAP_9396 = 9396; public static final int BOX_TRAP_9397 = 9397; public static final int DOOR_9398 = 9398; public static final int UNFERTHS_PATCH = 9400; public static final int UNFERTHS_PATCH_9401 = 9401; public static final int UNFERTHS_PATCH_9402 = 9402; public static final int UNFERTHS_PATCH_9403 = 9403; public static final int POTATO_PLANTS = 9404; public static final int POTATO_PLANTS_9405 = 9405; public static final int POTATO_PLANTS_9406 = 9406; public static final int POTATO_PLANTS_9407 = 9407; public static final int POTATOES = 9408; public static final int TABLE_9430 = 9430; public static final int TABLE_9431 = 9431; public static final int TABLE_9432 = 9432; public static final int TABLE_9433 = 9433; public static final int TABLE_9434 = 9434; public static final int BED_9436 = 9436; public static final int BED_9437 = 9437; public static final int FIREPLACE_9439 = 9439; public static final int FIREPLACE_9440 = 9440; public static final int FIREPLACE_9441 = 9441; public static final int BOOKCASE_9443 = 9443; public static final int GATE_9470 = 9470; public static final int TREE_STUMP_9471 = 9471; public static final int LEVER_9472 = 9472; public static final int PLANT_9498 = 9498; public static final int PLANT_9499 = 9499; public static final int PLANT_9500 = 9500; public static final int PLANT_9501 = 9501; public static final int HAMMOCK_9508 = 9508; public static final int BED_9509 = 9509; public static final int SIGNPOST_9510 = 9510; public static final int CHAIR_9514 = 9514; public static final int BETTYS_CAULDRON = 9515; public static final int COUNTER_9516 = 9516; public static final int BARREL_9519 = 9519; public static final int BARREL_9520 = 9520; public static final int BARREL_9521 = 9521; public static final int ANCHOR_9522 = 9522; public static final int BOOKCASE_9523 = 9523; public static final int CHAIN = 9524; public static final int CART_9525 = 9525; public static final int SHELVES_9526 = 9526; public static final int SHELVES_9527 = 9527; public static final int SHELVES_9528 = 9528; public static final int SHELVES_9529 = 9529; public static final int FUNGUS_9530 = 9530; public static final int BENCH_9531 = 9531; public static final int PICNIC_BENCH_9532 = 9532; public static final int CRATE_9533 = 9533; public static final int CRATE_9534 = 9534; public static final int CRATES_9535 = 9535; public static final int BOXES_9536 = 9536; public static final int CRANE_9537 = 9537; public static final int ROW_BOAT_9538 = 9538; public static final int HOT_COALS = 9548; public static final int HOT_COALS_9549 = 9549; public static final int LADDER_9558 = 9558; public static final int LADDER_9559 = 9559; public static final int TRAPDOOR_9560 = 9560; public static final int BED_9561 = 9561; public static final int CELL_DOOR_9562 = 9562; public static final int CELL_DOOR_9563 = 9563; public static final int CELL_DOOR_9564 = 9564; public static final int DOOR_9565 = 9565; public static final int BUCKET = 9567; public static final int BUCKET_9568 = 9568; public static final int STAIRCASE_9582 = 9582; public static final int STAIRCASE_9584 = 9584; public static final int PLANT_9604 = 9604; public static final int PLANT_9605 = 9605; public static final int PLANT_9606 = 9606; public static final int BOOKCASE_9607 = 9607; public static final int BOOKCASE_9608 = 9608; public static final int BOOKCASE_9609 = 9609; public static final int EASEL = 9610; public static final int BOOKCASE_9611 = 9611; public static final int BED_9612 = 9612; public static final int LARGE_TABLE = 9613; public static final int TABLE_9614 = 9614; public static final int SMALL_TABLE_9615 = 9615; public static final int COUNTER_9616 = 9616; public static final int WAREHOUSE_SHELVES = 9617; public static final int WAREHOUSE_SHELVES_9618 = 9618; public static final int WAREHOUSE_SHELVES_9619 = 9619; public static final int WAREHOUSE_SHELVES_9620 = 9620; public static final int CHAIR_9621 = 9621; public static final int CHAIR_9622 = 9622; public static final int PLOUGH_9624 = 9624; public static final int WHEELBARROW_9625 = 9625; public static final int TREE_STUMP_9661 = 9661; public static final int SPADE = 9662; public static final int FALLEN_TREE_9663 = 9663; public static final int ROOTS_9664 = 9664; public static final int ROOTS_9665 = 9665; public static final int ROOTS_9666 = 9666; public static final int SCARECROW_9667 = 9667; public static final int MYSTERIOUS_STATUE_9668 = 9668; public static final int RANGE_9682 = 9682; public static final int RANGE_CHIMNEY = 9683; public static final int SINK_9684 = 9684; public static final int TABLE_9685 = 9685; public static final int CLOTH_9686 = 9686; public static final int CLOTHES_MODEL_9687 = 9687; public static final int CLOTHES_MODEL_9688 = 9688; public static final int CLOTHES_MODEL_9689 = 9689; public static final int CLOTHES_MODEL_9690 = 9690; public static final int NOTICEBOARD_9694 = 9694; public static final int NOTICEBOARD_9695 = 9695; public static final int SIGN_9696 = 9696; public static final int LARGE_TABLE_9697 = 9697; public static final int LARGE_TABLE_9698 = 9698; public static final int LARGE_TABLE_9699 = 9699; public static final int LARGE_TABLE_9700 = 9700; public static final int TABLE_9702 = 9702; public static final int CANDLESTICK_HOLDER_9703 = 9703; public static final int CHAIR_9704 = 9704; public static final int CHAIR_9705 = 9705; public static final int LEVER_9706 = 9706; public static final int LEVER_9707 = 9707; public static final int GATE_9708 = 9708; public static final int DOOR_9709 = 9709; public static final int DOOR_9710 = 9710; public static final int TREE_STUMP_9711 = 9711; public static final int TREE_STUMP_9712 = 9712; public static final int TREE_STUMP_9713 = 9713; public static final int TREE_STUMP_9714 = 9714; public static final int TREE_9715 = 9715; public static final int DOOR_9716 = 9716; public static final int GATE_9717 = 9717; public static final int GATE_9718 = 9718; public static final int GATE_9719 = 9719; public static final int GATE_9720 = 9720; public static final int DOOR_9721 = 9721; public static final int DOOR_9722 = 9722; public static final int DOOR_9723 = 9723; public static final int DOOR_9724 = 9724; public static final int LADDER_9725 = 9725; public static final int LADDER_9726 = 9726; public static final int LADDER_9727 = 9727; public static final int LADDER_9728 = 9728; public static final int FISHING_SPOT_9729 = 9729; public static final int TREE_9730 = 9730; public static final int TREE_9731 = 9731; public static final int TREE_9732 = 9732; public static final int TREE_9733 = 9733; public static final int OAK_9734 = 9734; public static final int FIRE_9735 = 9735; public static final int RANGE_9736 = 9736; public static final int CUPBOARD_9737 = 9737; public static final int LEVER_9738 = 9738; public static final int CREVICE_9739 = 9739; public static final int CREVICE_9740 = 9740; public static final int WALL_9741 = 9741; public static final int LADDER_9742 = 9742; public static final int SHIPS_LADDER_9744 = 9744; public static final int SHIPS_LADDER_9745 = 9745; public static final int CRYSTAL_COLLECTOR = 9748; public static final int CRYSTAL_COLLECTOR_9749 = 9749; public static final int CRYSTAL = 9751; public static final int CRYSTAL_9752 = 9752; public static final int OPEN_CHEST_9753 = 9753; public static final int CLOSED_CHEST_9754 = 9754; public static final int OPEN_CHEST_9755 = 9755; public static final int CLOSED_CHEST_9756 = 9756; public static final int OPEN_CHEST_9757 = 9757; public static final int CLOSED_CHEST_9758 = 9758; public static final int OPEN_CHEST_9759 = 9759; public static final int CLOSED_CHEST_9760 = 9760; public static final int OPEN_CHEST_9761 = 9761; public static final int CLOSED_CHEST_9762 = 9762; public static final int GUARD = 9763; public static final int GUARD_9764 = 9764; public static final int GUARD_9765 = 9765; public static final int SLAVE = 9766; public static final int SLAVE_9767 = 9767; public static final int LIGHT_DOOR = 9768; public static final int LIGHT_DOOR_9769 = 9769; public static final int LIGHT_DOOR_9770 = 9770; public static final int LIGHT_DOOR_9771 = 9771; public static final int LIGHT_DOOR_9772 = 9772; public static final int LIGHT_DOOR_9773 = 9773; public static final int LIGHT_DOOR_9774 = 9774; public static final int LIGHT_DOOR_9775 = 9775; public static final int PILLAR_OF_LIGHT = 9898; public static final int PILLAR_OF_LIGHT_9899 = 9899; public static final int PILLAR_OF_LIGHT_9900 = 9900; public static final int PILLAR_OF_LIGHT_9901 = 9901; public static final int PILLAR_OF_LIGHT_9902 = 9902; public static final int PILLAR_OF_LIGHT_9903 = 9903; public static final int PILLAR_OF_LIGHT_9904 = 9904; public static final int PILLAR_OF_LIGHT_9905 = 9905; public static final int PILLAR_OF_LIGHT_9906 = 9906; public static final int PILLAR_OF_LIGHT_9907 = 9907; public static final int PILLAR_OF_LIGHT_9908 = 9908; public static final int PILLAR_OF_LIGHT_9909 = 9909; public static final int PILLAR_OF_LIGHT_9910 = 9910; public static final int PILLAR_OF_LIGHT_9911 = 9911; public static final int PILLAR_OF_LIGHT_9912 = 9912; public static final int PILLAR_OF_LIGHT_9913 = 9913; public static final int PILLAR_OF_LIGHT_9914 = 9914; public static final int PILLAR_OF_LIGHT_9915 = 9915; public static final int PILLAR_OF_LIGHT_9916 = 9916; public static final int PILLAR_OF_LIGHT_9917 = 9917; public static final int PILLAR_OF_LIGHT_9918 = 9918; public static final int PILLAR_OF_LIGHT_9919 = 9919; public static final int PILLAR_OF_LIGHT_9920 = 9920; public static final int PILLAR_OF_LIGHT_9921 = 9921; public static final int PILLAR_OF_LIGHT_9922 = 9922; public static final int PILLAR_OF_LIGHT_9923 = 9923; public static final int PILLAR_OF_LIGHT_9924 = 9924; public static final int PILLAR_OF_LIGHT_9925 = 9925; public static final int PILLAR_OF_LIGHT_9926 = 9926; public static final int PILLAR_OF_LIGHT_9927 = 9927; public static final int PILLAR_OF_LIGHT_9928 = 9928; public static final int PILLAR_OF_LIGHT_9929 = 9929; public static final int PILLAR_OF_LIGHT_9930 = 9930; public static final int PILLAR_OF_LIGHT_9931 = 9931; public static final int PILLAR_OF_LIGHT_9932 = 9932; public static final int PILLAR_OF_LIGHT_9933 = 9933; public static final int PILLAR_OF_LIGHT_9934 = 9934; public static final int PILLAR_OF_LIGHT_9935 = 9935; public static final int PILLAR_OF_LIGHT_9936 = 9936; public static final int PILLAR_OF_LIGHT_9937 = 9937; public static final int PILLAR_OF_LIGHT_9973 = 9973; public static final int CAVE_STAIRS_9975 = 9975; public static final int CAVE_WALL_9976 = 9976; public static final int TUNNEL_9977 = 9977; public static final int LADDER_9978 = 9978; public static final int LADDER_9979 = 9979; public static final int FINAL_PILLAR = 9980; public static final int PILLAR_OF_LIGHT_9981 = 9981; public static final int PILLAR_OF_LIGHT_9982 = 9982; public static final int PILLAR_OF_LIGHT_9983 = 9983; public static final int PILLAR_OF_LIGHT_9984 = 9984; public static final int PILLAR_OF_LIGHT_9985 = 9985; public static final int PILLAR_OF_LIGHT_9986 = 9986; public static final int PILLAR_OF_LIGHT_9988 = 9988; public static final int LIGHT_DOOR_10002 = 10002; public static final int LIGHT_DOOR_10003 = 10003; public static final int LIGHT_DOOR_10004 = 10004; public static final int LIGHT_DOOR_10005 = 10005; public static final int LIGHT_DOOR_10006 = 10006; public static final int LIGHT_DOOR_10007 = 10007; public static final int LIGHT_DOOR_10008 = 10008; public static final int LIGHT_DOOR_10009 = 10009; public static final int LIGHT_DOOR_10010 = 10010; public static final int LIGHT_DOOR_10011 = 10011; public static final int LIGHT_DOOR_10012 = 10012; public static final int LIGHT_DOOR_10013 = 10013; public static final int CRYSTAL_10014 = 10014; public static final int STAIRCASE_10015 = 10015; public static final int STAIRCASE_10016 = 10016; public static final int STAIRCASE_10017 = 10017; public static final int STAIRCASE_10018 = 10018; public static final int PILLAR_10019 = 10019; public static final int PILLAR_10020 = 10020; public static final int PILLAR_10021 = 10021; public static final int PILLAR_10022 = 10022; public static final int WALL_SUPPORT_10033 = 10033; public static final int TRAP_10034 = 10034; public static final int LOW_WALL_10035 = 10035; public static final int ROCK_10036 = 10036; public static final int ROPE_10037 = 10037; public static final int ROPE_10038 = 10038; public static final int TREE_10041 = 10041; public static final int LADDER_10042 = 10042; public static final int DOOR_10043 = 10043; public static final int DOOR_10045 = 10045; public static final int DARK_TUNNEL_10047 = 10047; public static final int TRAPDOOR_10048 = 10048; public static final int GRAVE_10049 = 10049; public static final int GRAVE_10050 = 10050; public static final int GRAVE_10051 = 10051; public static final int GRAVE_10052 = 10052; public static final int GRAVE_10053 = 10053; public static final int GRAVE_10054 = 10054; public static final int MAUSOLEUM = 10055; public static final int DEAD_TREE_10056 = 10056; public static final int TREE_STUMP_10057 = 10057; public static final int FIREPLACE_10058 = 10058; public static final int GRAND_EXCHANGE_BOOTH = 10060; public static final int GRAND_EXCHANGE_BOOTH_10061 = 10061; public static final int SACRIFICIAL_BOAT = 10068; public static final int PAINTING_10074 = 10074; public static final int DRAWERS_10075 = 10075; public static final int STAFF_OF_BOB_THE_CAT = 10076; public static final int ARMOUR_10077 = 10077; public static final int CUPBOARD_10078 = 10078; public static final int ROCKS_10079 = 10079; public static final int ROCKS_10080 = 10080; public static final int ROCKS_10081 = 10081; public static final int FURNACE_10082 = 10082; public static final int BANK_BOOTH_10083 = 10083; public static final int ARCEUUS_STATUE = 10084; public static final int HOSIDIUS_STATUE = 10085; public static final int LOVAKENGJ_STATUE = 10086; public static final int OMINOUS_FISHING_SPOT = 10087; public static final int OMINOUS_FISHING_SPOT_10088 = 10088; public static final int OMINOUS_FISHING_SPOT_10089 = 10089; public static final int SIGNPOST_10090 = 10090; public static final int AQUARIUM = 10091; public static final int PISCARILIUS_STATUE = 10093; public static final int SHAYZIEN_STATUE = 10094; public static final int BLINDWEED_PATCH = 10097; public static final int BLINDWEED_PATCH_10098 = 10098; public static final int BLINDWEED_PATCH_10099 = 10099; public static final int BLINDWEED_PATCH_10100 = 10100; public static final int BLINDWEED_PATCH_10101 = 10101; public static final int BLINDWEED_PATCH_10102 = 10102; public static final int TRASHED_PATCH = 10103; public static final int STAGNANT_LAKE = 10105; public static final int CHIMNEY_PIPE = 10129; public static final int WOODEN_STAIR = 10136; public static final int WOODEN_STAIR_10137 = 10137; public static final int ROW_BOAT_10138 = 10138; public static final int PALM_TREE_10139 = 10139; public static final int PALM_TREE_10140 = 10140; public static final int PALM_TREE_10141 = 10141; public static final int BREWING_CONTROL = 10142; public static final int BREWING_CONTROL_10143 = 10143; public static final int BREWING_CONTROL_10144 = 10144; public static final int BREWING_VAT = 10145; public static final int BREWING_VAT_10146 = 10146; public static final int BREWING_VAT_10147 = 10147; public static final int OUTPUT_TAP = 10148; public static final int BARRELS = 10157; public static final int BREWERS_BARREL = 10158; public static final int CRATE_10159 = 10159; public static final int CRATES_10160 = 10160; public static final int BOXES_10161 = 10161; public static final int CUPBOARD_10162 = 10162; public static final int OPEN_CUPBOARD_10163 = 10163; public static final int PRESSURE_LEVER = 10165; public static final int PRESSURE_LEVER_10166 = 10166; public static final int LADDER_10167 = 10167; public static final int LADDER_10168 = 10168; public static final int HOPPER_10170 = 10170; public static final int PRESSURE_BARREL = 10171; public static final int GATE_10172 = 10172; public static final int PIRATE_SIGN = 10174; public static final int SINK_10175 = 10175; public static final int IRON_LADDER_10177 = 10177; public static final int STANDING_TORCH_10178 = 10178; public static final int STANDING_TORCH_10179 = 10179; public static final int LADDER_10193 = 10193; public static final int LADDER_10194 = 10194; public static final int LADDER_10195 = 10195; public static final int LADDER_10196 = 10196; public static final int LADDER_10197 = 10197; public static final int LADDER_10198 = 10198; public static final int LADDER_10199 = 10199; public static final int LADDER_10200 = 10200; public static final int LADDER_10201 = 10201; public static final int LADDER_10202 = 10202; public static final int LADDER_10203 = 10203; public static final int LADDER_10204 = 10204; public static final int LADDER_10205 = 10205; public static final int LADDER_10206 = 10206; public static final int LADDER_10207 = 10207; public static final int LADDER_10208 = 10208; public static final int LADDER_10209 = 10209; public static final int LADDER_10210 = 10210; public static final int LADDER_10211 = 10211; public static final int LADDER_10212 = 10212; public static final int LADDER_10213 = 10213; public static final int LADDER_10214 = 10214; public static final int LADDER_10215 = 10215; public static final int LADDER_10216 = 10216; public static final int LADDER_10217 = 10217; public static final int LADDER_10218 = 10218; public static final int LADDER_10219 = 10219; public static final int LADDER_10220 = 10220; public static final int LADDER_10221 = 10221; public static final int LADDER_10222 = 10222; public static final int LADDER_10223 = 10223; public static final int LADDER_10224 = 10224; public static final int LADDER_10225 = 10225; public static final int LADDER_10226 = 10226; public static final int LADDER_10227 = 10227; public static final int LADDER_10228 = 10228; public static final int KINGS_LADDER = 10229; public static final int KINGS_LADDER_10230 = 10230; public static final int BROKEN_KILN_10246 = 10246; public static final int BROKEN_KILN_10247 = 10247; public static final int BROKEN_KILN_10248 = 10248; public static final int ERIC = 10250; public static final int PORTAL_10251 = 10251; public static final int MAGIC_CIRCLE = 10252; public static final int STANDARD_10253 = 10253; public static final int BED_10255 = 10255; public static final int SHELF_10256 = 10256; public static final int SHELF_10257 = 10257; public static final int TABLE_10258 = 10258; public static final int CHAIR_10259 = 10259; public static final int DOOR_10260 = 10260; public static final int DOOR_10261 = 10261; public static final int DOOR_10262 = 10262; public static final int DOOR_10263 = 10263; public static final int DOOR_10264 = 10264; public static final int DOOR_10265 = 10265; public static final int SHIELD_DISPLAY = 10267; public static final int LARGE_DISPLAY = 10269; public static final int LARGE_DISPLAY_10271 = 10271; public static final int BOOKCASE_10273 = 10273; public static final int SACKS_10274 = 10274; public static final int CATAPULT_10278 = 10278; public static final int CRATES_10279 = 10279; public static final int CRATES_10280 = 10280; public static final int CRATE_10281 = 10281; public static final int CRATES_10282 = 10282; public static final int RIVER = 10283; public static final int LADDER_10284 = 10284; public static final int SACK_10286 = 10286; public static final int STAIRS_10287 = 10287; public static final int STAIRS_10288 = 10288; public static final int RAT_TRAP = 10290; public static final int RAT_TRAP_10291 = 10291; public static final int RAT_TRAP_10292 = 10292; public static final int BARREL_10293 = 10293; public static final int BARREL_10294 = 10294; public static final int BAR_PUMPS_10295 = 10295; public static final int STOOL_10296 = 10296; public static final int CRATES_10298 = 10298; public static final int RAT_LEVER = 10299; public static final int RAT_BARN = 10300; public static final int RAT_BARREL = 10301; public static final int RAT_BARREL_10302 = 10302; public static final int RAT_BARREL_10303 = 10303; public static final int SACKS_10304 = 10304; public static final int SACK_10305 = 10305; public static final int SACK_10306 = 10306; public static final int LANTERN_10307 = 10307; public static final int LADDER_10308 = 10308; public static final int LADDER_10309 = 10309; public static final int RAT_BARREL_10310 = 10310; public static final int RAT_LEVER_10311 = 10311; public static final int RAT_BARN_10312 = 10312; public static final int SACKS_10313 = 10313; public static final int SACK_10314 = 10314; public static final int SACK_10315 = 10315; public static final int RAT_BARREL_10316 = 10316; public static final int RAT_BARREL_10317 = 10317; public static final int GATES = 10318; public static final int TRELLIS_TOP = 10319; public static final int HOLE_IN_WALL_10320 = 10320; public static final int MANHOLE_10321 = 10321; public static final int LADDER_10322 = 10322; public static final int TRELLIS = 10323; public static final int TRELLIS_10324 = 10324; public static final int DOOR_10325 = 10325; public static final int DOOR_10326 = 10326; public static final int DOOR_10327 = 10327; public static final int RAT_WALL = 10335; public static final int RAT_WALL_10336 = 10336; public static final int RAT_WALL_10337 = 10337; public static final int RAT_WALL_10338 = 10338; public static final int RAT_WALL_10342 = 10342; public static final int RAT_WALL_10343 = 10343; public static final int RAT_WALL_10344 = 10344; public static final int RAT_WALL_10345 = 10345; public static final int RAT_HOLE = 10346; public static final int RAT_HOLE_10347 = 10347; public static final int RAT_HOLE_10348 = 10348; public static final int RAT_HOLE_10349 = 10349; public static final int RAT_HOLE_10350 = 10350; public static final int WHITE_ROSES = 10352; public static final int BOULDER_10354 = 10354; public static final int BANK_BOOTH_10355 = 10355; public static final int BANK_BOOTH_10357 = 10357; public static final int BED_10358 = 10358; public static final int BED_10359 = 10359; public static final int ROLLED_UP_RUGS_10360 = 10360; public static final int DOOR_10361 = 10361; public static final int HAY_BALES_10362 = 10362; public static final int BARREL_10371 = 10371; public static final int CRATES_10374 = 10374; public static final int TOOLS_10375 = 10375; public static final int CHOCICE_STALL = 10376; public static final int CLAY_OVEN = 10377; public static final int CRATE_10378 = 10378; public static final int CRATES_10379 = 10379; public static final int BOXES_10380 = 10380; public static final int CRATES_10381 = 10381; public static final int CUPBOARD_10382 = 10382; public static final int CUPBOARD_10383 = 10383; public static final int CUPBOARD_10384 = 10384; public static final int CUPBOARD_10385 = 10385; public static final int CUPBOARD_10386 = 10386; public static final int CUPBOARD_10387 = 10387; public static final int WATER_CHANNEL = 10402; public static final int WATER_CHANNEL_10404 = 10404; public static final int WATER_CHANNEL_10405 = 10405; public static final int WATER_CHANNEL_10406 = 10406; public static final int WATER_CHANNEL_10407 = 10407; public static final int WATER_CHANNEL_10408 = 10408; public static final int WATER_CHANNEL_10409 = 10409; public static final int WATER_CHANNEL_10410 = 10410; public static final int HOLE_10412 = 10412; public static final int BED_10413 = 10413; public static final int TABLE_10414 = 10414; public static final int ROLLED_UP_RUGS_10415 = 10415; public static final int CREVICE_10416 = 10416; public static final int CAVE_EXIT_10417 = 10417; public static final int DOOR_10418 = 10418; public static final int DOOR_10419 = 10419; public static final int DOOR_10420 = 10420; public static final int DOOR_10421 = 10421; public static final int DOOR_10423 = 10423; public static final int DOOR_10425 = 10425; public static final int DOOR_10427 = 10427; public static final int DOOR_10429 = 10429; public static final int DOOR_10431 = 10431; public static final int FIRE_10433 = 10433; public static final int ROPE_10434 = 10434; public static final int FOUNTAIN_10436 = 10436; public static final int FOUNTAIN_10437 = 10437; public static final int STATUETTE_PLINTH = 10438; public static final int ELIDINIS_STATUETTE = 10439; public static final int ROCK_CHAIR = 10440; public static final int CART_10457 = 10457; public static final int BARREL_10458 = 10458; public static final int COUNTER_10485 = 10485; public static final int COUNTER_10486 = 10486; public static final int BLACKSMITHS_TOOLS_10487 = 10487; public static final int ARMOUR_10489 = 10489; public static final int TABLE_10490 = 10490; public static final int CHAIR_10491 = 10491; public static final int CHAIR_10492 = 10492; public static final int LADDER_10493 = 10493; public static final int LADDER_10494 = 10494; public static final int WAREHOUSE_SHELVES_10495 = 10495; public static final int WAREHOUSE_SHELVES_10496 = 10496; public static final int WAREHOUSE_SHELVES_10497 = 10497; public static final int WAREHOUSE_SHELVES_10498 = 10498; public static final int POTTED_FERN_10499 = 10499; public static final int POTTED_FERN_10500 = 10500; public static final int POTTED_FERN_10501 = 10501; public static final int POTTED_FERN_10502 = 10502; public static final int PILE_OF_BRICKS_10503 = 10503; public static final int COOKING_POTS_10504 = 10504; public static final int COOKING_POTS_10505 = 10505; public static final int SHELF_10506 = 10506; public static final int STONE_PEW = 10508; public static final int TABLE_10509 = 10509; public static final int BOOKCASE_10510 = 10510; public static final int BED_10511 = 10511; public static final int BED_10512 = 10512; public static final int SHELVES_10513 = 10513; public static final int SHELVES_10514 = 10514; public static final int WHEELBARROW_10516 = 10516; public static final int BANK_BOOTH_10517 = 10517; public static final int CLOSED_BANK_BOOTH_10518 = 10518; public static final int CHALICE = 10521; public static final int TAPESTRY = 10522; public static final int STAIRCASE_10525 = 10525; public static final int STAIRCASE_10526 = 10526; public static final int BANK_BOOTH_10527 = 10527; public static final int CLOSED_BANK_BOOTH_10528 = 10528; public static final int BANK_DEPOSIT_BOX = 10529; public static final int BANK_DEPOSIT_CHEST = 10530; public static final int HUMAN_FLAG = 10541; public static final int HUMAN_FLAG_10542 = 10542; public static final int DWARF_FLAG = 10543; public static final int DWARF_FLAG_10544 = 10544; public static final int ELF_FLAG = 10545; public static final int ELF_FLAG_10546 = 10546; public static final int GNOME_FLAG = 10547; public static final int GNOME_FLAG_10548 = 10548; public static final int WEREWOLF_FLAG = 10549; public static final int WEREWOLF_FLAG_10550 = 10550; public static final int TZHAAR_FLAG = 10551; public static final int TZHAAR_FLAG_10552 = 10552; public static final int PORTCULLIS_10553 = 10553; public static final int LADDER_10554 = 10554; public static final int CHAMPION_STATUE = 10556; public static final int CHAMPION_STATUE_10557 = 10557; public static final int TRAPDOOR_10558 = 10558; public static final int TRAPDOOR_10559 = 10559; public static final int LADDER_10560 = 10560; public static final int BANK_CHEST_10562 = 10562; public static final int BANNER_10564 = 10564; public static final int BANNER_10566 = 10566; public static final int BANNER_10568 = 10568; public static final int BANNER_10570 = 10570; public static final int BANNER_10572 = 10572; public static final int BANNER_10574 = 10574; public static final int BANNER_10576 = 10576; public static final int BANNER_10578 = 10578; public static final int BANNER_10580 = 10580; public static final int BANNER_10582 = 10582; public static final int BANK_BOOTH_10583 = 10583; public static final int BANK_BOOTH_10584 = 10584; public static final int CLOSED_BOOTH = 10585; public static final int ICY_CAVERN = 10595; public static final int ICY_CAVERN_10596 = 10596; public static final int DANGER_SIGN_10605 = 10605; public static final int BRONZE_CHEST_10607 = 10607; public static final int BRONZE_CHEST_10608 = 10608; public static final int BRONZE_CHEST_10609 = 10609; public static final int BRONZE_CHEST_10610 = 10610; public static final int STEEL_CHEST_10611 = 10611; public static final int STEEL_CHEST_10612 = 10612; public static final int STEEL_CHEST_10613 = 10613; public static final int STEEL_CHEST_10614 = 10614; public static final int STEEL_CHEST_10615 = 10615; public static final int BLACK_CHEST_10616 = 10616; public static final int BLACK_CHEST_10617 = 10617; public static final int BLACK_CHEST_10618 = 10618; public static final int BLACK_CHEST_10619 = 10619; public static final int BLACK_CHEST_10620 = 10620; public static final int SILVER_CHEST_10621 = 10621; public static final int SILVER_CHEST_10622 = 10622; public static final int SILVER_CHEST_10623 = 10623; public static final int SILVER_CHEST_10624 = 10624; public static final int SILVER_CHEST_10625 = 10625; public static final int ALTAR_10639 = 10639; public static final int ALTAR_10640 = 10640; public static final int DORICS_WHETSTONE = 10641; public static final int TORCH = 10658; public static final int FIRE_10660 = 10660; public static final int CHEST_10661 = 10661; public static final int CRATE_10662 = 10662; public static final int STEPPING_STONE_10663 = 10663; public static final int CRATE_10671 = 10671; public static final int CRATE_10672 = 10672; public static final int DOORWAY_10721 = 10721; public static final int OLD_BOOKSHELF_10722 = 10722; public static final int OLD_BOOKSHELF_10723 = 10723; public static final int CHAIR_10724 = 10724; public static final int BONES_10725 = 10725; public static final int BONES_10726 = 10726; public static final int BONES_10727 = 10727; public static final int BONES_10728 = 10728; public static final int PORTAL_10733 = 10733; public static final int COIN_COLLECTOR = 10734; public static final int FOOD_CHUTE = 10735; public static final int STATUE_10736 = 10736; public static final int STATUE_10737 = 10737; public static final int STATUE_10738 = 10738; public static final int STATUE_10739 = 10739; public static final int BANK = 10768; public static final int STAIRS_10771 = 10771; public static final int STAIRS_10772 = 10772; public static final int STAIRS_10773 = 10773; public static final int STAIRS_10774 = 10774; public static final int STAIRS_10775 = 10775; public static final int STAIRS_10776 = 10776; public static final int ROCK_10782 = 10782; public static final int ROCK_10783 = 10783; public static final int ROCK_10784 = 10784; public static final int ROCK_10785 = 10785; public static final int ROCK_10786 = 10786; public static final int ROCK_10787 = 10787; public static final int ROCK_10788 = 10788; public static final int BOULDER_10790 = 10790; public static final int BOULDER_10791 = 10791; public static final int STONES = 10792; public static final int STONES_10793 = 10793; public static final int OVERHANGING_ROCK = 10795; public static final int TAILORS_MATERIALS = 10801; public static final int BOXES_10802 = 10802; public static final int BOXES_10803 = 10803; public static final int TRAPDOOR_10804 = 10804; public static final int SANDYS_DESK = 10805; public static final int SANDYS_COFFEE_MUG = 10807; public static final int TABLE_10808 = 10808; public static final int WASTE_PAPER_BIN = 10809; public static final int COUNTER_10813 = 10813; public static final int SANDPIT = 10814; public static final int ARMOUR_STAND = 10817; public static final int WILLOW = 10819; public static final int OAK_10820 = 10820; public static final int HOLLOW_TREE_10821 = 10821; public static final int YEW = 10822; public static final int FIREPLACE_10824 = 10824; public static final int FOUNTAIN_10827 = 10827; public static final int WILLOW_10829 = 10829; public static final int HOLLOW_TREE_10830 = 10830; public static final int WILLOW_10831 = 10831; public static final int MAPLE_TREE_10832 = 10832; public static final int WILLOW_10833 = 10833; public static final int MAGIC_TREE_10834 = 10834; public static final int COAL_TRUCK = 10836; public static final int DOORWAY_10848 = 10848; public static final int DOORWAY_10849 = 10849; public static final int CLIMBING_ROCKS_10851 = 10851; public static final int CLIMBING_ROCKS_10852 = 10852; public static final int DOORWAY_10855 = 10855; public static final int DOORWAY_10856 = 10856; public static final int STAIRS_10857 = 10857; public static final int STAIRS_10858 = 10858; public static final int GAP_10859 = 10859; public static final int LEDGE_10860 = 10860; public static final int GAP_10861 = 10861; public static final int GAP_10862 = 10862; public static final int GAP_10863 = 10863; public static final int GAP_10864 = 10864; public static final int LOW_WALL_10865 = 10865; public static final int PLANK_10867 = 10867; public static final int PLANK_10868 = 10868; public static final int STONE_BLOCK = 10875; public static final int STONE_BLOCK_10876 = 10876; public static final int GAP_10882 = 10882; public static final int GAP_10883 = 10883; public static final int GAP_10884 = 10884; public static final int GAP_10885 = 10885; public static final int LEDGE_10886 = 10886; public static final int LEDGE_10887 = 10887; public static final int LEDGE_10888 = 10888; public static final int LEDGE_10889 = 10889; public static final int ROCKS_10943 = 10943; public static final int CRATE_10944 = 10944; public static final int CRATE_10945 = 10945; public static final int VINE_PATCH_10949 = 10949; public static final int SAND_PILE = 10950; public static final int HOLE_10953 = 10953; public static final int FLAT_GROUND = 10954; public static final int HEADLESS_STATUE = 10955; public static final int HEADLESS_STATUE_10956 = 10956; public static final int HEADLESS_STATUE_10957 = 10957; public static final int LAZIMS_STATUE = 10958; public static final int ZAMORAKS_STATUE = 10959; public static final int ICTHLARINS_STATUE = 10960; public static final int CAMELS_STATUE = 10961; public static final int STATUE_10962 = 10962; public static final int STATUE_10963 = 10963; public static final int STATUE_10964 = 10964; public static final int STATUE_10965 = 10965; public static final int STATUE_10966 = 10966; public static final int STATUE_10967 = 10967; public static final int STATUE_10968 = 10968; public static final int STATUE_10969 = 10969; public static final int FALLEN_STATUE = 10971; public static final int FALLEN_STATUE_10972 = 10972; public static final int FALLEN_STATUE_10973 = 10973; public static final int FALLEN_STATUE_10974 = 10974; public static final int FALLEN_STATUE_10975 = 10975; public static final int FALLEN_STATUE_10976 = 10976; public static final int FALLEN_STATUE_10977 = 10977; public static final int FALLEN_STATUE_10978 = 10978; public static final int FALLEN_STATUE_10979 = 10979; public static final int FALLEN_STATUE_10980 = 10980; public static final int FALLEN_STATUE_10981 = 10981; public static final int FALLEN_STATUE_10982 = 10982; public static final int FALLEN_STATUE_10983 = 10983; public static final int FALLEN_STATUE_10984 = 10984; public static final int FALLEN_STATUE_10985 = 10985; public static final int FALLEN_STATUE_10986 = 10986; public static final int PEDESTAL = 10988; public static final int PEDESTAL_10989 = 10989; public static final int PEDESTAL_10990 = 10990; public static final int PEDESTAL_10991 = 10991; public static final int PEDESTAL_10992 = 10992; public static final int PEDESTAL_10993 = 10993; public static final int PEDESTAL_10994 = 10994; public static final int PEDESTAL_10995 = 10995; public static final int PEDESTAL_10996 = 10996; public static final int PEDESTAL_10997 = 10997; public static final int PEDESTAL_10998 = 10998; public static final int PEDESTAL_10999 = 10999; public static final int PEDESTAL_11000 = 11000; public static final int PEDESTAL_11001 = 11001; public static final int PEDESTAL_11002 = 11002; public static final int PEDESTAL_11003 = 11003; public static final int PEDESTAL_11004 = 11004; public static final int MAGIC_BARRIER = 11005; public static final int FOUNTAIN_11007 = 11007; public static final int FURNACE_11009 = 11009; public static final int FURNACE_11010 = 11010; public static final int BRAZIER = 11017; public static final int BRAZIER_11018 = 11018; public static final int BRAZIER_11019 = 11019; public static final int BRAZIER_11020 = 11020; public static final int BRAZIER_11021 = 11021; public static final int BRAZIER_11022 = 11022; public static final int BRAZIER_11023 = 11023; public static final int BRAZIER_11024 = 11024; public static final int BRAZIER_11025 = 11025; public static final int WALL_11028 = 11028; public static final int WALL_11029 = 11029; public static final int WALL_11030 = 11030; public static final int WALL_11031 = 11031; public static final int WALL_11032 = 11032; public static final int WALL_11033 = 11033; public static final int WALL_11034 = 11034; public static final int WALL_11035 = 11035; public static final int WALL_11036 = 11036; public static final int WALL_11037 = 11037; public static final int WALL_11038 = 11038; public static final int WALL_11039 = 11039; public static final int LADDER_11041 = 11041; public static final int LADDER_11042 = 11042; public static final int STONE_LADDER = 11043; public static final int STONE_LADDER_11044 = 11044; public static final int BOULDER_11049 = 11049; public static final int SECRET_ENTRANCE = 11050; public static final int DOOR_11051 = 11051; public static final int DOOR_11052 = 11052; public static final int DOOR_11053 = 11053; public static final int DOOR_11054 = 11054; public static final int DOOR_11055 = 11055; public static final int DOOR_11056 = 11056; public static final int DOOR_11057 = 11057; public static final int DOOR_11058 = 11058; public static final int PEDESTAL_11059 = 11059; public static final int PEDESTAL_11060 = 11060; public static final int PEDESTAL_11061 = 11061; public static final int PEDESTAL_11062 = 11062; public static final int PEDESTAL_11063 = 11063; public static final int DOOR_11064 = 11064; public static final int DOOR_11065 = 11065; public static final int DOOR_11066 = 11066; public static final int DOOR_11067 = 11067; public static final int DOOR_11068 = 11068; public static final int DOOR_11069 = 11069; public static final int DOOR_11070 = 11070; public static final int DOOR_11071 = 11071; public static final int RUINS_11072 = 11072; public static final int RUINS_11073 = 11073; public static final int RUINS_11074 = 11074; public static final int RUINS_11075 = 11075; public static final int LIGHT = 11079; public static final int SCAFFOLD_11080 = 11080; public static final int LADDER_11081 = 11081; public static final int WHEELBARROW_11082 = 11082; public static final int ROCK_11097 = 11097; public static final int ROCK_11098 = 11098; public static final int DEAD_TREE_11112 = 11112; public static final int BUSH_11113 = 11113; public static final int MAGIC_SPELL = 11141; public static final int DOOR_11151 = 11151; public static final int DOOR_11152 = 11152; public static final int PEDESTAL_11153 = 11153; public static final int ROCKS_11161 = 11161; public static final int TREATED_PATCH = 11164; public static final int VINE_11166 = 11166; public static final int VINE_11168 = 11168; public static final int VINE_11170 = 11170; public static final int VINE_11172 = 11172; public static final int CAVE_ROCKS = 11174; public static final int CAVE_ROCKS_11175 = 11175; public static final int MOSSY_ROCK_11182 = 11182; public static final int MOSSY_ROCK_11183 = 11183; public static final int COLUMN_11184 = 11184; public static final int COLUMN_11185 = 11185; public static final int COLUMN_11186 = 11186; public static final int STALACTITE_11187 = 11187; public static final int STALAGMITES_11188 = 11188; public static final int STALACTITE_11189 = 11189; public static final int ROCKSLIDE_11190 = 11190; public static final int ROCKSLIDE_11191 = 11191; public static final int ROCKSLIDE_11192 = 11192; public static final int ROCKSLIDE_11193 = 11193; public static final int DOOR_11196 = 11196; public static final int DOOR_11197 = 11197; public static final int LADDER_11198 = 11198; public static final int LADDER_11199 = 11199; public static final int LADDER_11200 = 11200; public static final int LADDER_11201 = 11201; public static final int TABLE_11202 = 11202; public static final int TABLE_11203 = 11203; public static final int PLAQUE_11204 = 11204; public static final int PLAQUE_11205 = 11205; public static final int PLAQUE_11206 = 11206; public static final int PLAQUE_11207 = 11207; public static final int COFFIN_11208 = 11208; public static final int GANGPLANK_11209 = 11209; public static final int GANGPLANK_11210 = 11210; public static final int GANGPLANK_11211 = 11211; public static final int GANGPLANK_11212 = 11212; public static final int CANNON_11214 = 11214; public static final int BROKEN_CANNON = 11215; public static final int BROKEN_CANNON_11216 = 11216; public static final int CANNON_11217 = 11217; public static final int CANNON_11219 = 11219; public static final int BROKEN_CANNON_11220 = 11220; public static final int CRATE_11228 = 11228; public static final int CRATE_11229 = 11229; public static final int CLOSED_CHEST_11231 = 11231; public static final int OPEN_CHEST_11232 = 11232; public static final int BARREL_11234 = 11234; public static final int BARREL_11235 = 11235; public static final int PLUNDER_STORAGE = 11236; public static final int POWDER_BARREL = 11238; public static final int BARREL_11239 = 11239; public static final int BARREL_11240 = 11240; public static final int CLIMBING_NET = 11244; public static final int POWDER_BARREL_11245 = 11245; public static final int REPAIR_LOCKER = 11246; public static final int REPAIR_LOCKER_11247 = 11247; public static final int GUN_LOCKER = 11248; public static final int GUN_LOCKER_11249 = 11249; public static final int MAST_11276 = 11276; public static final int MAST_11277 = 11277; public static final int MAST_11278 = 11278; public static final int MAST_11279 = 11279; public static final int SAIL_11280 = 11280; public static final int SAIL_11281 = 11281; public static final int SAIL_11282 = 11282; public static final int SAIL_11283 = 11283; public static final int FIGUREHEAD_11287 = 11287; public static final int SHIPS_LADDER_11289 = 11289; public static final int SHIPS_LADDER_11290 = 11290; public static final int SAIL_11291 = 11291; public static final int HOISTED_SAIL_11292 = 11292; public static final int HOISTED_SAIL_11293 = 11293; public static final int HOISTED_SAIL_11294 = 11294; public static final int HOISTED_SAIL_11297 = 11297; public static final int HOISTED_SAIL_11298 = 11298; public static final int HOISTED_SAIL_11299 = 11299; public static final int HOISTED_SAIL_11300 = 11300; public static final int HOISTED_SAIL_11301 = 11301; public static final int SAIL_11302 = 11302; public static final int HOISTED_SAIL_11303 = 11303; public static final int HOISTED_SAIL_11304 = 11304; public static final int BARREL_11305 = 11305; public static final int SHIPS_WHEEL_11306 = 11306; public static final int ANCHOR_11307 = 11307; public static final int SHIPS_LADDER_11308 = 11308; public static final int SHIPS_LADDER_11309 = 11309; public static final int CLIMBING_NET_11310 = 11310; public static final int ROPE_11311 = 11311; public static final int CANNON_11312 = 11312; public static final int CANNON_11313 = 11313; public static final int CANNON_11314 = 11314; public static final int BARREL_11315 = 11315; public static final int FUSE = 11316; public static final int SHIP_HULL = 11317; public static final int SHIP_HULL_11318 = 11318; public static final int SHIP_HULL_11319 = 11319; public static final int BARREL_11320 = 11320; public static final int BARREL_11322 = 11322; public static final int CHEST_11323 = 11323; public static final int ANCIENT_PILLAR = 11324; public static final int CRATE_11330 = 11330; public static final int CRATE_11331 = 11331; public static final int GATE_11332 = 11332; public static final int GATE_11333 = 11333; public static final int BAMBOO_DESK_11335 = 11335; public static final int BAMBOO_DESK_11336 = 11336; public static final int BAMBOO_DESK_11337 = 11337; public static final int BANK_BOOTH_11338 = 11338; public static final int OPEN_CHEST_11339 = 11339; public static final int CLOSED_CHEST_11341 = 11341; public static final int REPAIR_LOCKER_11342 = 11342; public static final int GUN_LOCKER_11343 = 11343; public static final int INTERDIMENSIONAL_RIFT = 11354; public static final int PORTAL_HOME = 11356; public static final int PORTAL_MACHINE = 11357; public static final int STAIRCASE_11358 = 11358; public static final int ROCKS_11360 = 11360; public static final int ROCKS_11361 = 11361; public static final int ROCKS_11362 = 11362; public static final int ROCKS_11363 = 11363; public static final int ROCKS_11364 = 11364; public static final int ROCKS_11365 = 11365; public static final int ROCKS_11366 = 11366; public static final int ROCKS_11367 = 11367; public static final int ROCKS_11368 = 11368; public static final int ROCKS_11369 = 11369; public static final int ROCKS_11370 = 11370; public static final int ROCKS_11371 = 11371; public static final int ROCKS_11372 = 11372; public static final int ROCKS_11373 = 11373; public static final int ROCKS_11374 = 11374; public static final int ROCKS_11375 = 11375; public static final int ROCKS_11376 = 11376; public static final int ROCKS_11377 = 11377; public static final int ROCKS_11378 = 11378; public static final int ROCKS_11379 = 11379; public static final int ROCKS_11380 = 11380; public static final int ROCKS_11381 = 11381; public static final int PILE_OF_ROCK = 11382; public static final int PILE_OF_ROCK_11383 = 11383; public static final int PILE_OF_ROCK_11384 = 11384; public static final int PILE_OF_ROCK_11385 = 11385; public static final int ROCKS_11386 = 11386; public static final int ROCKS_11387 = 11387; public static final int CRYSTALS = 11388; public static final int CRYSTALS_11389 = 11389; public static final int ROCKS_11390 = 11390; public static final int ROCKS_11391 = 11391; public static final int ROCKS_11392 = 11392; public static final int EMPTY_WALL = 11393; public static final int OUR_LIVES = 11398; public static final int CAVE_ENTRANCE_11399 = 11399; public static final int WEB_11400 = 11400; public static final int SLASHED_WEB_11401 = 11401; public static final int SIGN_11402 = 11402; public static final int ROUGH_WALL = 11404; public static final int TIGHTROPE = 11405; public static final int TIGHTROPE_11406 = 11406; public static final int PIPE_WITH_ROPE = 11409; public static final int PIPE_11410 = 11410; public static final int ROPE_11411 = 11411; public static final int STRAIGHT_ROPE = 11412; public static final int ROPE_11413 = 11413; public static final int ROPE_11414 = 11414; public static final int ROPE_11415 = 11415; public static final int ROPE_11416 = 11416; public static final int DUG_HOLE = 11417; public static final int MUD_PATCH_11418 = 11418; public static final int GRILL_11423 = 11423; public static final int MOSSY_ROCK_11424 = 11424; public static final int MOSSY_ROCK_11425 = 11425; public static final int ROCKSLIDE_11426 = 11426; public static final int ROCKSLIDE_11427 = 11427; public static final int ROCKSLIDE_11428 = 11428; public static final int NARROW_WALL = 11430; public static final int ROCKSLIDE_11431 = 11431; public static final int ROCKSLIDE_11432 = 11432; public static final int ROCKSLIDE_11433 = 11433; public static final int ROCKSLIDE_11434 = 11434; public static final int ROCKSLIDE_11435 = 11435; public static final int ROCKS_11441 = 11441; public static final int DOOR_11449 = 11449; public static final int DOOR_11450 = 11450; public static final int LEVER_A = 11451; public static final int LEVER_A_11452 = 11452; public static final int LEVER_B = 11453; public static final int LEVER_B_11454 = 11454; public static final int LEVER_C = 11455; public static final int LEVER_C_11456 = 11456; public static final int LEVER_D = 11457; public static final int LEVER_D_11458 = 11458; public static final int LEVER_E = 11459; public static final int LEVER_E_11460 = 11460; public static final int LEVER_F = 11461; public static final int LEVER_F_11462 = 11462; public static final int LANTERN_11468 = 11468; public static final int SPOOKY_PICTURE_11469 = 11469; public static final int DOOR_11470 = 11470; public static final int DOOR_11471 = 11471; public static final int CANDLES_11472 = 11472; public static final int CANDLES_11473 = 11473; public static final int DOOR_11483 = 11483; public static final int BARREL_11484 = 11484; public static final int CRATE_11485 = 11485; public static final int CRATES_11486 = 11486; public static final int BOXES_11487 = 11487; public static final int CRATES_11488 = 11488; public static final int CHAIR_11489 = 11489; public static final int CHAIR_11490 = 11490; public static final int LARGE_TABLE_11491 = 11491; public static final int SMASHED_CHAIR_11492 = 11492; public static final int GRANDFATHER_CLOCK_11493 = 11493; public static final int CABBAGE_11494 = 11494; public static final int GALLOWS_11495 = 11495; public static final int CHAIR_11496 = 11496; public static final int SPOOKY_PICTURE_11497 = 11497; public static final int STAIRCASE_11498 = 11498; public static final int STAIRCASE_11499 = 11499; public static final int TABLE_11500 = 11500; public static final int TABLE_11501 = 11501; public static final int TABLE_11502 = 11502; public static final int TABLE_11503 = 11503; public static final int TABLE_11504 = 11504; public static final int DEAD_TREE_11510 = 11510; public static final int STAIRCASE_11511 = 11511; public static final int STRANGE_MACHINE_11546 = 11546; public static final int STRANGE_MACHINE_11547 = 11547; public static final int STRANGE_MACHINE_11548 = 11548; public static final int STRANGE_MACHINE_11549 = 11549; public static final int STRANGE_MACHINE_11550 = 11550; public static final int TABLE_11551 = 11551; public static final int BARREL_11589 = 11589; public static final int BARREL_11590 = 11590; public static final int CRATE_11599 = 11599; public static final int CRATES_11600 = 11600; public static final int POTTERY_OVEN_11601 = 11601; public static final int STOOL_11603 = 11603; public static final int STANDING_TORCH_11606 = 11606; public static final int STANDARD_11614 = 11614; public static final int STANDARD_11615 = 11615; public static final int DOOR_11616 = 11616; public static final int DOOR_11617 = 11617; public static final int TABLE_11619 = 11619; public static final int LONGHALL_DOOR = 11620; public static final int LONGHALL_DOOR_11621 = 11621; public static final int LONGHALL_DOOR_11624 = 11624; public static final int LONGHALL_DOOR_11625 = 11625; public static final int COUNTER_11626 = 11626; public static final int SMALL_TABLE_11627 = 11627; public static final int VINE_11629 = 11629; public static final int WALL_11630 = 11630; public static final int GAP_11631 = 11631; public static final int CRATE_11632 = 11632; public static final int ROUGH_WALL_11633 = 11633; public static final int ROOF_TOP_BEAMS = 11634; public static final int LADDER_11635 = 11635; public static final int TRAPDOOR_11636 = 11636; public static final int TRAPDOOR_11637 = 11637; public static final int HURDLE = 11638; public static final int HURDLE_11639 = 11639; public static final int HURDLE_11640 = 11640; public static final int SKULL_SLOPE = 11641; public static final int STEPPING_STONE_11643 = 11643; public static final int ZIP_LINE = 11644; public static final int ZIP_LINE_11645 = 11645; public static final int ZIP_LINE_11646 = 11646; public static final int ZIP_LINE_11647 = 11647; public static final int ZIP_LINE_11648 = 11648; public static final int ZIP_LINE_11649 = 11649; public static final int ZIP_LINE_11650 = 11650; public static final int GOAL = 11651; public static final int GOAL_11652 = 11652; public static final int GOAL_11653 = 11653; public static final int PIPE_11657 = 11657; public static final int TOWER_LADDER = 11661; public static final int TOWER_LADDER_11662 = 11662; public static final int TARGET_11663 = 11663; public static final int GUILD_DOOR = 11665; public static final int LADDER_11666 = 11666; public static final int TRAPDOOR_11667 = 11667; public static final int TRAPDOOR_11668 = 11668; public static final int BARREL_11669 = 11669; public static final int BARREL_11671 = 11671; public static final int BARREL_11672 = 11672; public static final int BARREL_11673 = 11673; public static final int BARREL_11674 = 11674; public static final int DWARVEN_STOUT = 11675; public static final int MATURE_DWARVEN_STOUT = 11676; public static final int ASGARNIAN_ALE = 11677; public static final int MATURE_ASGARNIAN_ALE = 11678; public static final int GREENMANS_ALE = 11679; public static final int MATURE_GREENMANS_ALE = 11680; public static final int WIZARDS_MIND_BOMB = 11681; public static final int MATURE_WIZARDS_MIND_BOMB = 11682; public static final int DRAGON_BITTER = 11683; public static final int MATURE_DRAGON_BITTER = 11684; public static final int MOONLIGHT_MEAD = 11685; public static final int MATURE_MOONLIGHT_MEAD = 11686; public static final int AXEMANS_FOLLY = 11687; public static final int MATURE_AXEMANS_FOLLY = 11688; public static final int CHEFS_DELIGHT = 11689; public static final int MATURE_CHEFS_DELIGHT = 11690; public static final int SLAYERS_RESPITE = 11691; public static final int MATURE_SLAYERS_RESPITE = 11692; public static final int CIDER = 11693; public static final int MATURE_CIDER = 11694; public static final int DAIRY_CHURN = 11695; public static final int DAIRY_CHURN_11696 = 11696; public static final int PIE_STALL = 11697; public static final int ZULANDRA_TELEPORT = 11701; public static final int TELESCOPE_11702 = 11702; public static final int DOOR_11719 = 11719; public static final int DOOR_11720 = 11720; public static final int GATE_11721 = 11721; public static final int GATE_11722 = 11722; public static final int DOOR_11723 = 11723; public static final int DOOR_11724 = 11724; public static final int DOOR_11725 = 11725; public static final int DOOR_11726 = 11726; public static final int DOOR_11727 = 11727; public static final int DOOR_11728 = 11728; public static final int SILK_STALL_11729 = 11729; public static final int BAKERS_STALL_11730 = 11730; public static final int GEM_STALL_11731 = 11731; public static final int FUR_STALL_11732 = 11732; public static final int SPICE_STALL_11733 = 11733; public static final int SILVER_STALL_11734 = 11734; public static final int CHEST_11735 = 11735; public static final int CHEST_11736 = 11736; public static final int CHEST_11737 = 11737; public static final int CHEST_11738 = 11738; public static final int CHEST_11739 = 11739; public static final int CHEST_11740 = 11740; public static final int CHEST_11741 = 11741; public static final int CHEST_11742 = 11742; public static final int VINE_11745 = 11745; public static final int VINE_11747 = 11747; public static final int GRAPE_VINE = 11748; public static final int GRAPE_VINE_11750 = 11750; public static final int GRAPE_VINE_11752 = 11752; public static final int GRAPE_VINE_11754 = 11754; public static final int GRAPE_VINE_11756 = 11756; public static final int GRAPE_VINE_11758 = 11758; public static final int DEAD_VINE = 11760; public static final int FAIRY_RING = 11761; public static final int SCAREGULL = 11762; public static final int DOOR_11763 = 11763; public static final int DOOR_11765 = 11765; public static final int GATE_11766 = 11766; public static final int GATE_11767 = 11767; public static final int STEPPING_STONE_11768 = 11768; public static final int GATE_11770 = 11770; public static final int GATE_11771 = 11771; public static final int DOOR_11772 = 11772; public static final int DOOR_11773 = 11773; public static final int DOOR_11774 = 11774; public static final int DOOR_11775 = 11775; public static final int DOOR_11776 = 11776; public static final int DOOR_11777 = 11777; public static final int DOOR_11778 = 11778; public static final int DOOR_11780 = 11780; public static final int DOOR_11781 = 11781; public static final int DOOR_11782 = 11782; public static final int DOOR_11783 = 11783; public static final int DOOR_11788 = 11788; public static final int STAIRCASE_11789 = 11789; public static final int STAIRCASE_11790 = 11790; public static final int STAIRCASE_11791 = 11791; public static final int STAIRCASE_11792 = 11792; public static final int STAIRCASE_11793 = 11793; public static final int LADDER_11794 = 11794; public static final int LADDER_11795 = 11795; public static final int STAIRCASE_11796 = 11796; public static final int STAIRCASE_11797 = 11797; public static final int STAIRCASE_11798 = 11798; public static final int STAIRCASE_11799 = 11799; public static final int STAIRCASE_11800 = 11800; public static final int LADDER_11801 = 11801; public static final int LADDER_11802 = 11802; public static final int LADDER_11803 = 11803; public static final int LADDER_11804 = 11804; public static final int STAIRCASE_11805 = 11805; public static final int LADDER_11806 = 11806; public static final int STAIRCASE_11807 = 11807; public static final int WINE_BARREL = 11808; public static final int WINE_BARREL_11809 = 11809; public static final int CAVE_EXIT_11831 = 11831; public static final int CAVE_ENTRANCE_11832 = 11832; public static final int CAVE_ENTRANCE_11833 = 11833; public static final int CAVE_ENTRANCE_11834 = 11834; public static final int CAVE_ENTRANCE_11835 = 11835; public static final int CAVE_EXIT_11836 = 11836; public static final int OPEN_HOT_VENT_DOOR = 11843; public static final int HOT_VENT_DOOR = 11844; public static final int HOT_VENT_DOOR_11845 = 11845; public static final int HOT_VENT_DOOR_11846 = 11846; public static final int SULPHUR_VENT = 11851; public static final int STANDARD_11861 = 11861; public static final int DWARF_BATH = 11862; public static final int WINCH_11863 = 11863; public static final int TRAPDOOR_11867 = 11867; public static final int DWARF_MULTICANNON_11868 = 11868; public static final int MULTICANNON_PARTS = 11869; public static final int MULTICANNON_PARTS_11870 = 11870; public static final int MULTICANNON_PARTS_11873 = 11873; public static final int MULTICANNON_PARTS_11874 = 11874; public static final int CANARY = 11875; public static final int BLACKSMITHS_TOOLS_11876 = 11876; public static final int BED_11877 = 11877; public static final int STAIRCASE_11888 = 11888; public static final int STAIRCASE_11889 = 11889; public static final int STAIRCASE_11890 = 11890; public static final int SINISTER_BARREL = 11891; public static final int TABLE_11892 = 11892; public static final int BOOKCASE_11893 = 11893; public static final int BOOKCASE_11894 = 11894; public static final int THORNS = 11895; public static final int THORNS_11896 = 11896; public static final int THORNS_11897 = 11897; public static final int CREATURE = 11910; public static final int BUSH_11911 = 11911; public static final int BUSH_11912 = 11912; public static final int BUSH_11913 = 11913; public static final int BUSH_11914 = 11914; public static final int ROCKSLIDE_11920 = 11920; public static final int ROCKSLIDE_11921 = 11921; public static final int ROCKSLIDE_11922 = 11922; public static final int ROCKSLIDE_11923 = 11923; public static final int ROCKS_11924 = 11924; public static final int EGG = 11926; public static final int ICE_COLUMN = 11930; public static final int ROCKSLIDE_11931 = 11931; public static final int ROCKSLIDE_11932 = 11932; public static final int ROCKSLIDE_11933 = 11933; public static final int ROCKSLIDE_11934 = 11934; public static final int COLUMN_11937 = 11937; public static final int COLUMN_11938 = 11938; public static final int COLUMN_11939 = 11939; public static final int COLUMN_11940 = 11940; public static final int COLUMN_11941 = 11941; public static final int COLUMN_11942 = 11942; public static final int STALACTITE_11943 = 11943; public static final int STALAGMITES_11944 = 11944; public static final int STALACTITE_11945 = 11945; public static final int STALAGMITES_11946 = 11946; public static final int CLIMBING_ROCKS_11948 = 11948; public static final int CLIMBING_ROCKS_11949 = 11949; public static final int STALACTITE_11950 = 11950; public static final int GATE_11951 = 11951; public static final int GATE_11952 = 11952; public static final int GATE_11953 = 11953; public static final int GATE_11954 = 11954; public static final int EGG_11966 = 11966; public static final int EGG_11967 = 11967; public static final int TZHAAR_STATUE = 11968; public static final int CRATE_11969 = 11969; public static final int CRATES_11970 = 11970; public static final int LAVA_FORGE = 11978; public static final int VIEWING_ORB = 11979; public static final int GATE_11987 = 11987; public static final int FAIRY_RING_12003 = 12003; public static final int A_GAP_THROUGH_THE_WALL = 12004; public static final int MUSHROOM_TORCH = 12005; public static final int MUSHROOM_TORCH_12006 = 12006; public static final int A_GAP_THROUGH_THE_WALL_12041 = 12041; public static final int A_WALL = 12042; public static final int A_WALL_12043 = 12043; public static final int MAGIC_DOOR_12045 = 12045; public static final int MAGIC_DOOR_12046 = 12046; public static final int MAGIC_DOOR_12047 = 12047; public static final int MAGIC_DOOR_12048 = 12048; public static final int POTION_SHELVES = 12060; public static final int POTION_SHELVES_12061 = 12061; public static final int POTION_SHELF = 12062; public static final int POTION_SHELF_12063 = 12063; public static final int HEALING_CERTIFICATE = 12064; public static final int CERTIFICATE_OF_HEALING = 12065; public static final int A_FAIRY_WORKBENCH = 12066; public static final int A_FAIRY_WORKBENCH_12067 = 12067; public static final int FAIRY_FOUNTAIN = 12089; public static final int FAIRY_QUEEN = 12090; public static final int FAIRY_QUEEN_THRONE = 12091; public static final int GODFATHER_THRONE = 12092; public static final int CHICKEN_SHRINE = 12093; public static final int FAIRY_RING_12094 = 12094; public static final int FAIRY_RING_12095 = 12095; public static final int FURNACE_12100 = 12100; public static final int RANGE_12102 = 12102; public static final int CRATE_12103 = 12103; public static final int CRATES_12104 = 12104; public static final int CRATE_12105 = 12105; public static final int TABLE_12106 = 12106; public static final int BARREL_12107 = 12107; public static final int TABLE_12108 = 12108; public static final int WALL_12109 = 12109; public static final int GAG_BANNER = 12110; public static final int DAIRY_COW_12111 = 12111; public static final int LADDER_12112 = 12112; public static final int LADDER_12113 = 12113; public static final int COW_WHEEL = 12114; public static final int SACKS_12115 = 12115; public static final int CLOSED_CHEST_12120 = 12120; public static final int OPEN_CHEST_12121 = 12121; public static final int WATER_TROUGH = 12122; public static final int GRAVESTONE_12125 = 12125; public static final int STAIRS_12131 = 12131; public static final int TOMB_12132 = 12132; public static final int JULIET = 12133; public static final int COFFIN_12134 = 12134; public static final int COFFIN_12135 = 12135; public static final int CHURCH_PEW_12140 = 12140; public static final int CANOE_STATION = 12144; public static final int CANOE_STATION_12145 = 12145; public static final int CANOE_STATION_12146 = 12146; public static final int CANOE_STATION_12147 = 12147; public static final int CANOE_STATION_12148 = 12148; public static final int CANOE_STATION_12149 = 12149; public static final int CANOE_STATION_12150 = 12150; public static final int CANOE_STATION_12151 = 12151; public static final int CANOE_STATION_12152 = 12152; public static final int CANOE_STATION_12153 = 12153; public static final int CANOE_STATION_12154 = 12154; public static final int CANOE_STATION_12155 = 12155; public static final int CANOE_STATION_12156 = 12156; public static final int CANOE_STATION_12157 = 12157; public static final int CANOE_STATION_12158 = 12158; public static final int A_SINKING_CANOE = 12159; public static final int A_SINKING_CANOE_12160 = 12160; public static final int A_SINKING_CANOE_12161 = 12161; public static final int A_SINKING_CANOE_12162 = 12162; public static final int WELL_12201 = 12201; public static final int MOLE_HILL = 12202; public static final int LIGHT_12203 = 12203; public static final int ROPE_12230 = 12230; public static final int VANILLA_PLANT = 12239; public static final int BONES_12240 = 12240; public static final int BONES_12241 = 12241; public static final int BONES_12242 = 12242; public static final int SKELETON_12243 = 12243; public static final int SKELETON_12244 = 12244; public static final int SKELETON_12245 = 12245; public static final int SKELETON_12246 = 12246; public static final int SKELETON_12247 = 12247; public static final int SKELETON_12248 = 12248; public static final int TUNNEL_ENTRANCE_12253 = 12253; public static final int TUNNEL_ENTRANCE_12254 = 12254; public static final int ROPE_12255 = 12255; public static final int NEST = 12256; public static final int DRAGON_EGG = 12257; public static final int DRAGONFIRE = 12258; public static final int NEST_12259 = 12259; public static final int PORTAL_12260 = 12260; public static final int BROKEN_CAGE = 12261; public static final int BROKEN_CAGE_12262 = 12262; public static final int STAIRS_12263 = 12263; public static final int STAIRS_12264 = 12264; public static final int CELLAR_STAIRS = 12265; public static final int TRAPDOOR_12267 = 12267; public static final int OPEN_TRAPDOOR = 12268; public static final int STOVE_12269 = 12269; public static final int SINK_12279 = 12279; public static final int LARGE_TABLE_12280 = 12280; public static final int SMALL_TABLE_12281 = 12281; public static final int BOOKCASE_12282 = 12282; public static final int GRANDFATHER_CLOCK_12293 = 12293; public static final int CANDLES_12301 = 12301; public static final int CANDLES_12302 = 12302; public static final int CHEST_12309 = 12309; public static final int CHAIR_12310 = 12310; public static final int CHAIR_12311 = 12311; public static final int CHAIR_12312 = 12312; public static final int CHAIR_12313 = 12313; public static final int BANQUET_TABLE = 12314; public static final int BANQUET_TABLE_12315 = 12315; public static final int BANQUET_TABLE_12316 = 12316; public static final int BANQUET_TABLE_12317 = 12317; public static final int CHAIR_12318 = 12318; public static final int CHAIR_12319 = 12319; public static final int PIRATE_PETE = 12320; public static final int DWARF = 12321; public static final int GENERAL_WARTFACE = 12322; public static final int GENERAL_BENTNOZE = 12323; public static final int LUMBRIDGE_GUIDE = 12324; public static final int EVIL_DAVE = 12325; public static final int SIR_AMIK_VARZE = 12326; public static final int AWOWOGEI_12327 = 12327; public static final int SKRACH_UGLOGWEE = 12328; public static final int DWARF_12330 = 12330; public static final int GENERAL_BENTNOZE_12332 = 12332; public static final int GENERAL_WARTFACE_12334 = 12334; public static final int PIRATE_PETE_12337 = 12337; public static final int LUMBRIDGE_GUIDE_12339 = 12339; public static final int EVIL_DAVE_12341 = 12341; public static final int SKRACH_UGLOGWEE_12343 = 12343; public static final int SIR_AMIK_VARZE_12345 = 12345; public static final int AWOWOGEI_12347 = 12347; public static final int DOOR_12348 = 12348; public static final int LARGE_DOOR_12349 = 12349; public static final int LARGE_DOOR_12350 = 12350; public static final int BARRIER_12351 = 12351; public static final int BARRIER_12352 = 12352; public static final int BARRIER_12353 = 12353; public static final int PORTAL_12355 = 12355; public static final int PORTAL_12356 = 12356; public static final int TABLE_12386 = 12386; public static final int TABLE_12387 = 12387; public static final int TABLE_12388 = 12388; public static final int LADDER_12389 = 12389; public static final int LADDER_12390 = 12390; public static final int LADDER_12391 = 12391; public static final int SACKS_12392 = 12392; public static final int SACKS_12393 = 12393; public static final int SACK_PILE = 12394; public static final int SACK_PILE_12395 = 12395; public static final int SACK_12396 = 12396; public static final int SACK_12399 = 12399; public static final int CAULDRON_12400 = 12400; public static final int CAULDRON_12401 = 12401; public static final int EXPLOSION = 12402; public static final int SHELVES_12403 = 12403; public static final int SHELVES_12404 = 12404; public static final int CUPBOARD_12405 = 12405; public static final int CUPBOARD_12406 = 12406; public static final int STOOL_12407 = 12407; public static final int STOOL_12408 = 12408; public static final int STOOL_12409 = 12409; public static final int SAUCEPAN = 12410; public static final int SAUCEPAN_12411 = 12411; public static final int ROLLING_PIN = 12412; public static final int ROLLING_PIN_12413 = 12413; public static final int SPORK = 12414; public static final int SPORK_12415 = 12415; public static final int BARREL_12434 = 12434; public static final int BARREL_12435 = 12435; public static final int STOOL_12440 = 12440; public static final int CRATE_12442 = 12442; public static final int CRATE_12443 = 12443; public static final int DOOR_12444 = 12444; public static final int DOOR_12445 = 12445; public static final int LARGE_DOOR_12446 = 12446; public static final int LARGE_DOOR_12447 = 12447; public static final int LARGE_DOOR_12448 = 12448; public static final int LARGE_DOOR_12449 = 12449; public static final int TABLE_12450 = 12450; public static final int CHEST_12451 = 12451; public static final int CHEST_12452 = 12452; public static final int SKULLS = 12453; public static final int UNDERWATER_CAVERN_ENTRANCE = 12460; public static final int UNDERWATER_CAVERN_ENTRANCE_12461 = 12461; public static final int UNDERWATER_CAVERN_ENTRANCE_12462 = 12462; public static final int UNDERWATER_CAVERN_ENTRANCE_12463 = 12463; public static final int PEN_DOOR = 12467; public static final int PEN_DOOR_12468 = 12468; public static final int ANCHOR_12474 = 12474; public static final int ANCHOR_12475 = 12475; public static final int ANCHOR_12476 = 12476; public static final int KELP = 12477; public static final int KELP_12478 = 12478; public static final int CORAL_REEF = 12479; public static final int CORAL = 12480; public static final int CORAL_12481 = 12481; public static final int CORAL_12482 = 12482; public static final int CORAL_12483 = 12483; public static final int CORAL_12484 = 12484; public static final int CORAL_12485 = 12485; public static final int CORAL_12486 = 12486; public static final int CORAL_12487 = 12487; public static final int CORAL_12488 = 12488; public static final int CORAL_12489 = 12489; public static final int CORAL_12490 = 12490; public static final int CORAL_12491 = 12491; public static final int CORAL_12492 = 12492; public static final int CORAL_12493 = 12493; public static final int CORAL_12494 = 12494; public static final int CORAL_12495 = 12495; public static final int CORAL_12496 = 12496; public static final int CORAL_12497 = 12497; public static final int CORAL_12498 = 12498; public static final int CORAL_REEF_12499 = 12499; public static final int CORAL_12500 = 12500; public static final int CORAL_12501 = 12501; public static final int CORAL_12502 = 12502; public static final int CORAL_12503 = 12503; public static final int CORAL_12504 = 12504; public static final int CORAL_12505 = 12505; public static final int CORAL_12506 = 12506; public static final int CORAL_12507 = 12507; public static final int CORAL_12508 = 12508; public static final int CORAL_REEF_12509 = 12509; public static final int CORAL_12510 = 12510; public static final int CORAL_12511 = 12511; public static final int CORAL_12512 = 12512; public static final int CORAL_12513 = 12513; public static final int CORAL_12514 = 12514; public static final int CORAL_12515 = 12515; public static final int CORAL_12516 = 12516; public static final int CORAL_12517 = 12517; public static final int CORAL_12518 = 12518; public static final int CORAL_12519 = 12519; public static final int CORAL_REEF_12520 = 12520; public static final int CORAL_12521 = 12521; public static final int CORAL_12522 = 12522; public static final int CORAL_12523 = 12523; public static final int CORAL_12524 = 12524; public static final int CORAL_12525 = 12525; public static final int CORAL_12526 = 12526; public static final int CORAL_12527 = 12527; public static final int CORAL_12528 = 12528; public static final int CORAL_12529 = 12529; public static final int ANCHOR_12530 = 12530; public static final int BUBBLES = 12531; public static final int STAIRCASE_12536 = 12536; public static final int STAIRCASE_12537 = 12537; public static final int STAIRCASE_12538 = 12538; public static final int BOOKCASE_12539 = 12539; public static final int BOOKCASE_12540 = 12540; public static final int TABLE_12541 = 12541; public static final int LARGE_TABLE_12543 = 12543; public static final int TABLE_12544 = 12544; public static final int BOXES_12545 = 12545; public static final int CRATE_12546 = 12546; public static final int CRATE_12547 = 12547; public static final int CRATES_12548 = 12548; public static final int OLD_TREE = 12550; public static final int OLD_TREE_12551 = 12551; public static final int OLD_TREE_12552 = 12552; public static final int OLD_TREE_12553 = 12553; public static final int CRUDE_BOAT = 12554; public static final int ROOTS_12555 = 12555; public static final int ROCK_AND_STRING = 12556; public static final int ROCK_AND_STRING_12557 = 12557; public static final int TREE_12559 = 12559; public static final int TREE_12560 = 12560; public static final int OGRE_SPITROAST_12561 = 12561; public static final int OGRE_SPITROAST_12562 = 12562; public static final int OGRE_SPITROAST_12563 = 12563; public static final int PILE_OF_ROCK_12564 = 12564; public static final int PILE_OF_ROCK_12565 = 12565; public static final int PILE_OF_ROCK_12566 = 12566; public static final int PILE_OF_ROCK_12567 = 12567; public static final int STALAGMITE_12568 = 12568; public static final int STALACTITE_12573 = 12573; public static final int STALAGMITE_12575 = 12575; public static final int STALAGMITE_12576 = 12576; public static final int STALACTITE_12577 = 12577; public static final int STALAGMITE_12578 = 12578; public static final int BOULDER_12579 = 12579; public static final int EERIE_STATUE_12580 = 12580; public static final int ROCKSLIDE_12582 = 12582; public static final int ROCKSLIDE_12583 = 12583; public static final int ROCKSLIDE_12584 = 12584; public static final int ROCKSLIDE_12585 = 12585; public static final int ROCK_12588 = 12588; public static final int ROCK_12589 = 12589; public static final int ROCKS_12590 = 12590; public static final int ROCKSLIDE_12591 = 12591; public static final int ROCKSLIDE_12592 = 12592; public static final int ROCKSLIDE_12593 = 12593; public static final int ROCKSLIDE_12594 = 12594; public static final int BRONZE_AXE = 12604; public static final int SINK_12609 = 12609; public static final int WASHBASIN = 12610; public static final int RANGE_12611 = 12611; public static final int TABLE_12612 = 12612; public static final int GATE_12617 = 12617; public static final int GATE_12639 = 12639; public static final int SMALL_FURNACE_12655 = 12655; public static final int HOLE_12656 = 12656; public static final int DOOR_12657 = 12657; public static final int DOOR_12658 = 12658; public static final int BRIDGE_12683 = 12683; public static final int BRIDGE_12684 = 12684; public static final int GATE_12719 = 12719; public static final int COLONY_GATE = 12723; public static final int COLONY_GATE_12725 = 12725; public static final int TABLE_12734 = 12734; public static final int CLOSED_CHEST_12735 = 12735; public static final int OPEN_CHEST_12736 = 12736; public static final int BROKEN_DOWN_WALL = 12737; public static final int RUBBLE_12739 = 12739; public static final int RUBBLE_12740 = 12740; public static final int FALLEN_WALL = 12741; public static final int RUBBLE_12742 = 12742; public static final int TRAPDOOR_12744 = 12744; public static final int TRAPDOOR_12745 = 12745; public static final int RUBBLE_12746 = 12746; public static final int PILE_OF_RUBBLE = 12747; public static final int LADDER_12748 = 12748; public static final int RUBBLE_PILE = 12749; public static final int PLAQUE_12750 = 12750; public static final int DOOR_12761 = 12761; public static final int TRAPDOOR_12763 = 12763; public static final int LADDER_12764 = 12764; public static final int KEYHOLE = 12765; public static final int BOOKCASE_12766 = 12766; public static final int BOOKCASE_12767 = 12767; public static final int CLOSED_CHEST_12768 = 12768; public static final int OPEN_CHEST_12769 = 12769; public static final int CAVE_ENTRANCE_12770 = 12770; public static final int CAVE_ENTRANCE_12771 = 12771; public static final int WOODEN_BOARDS_12773 = 12773; public static final int ROCK_12774 = 12774; public static final int MARIUS = 12775; public static final int LOW_FENCE = 12776; public static final int TRAPDOOR_12777 = 12777; public static final int TRAPDOOR_12778 = 12778; public static final int LADDER_12779 = 12779; public static final int LADDER_12780 = 12780; public static final int LADDER_12781 = 12781; public static final int BROKEN_ROOF = 12782; public static final int REPAIRED_ROOF = 12783; public static final int BUCKET_12784 = 12784; public static final int BUCKET_12785 = 12785; public static final int REPAIRED_WALL = 12786; public static final int DAMAGED_WALL = 12787; public static final int FIRE_12796 = 12796; public static final int BANK_BOOTH_12798 = 12798; public static final int BANK_BOOTH_12799 = 12799; public static final int BANK_BOOTH_12800 = 12800; public static final int BANK_BOOTH_12801 = 12801; public static final int TOMB_12802 = 12802; public static final int BARREL_12804 = 12804; public static final int BROKEN_FURNACE = 12806; public static final int REPAIRED_FURNACE = 12807; public static final int REPAIRED_FURNACE_12808 = 12808; public static final int FURNACE_12809 = 12809; public static final int RUBBLE_12812 = 12812; public static final int RUBBLE_12813 = 12813; public static final int RUBBLE_12814 = 12814; public static final int RUBBLE_12815 = 12815; public static final int GATE_12816 = 12816; public static final int GATE_12817 = 12817; public static final int GATE_12818 = 12818; public static final int EXIT_PATH = 12820; public static final int PILE_OF_BRICKS_12844 = 12844; public static final int TABLE_12855 = 12855; public static final int STORE_DOOR = 12856; public static final int BAR_PUMPS_12857 = 12857; public static final int TRAPDOOR_12872 = 12872; public static final int BOOKCASE_12873 = 12873; public static final int CRATE_12874 = 12874; public static final int WHEELBARROW_12875 = 12875; public static final int CRATE_12876 = 12876; public static final int CRATES_12877 = 12877; public static final int BOXES_12878 = 12878; public static final int CRATE_12879 = 12879; public static final int BED_12880 = 12880; public static final int BOOKCASE_12881 = 12881; public static final int BOOKCASE_12882 = 12882; public static final int BOOKCASE_12883 = 12883; public static final int TABLE_12884 = 12884; public static final int CHAIR_12885 = 12885; public static final int CHAIR_12886 = 12886; public static final int CHAIR_12887 = 12887; public static final int CHAIR_12888 = 12888; public static final int SMASHED_CHAIR_12889 = 12889; public static final int BARREL_12890 = 12890; public static final int BARREL_12891 = 12891; public static final int SMALL_TABLE_12892 = 12892; public static final int TREE_STUMP_12894 = 12894; public static final int TREE_12895 = 12895; public static final int TREE_12896 = 12896; public static final int WELL_12897 = 12897; public static final int LADDER_12906 = 12906; public static final int LADDER_12907 = 12907; public static final int COUNTER_12933 = 12933; public static final int FOUNTAIN_12941 = 12941; public static final int SQIRK_TREE = 12943; public static final int CRATE_12961 = 12961; public static final int TABLE_12962 = 12962; public static final int CRATE_12963 = 12963; public static final int LADDER_12964 = 12964; public static final int LADDER_12965 = 12965; public static final int LADDER_12966 = 12966; public static final int BARREL_12967 = 12967; public static final int BARREL_12968 = 12968; public static final int COOKING_POT_12969 = 12969; public static final int BED_12970 = 12970; public static final int TABLE_12971 = 12971; public static final int TABLE_12972 = 12972; public static final int CHAIR_12973 = 12973; public static final int SINK_12974 = 12974; public static final int CRATE_12977 = 12977; public static final int CRATE_12978 = 12978; public static final int ROCKING_CHAIR_12979 = 12979; public static final int SHELVES_12980 = 12980; public static final int HAT_STAND_12981 = 12981; public static final int STILE_12982 = 12982; public static final int GATE_12986 = 12986; public static final int GATE_12987 = 12987; public static final int GATE_12988 = 12988; public static final int GATE_12989 = 12989; public static final int DOOR_13001 = 13001; public static final int DOOR_13002 = 13002; public static final int CLOSED_CHEST_13003 = 13003; public static final int OPEN_CHEST_13004 = 13004; public static final int DOOR_13006 = 13006; public static final int DOOR_13007 = 13007; public static final int DOOR_13008 = 13008; public static final int DOOR_13009 = 13009; public static final int DOOR_13015 = 13015; public static final int DOOR_13016 = 13016; public static final int DOOR_13017 = 13017; public static final int DOOR_13018 = 13018; public static final int LARGE_DOOR_13094 = 13094; public static final int LARGE_DOOR_13095 = 13095; public static final int LARGE_DOOR_13096 = 13096; public static final int LARGE_DOOR_13097 = 13097; public static final int DOOR_13100 = 13100; public static final int DOOR_13101 = 13101; public static final int DOOR_13102 = 13102; public static final int DOOR_13103 = 13103; public static final int HAZELMERE_STATUE = 13104; public static final int GLOUPHRIE_STATUE = 13105; public static final int GLOUPHRIE_STATUE_13106 = 13106; public static final int DOOR_13107 = 13107; public static final int DOOR_13108 = 13108; public static final int DOOR_13109 = 13109; public static final int DOOR_13110 = 13110; public static final int ORNAMENT = 13114; public static final int GOBLIN_CROWD = 13115; public static final int DOOR_13118 = 13118; public static final int DOOR_13119 = 13119; public static final int DOOR_13120 = 13120; public static final int DOOR_13121 = 13121; public static final int BOXING_MAT = 13126; public static final int BOXING_MAT_13127 = 13127; public static final int BOXING_MAT_13128 = 13128; public static final int BOXING_RING = 13129; public static final int BOXING_RING_13130 = 13130; public static final int BOXING_RING_13131 = 13131; public static final int BOXING_RING_13132 = 13132; public static final int FENCING_RING = 13133; public static final int FENCING_RING_13134 = 13134; public static final int FENCING_RING_13135 = 13135; public static final int FENCING_RING_13136 = 13136; public static final int COMBAT_RING = 13137; public static final int COMBAT_RING_13138 = 13138; public static final int COMBAT_RING_13139 = 13139; public static final int COMBAT_RING_13140 = 13140; public static final int NOTHING_13141 = 13141; public static final int BALANCE_BEAM = 13142; public static final int BALANCE_BEAM_13143 = 13143; public static final int BALANCE_BEAM_13144 = 13144; public static final int MAGIC_BARRIER_13145 = 13145; public static final int MAGIC_BARRIER_13146 = 13146; public static final int RANGING_SPOT = 13147; public static final int BED_13148 = 13148; public static final int BED_13149 = 13149; public static final int BED_13150 = 13150; public static final int BED_13151 = 13151; public static final int BED_13152 = 13152; public static final int BED_13153 = 13153; public static final int BED_13154 = 13154; public static final int SHOE_BOX = 13155; public static final int OAK_DRAWERS = 13156; public static final int OAK_WARDROBE = 13157; public static final int TEAK_DRAWERS = 13158; public static final int TEAK_WARDROBE = 13159; public static final int MAHOGANY_WARDROBE = 13160; public static final int GILDED_WARDROBE = 13161; public static final int SHAVING_STAND = 13162; public static final int SHAVING_STAND_13163 = 13163; public static final int DRESSER_13164 = 13164; public static final int DRESSER_13165 = 13165; public static final int DRESSER_13166 = 13166; public static final int DRESSER_13167 = 13167; public static final int DRESSER_13168 = 13168; public static final int CLOCK_13169 = 13169; public static final int CLOCK_13170 = 13170; public static final int CLOCK_13171 = 13171; public static final int SYMBOL_OF_SARADOMIN = 13172; public static final int SYMBOL_OF_ZAMORAK = 13173; public static final int SYMBOL_OF_GUTHIX = 13174; public static final int ICON_OF_SARADOMIN = 13175; public static final int ICON_OF_ZAMORAK = 13176; public static final int ICON_OF_GUTHIX = 13177; public static final int ICON_OF_BOB = 13178; public static final int ALTAR_13179 = 13179; public static final int ALTAR_13180 = 13180; public static final int ALTAR_13181 = 13181; public static final int ALTAR_13182 = 13182; public static final int ALTAR_13183 = 13183; public static final int ALTAR_13184 = 13184; public static final int ALTAR_13185 = 13185; public static final int ALTAR_13186 = 13186; public static final int ALTAR_13187 = 13187; public static final int ALTAR_13188 = 13188; public static final int ALTAR_13189 = 13189; public static final int ALTAR_13190 = 13190; public static final int ALTAR_13191 = 13191; public static final int ALTAR_13192 = 13192; public static final int ALTAR_13193 = 13193; public static final int ALTAR_13194 = 13194; public static final int ALTAR_13195 = 13195; public static final int ALTAR_13196 = 13196; public static final int ALTAR_13197 = 13197; public static final int ALTAR_13198 = 13198; public static final int ALTAR_13199 = 13199; public static final int TORCH_13200 = 13200; public static final int TORCH_13201 = 13201; public static final int TORCH_13202 = 13202; public static final int TORCH_13203 = 13203; public static final int TORCH_13204 = 13204; public static final int TORCH_13205 = 13205; public static final int TORCH_13206 = 13206; public static final int TORCH_13207 = 13207; public static final int INCENSE_BURNER = 13208; public static final int INCENSE_BURNER_13209 = 13209; public static final int INCENSE_BURNER_13210 = 13210; public static final int INCENSE_BURNER_13211 = 13211; public static final int INCENSE_BURNER_13212 = 13212; public static final int INCENSE_BURNER_13213 = 13213; public static final int WINDCHIMES = 13214; public static final int BELLS = 13215; public static final int ORGAN = 13216; public static final int SHUTTERED_WINDOW = 13217; public static final int DECORATIVE_WINDOW = 13218; public static final int STAINEDGLASS_WINDOW = 13219; public static final int DECORATIVE_WINDOW_13220 = 13220; public static final int STAINEDGLASS_WINDOW_13221 = 13221; public static final int DECORATIVE_WINDOW_13222 = 13222; public static final int STAINEDGLASS_WINDOW_13223 = 13223; public static final int DECORATIVE_WINDOW_13224 = 13224; public static final int STAINEDGLASS_WINDOW_13225 = 13225; public static final int SHUTTERED_WINDOW_13226 = 13226; public static final int DECORATIVE_WINDOW_13227 = 13227; public static final int STAINEDGLASS_WINDOW_13228 = 13228; public static final int DECORATIVE_WINDOW_13229 = 13229; public static final int STAINEDGLASS_WINDOW_13230 = 13230; public static final int DECORATIVE_WINDOW_13231 = 13231; public static final int STAINEDGLASS_WINDOW_13232 = 13232; public static final int DECORATIVE_WINDOW_13233 = 13233; public static final int STAINEDGLASS_WINDOW_13234 = 13234; public static final int SHUTTERED_WINDOW_13235 = 13235; public static final int DECORATIVE_WINDOW_13236 = 13236; public static final int STAINEDGLASS_WINDOW_13237 = 13237; public static final int DECORATIVE_WINDOW_13238 = 13238; public static final int STAINEDGLASS_WINDOW_13239 = 13239; public static final int DECORATIVE_WINDOW_13240 = 13240; public static final int STAINEDGLASS_WINDOW_13241 = 13241; public static final int DECORATIVE_WINDOW_13242 = 13242; public static final int STAINEDGLASS_WINDOW_13243 = 13243; public static final int SHUTTERED_WINDOW_13244 = 13244; public static final int DECORATIVE_WINDOW_13245 = 13245; public static final int STAINEDGLASS_WINDOW_13246 = 13246; public static final int DECORATIVE_WINDOW_13247 = 13247; public static final int STAINEDGLASS_WINDOW_13248 = 13248; public static final int DECORATIVE_WINDOW_13249 = 13249; public static final int STAINEDGLASS_WINDOW_13250 = 13250; public static final int DECORATIVE_WINDOW_13251 = 13251; public static final int STAINEDGLASS_WINDOW_13252 = 13252; public static final int SHUTTERED_WINDOW_13253 = 13253; public static final int DECORATIVE_WINDOW_13254 = 13254; public static final int STAINEDGLASS_WINDOW_13255 = 13255; public static final int DECORATIVE_WINDOW_13256 = 13256; public static final int STAINEDGLASS_WINDOW_13257 = 13257; public static final int DECORATIVE_WINDOW_13258 = 13258; public static final int STAINEDGLASS_WINDOW_13259 = 13259; public static final int DECORATIVE_WINDOW_13260 = 13260; public static final int STAINEDGLASS_WINDOW_13261 = 13261; public static final int SHUTTERED_WINDOW_13262 = 13262; public static final int DECORATIVE_WINDOW_13263 = 13263; public static final int STAINEDGLASS_WINDOW_13264 = 13264; public static final int DECORATIVE_WINDOW_13265 = 13265; public static final int STAINEDGLASS_WINDOW_13266 = 13266; public static final int DECORATIVE_WINDOW_13267 = 13267; public static final int STAINEDGLASS_WINDOW_13268 = 13268; public static final int DECORATIVE_WINDOW_13269 = 13269; public static final int STAINEDGLASS_WINDOW_13270 = 13270; public static final int STATUE_13271 = 13271; public static final int STATUE_13272 = 13272; public static final int STATUE_13273 = 13273; public static final int STATUE_13274 = 13274; public static final int STATUE_13275 = 13275; public static final int STATUE_13276 = 13276; public static final int STATUE_13277 = 13277; public static final int STATUE_13278 = 13278; public static final int STATUE_13279 = 13279; public static final int STATUE_13280 = 13280; public static final int STATUE_13281 = 13281; public static final int STATUE_13282 = 13282; public static final int WOODEN_CRATE = 13283; public static final int WOODEN_CRATE_13284 = 13284; public static final int OAK_CHEST = 13285; public static final int OAK_CHEST_13286 = 13286; public static final int TEAK_CHEST = 13287; public static final int TEAK_CHEST_13288 = 13288; public static final int MAHOGANY_CHEST = 13289; public static final int MAHOGANY_CHEST_13290 = 13290; public static final int MAGIC_CHEST = 13291; public static final int MAGIC_CHEST_13292 = 13292; public static final int WOODEN_TABLE_13293 = 13293; public static final int OAK_TABLE = 13294; public static final int OAK_TABLE_13295 = 13295; public static final int TEAK_TABLE_13296 = 13296; public static final int TEAK_TABLE_13297 = 13297; public static final int MAHOGANY_TABLE = 13298; public static final int OPULENT_TABLE = 13299; public static final int WOODEN_BENCH = 13300; public static final int OAK_BENCH = 13301; public static final int CARVED_OAK_BENCH = 13302; public static final int TEAK_BENCH = 13303; public static final int CARVED_TEAK_BENCH = 13304; public static final int MAHOGANY_BENCH = 13305; public static final int GILDED_BENCH = 13306; public static final int ROPE_BELLPULL = 13307; public static final int BELLPULL = 13308; public static final int POSH_BELLPULL = 13309; public static final int SKELETON_13310 = 13310; public static final int PIPE_13311 = 13311; public static final int BLOOD = 13312; public static final int CAGE_13313 = 13313; public static final int DOOR_13314 = 13314; public static final int DOOR_13315 = 13315; public static final int CAGE_13316 = 13316; public static final int DOOR_13317 = 13317; public static final int DOOR_13318 = 13318; public static final int CAGE_13319 = 13319; public static final int DOOR_13320 = 13320; public static final int DOOR_13321 = 13321; public static final int CAGE_13322 = 13322; public static final int DOOR_13323 = 13323; public static final int DOOR_13324 = 13324; public static final int CAGE_13325 = 13325; public static final int DOOR_13326 = 13326; public static final int DOOR_13327 = 13327; public static final int LADDER_13328 = 13328; public static final int LADDER_13329 = 13329; public static final int LADDER_13330 = 13330; public static final int SLIMY_WATER = 13331; public static final int SLIMY_WATER_13332 = 13332; public static final int SLIMY_WATER_13333 = 13333; public static final int SPIKES = 13334; public static final int SPIKES_13335 = 13335; public static final int SPIKES_13336 = 13336; public static final int FIRE_13337 = 13337; public static final int FLOOR_13338 = 13338; public static final int FLOOR_13339 = 13339; public static final int FLOOR_13340 = 13340; public static final int TORCH_13341 = 13341; public static final int CANDLE = 13342; public static final int SKULL = 13343; public static final int DOOR_13344 = 13344; public static final int DOOR_13345 = 13345; public static final int DOOR_13346 = 13346; public static final int DOOR_13347 = 13347; public static final int DOOR_13348 = 13348; public static final int DOOR_13349 = 13349; public static final int DOOR_13350 = 13350; public static final int DOOR_13351 = 13351; public static final int DOOR_13352 = 13352; public static final int DOOR_13353 = 13353; public static final int DOOR_13354 = 13354; public static final int DOOR_13355 = 13355; public static final int SPIKE_TRAP = 13356; public static final int MAN_TRAP = 13357; public static final int TANGLE_VINE = 13358; public static final int MARBLE_TRAP = 13359; public static final int TELEPORT_TRAP = 13360; public static final int SPIKE_HIDDEN = 13361; public static final int MAN_HIDDEN = 13362; public static final int TANGLE_HIDDEN = 13363; public static final int MARBLE_HIDDEN = 13364; public static final int TELEPORT_HIDDEN = 13365; public static final int BONES_13366 = 13366; public static final int GUARD_DOG = 13367; public static final int HOBGOBLIN = 13368; public static final int TROLL = 13369; public static final int HUGE_SPIDER = 13370; public static final int BABY_RED_DRAGON = 13372; public static final int ROCNAR = 13373; public static final int KALPHITE_SOLDIER = 13374; public static final int STEEL_DRAGON = 13375; public static final int DAGANNOTH = 13376; public static final int TOKXIL = 13377; public static final int DEMON = 13378; public static final int TREASURE_HUNT_FAIRY_HOUSE = 13379; public static final int TREASURE_HUNT_FAIRY_HOUSE_13380 = 13380; public static final int GLOVE_RACK = 13381; public static final int WEAPONS_RACK = 13382; public static final int WEAPONS_RACK_13383 = 13383; public static final int OAK_PRIZE_CHEST = 13384; public static final int OAK_PRIZE_CHEST_13385 = 13385; public static final int TEAK_PRIZE_CHEST = 13386; public static final int TEAK_PRIZE_CHEST_13387 = 13387; public static final int MAHOGANY_PRIZE_CHEST = 13388; public static final int MAHOGANY_PRIZE_CHEST_13389 = 13389; public static final int JACKY_JESTER = 13390; public static final int JACKY_JESTER_13391 = 13391; public static final int ATTACK_STONE = 13392; public static final int ATTACK_STONE_13393 = 13393; public static final int ATTACK_STONE_13394 = 13394; public static final int ELEMENTAL_BALANCE = 13395; public static final int ELEMENTAL_BALANCE_13396 = 13396; public static final int ELEMENTAL_BALANCE_13397 = 13397; public static final int STICK = 13398; public static final int STICK_AND_HOOP = 13399; public static final int DARTBOARD = 13400; public static final int DARTBOARD_13401 = 13401; public static final int ARCHERY_TARGET = 13402; public static final int ARCHERY_TARGET_13403 = 13403; public static final int HANGMAN_GAME = 13404; public static final int SQIRK_TREE_13405 = 13405; public static final int SQIRK_TREE_13406 = 13406; public static final int SQIRK_TREE_13407 = 13407; public static final int SHAYZIEN_BANNER = 13430; public static final int SHAYZIEN_BANNER_13432 = 13432; public static final int SHAYZIEN_BANNER_13433 = 13433; public static final int SHAYZIEN_SNAPPED_BANNER = 13434; public static final int GABION_DEFENCE = 13435; public static final int SPIKE_DEFENCE = 13436; public static final int SPIKE_DEFENCE_13437 = 13437; public static final int SPIKE_DEFENCE_13438 = 13438; public static final int TABLE_BLOCKADE = 13439; public static final int TABLE_BLOCKADE_13440 = 13440; public static final int KOUREND_SIGIL = 13465; public static final int FISHING_SPOT_13476 = 13476; public static final int CRAWLING_HAND = 13481; public static final int COCKATRICE_HEAD = 13482; public static final int BASILISK_HEAD = 13483; public static final int KURASK_HEAD_13484 = 13484; public static final int ABYSSAL_DEMON_HEAD = 13485; public static final int KBD_HEADS = 13486; public static final int KQ_HEAD = 13487; public static final int MOUNTED_SEA_BASS_13488 = 13488; public static final int MOUNTED_SWORDFISH_13489 = 13489; public static final int MOUNTED_SHARK = 13490; public static final int MITHRIL_ARMOUR = 13491; public static final int ADAMANT_ARMOUR = 13492; public static final int RUNE_ARMOUR = 13493; public static final int RED_CASTLEWARS_ARMOUR = 13494; public static final int WHITE_CASTLEWARS_ARMOUR = 13495; public static final int GOLD_CASTLEWARS_ARMOUR = 13496; public static final int STAIRCASE_13497 = 13497; public static final int STAIRCASE_13498 = 13498; public static final int STAIRCASE_13499 = 13499; public static final int STAIRCASE_13500 = 13500; public static final int STAIRCASE_13501 = 13501; public static final int STAIRCASE_13502 = 13502; public static final int STAIRCASE_13503 = 13503; public static final int STEPPING_STONE_13504 = 13504; public static final int STAIRCASE_13505 = 13505; public static final int RUNE_DISPLAY_CASE = 13507; public static final int RUNE_DISPLAY_CASE_13508 = 13508; public static final int RUNE_DISPLAY_CASE_13509 = 13509; public static final int PORTRAIT_13510 = 13510; public static final int PORTRAIT_13511 = 13511; public static final int PAINTING_13512 = 13512; public static final int PORTRAIT_13513 = 13513; public static final int DESERT_PAINTING = 13514; public static final int ISAFDAR_PAINTING = 13515; public static final int KARAMJA_PAINTING = 13516; public static final int LUMBRIDGE_PAINTING = 13517; public static final int MORYTANIA_PAINTING = 13518; public static final int SILVERLIGHT = 13519; public static final int DARKLIGHT = 13520; public static final int EXCALIBUR = 13521; public static final int ANTIDRAGON_BREATH_SHIELD = 13522; public static final int AMULET_OF_GLORY = 13523; public static final int CAPE_OF_LEGENDS = 13524; public static final int MAP = 13525; public static final int MAP_13526 = 13526; public static final int MAP_13527 = 13527; public static final int FIREPIT = 13528; public static final int FIREPIT_WITH_HOOK = 13529; public static final int FIREPIT_WITH_HOOK_13530 = 13530; public static final int FIREPIT_WITH_POT = 13531; public static final int FIREPIT_WITH_POT_13532 = 13532; public static final int SMALL_OVEN = 13533; public static final int SMALL_OVEN_13534 = 13534; public static final int SMALL_OVEN_13535 = 13535; public static final int LARGE_OVEN = 13536; public static final int LARGE_OVEN_13537 = 13537; public static final int LARGE_OVEN_13538 = 13538; public static final int STEEL_RANGE = 13539; public static final int STEEL_RANGE_13540 = 13540; public static final int STEEL_RANGE_13541 = 13541; public static final int FANCY_RANGE = 13542; public static final int FANCY_RANGE_13543 = 13543; public static final int FANCY_RANGE_13544 = 13544; public static final int SHELVES_13545 = 13545; public static final int SHELVES_13546 = 13546; public static final int SHELVES_13547 = 13547; public static final int SHELVES_13548 = 13548; public static final int SHELVES_13549 = 13549; public static final int SHELVES_13550 = 13550; public static final int SHELVES_13551 = 13551; public static final int SHELVES_13552 = 13552; public static final int SHELVES_13553 = 13553; public static final int SHELVES_13554 = 13554; public static final int SHELVES_13555 = 13555; public static final int SHELVES_13556 = 13556; public static final int SHELVES_13557 = 13557; public static final int SHELVES_13558 = 13558; public static final int PUMP_AND_DRAIN_13559 = 13559; public static final int PUMP_AND_DRAIN_13560 = 13560; public static final int PUMP_AND_TUB = 13561; public static final int PUMP_AND_TUB_13562 = 13562; public static final int SINK_13563 = 13563; public static final int SINK_13564 = 13564; public static final int LARDER_13565 = 13565; public static final int LARDER_13566 = 13566; public static final int LARDER_13567 = 13567; public static final int BEER_BARREL = 13568; public static final int CIDER_BARREL = 13569; public static final int ASGARNIAN_ALE_13570 = 13570; public static final int GREENMANS_ALE_13571 = 13571; public static final int DRAGON_BITTER_13572 = 13572; public static final int CHEFS_DELIGHT_13573 = 13573; public static final int PET_BLANKET = 13574; public static final int PET_BASKET = 13575; public static final int PET_BASKET_13576 = 13576; public static final int WOODEN_TABLE_13577 = 13577; public static final int OAK_TABLE_13578 = 13578; public static final int TEAK_TABLE_13579 = 13579; public static final int PET_BLANKET_13580 = 13580; public static final int BROKEN_WALL_13583 = 13583; public static final int BROKEN_WALL_13584 = 13584; public static final int BROKEN_WALL_13585 = 13585; public static final int PATCHED_WALL_13586 = 13586; public static final int PATCHED_WALL_13587 = 13587; public static final int PATCHED_WALL_13588 = 13588; public static final int COGS_13589 = 13589; public static final int JUNK = 13590; public static final int FISHING_WEIGHTS = 13591; public static final int METAL_PRESS = 13592; public static final int METAL_PRESS_13593 = 13593; public static final int FIREBOX = 13594; public static final int FIREBOX_13595 = 13595; public static final int FIREBOX_13596 = 13596; public static final int SHELVES_13597 = 13597; public static final int CRATES_13598 = 13598; public static final int CRATES_13599 = 13599; public static final int BARREL_13600 = 13600; public static final int LARGE_BARREL = 13601; public static final int RACK_OF_BARRELS = 13602; public static final int LARGE_BARREL_13603 = 13603; public static final int BARROW = 13604; public static final int BARROW_13605 = 13605; public static final int BARROW_13606 = 13606; public static final int HERMANS_DESK = 13607; public static final int NET = 13608; public static final int NET_13609 = 13609; public static final int LUMBRIDGE_PORTAL = 13616; public static final int FALADOR_PORTAL = 13617; public static final int ARDOUGNE_PORTAL = 13619; public static final int FAIRY_RING_13621 = 13621; public static final int LUMBRIDGE_PORTAL_13623 = 13623; public static final int FALADOR_PORTAL_13624 = 13624; public static final int ARDOUGNE_PORTAL_13626 = 13626; public static final int FAIRY_RING_13628 = 13628; public static final int LUMBRIDGE_PORTAL_13630 = 13630; public static final int FALADOR_PORTAL_13631 = 13631; public static final int ARDOUGNE_PORTAL_13633 = 13633; public static final int FAIRY_RING_13635 = 13635; public static final int PORTAL_FRAME = 13636; public static final int PORTAL_FRAME_13637 = 13637; public static final int PORTAL_FRAME_13638 = 13638; public static final int SCRYING_POOL = 13639; public static final int TELEPORTATION_FOCUS = 13640; public static final int GREATER_TELEPORT_FOCUS = 13641; public static final int LECTERN_13642 = 13642; public static final int LECTERN_13643 = 13643; public static final int LECTERN_13644 = 13644; public static final int LECTERN_13645 = 13645; public static final int LECTERN_13646 = 13646; public static final int LECTERN_13647 = 13647; public static final int LECTERN_13648 = 13648; public static final int GLOBE = 13649; public static final int ORNAMENTAL_GLOBE = 13650; public static final int LUNAR_GLOBE = 13651; public static final int CELESTIAL_GLOBE = 13652; public static final int ARMILLARY_SPHERE = 13653; public static final int SMALL_ORRERY = 13654; public static final int LARGE_ORRERY = 13655; public static final int TELESCOPE_13656 = 13656; public static final int TELESCOPE_13657 = 13657; public static final int TELESCOPE_13658 = 13658; public static final int CRYSTAL_BALL_13659 = 13659; public static final int ELEMENTAL_SPHERE = 13660; public static final int CRYSTAL_OF_POWER = 13661; public static final int ALCHEMICAL_CHART = 13662; public static final int ASTRONOMICAL_CHART = 13663; public static final int INFERNAL_CHART = 13664; public static final int THRONE_13665 = 13665; public static final int THRONE_13666 = 13666; public static final int THRONE_13667 = 13667; public static final int THRONE_13668 = 13668; public static final int THRONE_13669 = 13669; public static final int THRONE_13670 = 13670; public static final int THRONE_13671 = 13671; public static final int LEVER_13672 = 13672; public static final int LEVER_13673 = 13673; public static final int LEVER_13674 = 13674; public static final int TRAPDOOR_13675 = 13675; public static final int TRAPDOOR_13676 = 13676; public static final int TRAPDOOR_13677 = 13677; public static final int TRAPDOOR_13678 = 13678; public static final int TRAPDOOR_13679 = 13679; public static final int TRAPDOOR_13680 = 13680; public static final int STEEL_CAGE = 13681; public static final int MAGIC_CIRCLE_13682 = 13682; public static final int GREATER_MAGIC_CIRCLE = 13683; public static final int FLOOR_DECORATION = 13684; public static final int FLOOR_DECORATION_13685 = 13685; public static final int FLOOR_DECORATION_13686 = 13686; public static final int FLOOR_DECORATION_13687 = 13687; public static final int FLOOR_DECORATION_13688 = 13688; public static final int FLOOR_DECORATION_13689 = 13689; public static final int HANGING = 13690; public static final int DECORATION = 13691; public static final int DECORATION_13692 = 13692; public static final int DECORATION_13693 = 13693; public static final int TEAK_BENCH_13694 = 13694; public static final int MAHOGANY_BENCH_13695 = 13695; public static final int GILDED_BENCH_13696 = 13696; public static final int NOTHING_13697 = 13697; public static final int THRONE_13698 = 13698; public static final int TREE_13703 = 13703; public static final int NOTHING_13721 = 13721; public static final int NOTHING_13722 = 13722; public static final int NOTHING_13723 = 13723; public static final int NOTHING_13724 = 13724; public static final int JACKY_JESTER_13726 = 13726; public static final int JACKY_JESTER_13727 = 13727; public static final int WINDOW_SPACE = 13728; public static final int WINDOW_SPACE_13729 = 13729; public static final int WINDOW_SPACE_13730 = 13730; public static final int WINDOW_SPACE_13731 = 13731; public static final int WINDOW_SPACE_13732 = 13732; public static final int WINDOW_SPACE_13733 = 13733; public static final int ROUND_SHIELD = 13734; public static final int ROUND_SHIELD_13735 = 13735; public static final int ROUND_SHIELD_13736 = 13736; public static final int ROUND_SHIELD_13737 = 13737; public static final int ROUND_SHIELD_13738 = 13738; public static final int ROUND_SHIELD_13739 = 13739; public static final int ROUND_SHIELD_13740 = 13740; public static final int ROUND_SHIELD_13741 = 13741; public static final int ROUND_SHIELD_13742 = 13742; public static final int ROUND_SHIELD_13743 = 13743; public static final int ROUND_SHIELD_13744 = 13744; public static final int ROUND_SHIELD_13745 = 13745; public static final int ROUND_SHIELD_13746 = 13746; public static final int ROUND_SHIELD_13747 = 13747; public static final int ROUND_SHIELD_13748 = 13748; public static final int ROUND_SHIELD_13749 = 13749; public static final int KITE_SHIELD = 13750; public static final int KITE_SHIELD_13751 = 13751; public static final int KITE_SHIELD_13752 = 13752; public static final int KITE_SHIELD_13753 = 13753; public static final int KITE_SHIELD_13754 = 13754; public static final int KITE_SHIELD_13755 = 13755; public static final int KITE_SHIELD_13756 = 13756; public static final int KITE_SHIELD_13757 = 13757; public static final int KITE_SHIELD_13758 = 13758; public static final int KITE_SHIELD_13759 = 13759; public static final int KITE_SHIELD_13760 = 13760; public static final int KITE_SHIELD_13761 = 13761; public static final int KITE_SHIELD_13762 = 13762; public static final int KITE_SHIELD_13763 = 13763; public static final int KITE_SHIELD_13764 = 13764; public static final int KITE_SHIELD_13765 = 13765; public static final int SQUARE_SHIELD = 13766; public static final int SQUARE_SHIELD_13767 = 13767; public static final int SQUARE_SHIELD_13768 = 13768; public static final int SQUARE_SHIELD_13769 = 13769; public static final int SQUARE_SHIELD_13770 = 13770; public static final int SQUARE_SHIELD_13771 = 13771; public static final int SQUARE_SHIELD_13772 = 13772; public static final int SQUARE_SHIELD_13773 = 13773; public static final int SQUARE_SHIELD_13774 = 13774; public static final int SQUARE_SHIELD_13775 = 13775; public static final int SQUARE_SHIELD_13776 = 13776; public static final int SQUARE_SHIELD_13777 = 13777; public static final int SQUARE_SHIELD_13778 = 13778; public static final int SQUARE_SHIELD_13779 = 13779; public static final int SQUARE_SHIELD_13780 = 13780; public static final int SQUARE_SHIELD_13781 = 13781; public static final int MAHOGANY_WALL_DECORATION = 13782; public static final int MAHOGANY_WALL_DECORATION_13783 = 13783; public static final int MAHOGANY_WALL_DECORATION_13784 = 13784; public static final int MAHOGANY_WALL_DECORATION_13785 = 13785; public static final int MAHOGANY_WALL_DECORATION_13786 = 13786; public static final int MAHOGANY_WALL_DECORATION_13787 = 13787; public static final int MAHOGANY_WALL_DECORATION_13788 = 13788; public static final int MAHOGANY_WALL_DECORATION_13789 = 13789; public static final int MAHOGANY_WALL_DECORATION_13790 = 13790; public static final int MAHOGANY_WALL_DECORATION_13791 = 13791; public static final int MAHOGANY_WALL_DECORATION_13792 = 13792; public static final int MAHOGANY_WALL_DECORATION_13793 = 13793; public static final int MAHOGANY_WALL_DECORATION_13794 = 13794; public static final int MAHOGANY_WALL_DECORATION_13795 = 13795; public static final int MAHOGANY_WALL_DECORATION_13796 = 13796; public static final int MAHOGANY_WALL_DECORATION_13797 = 13797; public static final int OAK_WALL_DECORATION = 13798; public static final int OAK_WALL_DECORATION_13799 = 13799; public static final int OAK_WALL_DECORATION_13800 = 13800; public static final int OAK_WALL_DECORATION_13801 = 13801; public static final int OAK_WALL_DECORATION_13802 = 13802; public static final int OAK_WALL_DECORATION_13803 = 13803; public static final int OAK_WALL_DECORATION_13804 = 13804; public static final int OAK_WALL_DECORATION_13805 = 13805; public static final int OAK_WALL_DECORATION_13806 = 13806; public static final int OAK_WALL_DECORATION_13807 = 13807; public static final int OAK_WALL_DECORATION_13808 = 13808; public static final int OAK_WALL_DECORATION_13809 = 13809; public static final int OAK_WALL_DECORATION_13810 = 13810; public static final int OAK_WALL_DECORATION_13811 = 13811; public static final int OAK_WALL_DECORATION_13812 = 13812; public static final int OAK_WALL_DECORATION_13813 = 13813; public static final int TEAK_WALL_DECORATION = 13814; public static final int TEAK_WALL_DECORATION_13815 = 13815; public static final int TEAK_WALL_DECORATION_13816 = 13816; public static final int TEAK_WALL_DECORATION_13817 = 13817; public static final int TEAK_WALL_DECORATION_13818 = 13818; public static final int TEAK_WALL_DECORATION_13819 = 13819; public static final int TEAK_WALL_DECORATION_13820 = 13820; public static final int TEAK_WALL_DECORATION_13821 = 13821; public static final int TEAK_WALL_DECORATION_13822 = 13822; public static final int TEAK_WALL_DECORATION_13823 = 13823; public static final int TEAK_WALL_DECORATION_13824 = 13824; public static final int TEAK_WALL_DECORATION_13825 = 13825; public static final int TEAK_WALL_DECORATION_13826 = 13826; public static final int TEAK_WALL_DECORATION_13827 = 13827; public static final int TEAK_WALL_DECORATION_13828 = 13828; public static final int TEAK_WALL_DECORATION_13829 = 13829; public static final int WINDOW_13830 = 13830; public static final int PATH = 13831; public static final int PATH_13832 = 13832; public static final int PATH_13833 = 13833; public static final int BROKEN_BRIDGE_13834 = 13834; public static final int PARTIALLY_BROKEN_BRIDGE = 13835; public static final int SLIGHTLY_BROKEN_BRIDGE = 13836; public static final int FIXED_BRIDGE = 13837; public static final int BOG = 13838; public static final int BOG_13839 = 13839; public static final int SPINY_BUSH = 13840; public static final int ROW_BOAT_13841 = 13841; public static final int RIPPLES = 13842; public static final int SWAMP_TREE = 13843; public static final int SWAMP_TREE_13844 = 13844; public static final int SWAMP_TREE_13845 = 13845; public static final int VINE_HANGING_FROM_BRANCH = 13846; public static final int SWAMP_TREE_13847 = 13847; public static final int SWAMP_TREE_13848 = 13848; public static final int SWAMP_TREE_13849 = 13849; public static final int SWAMP_TREE_13850 = 13850; public static final int BOAT_13864 = 13864; public static final int PATH_13866 = 13866; public static final int PATH_13867 = 13867; public static final int PATH_13868 = 13868; public static final int PATH_13869 = 13869; public static final int PATH_13870 = 13870; public static final int PATH_13871 = 13871; public static final int BACKPACK = 13872; public static final int SIGNPOST_13873 = 13873; public static final int EXIT_13878 = 13878; public static final int EXIT_13879 = 13879; public static final int FIRE_13881 = 13881; public static final int EXIT_13882 = 13882; public static final int DARK_HOLE_13891 = 13891; public static final int DARK_HOLE_13892 = 13892; public static final int DARK_HOLE_13893 = 13893; public static final int DARK_HOLE_13894 = 13894; public static final int DARK_HOLE_13895 = 13895; public static final int DARK_HOLE_13896 = 13896; public static final int BLACK_HOLE = 13899; public static final int BLACK_HOLE_13900 = 13900; public static final int EXIT_13901 = 13901; public static final int EXIT_13904 = 13904; public static final int CONFUSING_DOOR = 13913; public static final int CONFUSING_DOOR_13914 = 13914; public static final int CONFUSING_DOOR_13915 = 13915; public static final int CONFUSING_DOOR_13916 = 13916; public static final int CONFUSING_DOOR_13917 = 13917; public static final int CONFUSING_DOOR_13918 = 13918; public static final int CONFUSING_DOOR_13919 = 13919; public static final int CONFUSING_DOOR_13920 = 13920; public static final int CONFUSING_DOOR_13921 = 13921; public static final int CONFUSING_DOOR_13922 = 13922; public static final int CONFUSING_DOOR_13923 = 13923; public static final int CONFUSING_DOOR_13924 = 13924; public static final int HOLE_13925 = 13925; public static final int EXIT_13932 = 13932; public static final int EXIT_13933 = 13933; public static final int HOPE_BRIDGE = 13938; public static final int HOPE_BRIDGE_13939 = 13939; public static final int HOPE_BRIDGE_13940 = 13940; public static final int HOPE_BRIDGE_13941 = 13941; public static final int HOPE_BRIDGE_13942 = 13942; public static final int HOPE_BRIDGE_13943 = 13943; public static final int HOPE_BRIDGE_13944 = 13944; public static final int HOPE_BRIDGE_13945 = 13945; public static final int HOPE_BRIDGE_13946 = 13946; public static final int HOPE_BRIDGE_13947 = 13947; public static final int HOPE_BRIDGE_13948 = 13948; public static final int HOPE_BRIDGE_13949 = 13949; public static final int HOPE_BRIDGE_13950 = 13950; public static final int HOPE_BRIDGE_13951 = 13951; public static final int HOPE_BRIDGE_13952 = 13952; public static final int HOPE_BRIDGE_13953 = 13953; public static final int HOPE_BRIDGE_13954 = 13954; public static final int HOPE_BRIDGE_13955 = 13955; public static final int HOPE_BRIDGE_13956 = 13956; public static final int HOPE_BRIDGE_13957 = 13957; public static final int HOPE_BRIDGE_13958 = 13958; public static final int HOPE_BRIDGE_13959 = 13959; public static final int HOPE_BRIDGE_13960 = 13960; public static final int HOPE_BRIDGE_13961 = 13961; public static final int RIFT = 13967; public static final int RIFT_13969 = 13969; public static final int RIFT_13970 = 13970; public static final int RIFT_13971 = 13971; public static final int RIFT_13972 = 13972; public static final int RIFT_13973 = 13973; public static final int RIFT_13974 = 13974; public static final int RIFT_13975 = 13975; public static final int RIFT_13976 = 13976; public static final int RIFT_13977 = 13977; public static final int RIFT_13978 = 13978; public static final int RIFT_13979 = 13979; public static final int RIFT_13980 = 13980; public static final int WEAPON_RACK_13994 = 13994; public static final int WEAPON_RACK_13995 = 13995; public static final int WEAPON_RACK_13996 = 13996; public static final int WEAPON_RACK_13997 = 13997; public static final int WEAPON_RACK_13998 = 13998; public static final int ROPE_13999 = 13999; public static final int WARNING_SIGN_14002 = 14002; public static final int GRASS_14003 = 14003; public static final int POTBOILER = 14005; public static final int POTBOILER_14006 = 14006; public static final int POTBOILER_14007 = 14007; public static final int POTBOILER_14008 = 14008; public static final int POTBOILER_14009 = 14009; public static final int WISHLIST = 14010; public static final int MARKET_STALL_14011 = 14011; public static final int MARKET_STALL_14012 = 14012; public static final int MASSIVE_RIBS = 14013; public static final int BOX_OF_BONES = 14016; public static final int BOX_OF_BONES_14017 = 14017; public static final int BONES_14018 = 14018; public static final int BONES_14019 = 14019; public static final int BONES_14020 = 14020; public static final int BONES_14021 = 14021; public static final int BONES_14022 = 14022; public static final int BONES_14023 = 14023; public static final int BONES_14024 = 14024; public static final int BONES_14025 = 14025; public static final int BONES_14026 = 14026; public static final int BONES_14027 = 14027; public static final int BONES_14028 = 14028; public static final int BONES_14029 = 14029; public static final int BONES_14030 = 14030; public static final int BONES_14031 = 14031; public static final int BONES_14032 = 14032; public static final int FISHING_CONTEST_BANNER = 14035; public static final int BONZOS_TABLE = 14040; public static final int BONZOS_TABLE_14041 = 14041; public static final int BARREL_14043 = 14043; public static final int TABLE_14044 = 14044; public static final int BED_14045 = 14045; public static final int TABLE_14049 = 14049; public static final int CHAIR_14050 = 14050; public static final int SMALL_TABLE_14051 = 14051; public static final int ROCKS_14106 = 14106; public static final int TABLE_14163 = 14163; public static final int FIRE_14169 = 14169; public static final int EMBERS = 14171; public static final int OLAFS_BOAT = 14173; public static final int DRIFTWOOD = 14174; public static final int STATUE_14193 = 14193; public static final int STATUE_14194 = 14194; public static final int STATUE_14195 = 14195; public static final int CHEST_14196 = 14196; public static final int CHEST_14197 = 14197; public static final int STONE_BLOCK_14203 = 14203; public static final int STONE_BLOCK_14204 = 14204; public static final int STONE_BLOCK_14205 = 14205; public static final int FINAL_OWNAGE_ELITE_STATUE = 14209; public static final int WALL_14212 = 14212; public static final int WALL_14213 = 14213; public static final int WALL_14216 = 14216; public static final int WALL_14217 = 14217; public static final int WALL_14218 = 14218; public static final int WALL_14219 = 14219; public static final int WALL_14220 = 14220; public static final int WALL_14221 = 14221; public static final int BARRICADE_14224 = 14224; public static final int BARRICADE_14225 = 14225; public static final int BARRICADE_14226 = 14226; public static final int BARRICADE_14227 = 14227; public static final int BARRICADE_14228 = 14228; public static final int BARRICADE_14229 = 14229; public static final int BARRICADE_14230 = 14230; public static final int BARRICADE_14231 = 14231; public static final int BARRICADE_14232 = 14232; public static final int GATE_14233 = 14233; public static final int GATE_14234 = 14234; public static final int GATE_14235 = 14235; public static final int GATE_14236 = 14236; public static final int GATE_14237 = 14237; public static final int GATE_14238 = 14238; public static final int GATE_14239 = 14239; public static final int GATE_14240 = 14240; public static final int GATE_14241 = 14241; public static final int GATE_14242 = 14242; public static final int GATE_14243 = 14243; public static final int GATE_14244 = 14244; public static final int GATE_14245 = 14245; public static final int GATE_14246 = 14246; public static final int GATE_14247 = 14247; public static final int GATE_14248 = 14248; public static final int LANDER_BOAT = 14258; public static final int LANDER_BOAT_14259 = 14259; public static final int LANDER_BOAT_14260 = 14260; public static final int LANDER_BOAT_14261 = 14261; public static final int LANDER_BOAT_14262 = 14262; public static final int LANDER_BOAT_14263 = 14263; public static final int LANDER_BOAT_14264 = 14264; public static final int LANDER_BOAT_14265 = 14265; public static final int LANDER_BOAT_14266 = 14266; public static final int LANDER_BOAT_14267 = 14267; public static final int LANDER_BOAT_14268 = 14268; public static final int LANDER_HATCH = 14269; public static final int BANNER_14283 = 14283; public static final int LADDER_14296 = 14296; public static final int GANGPLANK_14304 = 14304; public static final int GANGPLANK_14305 = 14305; public static final int GANGPLANK_14306 = 14306; public static final int GANGPLANK_14307 = 14307; public static final int TREE_14308 = 14308; public static final int TREE_14309 = 14309; public static final int LADDER_14314 = 14314; public static final int GANGPLANK_14315 = 14315; public static final int BONES_14335 = 14335; public static final int PILE_OF_BRICKS_14355 = 14355; public static final int SHELVES_14356 = 14356; public static final int SHELVES_14357 = 14357; public static final int SHELVES_14358 = 14358; public static final int SHELVES_14359 = 14359; public static final int CAULDRON_14360 = 14360; public static final int CHARMS_14362 = 14362; public static final int TABLE_14363 = 14363; public static final int ROCKING_CHAIR_14364 = 14364; public static final int COUNTER_14366 = 14366; public static final int BANK_BOOTH_14367 = 14367; public static final int BANK_BOOTH_14368 = 14368; public static final int CRATE_14369 = 14369; public static final int CRATES_14370 = 14370; public static final int BOXES_14371 = 14371; public static final int CRATES_14372 = 14372; public static final int BLACKSMITHS_TOOLS_14373 = 14373; public static final int BARREL_14374 = 14374; public static final int SHELVES_14375 = 14375; public static final int SHELVES_14376 = 14376; public static final int SHELVES_14377 = 14377; public static final int SHELVES_14378 = 14378; public static final int SHELVES_14379 = 14379; public static final int STOOL_14381 = 14381; public static final int BANK_CHEST_14382 = 14382; public static final int BOXES_14395 = 14395; public static final int TIGHTROPE_14398 = 14398; public static final int GAP_14399 = 14399; public static final int CABLE = 14402; public static final int ZIP_LINE_14403 = 14403; public static final int TROPICAL_TREE_14404 = 14404; public static final int ZIP_LINE_14405 = 14405; public static final int ZIP_LINE_14406 = 14406; public static final int ZIP_LINE_14407 = 14407; public static final int ZIP_LINE_14408 = 14408; public static final int TIGHTROPE_14409 = 14409; public static final int TREE_14411 = 14411; public static final int ROUGH_WALL_14412 = 14412; public static final int CLOTHES_LINE = 14413; public static final int GAP_14414 = 14414; public static final int STUDY_DESK_14415 = 14415; public static final int RIFT_14431 = 14431; public static final int GAS_BUBBLE = 14434; public static final int CAVE_ENTRANCE_14436 = 14436; public static final int MUSHROOM_14443 = 14443; public static final int MUSHROOM_14444 = 14444; public static final int MUSHROOM_14445 = 14445; public static final int MUSHROOM_14446 = 14446; public static final int MUSHROOM_14447 = 14447; public static final int MUSHROOM_14448 = 14448; public static final int MUSHROOM_14449 = 14449; public static final int SKELETON_14472 = 14472; public static final int CAGE_14473 = 14473; public static final int CAGE_14474 = 14474; public static final int SKELETON_14475 = 14475; public static final int SKELETON_14476 = 14476; public static final int SKELETON_14477 = 14477; public static final int SKELETON_14478 = 14478; public static final int STOCKS_14479 = 14479; public static final int SKELETON_14480 = 14480; public static final int SKELETON_14481 = 14481; public static final int WILDERNESS_SIGN = 14503; public static final int WILDERNESS_SIGN_14504 = 14504; public static final int WILDERNESS_SIGN_14505 = 14505; public static final int WILDERNESS_SIGN_14506 = 14506; public static final int WILDERNESS_SIGN_14507 = 14507; public static final int TREE_14513 = 14513; public static final int TREE_14514 = 14514; public static final int TREE_14515 = 14515; public static final int TREE_STUMP_14516 = 14516; public static final int TREE_STUMP_14517 = 14517; public static final int ROOTS_14518 = 14518; public static final int ROOTS_14519 = 14519; public static final int ROOTS_14520 = 14520; public static final int TREE_14521 = 14521; public static final int SKELETON_14523 = 14523; public static final int SKELETON_14524 = 14524; public static final int SKELETON_14525 = 14525; public static final int BONES_14526 = 14526; public static final int BONES_14527 = 14527; public static final int BONES_14528 = 14528; public static final int BONES_14529 = 14529; public static final int BONES_14530 = 14530; public static final int BONES_14531 = 14531; public static final int BONES_14532 = 14532; public static final int BONES_14533 = 14533; public static final int BONES_14534 = 14534; public static final int BONES_14535 = 14535; public static final int BONES_14536 = 14536; public static final int BONES_14537 = 14537; public static final int MUSHROOM_14538 = 14538; public static final int MUSHROOM_14539 = 14539; public static final int MUSHROOM_14540 = 14540; public static final int MUSHROOM_14541 = 14541; public static final int MUSHROOM_14542 = 14542; public static final int STONE_PILE_14556 = 14556; public static final int STONE_PILE_14557 = 14557; public static final int TREE_14564 = 14564; public static final int TREE_14565 = 14565; public static final int TREE_14566 = 14566; public static final int TREE_STUMP_14567 = 14567; public static final int ROOTS_14568 = 14568; public static final int ROOTS_14569 = 14569; public static final int ROOTS_14570 = 14570; public static final int TREE_14571 = 14571; public static final int SKELETON_14573 = 14573; public static final int SKELETON_14574 = 14574; public static final int SKELETON_14575 = 14575; public static final int BONES_14576 = 14576; public static final int BONES_14577 = 14577; public static final int BONES_14578 = 14578; public static final int BONES_14579 = 14579; public static final int BONES_14580 = 14580; public static final int BONES_14581 = 14581; public static final int BONES_14582 = 14582; public static final int BONES_14583 = 14583; public static final int BONES_14584 = 14584; public static final int BONES_14585 = 14585; public static final int BONES_14586 = 14586; public static final int BONES_14587 = 14587; public static final int MUSHROOM_14588 = 14588; public static final int MUSHROOM_14589 = 14589; public static final int MUSHROOM_14590 = 14590; public static final int MUSHROOM_14591 = 14591; public static final int MUSHROOM_14592 = 14592; public static final int TREE_14593 = 14593; public static final int TREE_14594 = 14594; public static final int TREE_14595 = 14595; public static final int TREE_STUMP_14596 = 14596; public static final int ROOTS_14597 = 14597; public static final int ROOTS_14598 = 14598; public static final int ROOTS_14599 = 14599; public static final int TREE_14600 = 14600; public static final int SKELETON_14602 = 14602; public static final int SKELETON_14603 = 14603; public static final int SKELETON_14604 = 14604; public static final int BONES_14605 = 14605; public static final int BONES_14606 = 14606; public static final int BONES_14607 = 14607; public static final int BONES_14608 = 14608; public static final int BONES_14609 = 14609; public static final int BONES_14610 = 14610; public static final int BONES_14611 = 14611; public static final int BONES_14612 = 14612; public static final int BONES_14613 = 14613; public static final int BONES_14614 = 14614; public static final int BONES_14615 = 14615; public static final int BONES_14616 = 14616; public static final int MUSHROOM_14617 = 14617; public static final int MUSHROOM_14618 = 14618; public static final int MUSHROOM_14619 = 14619; public static final int MUSHROOM_14620 = 14620; public static final int MUSHROOM_14621 = 14621; public static final int STONE_PILE_14630 = 14630; public static final int STONE_PILE_14631 = 14631; public static final int TREE_14635 = 14635; public static final int TREE_14636 = 14636; public static final int TREE_14637 = 14637; public static final int TREE_STUMP_14638 = 14638; public static final int ROOTS_14639 = 14639; public static final int ROOTS_14640 = 14640; public static final int ROOTS_14641 = 14641; public static final int TREE_14642 = 14642; public static final int SKELETON_14644 = 14644; public static final int SKELETON_14645 = 14645; public static final int SKELETON_14646 = 14646; public static final int BONES_14647 = 14647; public static final int BONES_14648 = 14648; public static final int BONES_14649 = 14649; public static final int BONES_14650 = 14650; public static final int BONES_14651 = 14651; public static final int BONES_14652 = 14652; public static final int BONES_14653 = 14653; public static final int BONES_14654 = 14654; public static final int BONES_14655 = 14655; public static final int BONES_14656 = 14656; public static final int BONES_14657 = 14657; public static final int BONES_14658 = 14658; public static final int MUSHROOM_14659 = 14659; public static final int MUSHROOM_14660 = 14660; public static final int MUSHROOM_14661 = 14661; public static final int MUSHROOM_14662 = 14662; public static final int MUSHROOM_14663 = 14663; public static final int TREE_14664 = 14664; public static final int TREE_14665 = 14665; public static final int TREE_14666 = 14666; public static final int TREE_STUMP_14667 = 14667; public static final int ROOTS_14668 = 14668; public static final int ROOTS_14669 = 14669; public static final int ROOTS_14670 = 14670; public static final int TREE_14671 = 14671; public static final int SKELETON_14673 = 14673; public static final int SKELETON_14674 = 14674; public static final int SKELETON_14675 = 14675; public static final int BONES_14676 = 14676; public static final int BONES_14677 = 14677; public static final int BONES_14678 = 14678; public static final int BONES_14679 = 14679; public static final int BONES_14680 = 14680; public static final int BONES_14681 = 14681; public static final int BONES_14682 = 14682; public static final int BONES_14683 = 14683; public static final int BONES_14684 = 14684; public static final int BONES_14685 = 14685; public static final int BONES_14686 = 14686; public static final int BONES_14687 = 14687; public static final int MUSHROOM_14688 = 14688; public static final int MUSHROOM_14689 = 14689; public static final int MUSHROOM_14690 = 14690; public static final int MUSHROOM_14691 = 14691; public static final int MUSHROOM_14692 = 14692; public static final int TREE_14693 = 14693; public static final int TREE_14694 = 14694; public static final int TREE_14695 = 14695; public static final int TREE_14696 = 14696; public static final int TREE_STUMP_14697 = 14697; public static final int ROOTS_14698 = 14698; public static final int ROOTS_14699 = 14699; public static final int ROOTS_14700 = 14700; public static final int TREE_14701 = 14701; public static final int SKELETON_14703 = 14703; public static final int SKELETON_14704 = 14704; public static final int SKELETON_14705 = 14705; public static final int BONES_14706 = 14706; public static final int BONES_14707 = 14707; public static final int BONES_14708 = 14708; public static final int BONES_14709 = 14709; public static final int BONES_14710 = 14710; public static final int BONES_14711 = 14711; public static final int BONES_14712 = 14712; public static final int BONES_14713 = 14713; public static final int BONES_14714 = 14714; public static final int BONES_14715 = 14715; public static final int BONES_14716 = 14716; public static final int BONES_14717 = 14717; public static final int MUSHROOM_14718 = 14718; public static final int MUSHROOM_14719 = 14719; public static final int MUSHROOM_14720 = 14720; public static final int MUSHROOM_14721 = 14721; public static final int MUSHROOM_14722 = 14722; public static final int STONE_PILE_14731 = 14731; public static final int STONE_PILE_14732 = 14732; public static final int STAIRCASE_14735 = 14735; public static final int STAIRCASE_14736 = 14736; public static final int STAIRCASE_14737 = 14737; public static final int TREE_14738 = 14738; public static final int CRATE_14739 = 14739; public static final int BARREL_14740 = 14740; public static final int CRATES_14741 = 14741; public static final int PILE_OF_CRATES = 14742; public static final int SACK_14743 = 14743; public static final int LADDER_14745 = 14745; public static final int LADDER_14746 = 14746; public static final int LADDER_14747 = 14747; public static final int LADDER_14748 = 14748; public static final int DOOR_14749 = 14749; public static final int DOOR_14750 = 14750; public static final int DOOR_14751 = 14751; public static final int DOOR_14752 = 14752; public static final int DOOR_14753 = 14753; public static final int DOOR_14754 = 14754; public static final int BANNER_14755 = 14755; public static final int BANNER_14756 = 14756; public static final int BANNER_14757 = 14757; public static final int LADDER_14758 = 14758; public static final int ROOTS_14759 = 14759; public static final int ROOTS_14760 = 14760; public static final int ROOTS_14761 = 14761; public static final int TABLE_14762 = 14762; public static final int TABLE_14763 = 14763; public static final int STOOL_14764 = 14764; public static final int GRAVESTONE_14765 = 14765; public static final int GRAVESTONE_14766 = 14766; public static final int GRAVESTONE_14767 = 14767; public static final int GRAVESTONE_14768 = 14768; public static final int GRAVESTONE_14769 = 14769; public static final int BED_14771 = 14771; public static final int BED_14772 = 14772; public static final int CHEST_14773 = 14773; public static final int CHEST_14774 = 14774; public static final int TREE_14796 = 14796; public static final int TREE_14797 = 14797; public static final int TREE_14798 = 14798; public static final int TREE_14799 = 14799; public static final int TREE_14800 = 14800; public static final int TREE_14801 = 14801; public static final int TREE_14802 = 14802; public static final int TREE_14803 = 14803; public static final int TREE_14804 = 14804; public static final int TREE_14805 = 14805; public static final int TREE_14806 = 14806; public static final int TREE_14807 = 14807; public static final int CREEPER = 14808; public static final int CREEPER_14809 = 14809; public static final int CREEPER_14810 = 14810; public static final int CREEPER_14811 = 14811; public static final int CREEPER_14812 = 14812; public static final int CREEPER_14813 = 14813; public static final int ROCK_14814 = 14814; public static final int ROCK_14815 = 14815; public static final int ROCK_14816 = 14816; public static final int ROCK_14817 = 14817; public static final int OBELISK_14825 = 14825; public static final int OBELISK_14826 = 14826; public static final int OBELISK_14827 = 14827; public static final int OBELISK_14828 = 14828; public static final int OBELISK_14829 = 14829; public static final int OBELISK_14830 = 14830; public static final int OBELISK_14831 = 14831; public static final int WALL_14832 = 14832; public static final int GAP_14833 = 14833; public static final int GAP_14834 = 14834; public static final int GAP_14835 = 14835; public static final int LEDGE_14836 = 14836; public static final int EDGE = 14841; public static final int TALL_TREE_14843 = 14843; public static final int GAP_14844 = 14844; public static final int GAP_14845 = 14845; public static final int GAP_14846 = 14846; public static final int GAP_14847 = 14847; public static final int GAP_14848 = 14848; public static final int CHAIR_14849 = 14849; public static final int CHAIR_14850 = 14850; public static final int TABLE_14851 = 14851; public static final int TABLE_14852 = 14852; public static final int CHAIR_14853 = 14853; public static final int CHEST_14854 = 14854; public static final int BED_14855 = 14855; public static final int BUNK_BED = 14856; public static final int TRUNK = 14857; public static final int LOCKER = 14858; public static final int SARADOMIN_STAR = 14859; public static final int ALTAR_14860 = 14860; public static final int CHURCH_PEW_14861 = 14861; public static final int BARREL_14865 = 14865; public static final int BARREL_14866 = 14866; public static final int BARREL_14867 = 14867; public static final int SINK_14868 = 14868; public static final int SHELVES_14869 = 14869; public static final int STOOL_14872 = 14872; public static final int HANGING_MEAT_14873 = 14873; public static final int HANGING_MEAT_14874 = 14874; public static final int TRAPDOOR_14880 = 14880; public static final int CANDLES_14883 = 14883; public static final int TREE_TRUNK = 14884; public static final int TREE_14885 = 14885; public static final int BANK_CHEST_14886 = 14886; public static final int POTTERS_WHEEL_14887 = 14887; public static final int POTTERY_OVEN_14888 = 14888; public static final int SPINNING_WHEEL_14889 = 14889; public static final int SAND_PIT_14890 = 14890; public static final int BED_14891 = 14891; public static final int TIGHTROPE_14892 = 14892; public static final int POLEVAULT = 14894; public static final int FLAX = 14896; public static final int GAP_14897 = 14897; public static final int ROUGH_WALL_14898 = 14898; public static final int TIGHTROPE_14899 = 14899; public static final int HAND_HOLDS_14901 = 14901; public static final int GAP_14903 = 14903; public static final int GAP_14904 = 14904; public static final int TIGHTROPE_14905 = 14905; public static final int GUILD_DOOR_14910 = 14910; public static final int TIGHTROPE_14911 = 14911; public static final int SAND = 14914; public static final int SAND_14915 = 14915; public static final int BROKEN_MULTICANNON_14916 = 14916; public static final int STEPPING_STONE_14917 = 14917; public static final int STEPPING_STONE_14918 = 14918; public static final int GAP_14919 = 14919; public static final int LEDGE_14920 = 14920; public static final int LEDGE_14921 = 14921; public static final int LEDGE_14922 = 14922; public static final int LEDGE_14923 = 14923; public static final int LEDGE_14924 = 14924; public static final int EDGE_14925 = 14925; public static final int WALL_14927 = 14927; public static final int GAP_14928 = 14928; public static final int GAP_14929 = 14929; public static final int GAP_14930 = 14930; public static final int EDGE_14931 = 14931; public static final int TIGHTROPE_14932 = 14932; public static final int CRATE_14934 = 14934; public static final int BASKET_14935 = 14935; public static final int MARKET_STALL_14936 = 14936; public static final int BANNER_14937 = 14937; public static final int GAP_14938 = 14938; public static final int TREE_14939 = 14939; public static final int ROUGH_WALL_14940 = 14940; public static final int MONKEYBARS = 14941; public static final int TREE_14944 = 14944; public static final int DRYING_LINE = 14945; public static final int ROUGH_WALL_14946 = 14946; public static final int GAP_14947 = 14947; public static final int SAND_14948 = 14948; public static final int BAMBOO_DOOR_14974 = 14974; public static final int GATE_14979 = 14979; public static final int GATE_14980 = 14980; public static final int GATE_14981 = 14981; public static final int GATE_14982 = 14982; public static final int GATE_14983 = 14983; public static final int STRANGE_SHRINE = 14985; public static final int CHEST_14986 = 14986; public static final int TIGHTROPE_14987 = 14987; public static final int CHEST_14988 = 14988; public static final int GAP_14990 = 14990; public static final int GAP_14991 = 14991; public static final int TIGHTROPE_14992 = 14992; public static final int PILE_OF_FISH = 14994; public static final int LADDER_14995 = 14995; public static final int LADDER_14996 = 14996; public static final int WATER_SOURCE = 14998; public static final int CRATE_15030 = 15030; public static final int CRATE_15031 = 15031; public static final int CRATES_15032 = 15032; public static final int STOOL_15039 = 15039; public static final int COUNTER_15040 = 15040; public static final int PICNIC_TABLE = 15041; public static final int TABLE_15044 = 15044; public static final int BAR_PUMPS_15045 = 15045; public static final int WAREHOUSE_SHELVES_15046 = 15046; public static final int WAREHOUSE_SHELVES_15047 = 15047; public static final int WAREHOUSE_SHELVES_15048 = 15048; public static final int WAREHOUSE_SHELVES_15049 = 15049; public static final int ALTAR_15050 = 15050; public static final int ALTAR_15051 = 15051; public static final int COFFIN_15052 = 15052; public static final int COFFIN_15053 = 15053; public static final int DOOR_15056 = 15056; public static final int SKELETON_15057 = 15057; public static final int TEAK_15062 = 15062; public static final int WEEDY_PATCH = 15063; public static final int WEEDY_PATCH_15064 = 15064; public static final int WEEDY_PATCH_15065 = 15065; public static final int WEEDY_PATCH_15066 = 15066; public static final int DRY_PATCH = 15068; public static final int DRY_PATCH_15069 = 15069; public static final int DRY_PATCH_15070 = 15070; public static final int BARREN_PATCH = 15072; public static final int BARREN_PATCH_15073 = 15073; public static final int FLAX_15075 = 15075; public static final int FLAX_15076 = 15076; public static final int FLAX_15077 = 15077; public static final int FLAX_15078 = 15078; public static final int HERBS_15080 = 15080; public static final int HERBS_15081 = 15081; public static final int HERBS_15082 = 15082; public static final int HERBS_15083 = 15083; public static final int BENCH_15088 = 15088; public static final int CHAIR_15091 = 15091; public static final int TABLE_15092 = 15092; public static final int STOOL_15093 = 15093; public static final int BED_15094 = 15094; public static final int BED_15095 = 15095; public static final int BED_15096 = 15096; public static final int BED_15097 = 15097; public static final int SHELF_15098 = 15098; public static final int SHELF_15099 = 15099; public static final int SHELF_15100 = 15100; public static final int SHELF_15101 = 15101; public static final int SHELF_15102 = 15102; public static final int BAR_PUMPS_15103 = 15103; public static final int BAR_15104 = 15104; public static final int BARREL_15105 = 15105; public static final int CRATES_15106 = 15106; public static final int CRATE_15107 = 15107; public static final int BARREL_15108 = 15108; public static final int CRATES_15109 = 15109; public static final int WAREHOUSE_SHELVES_15110 = 15110; public static final int WAREHOUSE_SHELVES_15111 = 15111; public static final int WAREHOUSE_SHELVES_15112 = 15112; public static final int WAREHOUSE_SHELVES_15113 = 15113; public static final int COUNTER_15114 = 15114; public static final int LADDER_15115 = 15115; public static final int LADDER_15116 = 15116; public static final int BOOKCASE_15117 = 15117; public static final int BOOKCASE_15118 = 15118; public static final int BOOKCASE_15119 = 15119; public static final int FUNGUS_15120 = 15120; public static final int FUNGUS_15121 = 15121; public static final int ROCKS_15127 = 15127; public static final int ROCKS_15128 = 15128; public static final int DYED_FABRIC = 15134; public static final int DYED_FABRIC_15135 = 15135; public static final int DYED_FABRIC_15136 = 15136; public static final int TABLE_15137 = 15137; public static final int DYE_POTS_15138 = 15138; public static final int CLOTH_15139 = 15139; public static final int CLOTHES_MODEL_15140 = 15140; public static final int CLOTHES_MODEL_15141 = 15141; public static final int CLOTHES_MODEL_15142 = 15142; public static final int CLOTHES_MODEL_15143 = 15143; public static final int CLOTHES_EQUIPMENT_15144 = 15144; public static final int CLOTHING_SHELVES_15145 = 15145; public static final int FIRE_15156 = 15156; public static final int STANDING_TORCH_15158 = 15158; public static final int HAT_STAND_15165 = 15165; public static final int ARMOUR_15166 = 15166; public static final int ARMOUR_15167 = 15167; public static final int EGGS_15182 = 15182; public static final int EGGS_15183 = 15183; public static final int EGGS_15184 = 15184; public static final int EGGS_15185 = 15185; public static final int CREVICE_15186 = 15186; public static final int CREVICE_15187 = 15187; public static final int TUNNEL_15188 = 15188; public static final int TUNNEL_15189 = 15189; public static final int LIGHT_15190 = 15190; public static final int EXIT_15191 = 15191; public static final int CREVICE_15194 = 15194; public static final int CREVICE_15195 = 15195; public static final int CREVICE_15196 = 15196; public static final int CREVICE_15197 = 15197; public static final int ROCK_15198 = 15198; public static final int ROCK_15199 = 15199; public static final int HOLE_15201 = 15201; public static final int HOLE_15202 = 15202; public static final int DOOR_15204 = 15204; public static final int DOOR_15205 = 15205; public static final int FIRE_REMAINS_15206 = 15206; public static final int FIRE_REMAINS_15207 = 15207; public static final int FIRE_REMAINS_15208 = 15208; public static final int FIRE_REMAINS_15209 = 15209; public static final int FIRE_REMAINS_15210 = 15210; public static final int ROCKS_15213 = 15213; public static final int STEAM_VENT = 15214; public static final int STEAM_VENT_15215 = 15215; public static final int ROPESWING = 15216; public static final int ROCK_15217 = 15217; public static final int ROCK_15218 = 15218; public static final int ROCK_15219 = 15219; public static final int PLATFORM_15222 = 15222; public static final int PLATFORM_15223 = 15223; public static final int PLATFORM_15224 = 15224; public static final int PLATFORM_15225 = 15225; public static final int PLATFORM_15226 = 15226; public static final int ENGINE_PLATFORM = 15227; public static final int LIFT_ENGINE = 15228; public static final int LIFT_ENGINE_15229 = 15229; public static final int BROKEN_SCAFFOLD = 15230; public static final int SCAFFOLD_15231 = 15231; public static final int SCAFFOLD_15232 = 15232; public static final int BROKEN_SCAFFOLD_15233 = 15233; public static final int SCAFFOLD_15234 = 15234; public static final int SCAFFOLD_15235 = 15235; public static final int SCAFFOLD_15236 = 15236; public static final int LIFT_PLATFORM = 15237; public static final int CRATE_15243 = 15243; public static final int CRATE_15244 = 15244; public static final int CRATE_15245 = 15245; public static final int STALAGMITES_15250 = 15250; public static final int STALAGMITE_15251 = 15251; public static final int TREASURE_SPACE = 15256; public static final int MONSTER_SPACE = 15257; public static final int DECORATION_SPACE = 15259; public static final int BED_SPACE = 15260; public static final int WARDROBE_SPACE = 15261; public static final int DRESSER_SPACE = 15262; public static final int CURTAIN_SPACE_15263 = 15263; public static final int RUG_SPACE_15264 = 15264; public static final int RUG_SPACE_15265 = 15265; public static final int RUG_SPACE_15266 = 15266; public static final int FIREPLACE_SPACE_15267 = 15267; public static final int CORNER_SPACE = 15268; public static final int ICON_SPACE = 15269; public static final int ALTAR_SPACE = 15270; public static final int LAMP_SPACE = 15271; public static final int RUG_SPACE_15272 = 15272; public static final int RUG_SPACE_15273 = 15273; public static final int RUG_SPACE_15274 = 15274; public static final int STATUE_SPACE = 15275; public static final int MUSICAL_SPACE = 15276; public static final int COMBAT_RING_SPACE = 15277; public static final int COMBAT_RING_SPACE_15278 = 15278; public static final int COMBAT_RING_SPACE_15279 = 15279; public static final int COMBAT_RING_SPACE_15280 = 15280; public static final int COMBAT_RING_SPACE_15281 = 15281; public static final int COMBAT_RING_SPACE_15282 = 15282; public static final int COMBAT_RING_SPACE_15283 = 15283; public static final int COMBAT_RING_SPACE_15284 = 15284; public static final int COMBAT_RING_SPACE_15285 = 15285; public static final int COMBAT_RING_SPACE_15286 = 15286; public static final int COMBAT_RING_SPACE_15287 = 15287; public static final int COMBAT_RING_SPACE_15288 = 15288; public static final int COMBAT_RING_SPACE_15289 = 15289; public static final int COMBAT_RING_SPACE_15290 = 15290; public static final int COMBAT_RING_SPACE_15291 = 15291; public static final int COMBAT_RING_SPACE_15292 = 15292; public static final int COMBAT_RING_SPACE_15293 = 15293; public static final int COMBAT_RING_SPACE_15294 = 15294; public static final int COMBAT_RING_SPACE_15295 = 15295; public static final int STORAGE_SPACE = 15296; public static final int DECORATION_SPACE_15297 = 15297; public static final int TABLE_SPACE = 15298; public static final int SEATING_SPACE = 15299; public static final int SEATING_SPACE_15300 = 15300; public static final int FIREPLACE_SPACE_15301 = 15301; public static final int CURTAIN_SPACE_15302 = 15302; public static final int DECORATION_SPACE_15303 = 15303; public static final int BELL_PULL_SPACE = 15304; public static final int DOOR_HOTSPOT = 15305; public static final int DOOR_HOTSPOT_15306 = 15306; public static final int DOOR_HOTSPOT_15307 = 15307; public static final int DOOR_HOTSPOT_15308 = 15308; public static final int DOOR_HOTSPOT_15309 = 15309; public static final int DOOR_HOTSPOT_15310 = 15310; public static final int DOOR_HOTSPOT_15311 = 15311; public static final int DOOR_HOTSPOT_15312 = 15312; public static final int DOOR_HOTSPOT_15313 = 15313; public static final int DOOR_HOTSPOT_15314 = 15314; public static final int DOOR_HOTSPOT_15315 = 15315; public static final int DOOR_HOTSPOT_15316 = 15316; public static final int DOOR_HOTSPOT_15317 = 15317; public static final int DOOR_HOTSPOT_15318 = 15318; public static final int DOOR_HOTSPOT_15319 = 15319; public static final int DOOR_HOTSPOT_15320 = 15320; public static final int DOOR_HOTSPOT_15321 = 15321; public static final int DOOR_HOTSPOT_15322 = 15322; public static final int GUARD_SPACE = 15323; public static final int TRAP_SPACE = 15324; public static final int TRAP_SPACE_15325 = 15325; public static final int DOOR_SPACE = 15326; public static final int DOOR_SPACE_15327 = 15327; public static final int DOOR_SPACE_15328 = 15328; public static final int DOOR_SPACE_15329 = 15329; public static final int LIGHTING_SPACE = 15330; public static final int DECORATION_SPACE_15331 = 15331; public static final int RUG_SPACE_15332 = 15332; public static final int RUG_SPACE_15333 = 15333; public static final int RUG_SPACE_15334 = 15334; public static final int RUG_SPACE_15335 = 15335; public static final int GUARD_SPACE_15336 = 15336; public static final int GUARD_SPACE_15337 = 15337; public static final int DOOR_SPACE_15338 = 15338; public static final int DOOR_SPACE_15339 = 15339; public static final int LIGHTING_SPACE_15340 = 15340; public static final int DECORATION_SPACE_15341 = 15341; public static final int GAME_SPACE = 15342; public static final int PRIZE_CHEST_SPACE = 15343; public static final int STONE_SPACE = 15344; public static final int ELEMENTAL_BALANCE_SPACE = 15345; public static final int RANGING_GAME_SPACE = 15346; public static final int FLOOR_SPACE_MID = 15347; public static final int FLOOR_SPACE_SIDE = 15348; public static final int FLOOR_SPACE_CORNER = 15349; public static final int FLOOR_SPACE = 15350; public static final int FLOOR_SPACE_15351 = 15351; public static final int PRISON_SPACE = 15352; public static final int PRISON_SPACE_15353 = 15353; public static final int GUARD_SPACE_15354 = 15354; public static final int LIGHTING_SPACE_15355 = 15355; public static final int LADDER_SPACE = 15356; public static final int DOOR_SPACE_15357 = 15357; public static final int DOOR_SPACE_15358 = 15358; public static final int DOOR_SPACE_15359 = 15359; public static final int DOOR_SPACE_15360 = 15360; public static final int CENTREPIECE_SPACE = 15361; public static final int BIG_TREE_SPACE = 15362; public static final int TREE_SPACE = 15363; public static final int BIG_PLANT_SPACE_1 = 15364; public static final int BIG_PLANT_SPACE_2 = 15365; public static final int SMALL_PLANT_SPACE_1 = 15366; public static final int SMALL_PLANT_SPACE_2 = 15367; public static final int CENTREPIECE_SPACE_15368 = 15368; public static final int FENCING = 15369; public static final int HEDGING = 15370; public static final int HEDGING_15371 = 15371; public static final int HEDGING_15372 = 15372; public static final int BIG_PLANT = 15373; public static final int BIG_PLANT_2 = 15374; public static final int SMALL_PLANT = 15375; public static final int SMALL_PLANT_2 = 15376; public static final int RUG_SPACE_15377 = 15377; public static final int RUG_SPACE_15378 = 15378; public static final int RUG_SPACE_15379 = 15379; public static final int STAIR_SPACE = 15380; public static final int STAIR_SPACE_15381 = 15381; public static final int HEAD_TROPHY_SPACE = 15382; public static final int FISHING_TROPHY_SPACE = 15383; public static final int ARMOUR_SPACE = 15384; public static final int ARMOUR_SPACE_15385 = 15385; public static final int RUNE_CASE_SPACE = 15386; public static final int RUG_SPACE_15387 = 15387; public static final int RUG_SPACE_15388 = 15388; public static final int RUG_SPACE_15389 = 15389; public static final int STAIR_SPACE_15390 = 15390; public static final int STAIR_SPACE_15391 = 15391; public static final int PORTRAIT_SPACE = 15392; public static final int LANDSCAPE_SPACE = 15393; public static final int GUILD_TROPHY_SPACE = 15394; public static final int SWORD_SPACE = 15395; public static final int MAP_SPACE = 15396; public static final int BOOKCASE_SPACE_15397 = 15397; public static final int STOVE_SPACE = 15398; public static final int SHELF_SPACE = 15399; public static final int SHELF_SPACE_15400 = 15400; public static final int BARREL_SPACE = 15401; public static final int CAT_BASKET_SPACE = 15402; public static final int LARDER_SPACE = 15403; public static final int SINK_SPACE = 15404; public static final int TABLE_SPACE_15405 = 15405; public static final int PORTAL_SPACE = 15406; public static final int PORTAL_SPACE_15407 = 15407; public static final int PORTAL_SPACE_15408 = 15408; public static final int CENTREPIECE_SPACE_15409 = 15409; public static final int ROCK_15410 = 15410; public static final int STEPPING_STONE_15412 = 15412; public static final int TEMP_STONE_4_ZIP = 15413; public static final int TROPICAL_TREE_15414 = 15414; public static final int TROPICAL_TREE_15415 = 15415; public static final int TROPICAL_TREE_15416 = 15416; public static final int MONKEYBARS_15417 = 15417; public static final int MONKEYBARS_15419 = 15419; public static final int LECTERN_SPACE = 15420; public static final int GLOBE_SPACE = 15421; public static final int CRYSTAL_BALL_SPACE = 15422; public static final int WALL_CHART_SPACE = 15423; public static final int TELESCOPE_SPACE = 15424; public static final int BOOKCASE_SPACE_15425 = 15425; public static final int THRONE_SPACE = 15426; public static final int FLOOR_SPACE_15427 = 15427; public static final int FLOOR_SPACE_15428 = 15428; public static final int FLOOR_SPACE_15429 = 15429; public static final int FLOOR_SPACE_15430 = 15430; public static final int FLOOR_SPACE_15431 = 15431; public static final int FLOOR_SPACE_15432 = 15432; public static final int DECORATION_SPACE_15433 = 15433; public static final int DECORATION_SPACE_15434 = 15434; public static final int LEVER_SPACE = 15435; public static final int SEATING_SPACE_15436 = 15436; public static final int SEATING_SPACE_15437 = 15437; public static final int TRAPDOOR_SPACE = 15438; public static final int WORKBENCH_SPACE = 15439; public static final int NOTHING_15440 = 15440; public static final int CLOCKMAKING_SPACE = 15441; public static final int NOTHING_15442 = 15442; public static final int TOOL_SPACE = 15443; public static final int TOOL_SPACE_15444 = 15444; public static final int TOOL_SPACE_15445 = 15445; public static final int TOOL_SPACE_15446 = 15446; public static final int TOOL_SPACE_15447 = 15447; public static final int REPAIR_SPACE = 15448; public static final int NOTHING_15449 = 15449; public static final int HERALDRY_SPACE = 15450; public static final int DOOR_15452 = 15452; public static final int BOOKCASE_15461 = 15461; public static final int CHAIR_15462 = 15462; public static final int HAT_STAND_15463 = 15463; public static final int PICTURE_15464 = 15464; public static final int DISPLAY_BOARD = 15465; public static final int STONE_CRUSHER = 15466; public static final int CLEANING_SUPPLIES = 15467; public static final int POWER_SAW = 15468; public static final int EMBALMING_TUBE = 15469; public static final int FISH_BOWL = 15471; public static final int GLOVES_AND_DUSTER = 15472; public static final int MAHOGANY_TABLE_15473 = 15473; public static final int PORTAL_15477 = 15477; public static final int PORTAL_15478 = 15478; public static final int PORTAL_15479 = 15479; public static final int PORTAL_15480 = 15480; public static final int PORTAL_15481 = 15481; public static final int SKULL_SLOPE_15483 = 15483; public static final int ROPE_15487 = 15487; public static final int TROPICAL_TREE_15488 = 15488; public static final int TROPICAL_TREE_15489 = 15489; public static final int KALPHITE_QUEEN = 15490; public static final int HOLE_15491 = 15491; public static final int WHEAT_15506 = 15506; public static final int WHEAT_15507 = 15507; public static final int WHEAT_15508 = 15508; public static final int GATE_15510 = 15510; public static final int GATE_15511 = 15511; public static final int GATE_15512 = 15512; public static final int GATE_15513 = 15513; public static final int GATE_15514 = 15514; public static final int GATE_15515 = 15515; public static final int GATE_15516 = 15516; public static final int GATE_15517 = 15517; public static final int MOUSE_HOLE = 15518; public static final int MOUSE_HOLE_15519 = 15519; public static final int PIANO_STOOL_15521 = 15521; public static final int SIGNPOST_15522 = 15522; public static final int TRAPDOOR_15523 = 15523; public static final int BARREL_15524 = 15524; public static final int ROCK_15536 = 15536; public static final int ROCK_15537 = 15537; public static final int SNAKE = 15541; public static final int SNAKE_15542 = 15542; public static final int SNAKE_15543 = 15543; public static final int HOLE_15544 = 15544; public static final int SNAKE_15545 = 15545; public static final int SNAKE_15546 = 15546; public static final int ARMOUR_15547 = 15547; public static final int ARMOUR_15548 = 15548; public static final int SKELETON_15549 = 15549; public static final int SKELETON_15550 = 15550; public static final int SKELETON_15551 = 15551; public static final int SKELETON_15559 = 15559; public static final int LOCKER_15560 = 15560; public static final int DRAGONS_HEAD_15561 = 15561; public static final int DRAGONS_HEAD_15562 = 15562; public static final int DRAGONS_HEAD_15563 = 15563; public static final int DRAGONS_HEAD_15564 = 15564; public static final int DRAGONS_HEAD_15565 = 15565; public static final int WARNING_SIGN_15566 = 15566; public static final int STOOL_15567 = 15567; public static final int SMALL_TABLE_15568 = 15568; public static final int BOOKCASE_15569 = 15569; public static final int SNAKE_15570 = 15570; public static final int ROPE_15571 = 15571; public static final int PIT_15572 = 15572; public static final int TCHIKI_MONKEY_NUT_BUSH = 15573; public static final int STRANGE_BANANA_TREE = 15574; public static final int LIGHT_15575 = 15575; public static final int BANANA_TREE_15576 = 15576; public static final int BANANA_TREE_15577 = 15577; public static final int RED_BANANA_TREE = 15578; public static final int RED_BANANA_TREE_15579 = 15579; public static final int DWARF_REMAINS = 15596; public static final int BOXES_15598 = 15598; public static final int CRATE_15599 = 15599; public static final int CRATES_15600 = 15600; public static final int RAILING_15601 = 15601; public static final int RAILING_15602 = 15602; public static final int RAILING_15603 = 15603; public static final int GATE_15604 = 15604; public static final int GATE_15605 = 15605; public static final int WOODEN_BEAMS = 15608; public static final int GAP_15609 = 15609; public static final int GAP_15610 = 15610; public static final int GAP_15611 = 15611; public static final int GAP_15612 = 15612; public static final int SNOW = 15615; public static final int SNOW_15616 = 15616; public static final int SNOW_15617 = 15617; public static final int SPOTLIGHT = 15625; public static final int INCUBATION_CHAMBER = 15638; public static final int STAIRCASE_15645 = 15645; public static final int STAIRCASE_15646 = 15646; public static final int STAIRCASE_15647 = 15647; public static final int STAIRCASE_15648 = 15648; public static final int STAIRCASE_15649 = 15649; public static final int STAIRCASE_15650 = 15650; public static final int STAIRCASE_15651 = 15651; public static final int STAIRCASE_15652 = 15652; public static final int STAIRCASE_15653 = 15653; public static final int STAIRCASE_15654 = 15654; public static final int STAIRCASE_15655 = 15655; public static final int STAIRCASE_15656 = 15656; public static final int STAIRCASE_15657 = 15657; public static final int HEAVY_DOOR = 15658; public static final int HEAVY_DOOR_15659 = 15659; public static final int HEAVY_DOOR_15660 = 15660; public static final int HEAVY_DOOR_15661 = 15661; public static final int KEG_15662 = 15662; public static final int KEG_15663 = 15663; public static final int SHOT = 15664; public static final int SHOT_15665 = 15665; public static final int KEG_15668 = 15668; public static final int BARREL_15674 = 15674; public static final int BARREL_15675 = 15675; public static final int BARREL_15676 = 15676; public static final int BANK_TABLE_15677 = 15677; public static final int SINK_15678 = 15678; public static final int STOOL_15679 = 15679; public static final int TABLE_15680 = 15680; public static final int BED_15683 = 15683; public static final int TABLE_15684 = 15684; public static final int COOKING_SHELVES_15685 = 15685; public static final int COOKING_SHELVES_15686 = 15686; public static final int PORTRAIT_15690 = 15690; public static final int PAINTING_15691 = 15691; public static final int CRATE_15692 = 15692; public static final int CRATES_15693 = 15693; public static final int CRATE_15695 = 15695; public static final int CRATE_15696 = 15696; public static final int CRATE_15697 = 15697; public static final int CRATE_15698 = 15698; public static final int BOX_CART = 15699; public static final int BOX_CART_15700 = 15700; public static final int CRATE_15704 = 15704; public static final int CRATE_15705 = 15705; public static final int CRATE_15706 = 15706; public static final int CRATE_15707 = 15707; public static final int ZANIK = 15709; public static final int ZANIK_15711 = 15711; public static final int DRILLING_MACHINE = 15713; public static final int DRILLING_MACHINE_15714 = 15714; public static final int BROKEN_DRILLING_MACHINE = 15715; public static final int TABLE_15719 = 15719; public static final int CRATE_15720 = 15720; public static final int CRATE_15721 = 15721; public static final int SMALL_CHEST = 15722; public static final int SMALL_CHEST_15723 = 15723; public static final int SMALL_CHEST_15724 = 15724; public static final int SMALL_CHEST_15725 = 15725; public static final int SMALL_CHEST_15726 = 15726; public static final int DRIP = 15727; public static final int DRIPS = 15728; public static final int CRACK_15731 = 15731; public static final int WALL_15732 = 15732; public static final int WALL_15733 = 15733; public static final int LADDER_15746 = 15746; public static final int LADDER_15747 = 15747; public static final int TUNNEL_15748 = 15748; public static final int TUNNEL_15749 = 15749; public static final int TUNNEL_15750 = 15750; public static final int TUNNEL_15751 = 15751; public static final int TRAPDOOR_15752 = 15752; public static final int TRAPDOOR_15753 = 15753; public static final int RUBBLE_15754 = 15754; public static final int HIDDEN_TRAPDOOR = 15755; public static final int TRAPDOOR_15756 = 15756; public static final int LARGE_DOOR_15757 = 15757; public static final int LARGE_DOOR_15758 = 15758; public static final int DOOR_15759 = 15759; public static final int SACK_15760 = 15760; public static final int SACK_PILE_15761 = 15761; public static final int SACKS_15762 = 15762; public static final int BED_15767 = 15767; public static final int CRATE_15768 = 15768; public static final int CRATE_15769 = 15769; public static final int PASSAGEWAY_15770 = 15770; public static final int PASSAGEWAY_15771 = 15771; public static final int PASSAGEWAY_15772 = 15772; public static final int PASSAGEWAY_15773 = 15773; public static final int PASSAGEWAY_15774 = 15774; public static final int CRATE_15816 = 15816; public static final int BARREL_15817 = 15817; public static final int BUFFERS_15825 = 15825; public static final int CART_TUNNEL_15830 = 15830; public static final int CART_TUNNEL_15831 = 15831; public static final int WALL_SUPPORT_15832 = 15832; public static final int ENTRANCE_15833 = 15833; public static final int ENTRANCE_15834 = 15834; public static final int BAMBOO_PIPES = 15837; public static final int BAMBOO_PIPES_15838 = 15838; public static final int BAMBOO_PIPES_15839 = 15839; public static final int BAMBOO_PIPES_15840 = 15840; public static final int BAMBOO_PIPES_15841 = 15841; public static final int BAMBOO_PIPES_15842 = 15842; public static final int BAMBOO_PIPES_15843 = 15843; public static final int BAMBOO_PIPES_15844 = 15844; public static final int RUM_CRATE = 15845; public static final int RED_FLOWERS = 15846; public static final int HOPPER_15847 = 15847; public static final int HOPPER_15848 = 15848; public static final int HOPPER_15849 = 15849; public static final int HOPPER_15850 = 15850; public static final int HOPPER_15851 = 15851; public static final int HOPPER_15852 = 15852; public static final int HOPPER_15853 = 15853; public static final int HOPPER_15854 = 15854; public static final int BRIDGE_15855 = 15855; public static final int BRIDGE_15856 = 15856; public static final int BRIDGE_15857 = 15857; public static final int BRIDGE_15858 = 15858; public static final int BRIDGE_15859 = 15859; public static final int BRIDGE_15860 = 15860; public static final int BRIDGE_15861 = 15861; public static final int BRIDGE_15862 = 15862; public static final int BAMBOO_PIPES_15863 = 15863; public static final int BAMBOO_PIPES_15864 = 15864; public static final int BAMBOO_PIPES_15865 = 15865; public static final int BAMBOO_PIPES_15866 = 15866; public static final int BAMBOO_PIPES_15867 = 15867; public static final int BAMBOO_PIPES_15868 = 15868; public static final int BAMBOO_PIPES_15869 = 15869; public static final int BAMBOO_PIPES_15870 = 15870; public static final int RUM_CRATE_15871 = 15871; public static final int BLUE_FLOWERS = 15872; public static final int HOPPER_15873 = 15873; public static final int HOPPER_15874 = 15874; public static final int HOPPER_15875 = 15875; public static final int HOPPER_15876 = 15876; public static final int HOPPER_15877 = 15877; public static final int HOPPER_15878 = 15878; public static final int HOPPER_15879 = 15879; public static final int HOPPER_15880 = 15880; public static final int BRIDGE_15881 = 15881; public static final int BRIDGE_15882 = 15882; public static final int BRIDGE_15883 = 15883; public static final int BRIDGE_15884 = 15884; public static final int BRIDGE_15885 = 15885; public static final int BRIDGE_15886 = 15886; public static final int BRIDGE_15887 = 15887; public static final int BRIDGE_15888 = 15888; public static final int BAMBOO_LADDER_15890 = 15890; public static final int BAMBOO_LADDER_15891 = 15891; public static final int BAMBOO_LADDER_15892 = 15892; public static final int BAMBOO_LADDER_15893 = 15893; public static final int BAMBOO_LADDER_15894 = 15894; public static final int BAMBOO_LADDER_15895 = 15895; public static final int COPPER_LADDER = 15896; public static final int COPPER_LADDER_15897 = 15897; public static final int COPPER_LADDER_15898 = 15898; public static final int COPPER_LADDER_15899 = 15899; public static final int COPPER_LADDER_15900 = 15900; public static final int COPPER_LADDER_15901 = 15901; public static final int POSTS = 15902; public static final int BOILER_15903 = 15903; public static final int BOILER_15904 = 15904; public static final int BOILER_15905 = 15905; public static final int BOILER_15906 = 15906; public static final int BOILER_15907 = 15907; public static final int BOILER_15908 = 15908; public static final int BOILER_15909 = 15909; public static final int BOILER_15910 = 15910; public static final int BOILER_15911 = 15911; public static final int BOILER_15912 = 15912; public static final int BOILER_15913 = 15913; public static final int BOILER_15914 = 15914; public static final int MIDDLE_SECTION = 15916; public static final int MIDDLE_SECTION_15917 = 15917; public static final int MIDDLE_SECTION_15918 = 15918; public static final int MIDDLE_SECTION_15919 = 15919; public static final int MIDDLE_SECTION_15920 = 15920; public static final int MIDDLE_SECTION_15921 = 15921; public static final int BOTTLE_MACHINE = 15922; public static final int BOTTLE_MACHINE_15923 = 15923; public static final int CONVEYOR_BELT_15924 = 15924; public static final int CONVEYOR_BELT_15925 = 15925; public static final int CONVEYOR_BELT_15926 = 15926; public static final int CONVEYOR_BELT_15927 = 15927; public static final int STEAM_PUMP = 15928; public static final int STEAM_PUMP_15929 = 15929; public static final int STEAM_PUMP_15930 = 15930; public static final int LOG_STORE = 15931; public static final int WORKBENCH_15932 = 15932; public static final int WORKBENCH_15933 = 15933; public static final int WORKBENCH_15934 = 15934; public static final int WATERING_HOLE = 15935; public static final int WATER_PUMP = 15936; public static final int WATER_PUMP_15937 = 15937; public static final int WATER_PUMP_15938 = 15938; public static final int RED_FLOWERS_15939 = 15939; public static final int BLUE_FLOWERS_15940 = 15940; public static final int RED_FLOWERS_15941 = 15941; public static final int BLUE_FLOWERS_15942 = 15942; public static final int STASH_EASY = 15943; public static final int INCONSPICUOUS_HOLE_EASY = 15944; public static final int STASH_EASY_15945 = 15945; public static final int SWEETGRUB_MOUND = 15946; public static final int SWEETGRUB_MOUND_15947 = 15947; public static final int JUNGLE_TREE_15948 = 15948; public static final int JUNGLE_TREE_15949 = 15949; public static final int JUNGLE_TREE_15950 = 15950; public static final int JUNGLE_TREE_15951 = 15951; public static final int JUNGLE_TREE_15952 = 15952; public static final int JUNGLE_TREE_15953 = 15953; public static final int JUNGLE_TREE_15954 = 15954; public static final int JUNGLE_TREE_15955 = 15955; public static final int JUNGLE_TREE_15956 = 15956; public static final int TROPICAL_TREE_15957 = 15957; public static final int TROPICAL_TREE_15958 = 15958; public static final int TROPICAL_TREE_15959 = 15959; public static final int TROPICAL_LEAVES_15960 = 15960; public static final int BITTERNUT_TREE = 15961; public static final int BITTERNUT_TREE_15962 = 15962; public static final int BITTERNUT_TREE_15963 = 15963; public static final int BITTERNUT_TREE_15964 = 15964; public static final int BITTERNUT_TREE_15965 = 15965; public static final int BITTERNUT_TREE_15966 = 15966; public static final int BITTERNUT_TREE_15967 = 15967; public static final int BITTERNUT_TREE_15968 = 15968; public static final int BITTERNUT_TREE_15969 = 15969; public static final int SCRAPEY_TREE = 15970; public static final int SCRAPEY_TREE_15971 = 15971; public static final int JUNGLE_PLANT_15978 = 15978; public static final int CHAIR_15981 = 15981; public static final int TABLE_15982 = 15982; public static final int KETTLE = 15983; public static final int WAITING_ROOM_DOOR = 15984; public static final int DEPOSIT_BOX = 15985; public static final int BITTERNUT_SIGN = 15986; public static final int SWEETGRUB_SIGN = 15987; public static final int SCRAPEY_BARK_SIGN = 15988; public static final int RED_WATER_SIGN = 15989; public static final int BLUE_WATER_SIGN = 15990; public static final int WATER_SIGN = 15991; public static final int SIGN_15992 = 15992; public static final int SIGN_15993 = 15993; public static final int SIGN_15994 = 15994; public static final int STALL = 15995; public static final int PORTAL_15996 = 15996; public static final int PIRATE_FLAG = 15997; public static final int PIRATE_FLAG_15998 = 15998; public static final int CRATE_16001 = 16001; public static final int CRATE_16002 = 16002; public static final int BARREL_16003 = 16003; public static final int STEPPING_LOG = 16005; public static final int STEPPING_LOG_16006 = 16006; public static final int STEPPING_LOG_16007 = 16007; public static final int STEPPING_STONE_16012 = 16012; public static final int STEPPING_STONE_16013 = 16013; public static final int INCONSPICUOUS_ROCKS_EASY = 16014; public static final int STASH_EASY_16015 = 16015; public static final int INCONSPICUOUS_CRATE_EASY = 16016; public static final int STASH_EASY_16017 = 16017; public static final int INCONSPICUOUS_BUSH_MEDIUM = 16018; public static final int STASH_MEDIUM = 16019; public static final int INCONSPICUOUS_HOLE_MEDIUM = 16020; public static final int STASH_MEDIUM_16021 = 16021; public static final int INCONSPICUOUS_ROCKS_MEDIUM = 16022; public static final int STASH_MEDIUM_16023 = 16023; public static final int INCONSPICUOUS_CRATE_MEDIUM = 16024; public static final int BARS_16027 = 16027; public static final int BARS_16028 = 16028; public static final int BARS_16029 = 16029; public static final int BARS_16030 = 16030; public static final int STAIRS_16031 = 16031; public static final int STAIRS_16032 = 16032; public static final int BUSH_16059 = 16059; public static final int EXIT_16060 = 16060; public static final int EXIT_16061 = 16061; public static final int TROPICAL_TREE_16062 = 16062; public static final int VINE_16066 = 16066; public static final int TROPICAL_TREE_16071 = 16071; public static final int ROCK_16077 = 16077; public static final int ROCK_16078 = 16078; public static final int ROCK_16079 = 16079; public static final int ROCK_16080 = 16080; public static final int EXIT_16100 = 16100; public static final int SIGNPOST_16104 = 16104; public static final int ENERGY_BARRIER_16105 = 16105; public static final int STAIRS_16108 = 16108; public static final int STAIRS_16109 = 16109; public static final int LADDER_16110 = 16110; public static final int SHIPS_LADDER_16111 = 16111; public static final int SHIPS_LADDER_16112 = 16112; public static final int TRAPDOOR_16113 = 16113; public static final int TRAPDOOR_16114 = 16114; public static final int ROCK_16115 = 16115; public static final int CLOSED_CHEST_16116 = 16116; public static final int OPEN_CHEST_16117 = 16117; public static final int CLOSED_CHEST_16118 = 16118; public static final int OPEN_CHEST_16119 = 16119; public static final int PASSAGEWAY_16129 = 16129; public static final int PASSAGEWAY_16130 = 16130; public static final int PASSAGEWAY_16131 = 16131; public static final int PASSAGEWAY_16132 = 16132; public static final int PASSAGEWAY_16133 = 16133; public static final int PASSAGEWAY_16134 = 16134; public static final int ROCK_16136 = 16136; public static final int TRAPDOOR_16168 = 16168; public static final int TABLE_16169 = 16169; public static final int TABLE_16170 = 16170; public static final int WATERLILY_16177 = 16177; public static final int WATERLILY_16178 = 16178; public static final int WATERLILY_16179 = 16179; public static final int CLOUD_BANK = 16187; public static final int CLOUD_BANK_16189 = 16189; public static final int LIGHTNING = 16190; public static final int LIGHTNING_16191 = 16191; public static final int LIFELESS_MATTER = 16198; public static final int LIFELESS_MATTER_16199 = 16199; public static final int FAIRY_WORKBENCH = 16213; public static final int FAIRY_WORKBENCH_16215 = 16215; public static final int POTION_SHELVES_16217 = 16217; public static final int POTION_SHELVES_16219 = 16219; public static final int POTION_SHELF_16221 = 16221; public static final int POTION_SHELF_16223 = 16223; public static final int HEALING_CERTIFICATE_16224 = 16224; public static final int HURT_FAIRY = 16234; public static final int INJURED_FAIRY = 16235; public static final int WOUNDED_FAIRY = 16236; public static final int HURT_FAIRY_16237 = 16237; public static final int STRETCHER = 16238; public static final int FIRST_AID_BOX = 16239; public static final int CRUTCH = 16240; public static final int CRUTCH_16241 = 16241; public static final int CRUTCH_16242 = 16242; public static final int MEDICAL_TABLE = 16244; public static final int MAP_TABLE = 16245; public static final int STOOL_16246 = 16246; public static final int WALL_MAP = 16247; public static final int CRATE_OF_WANDS = 16248; public static final int CRATE_16249 = 16249; public static final int CRATE_16250 = 16250; public static final int CRATES_16251 = 16251; public static final int CRATE_16252 = 16252; public static final int BARREL_16253 = 16253; public static final int TACTICAL_MAP_FRAME = 16254; public static final int STALAGMITE_16260 = 16260; public static final int STALAGMITE_16261 = 16261; public static final int STALAGMITE_16262 = 16262; public static final int STALAGMITE_16263 = 16263; public static final int TREE_16264 = 16264; public static final int TREE_16265 = 16265; public static final int TREE_STUMP_16266 = 16266; public static final int PLANT_16267 = 16267; public static final int PLANT_16268 = 16268; public static final int PLANT_16269 = 16269; public static final int PLANT_16270 = 16270; public static final int LARGE_ROCK = 16283; public static final int LARGE_ROCK_16284 = 16284; public static final int WATERFALL = 16302; public static final int SMALL_ROCK_16303 = 16303; public static final int STRETCHER_16304 = 16304; public static final int FAIRY_QUEEN_16305 = 16305; public static final int FAIRY_QUEEN_16306 = 16306; public static final int RUNE_TEMPLE_SIGN = 16307; public static final int CAVE_ENTRANCE_16308 = 16308; public static final int CAVE_ENTRANCE_16309 = 16309; public static final int POTION_SHELVES_16374 = 16374; public static final int POTION_SHELVES_16375 = 16375; public static final int POTION_SHELF_16376 = 16376; public static final int POTION_SHELF_16377 = 16377; public static final int HEALING_CERTIFICATE_16378 = 16378; public static final int HEALING_CERTIFICATE_16379 = 16379; public static final int LADDER_16450 = 16450; public static final int ROCKS_16464 = 16464; public static final int CREVICE_16465 = 16465; public static final int STEPPING_STONE_16466 = 16466; public static final int INCUBATION_CHAMBER_16467 = 16467; public static final int TIGHTGAP = 16468; public static final int FURNACE_16469 = 16469; public static final int WHETSTONE_16470 = 16470; public static final int BELLOWS_16471 = 16471; public static final int LATHE_16472 = 16472; public static final int JUNK_16473 = 16473; public static final int COAL = 16474; public static final int COAL_16475 = 16475; public static final int CONTAINER = 16491; public static final int GATE_16492 = 16492; public static final int GATE_16493 = 16493; public static final int FLAGPOLE_16494 = 16494; public static final int OBSTACLE_NET = 16499; public static final int OBSTACLE_PIPE_16500 = 16500; public static final int EXERCISE_MAT_16508 = 16508; public static final int OBSTACLE_PIPE_16509 = 16509; public static final int STRANGE_FLOOR = 16510; public static final int OBSTACLE_PIPE_16511 = 16511; public static final int STEPPING_STONE_16513 = 16513; public static final int ROCKS_16514 = 16514; public static final int ROCKS_16515 = 16515; public static final int FENCE_16517 = 16517; public static final int FENCE_16518 = 16518; public static final int CASTLE_WALL = 16519; public static final int HOLE_16520 = 16520; public static final int ROCKS_16521 = 16521; public static final int ROCKS_16522 = 16522; public static final int ROCKS_16523 = 16523; public static final int ROCKS_16524 = 16524; public static final int WEATHERED_WALL = 16525; public static final int WEATHERED_WALL_16526 = 16526; public static final int UNDERWALL_TUNNEL = 16527; public static final int UNDERWALL_TUNNEL_16528 = 16528; public static final int UNDERWALL_TUNNEL_16529 = 16529; public static final int UNDERWALL_TUNNEL_16530 = 16530; public static final int DAMAGED_WALL_16531 = 16531; public static final int JUTTING_WALL = 16532; public static final int STEPPING_STONE_16533 = 16533; public static final int ROCKS_16534 = 16534; public static final int ROCKS_16535 = 16535; public static final int SPIKEY_CHAIN = 16537; public static final int SPIKEY_CHAIN_16538 = 16538; public static final int CREVICE_16539 = 16539; public static final int LOG_BALANCE_16540 = 16540; public static final int LOG_BALANCE_16541 = 16541; public static final int LOG_BALANCE_16542 = 16542; public static final int CREVICE_16543 = 16543; public static final int STRANGE_FLOOR_16544 = 16544; public static final int ROCKS_16545 = 16545; public static final int LOG_BALANCE_16546 = 16546; public static final int LOG_BALANCE_16547 = 16547; public static final int LOG_BALANCE_16548 = 16548; public static final int ROCKS_16549 = 16549; public static final int ROCKS_16550 = 16550; public static final int ORNATE_RAILING = 16552; public static final int LADDER_16556 = 16556; public static final int LADDER_16557 = 16557; public static final int CHANGING_CURTAIN = 16558; public static final int CRATE_16559 = 16559; public static final int CRATE_16560 = 16560; public static final int CRATE_16561 = 16561; public static final int TABLE_16562 = 16562; public static final int CRATE_16564 = 16564; public static final int CRATE_16565 = 16565; public static final int BARREL_16566 = 16566; public static final int STANDARD_16568 = 16568; public static final int STANDARD_16569 = 16569; public static final int TIMBER_DEFENCE_16573 = 16573; public static final int LOG_PILE_16585 = 16585; public static final int LOG_PILE_16586 = 16586; public static final int LOG_PILE_16587 = 16587; public static final int LOG_PILE_16588 = 16588; public static final int LOG_PILE_16589 = 16589; public static final int LOG_PILE_16590 = 16590; public static final int LOG_PILE_16591 = 16591; public static final int LOG_PILE_16592 = 16592; public static final int LOG_PILE_16593 = 16593; public static final int LOG_PILE_16594 = 16594; public static final int DREAM_PUFF = 16598; public static final int MY_LIFE = 16599; public static final int HURDLE_16600 = 16600; public static final int NOTE = 16601; public static final int NOTE_16602 = 16602; public static final int DREAM_TREE = 16604; public static final int DREAM_TREE_STUMP = 16605; public static final int ZERO = 16619; public static final int ONE = 16620; public static final int TWO = 16621; public static final int THREE = 16622; public static final int FOUR = 16623; public static final int FIVE = 16624; public static final int SIX = 16625; public static final int SEVEN = 16626; public static final int EIGHT = 16627; public static final int NINE = 16628; public static final int PLATFORM_16632 = 16632; public static final int PLATFORM_16633 = 16633; public static final int PLATFORM_16634 = 16634; public static final int PLATFORM_16635 = 16635; public static final int PLATFORM_16636 = 16636; public static final int PLATFORM_16637 = 16637; public static final int DREAM_PUFF_16638 = 16638; public static final int WINDSWEPT_TREE = 16639; public static final int MAST_16640 = 16640; public static final int COOKING_RANGE_16641 = 16641; public static final int BANK_BOOTH_16642 = 16642; public static final int CLOSED_BANK_BOOTH_16643 = 16643; public static final int COFFIN_16644 = 16644; public static final int COFFIN_16645 = 16645; public static final int STAIRCASE_16646 = 16646; public static final int STAIRCASE_16647 = 16647; public static final int ECTOFUNTUS = 16648; public static final int ECTOFUNTUS_16649 = 16649; public static final int BONE_GRINDER = 16650; public static final int GANGPLANK_16651 = 16651; public static final int GANGPLANK_16652 = 16652; public static final int PIRATE_CAPTAIN = 16653; public static final int LOADER = 16654; public static final int BONE_GRINDER_16655 = 16655; public static final int BIN = 16656; public static final int FURNACE_16657 = 16657; public static final int STAIRCASE_16661 = 16661; public static final int STAIRCASE_16662 = 16662; public static final int STAIRCASE_16663 = 16663; public static final int STAIRCASE_16664 = 16664; public static final int STAIRCASE_16665 = 16665; public static final int STAIRCASE_16666 = 16666; public static final int STAIRCASE_16667 = 16667; public static final int STAIRCASE_16668 = 16668; public static final int STAIRCASE_16669 = 16669; public static final int STAIRCASE_16670 = 16670; public static final int STAIRCASE_16671 = 16671; public static final int STAIRCASE_16672 = 16672; public static final int STAIRCASE_16673 = 16673; public static final int STAIRCASE_16674 = 16674; public static final int STAIRCASE_16675 = 16675; public static final int STAIRCASE_16676 = 16676; public static final int STAIRCASE_16677 = 16677; public static final int STAIRCASE_16678 = 16678; public static final int LADDER_16679 = 16679; public static final int LADDER_16680 = 16680; public static final int LADDER_16681 = 16681; public static final int LADDER_16682 = 16682; public static final int LADDER_16683 = 16683; public static final int LADDER_16684 = 16684; public static final int LADDER_16685 = 16685; public static final int PORTAL_16686 = 16686; public static final int RUNE_ESSENCE = 16687; public static final int TAR_BARREL = 16688; public static final int TANNING_BARREL = 16689; public static final int HAT_RACK = 16691; public static final int HAT_RACK_16692 = 16692; public static final int CLOTHES_RACK = 16693; public static final int BANK_CHEST_16695 = 16695; public static final int BANK_CHEST_16696 = 16696; public static final int CHEST_16697 = 16697; public static final int BANK_BOOTH_16700 = 16700; public static final int LIGHT_16701 = 16701; public static final int COOKER = 16702; public static final int COOKER_16703 = 16703; public static final int SINK_16704 = 16704; public static final int SINK_16705 = 16705; public static final int BENCH_16706 = 16706; public static final int BOOKCASE_16707 = 16707; public static final int TALL_MIRROR = 16708; public static final int BAGS_FOR_SALE = 16714; public static final int BAGS_FOR_SALE_16715 = 16715; public static final int BED_16719 = 16719; public static final int BED_16720 = 16720; public static final int BED_16721 = 16721; public static final int FLOWERS_16729 = 16729; public static final int FLOWERS_16730 = 16730; public static final int FLOWERS_16731 = 16731; public static final int STAIRS_16732 = 16732; public static final int STAIRS_16733 = 16733; public static final int STAIRS_16734 = 16734; public static final int LADDER_16735 = 16735; public static final int LADDER_16736 = 16736; public static final int TABLE_16737 = 16737; public static final int TABLE_16738 = 16738; public static final int TABLE_16739 = 16739; public static final int TABLE_16740 = 16740; public static final int TABLE_16741 = 16741; public static final int TABLE_16742 = 16742; public static final int CHAIR_16743 = 16743; public static final int CHAIR_16744 = 16744; public static final int STOOL_16745 = 16745; public static final int DOOR_16774 = 16774; public static final int DOOR_16776 = 16776; public static final int DOOR_16777 = 16777; public static final int DOOR_16778 = 16778; public static final int DOOR_16779 = 16779; public static final int CEREMONIAL_BRAZIER = 16808; public static final int CEREMONIAL_BRAZIER_16809 = 16809; public static final int CEREMONIAL_BRAZIER_16810 = 16810; public static final int CEREMONIAL_BRAZIER_16811 = 16811; public static final int COOKER_16812 = 16812; public static final int RACK_16813 = 16813; public static final int STOOL_16814 = 16814; public static final int TABLE_16815 = 16815; public static final int TABLE_16827 = 16827; public static final int TABLE_16828 = 16828; public static final int TRANSPORT_PLATFORM = 16829; public static final int TRANSPORT_PLATFORM_16831 = 16831; public static final int TRANSPORT_PLATFORM_16833 = 16833; public static final int TRANSPORT_PLATFORM_16835 = 16835; public static final int TRANSPORT_PLATFORM_16837 = 16837; public static final int TRANSPORT_PLATFORM_16839 = 16839; public static final int TRANSPORT_PLATFORM_16841 = 16841; public static final int DICE = 16843; public static final int DICE_16844 = 16844; public static final int DICE_16845 = 16845; public static final int DICE_16846 = 16846; public static final int DICE_16847 = 16847; public static final int DICE_16848 = 16848; public static final int DICE_16849 = 16849; public static final int DICE_16850 = 16850; public static final int DICE_16851 = 16851; public static final int DICE_16852 = 16852; public static final int DICE_16853 = 16853; public static final int DICE_16854 = 16854; public static final int DICE_16855 = 16855; public static final int DREAM_PUFF_16856 = 16856; public static final int DREAM_PUFF_16857 = 16857; public static final int PLATFORM_EDGE = 16858; public static final int HANGING_PIRATE = 16859; public static final int TAR_BARREL_16860 = 16860; public static final int HAMMOCK_16861 = 16861; public static final int CRATE_16862 = 16862; public static final int CRATE_16863 = 16863; public static final int CRATE_16864 = 16864; public static final int CRATE_16865 = 16865; public static final int SACK_PILE_16866 = 16866; public static final int SACK_PILE_16867 = 16867; public static final int SACK_PILE_16868 = 16868; public static final int SACK_PILE_16869 = 16869; public static final int SACK_PILE_16870 = 16870; public static final int SACK_PILE_16871 = 16871; public static final int FISH_BITS = 16872; public static final int FISH_BITS_16873 = 16873; public static final int STOOL_16874 = 16874; public static final int STOOL_16875 = 16875; public static final int BARREL_16876 = 16876; public static final int BARREL_16877 = 16877; public static final int SACK_16878 = 16878; public static final int CANNONBALLS_16879 = 16879; public static final int CANNONBALLS_16880 = 16880; public static final int BARREL_16881 = 16881; public static final int BARREL_16882 = 16882; public static final int BARREL_16883 = 16883; public static final int BARREL_16884 = 16884; public static final int BARREL_16885 = 16885; public static final int BARREL_16886 = 16886; public static final int WOODEN_CHEST = 16887; public static final int WOODEN_CHEST_16888 = 16888; public static final int WOODEN_CHEST_16889 = 16889; public static final int CHEST_16890 = 16890; public static final int CHEST_16891 = 16891; public static final int COOKING_RANGE_16893 = 16893; public static final int EXTRA_ANCHOR = 16894; public static final int EXTRA_CHAIN = 16895; public static final int WOODEN_TABLE_16899 = 16899; public static final int CHAIR_16900 = 16900; public static final int LANTERN_16901 = 16901; public static final int DOOR_16902 = 16902; public static final int DOOR_16903 = 16903; public static final int WHEEL = 16906; public static final int CANNON_16938 = 16938; public static final int CANNON_16939 = 16939; public static final int SUPPORT = 16941; public static final int STAIRS_16945 = 16945; public static final int STAIRS_16946 = 16946; public static final int STAIRS_16947 = 16947; public static final int STAIRS_16948 = 16948; public static final int SUPPORT_16951 = 16951; public static final int SUPPORT_16952 = 16952; public static final int CANNON_16953 = 16953; public static final int CRATE_16954 = 16954; public static final int WALL_CHART = 16955; public static final int CHEST_16956 = 16956; public static final int CRANE_16957 = 16957; public static final int ROW_BOAT_16958 = 16958; public static final int LADDER_16959 = 16959; public static final int LADDER_16960 = 16960; public static final int LADDER_16961 = 16961; public static final int LADDER_16962 = 16962; public static final int SHELF_16968 = 16968; public static final int SHELF_16969 = 16969; public static final int SHELF_16970 = 16970; public static final int SHELF_16971 = 16971; public static final int SHELF_16972 = 16972; public static final int SHELF_16973 = 16973; public static final int TABLE_16974 = 16974; public static final int WALLCHART = 16975; public static final int CHART_16978 = 16978; public static final int CHART_16979 = 16979; public static final int CHART_16980 = 16980; public static final int SCROLLS_16981 = 16981; public static final int ROCKS_16998 = 16998; public static final int ROCKS_16999 = 16999; public static final int ORNATE_RAILING_17000 = 17000; public static final int DAMAGED_WALL_17001 = 17001; public static final int JUTTING_WALL_17002 = 17002; public static final int RICKETY_DOOR = 17009; public static final int LADDER_17026 = 17026; public static final int LADDER_17027 = 17027; public static final int LADDER_17028 = 17028; public static final int CROSSBOW_STALL = 17031; public static final int CRATE_17033 = 17033; public static final int STRONG_TREE = 17036; public static final int STRONG_TREE_17037 = 17037; public static final int STRONG_TREE_17038 = 17038; public static final int STRONG_YEW = 17039; public static final int STRONG_YEW_17040 = 17040; public static final int STRONG_YEW_17041 = 17041; public static final int ROCKS_17042 = 17042; public static final int ROCKS_17043 = 17043; public static final int STRONG_TREE_17046 = 17046; public static final int WALL_17047 = 17047; public static final int WALL_17048 = 17048; public static final int WALL_17049 = 17049; public static final int WALL_17050 = 17050; public static final int WALL_17051 = 17051; public static final int WALL_17052 = 17052; public static final int CROSSBOW_TREE = 17056; public static final int CROSSBOW_TREE_17057 = 17057; public static final int CROSSBOW_TREE_17058 = 17058; public static final int CROSSBOW_TREE_17059 = 17059; public static final int CROSSBOW_TREE_17060 = 17060; public static final int CROSSBOW_TREE_17061 = 17061; public static final int CROSSBOW_TREE_17062 = 17062; public static final int CROSSBOW_TREE_17063 = 17063; public static final int ROCKS_17064 = 17064; public static final int ROCKS_17065 = 17065; public static final int BROKEN_RAFT = 17068; public static final int BROKEN_RAFT_17069 = 17069; public static final int BROKEN_RAFT_17070 = 17070; public static final int BROKEN_RAFT_17071 = 17071; public static final int STRONG_TREE_17074 = 17074; public static final int STRONG_TREE_17075 = 17075; public static final int STRONG_TREE_17076 = 17076; public static final int STRONG_TREE_17077 = 17077; public static final int STRONG_TREE_17080 = 17080; public static final int STRONG_TREE_17081 = 17081; public static final int LARGE_DOOR_17089 = 17089; public static final int LARGE_DOOR_17090 = 17090; public static final int LARGE_DOOR_17091 = 17091; public static final int LARGE_DOOR_17092 = 17092; public static final int LARGE_DOOR_17093 = 17093; public static final int LARGE_DOOR_17094 = 17094; public static final int STAIRS_17098 = 17098; public static final int STAIRS_17099 = 17099; public static final int RICKETY_DOOR_17100 = 17100; public static final int DOOR_17114 = 17114; public static final int DOOR_17115 = 17115; public static final int POOL_OF_SLIME = 17116; public static final int POOL_OF_SLIME_17117 = 17117; public static final int POOL_OF_SLIME_17118 = 17118; public static final int POOL_OF_SLIME_17119 = 17119; public static final int LADDER_17120 = 17120; public static final int LADDER_17121 = 17121; public static final int LADDER_17122 = 17122; public static final int GNOME_CHAIR = 17125; public static final int GNOME_TABLE = 17126; public static final int GNOME_TABLE_17127 = 17127; public static final int GNOME_TABLE_17128 = 17128; public static final int GNOME_TABLE_17129 = 17129; public static final int OFFICE_TABLE = 17130; public static final int GNOME_COOKER = 17131; public static final int KITCHEN_CABINET = 17132; public static final int GNOME_CABINET = 17133; public static final int GNOME_BARREL = 17134; public static final int GNOME_BARRELS = 17135; public static final int GNOME_CRATES = 17136; public static final int GNOME_CRATE = 17137; public static final int OAKNOCK_STATUE = 17140; public static final int HEALTHORG_STATUE = 17141; public static final int STAIRCASE_17143 = 17143; public static final int BOXES_17144 = 17144; public static final int TABLE_17145 = 17145; public static final int CHAIR_17146 = 17146; public static final int LADDER_17148 = 17148; public static final int LADDER_17149 = 17149; public static final int STORAGE_SHELVES = 17150; public static final int SHELVES_17151 = 17151; public static final int SHELVES_17152 = 17152; public static final int SINISTER_BARREL_17153 = 17153; public static final int STAIRCASE_17155 = 17155; public static final int STOOL_17158 = 17158; public static final int LADDER_17159 = 17159; public static final int LADDER_17160 = 17160; public static final int CAULDRON_17161 = 17161; public static final int CAULDRON_17162 = 17162; public static final int GOBLIN_CROWD_17196 = 17196; public static final int GNOME_CROWD = 17197; public static final int GNOME_CROWD_17198 = 17198; public static final int GOBLIN_CROWD_17199 = 17199; public static final int GOBLIN_CROWD_17200 = 17200; public static final int GNOME_CROWD_17201 = 17201; public static final int GNOME_CROWD_17202 = 17202; public static final int GOBLIN_CROWD_17203 = 17203; public static final int GOBLIN_CROWD_17204 = 17204; public static final int GNOME_CROWD_17205 = 17205; public static final int GNOME_CROWD_17206 = 17206; public static final int A_GOBLIN_STANDARD = 17207; public static final int CAVE_ENTRANCE_17209 = 17209; public static final int TUNNEL_17222 = 17222; public static final int TUNNEL_17223 = 17223; public static final int DRAWERS_17232 = 17232; public static final int DRAWERS_17233 = 17233; public static final int CHAIR_17234 = 17234; public static final int TABLE_17235 = 17235; public static final int HAMMOCK_17236 = 17236; public static final int TORCH_17237 = 17237; public static final int ASPIDISTRA_PLANT = 17238; public static final int SINGING_BOWL = 17239; public static final int OAKNOCKS_MACHINE = 17240; public static final int OAKNOCKS_MACHINE_17241 = 17241; public static final int BROKEN_COGS = 17242; public static final int COGS_17243 = 17243; public static final int OAKNOCKS_MACHINE_17245 = 17245; public static final int OAKNOCKS_MACHINE_17246 = 17246; public static final int OAKNOCKS_MACHINE_17247 = 17247; public static final int OAKNOCKS_EXCHANGER = 17248; public static final int OAKNOCKS_EXCHANGER_17249 = 17249; public static final int RIFT_17256 = 17256; public static final int RIFT_17257 = 17257; public static final int RIFT_17258 = 17258; public static final int RIFT_17259 = 17259; public static final int RIFT_17260 = 17260; public static final int RIFT_17261 = 17261; public static final int RIFT_17262 = 17262; public static final int RIFT_17263 = 17263; public static final int RIFT_17264 = 17264; public static final int RIFT_17265 = 17265; public static final int RIFT_17266 = 17266; public static final int CRYSTAL_BRIDGE = 17267; public static final int A_CHASM = 17268; public static final int CRATE_17271 = 17271; public static final int MACHINE_PANEL = 17272; public static final int ARGENTO = 17273; public static final int ARGENTO_17274 = 17274; public static final int ARGENTO_17275 = 17275; public static final int ARGENTO_17276 = 17276; public static final int ARGENTO_17277 = 17277; public static final int ARGENTO_17278 = 17278; public static final int ARGENTO_17279 = 17279; public static final int DOOR_17284 = 17284; public static final int HOISTED_SAIL_17286 = 17286; public static final int HOISTED_SAIL_17287 = 17287; public static final int HOISTED_SAIL_17288 = 17288; public static final int HOISTED_SAIL_17289 = 17289; public static final int HOISTED_SAIL_17290 = 17290; public static final int HOISTED_SAIL_17291 = 17291; public static final int HOISTED_SAIL_17292 = 17292; public static final int HOISTED_SAIL_17293 = 17293; public static final int HOISTED_SAIL_17294 = 17294; public static final int HOISTED_SAIL_17295 = 17295; public static final int BARREL_17296 = 17296; public static final int BARREL_17297 = 17297; public static final int TABLE_17299 = 17299; public static final int CUPBOARD_17300 = 17300; public static final int CUPBOARD_17301 = 17301; public static final int CUPBOARD_17302 = 17302; public static final int CUPBOARD_17303 = 17303; public static final int CRATE_17304 = 17304; public static final int CRATE_17305 = 17305; public static final int STOOL_17306 = 17306; public static final int BARREL_17307 = 17307; public static final int BARREL_17308 = 17308; public static final int STUDY_DESK_17309 = 17309; public static final int CHAIR_17311 = 17311; public static final int BENCH_17312 = 17312; public static final int HEDGE_17313 = 17313; public static final int HEDGE_17314 = 17314; public static final int HEDGE_17315 = 17315; public static final int DOOR_17316 = 17316; public static final int DOOR_17317 = 17317; public static final int BOOKCASE_17319 = 17319; public static final int BOOKCASE_17320 = 17320; public static final int BOOKCASE_17321 = 17321; public static final int LOG_PILE_17322 = 17322; public static final int CANDLES_17323 = 17323; public static final int LIMESTONE_FIREPLACE_17325 = 17325; public static final int LAVA = 17334; public static final int LAVA_17335 = 17335; public static final int LAVA_17336 = 17336; public static final int LAVA_17337 = 17337; public static final int LAVA_17338 = 17338; public static final int LAVA_17339 = 17339; public static final int LAVA_17340 = 17340; public static final int LAVA_17341 = 17341; public static final int LAVA_17342 = 17342; public static final int LAVA_17343 = 17343; public static final int LAVA_17344 = 17344; public static final int LAVA_17345 = 17345; public static final int TABLE_17348 = 17348; public static final int ROCK_17350 = 17350; public static final int ROCK_17351 = 17351; public static final int ROCK_17352 = 17352; public static final int ROCK_17353 = 17353; public static final int ROCK_17354 = 17354; public static final int ROCK_17355 = 17355; public static final int ROCK_17356 = 17356; public static final int ROCK_17357 = 17357; public static final int ROCK_17358 = 17358; public static final int URN = 17362; public static final int ROCK_17364 = 17364; public static final int SMALL_ROCK_17365 = 17365; public static final int ROCK_17366 = 17366; public static final int STONE_TABLET_17367 = 17367; public static final int FLOOR_17368 = 17368; public static final int RIFT_17370 = 17370; public static final int RIFT_17371 = 17371; public static final int RIFT_17372 = 17372; public static final int RIFT_17373 = 17373; public static final int RIFT_17374 = 17374; public static final int RIFT_17375 = 17375; public static final int RIFT_17376 = 17376; public static final int RIFT_17377 = 17377; public static final int RIFT_17378 = 17378; public static final int RIFT_17379 = 17379; public static final int RIFT_17380 = 17380; public static final int RIFT_17381 = 17381; public static final int BOOKCASE_17382 = 17382; public static final int LADDER_17383 = 17383; public static final int LADDER_17384 = 17384; public static final int LADDER_17385 = 17385; public static final int LADDER_17386 = 17386; public static final int LADDER_17387 = 17387; public static final int LADDER_17388 = 17388; public static final int LADDER_17389 = 17389; public static final int STEPLADDER_17390 = 17390; public static final int STEPS_17391 = 17391; public static final int GANGPLANK_17392 = 17392; public static final int GANGPLANK_17393 = 17393; public static final int GANGPLANK_17394 = 17394; public static final int GANGPLANK_17395 = 17395; public static final int GANGPLANK_17396 = 17396; public static final int GANGPLANK_17397 = 17397; public static final int GANGPLANK_17398 = 17398; public static final int GANGPLANK_17399 = 17399; public static final int GANGPLANK_17400 = 17400; public static final int GANGPLANK_17401 = 17401; public static final int GANGPLANK_17402 = 17402; public static final int GANGPLANK_17403 = 17403; public static final int GANGPLANK_17404 = 17404; public static final int GANGPLANK_17405 = 17405; public static final int GANGPLANK_17406 = 17406; public static final int GANGPLANK_17407 = 17407; public static final int GANGPLANK_17408 = 17408; public static final int GANGPLANK_17409 = 17409; public static final int DRAIN_17423 = 17423; public static final int DRAIN_17424 = 17424; public static final int SWORD_CASE_17425 = 17425; public static final int SWORD_CASE_17426 = 17426; public static final int SWORD_CASE_17427 = 17427; public static final int RUSTY_KEY = 17429; public static final int MUD_17430 = 17430; public static final int SEWER_PIPE_17432 = 17432; public static final int WARDROBE_17433 = 17433; public static final int WARDROBE_17434 = 17434; public static final int STONE_TABLE = 17435; public static final int STONE_TABLE_17436 = 17436; public static final int STONE_TABLE_17437 = 17437; public static final int STONE_TABLE_17438 = 17438; public static final int STONE_CIRCLE_WALL = 17439; public static final int STONE_CIRCLE_WALL_17440 = 17440; public static final int STONE_CIRCLE_WALL_17441 = 17441; public static final int STONE_CIRCLE_WALL_17442 = 17442; public static final int STONE_CIRCLE_WALL_17443 = 17443; public static final int STONE_CIRCLE_WALL_17444 = 17444; public static final int STONE_CIRCLE_WALL_17445 = 17445; public static final int DRAGON_HEAD = 17450; public static final int CHESS = 17451; public static final int DRAGONS_HEAD_17477 = 17477; public static final int DRAGONS_HEAD_17478 = 17478; public static final int DRAGONS_HEAD_17479 = 17479; public static final int DRAGONS_HEAD_17480 = 17480; public static final int DRAGONS_HEAD_17481 = 17481; public static final int DRAGONS_HEAD_17482 = 17482; public static final int DRAGONS_HEAD_17483 = 17483; public static final int DRAGONS_HEAD_17484 = 17484; public static final int DRAGONS_HEAD_17485 = 17485; public static final int DRAGONS_HEAD_17486 = 17486; public static final int DOOR_17488 = 17488; public static final int WALL_17497 = 17497; public static final int WALL_17498 = 17498; public static final int WALL_17500 = 17500; public static final int WASTE_PIPES = 17508; public static final int WASTE_PIPES_17509 = 17509; public static final int WASTE_PIPES_17510 = 17510; public static final int WASTE_PIPES_17511 = 17511; public static final int TABLE_17545 = 17545; public static final int TABLE_17546 = 17546; public static final int CHAIR_17547 = 17547; public static final int CHAIR_17548 = 17548; public static final int CHAIR_17549 = 17549; public static final int CHAIR_17550 = 17550; public static final int STOOL_17551 = 17551; public static final int STOOL_17552 = 17552; public static final int BED_17553 = 17553; public static final int BED_17554 = 17554; public static final int BED_17555 = 17555; public static final int BUCKET_17556 = 17556; public static final int BUCKET_17557 = 17557; public static final int BUCKET_17558 = 17558; public static final int PANNING_TRAY = 17559; public static final int PANNING_TRAY_17560 = 17560; public static final int POTS_17561 = 17561; public static final int POTS_17562 = 17562; public static final int FLOOR_BELOW = 17563; public static final int DOOR_17600 = 17600; public static final int DOOR_17601 = 17601; public static final int RUBBLE_17626 = 17626; public static final int WASHING_LINE_17627 = 17627; public static final int SCAFFOLDING = 17635; public static final int SCAFFOLDING_17636 = 17636; public static final int LADDER_17637 = 17637; public static final int FIREPLACE_17640 = 17640; public static final int FIREPLACE_17641 = 17641; public static final int FIREPLACE_17642 = 17642; public static final int FIREPLACE_17643 = 17643; public static final int BARRICADE_17644 = 17644; public static final int BARRICADE_17645 = 17645; public static final int BARRICADE_17646 = 17646; public static final int SICKLE_LOGO = 17647; public static final int SICKLE_LOGO_17648 = 17648; public static final int BARREL_17654 = 17654; public static final int CRATE_17655 = 17655; public static final int CRATES_17656 = 17656; public static final int BOXES_17657 = 17657; public static final int CRATE_17658 = 17658; public static final int STAIRCASE_17659 = 17659; public static final int STAIRCASE_17660 = 17660; public static final int TABLE_17661 = 17661; public static final int TABLE_17662 = 17662; public static final int CHAIR_17663 = 17663; public static final int TABLE_17666 = 17666; public static final int STOOL_17667 = 17667; public static final int BUNK_BED_17668 = 17668; public static final int BUNK_BED_17669 = 17669; public static final int BLACKBOARD_17670 = 17670; public static final int LOCKER_17671 = 17671; public static final int LOCKER_17672 = 17672; public static final int WALL_17676 = 17676; public static final int WALL_17677 = 17677; public static final int WALL_17678 = 17678; public static final int ROCK_17679 = 17679; public static final int WALL_17680 = 17680; public static final int WALL_17681 = 17681; public static final int WALL_17682 = 17682; public static final int WALL_17683 = 17683; public static final int WALL_17684 = 17684; public static final int WALL_17685 = 17685; public static final int WALL_17686 = 17686; public static final int WALL_17687 = 17687; public static final int WALL_17688 = 17688; public static final int WALL_17698 = 17698; public static final int FLOOR_17702 = 17702; public static final int FLOOR_17709 = 17709; public static final int FLOOR_17710 = 17710; public static final int FLOOR_17711 = 17711; public static final int FLOOR_17712 = 17712; public static final int CHAIR_17757 = 17757; public static final int CHAIR_17758 = 17758; public static final int CHAIR_17759 = 17759; public static final int CHAIR_17760 = 17760; public static final int CHAIR_17761 = 17761; public static final int TABLE_17762 = 17762; public static final int BOOKCASE_17763 = 17763; public static final int BENCH_17764 = 17764; public static final int GRANDFATHER_CLOCK_17765 = 17765; public static final int THE_MIDDLE_OF_A_FIREPLACE = 17766; public static final int LEFT_SIDE_OF_A_FIREPLACE = 17767; public static final int RIGHT_SIDE_OF_A_FIREPLACE = 17768; public static final int ORNATE_VASE = 17769; public static final int FENCE_END = 17782; public static final int FENCE_MID = 17783; public static final int FENCE_CORNER = 17784; public static final int FENCE_TPIECE = 17785; public static final int SINGLE_PILLAR = 17786; public static final int FENCE_MID_17787 = 17787; public static final int FENCE_CORNER_17788 = 17788; public static final int FENCE_BITS = 17789; public static final int FENCE_MID_17790 = 17790; public static final int FENCE_MID_17791 = 17791; public static final int ROCK_WALL = 17828; public static final int RIFT_17846 = 17846; public static final int RIFT_17847 = 17847; public static final int RIFT_17848 = 17848; public static final int RIFT_17849 = 17849; public static final int RIFT_17850 = 17850; public static final int RIFT_17851 = 17851; public static final int RIFT_17852 = 17852; public static final int RIFT_17853 = 17853; public static final int RIFT_17854 = 17854; public static final int RIFT_17855 = 17855; public static final int RIFT_17856 = 17856; public static final int RIFT_17879 = 17879; public static final int RIFT_17880 = 17880; public static final int RIFT_17881 = 17881; public static final int RIFT_17882 = 17882; public static final int RIFT_17883 = 17883; public static final int RIFT_17884 = 17884; public static final int RIFT_17885 = 17885; public static final int RIFT_17886 = 17886; public static final int RIFT_17887 = 17887; public static final int RIFT_17888 = 17888; public static final int RIFT_17889 = 17889; public static final int BOOKSHELF = 17890; public static final int BOOKSHELF_17891 = 17891; public static final int LAB_TABLE = 17893; public static final int LAB_TABLE_17894 = 17894; public static final int LAB_TABLE_17895 = 17895; public static final int LAB_TABLE_17896 = 17896; public static final int LAB_TUBE = 17897; public static final int LAB_TUBE_17898 = 17898; public static final int EXPERIMENT_BOOTH = 17899; public static final int BARREL_17904 = 17904; public static final int CRATE_17905 = 17905; public static final int CRATES_17906 = 17906; public static final int BOXES_17907 = 17907; public static final int CRATE_17908 = 17908; public static final int STOOL_17909 = 17909; public static final int STOOL_17910 = 17910; public static final int DOOR_17911 = 17911; public static final int DOOR_17912 = 17912; public static final int WALL_17934 = 17934; public static final int WALL_17935 = 17935; public static final int WALL_17936 = 17936; public static final int WALL_17937 = 17937; public static final int WALL_17938 = 17938; public static final int WALL_17939 = 17939; public static final int WALL_17940 = 17940; public static final int WALL_17941 = 17941; public static final int WALL_17943 = 17943; public static final int BOAT_17953 = 17953; public static final int BOAT_17954 = 17954; public static final int BOAT_17955 = 17955; public static final int BOAT_CHUTE = 17956; public static final int BOAT_CHUTE_17957 = 17957; public static final int ROCK_17958 = 17958; public static final int ROCK_17959 = 17959; public static final int ROCK_17960 = 17960; public static final int BOAT_17961 = 17961; public static final int DAEYALT_ROCKS = 17962; public static final int DAEYALT_ROCKS_17963 = 17963; public static final int DAEYALT_ROCKS_17964 = 17964; public static final int DAEYALT_ROCKS_17965 = 17965; public static final int MINE_CART_17966 = 17966; public static final int MINE_CART_17967 = 17967; public static final int MINE_CART_17968 = 17968; public static final int MINE_CART_17969 = 17969; public static final int ROCK_17970 = 17970; public static final int ROCK_17971 = 17971; public static final int ROCK_17972 = 17972; public static final int DOOR_17973 = 17973; public static final int LADDER_17974 = 17974; public static final int LADDER_17975 = 17975; public static final int STAIRS_UP = 17976; public static final int BROKEN_STAIRS = 17977; public static final int STAIRS_DOWN = 17978; public static final int BROKEN_STAIRS_17979 = 17979; public static final int WALL_17980 = 17980; public static final int DECORATED_WALL = 17982; public static final int RUG_17983 = 17983; public static final int LUMPY_RUG = 17984; public static final int TRAPDOOR_17985 = 17985; public static final int LADDER_17986 = 17986; public static final int CRATE_17987 = 17987; public static final int BUSH_17988 = 17988; public static final int BUSH_17989 = 17989; public static final int BUSH_17990 = 17990; public static final int BUSH_17991 = 17991; public static final int LADDER_17995 = 17995; public static final int LADDER_17996 = 17996; public static final int LADDER_17997 = 17997; public static final int LADDER_17998 = 17998; public static final int LADDER_17999 = 17999; public static final int LADDER_18000 = 18000; public static final int LADDER_18001 = 18001; public static final int LADDER_18002 = 18002; public static final int BARREL_OF_FISHBONES = 18006; public static final int CORNER_TABLE = 18007; public static final int CUTTING_TABLE = 18008; public static final int BROKEN_FISH_DISPLAY = 18009; public static final int STAGNANT_FISH_DISPLAY = 18010; public static final int A_FALLEN_BARREL = 18011; public static final int BROKEN_BARREL_18012 = 18012; public static final int STACKED_CRATES = 18013; public static final int TABLE_AND_TILL = 18014; public static final int BARREL_18015 = 18015; public static final int BROKEN_COUNTER = 18016; public static final int COUNTER_18017 = 18017; public static final int COUNTER_18018 = 18018; public static final int SKELETON_18028 = 18028; public static final int SKELETON_18029 = 18029; public static final int MACHINE = 18030; public static final int DOOR_18031 = 18031; public static final int DOOR_18032 = 18032; public static final int FLOOR_18033 = 18033; public static final int FLOOR_18034 = 18034; public static final int FLOOR_18035 = 18035; public static final int FLOOR_18036 = 18036; public static final int WALL_RUBBLE = 18037; public static final int WALL_RUBBLE_18038 = 18038; public static final int FIREPLACE_18039 = 18039; public static final int TAPESTRY_18040 = 18040; public static final int SLASHED_TAPESTRY = 18041; public static final int PORTRAIT_18042 = 18042; public static final int PORTRAIT_18043 = 18043; public static final int PORTRAIT_18044 = 18044; public static final int VAMPYRE_STATUE = 18045; public static final int STATUE_WITH_KEY = 18046; public static final int DOOR_18047 = 18047; public static final int DOOR_18048 = 18048; public static final int STAIRCASE_18049 = 18049; public static final int STAIRCASE_18050 = 18050; public static final int TABLE_18051 = 18051; public static final int BROKEN_RUNE_CASE = 18052; public static final int RUBBLE_18053 = 18053; public static final int BARRICADE_18054 = 18054; public static final int BARRICADE_18055 = 18055; public static final int ROCKY_SURFACE = 18056; public static final int DOOR_18057 = 18057; public static final int DOOR_18058 = 18058; public static final int TABLE_18059 = 18059; public static final int TRAPDOOR_TABLE = 18060; public static final int TRAPDOOR_TUNNEL = 18061; public static final int TABLE_18062 = 18062; public static final int TRAPDOOR_TABLE_18063 = 18063; public static final int TRAPDOOR_TABLE_18064 = 18064; public static final int POTS_18065 = 18065; public static final int WALL_18066 = 18066; public static final int WALL_18067 = 18067; public static final int BROKEN_LADDER_18068 = 18068; public static final int LADDER_18069 = 18069; public static final int FLOORBOARDS = 18070; public static final int FLOORBOARDS_18071 = 18071; public static final int FLOORBOARDS_18072 = 18072; public static final int FLOORBOARDS_18073 = 18073; public static final int WALL_18074 = 18074; public static final int WALL_18075 = 18075; public static final int FLOOR_18076 = 18076; public static final int FLOOR_18077 = 18077; public static final int WALL_18078 = 18078; public static final int WALL_18079 = 18079; public static final int WALL_18080 = 18080; public static final int FLOOR_18081 = 18081; public static final int FLOOR_18082 = 18082; public static final int TUNNEL_18085 = 18085; public static final int SHELF_18086 = 18086; public static final int SHELF_18087 = 18087; public static final int WALL_18088 = 18088; public static final int FLOORBOARDS_18089 = 18089; public static final int FLOORBOARDS_18090 = 18090; public static final int DOOR_18091 = 18091; public static final int DOOR_18092 = 18092; public static final int FLOORBOARDS_18093 = 18093; public static final int FLOORBOARDS_18094 = 18094; public static final int SHELF_18095 = 18095; public static final int SHELF_18096 = 18096; public static final int FLOORBOARDS_18097 = 18097; public static final int FLOORBOARDS_18098 = 18098; public static final int WASHING_LINE_18099 = 18099; public static final int WASHING_LINE_18100 = 18100; public static final int WALL_18101 = 18101; public static final int FALLING_DOOR = 18102; public static final int FLOOR_18103 = 18103; public static final int FLOOR_18104 = 18104; public static final int SHELF_18105 = 18105; public static final int SHELF_18106 = 18106; public static final int SHELF_18107 = 18107; public static final int SHELF_18108 = 18108; public static final int FLOORBOARDS_18109 = 18109; public static final int FLOORBOARDS_18110 = 18110; public static final int FLOORBOARDS_18111 = 18111; public static final int FLOORBOARDS_18112 = 18112; public static final int FLOORBOARDS_18113 = 18113; public static final int FLOORBOARDS_18114 = 18114; public static final int FLOORBOARDS_18117 = 18117; public static final int FLOORBOARDS_18118 = 18118; public static final int WINDSWEPT_TREE_18137 = 18137; public static final int DECORATED_WALL_18144 = 18144; public static final int DECORATED_WALL_18145 = 18145; public static final int PASSAGEWAY_18159 = 18159; public static final int DOOR_18168 = 18168; public static final int CLAY_OVEN_18170 = 18170; public static final int WASHBASIN_18171 = 18171; public static final int HAMMOCK_18172 = 18172; public static final int LARGE_TABLE_18176 = 18176; public static final int DISPLAY_TABLE = 18177; public static final int DISPLAY_TABLE_18178 = 18178; public static final int BROKEN_LOBSTER_TRAP = 18179; public static final int BARREL_18182 = 18182; public static final int BUCKET_18183 = 18183; public static final int SUIT_OF_ARMOUR_18184 = 18184; public static final int SUIT_OF_ARMOUR_18185 = 18185; public static final int ROWBOAT = 18186; public static final int ROWBOAT_18187 = 18187; public static final int BROKEN_BOAT = 18189; public static final int BROKEN_BOAT_18190 = 18190; public static final int BROKEN_BOAT_18191 = 18191; public static final int BROKEN_BOAT_18192 = 18192; public static final int A_BARREL_OF_RAINWATER = 18201; public static final int STACKED_CRATES_18202 = 18202; public static final int CRATES_18203 = 18203; public static final int CRATE_18204 = 18204; public static final int BARREL_18208 = 18208; public static final int LIFE_BUOY = 18211; public static final int PILLAR_18223 = 18223; public static final int STUDY_DESK_18224 = 18224; public static final int PAINTING_18225 = 18225; public static final int PAINTING_18226 = 18226; public static final int PAINTING_18227 = 18227; public static final int SAILFISH = 18228; public static final int SHARK_HEAD = 18229; public static final int SHARK_HEAD_18230 = 18230; public static final int LARGE_VASE = 18231; public static final int SMALL_VASE = 18232; public static final int VASE_SET = 18233; public static final int LADDER_18234 = 18234; public static final int LADDER_18235 = 18235; public static final int LADDER_18236 = 18236; public static final int LADDER_18237 = 18237; public static final int BENCH_18238 = 18238; public static final int BOOKCASE_18239 = 18239; public static final int DRAWERS_18240 = 18240; public static final int WARDROBE_18241 = 18241; public static final int DUMMY_18242 = 18242; public static final int ANCHOR_18243 = 18243; public static final int BED_18244 = 18244; public static final int LECTERN_18245 = 18245; public static final int ALTAR_18258 = 18258; public static final int STEEPLE = 18260; public static final int PILLAR_18261 = 18261; public static final int PILLAR_18262 = 18262; public static final int STATUE_18263 = 18263; public static final int OLD_RUIN_ENTRANCE = 18270; public static final int PASSAGEWAY_18307 = 18307; public static final int PASSAGEWAY_18308 = 18308; public static final int PASSAGEWAY_18309 = 18309; public static final int PASSAGEWAY_18310 = 18310; public static final int PASSAGEWAY_18311 = 18311; public static final int LADDER_18324 = 18324; public static final int LADDER_18325 = 18325; public static final int CRANE_18326 = 18326; public static final int CRANE_18327 = 18327; public static final int WALL_CORNER = 18343; public static final int TORTURE_RACK = 18351; public static final int CHEST_18352 = 18352; public static final int CHEST_18353 = 18353; public static final int EXIT_18354 = 18354; public static final int WALL_18359 = 18359; public static final int WALL_OPENING = 18360; public static final int BROKEN_WALL_18380 = 18380; public static final int BADLY_REPAIRED_WALL = 18381; public static final int BONE_BARREL = 18399; public static final int ICE_CUBE = 18400; public static final int KENNITHS_BALL = 18403; public static final int BOTTLE = 18404; public static final int BROKEN_FENCE_18411 = 18411; public static final int PASSAGE_18412 = 18412; public static final int IMPOSING_DOORS = 18413; public static final int IMPOSING_DOORS_18414 = 18414; public static final int IMPOSING_DOORS_18415 = 18415; public static final int SHORTCUT = 18416; public static final int SLUG_GOO = 18434; public static final int BARREL_18446 = 18446; public static final int WRECK = 18447; public static final int WRECK_18448 = 18448; public static final int WRECK_18449 = 18449; public static final int WRECK_18450 = 18450; public static final int WRECK_18451 = 18451; public static final int WRECK_18452 = 18452; public static final int BED_18457 = 18457; public static final int CHILDS_BED = 18458; public static final int FLOATS = 18459; public static final int BROKEN_BOAT_18460 = 18460; public static final int CROW_NEST = 18461; public static final int CRATE_18462 = 18462; public static final int CRATE_18463 = 18463; public static final int BIG_FISH = 18482; public static final int DOOR_18489 = 18489; public static final int DOOR_18490 = 18490; public static final int BANK_BOOTH_18491 = 18491; public static final int CLOSED_BOOTH_18492 = 18492; public static final int SIGNPOST_18493 = 18493; public static final int BOOKCASE_18495 = 18495; public static final int CRANE_18501 = 18501; public static final int ODD_LOOKING_WALL_18505 = 18505; public static final int CRATE_18506 = 18506; public static final int CRATE_18507 = 18507; public static final int CRATES_18508 = 18508; public static final int WATER_CONTROLS = 18509; public static final int WATER_CONTROLS_18510 = 18510; public static final int WATER_WHEEL_18511 = 18511; public static final int WATER_WHEEL_18512 = 18512; public static final int BELLOWS_18515 = 18515; public static final int BELLOWS_18516 = 18516; public static final int LAVA_TROUGH = 18519; public static final int LAVA_TROUGH_18520 = 18520; public static final int LAVA_TROUGH_18521 = 18521; public static final int LAVA_TROUGH_18522 = 18522; public static final int LAVA_TROUGH_18523 = 18523; public static final int FURNACE_18525 = 18525; public static final int FURNACE_18526 = 18526; public static final int MACHINERY_18530 = 18530; public static final int MACHINERY_18587 = 18587; public static final int MACHINERY_18594 = 18594; public static final int HATCH = 18595; public static final int HATCH_18596 = 18596; public static final int STAIRWELL = 18597; public static final int STAIRS_18598 = 18598; public static final int STAIRS_18599 = 18599; public static final int STAIRS_18610 = 18610; public static final int STAIRS_18611 = 18611; public static final int CRATE_18612 = 18612; public static final int CRATE_18613 = 18613; public static final int CRATES_18614 = 18614; public static final int CRATES_18615 = 18615; public static final int CRATE_18616 = 18616; public static final int CRATES_18617 = 18617; public static final int CRATE_18618 = 18618; public static final int CRATE_18619 = 18619; public static final int LEVER_18620 = 18620; public static final int AN_OLD_LEVER = 18621; public static final int AN_OLD_LEVER_18622 = 18622; public static final int OLD_CRANE = 18623; public static final int OLD_CRANE_18624 = 18624; public static final int OLD_CRANE_18625 = 18625; public static final int OLD_CRANE_18626 = 18626; public static final int OLD_CRANE_18627 = 18627; public static final int OLD_CRANE_18628 = 18628; public static final int OLD_CRANE_18629 = 18629; public static final int OLD_CRANE_18630 = 18630; public static final int OLD_CRANE_18631 = 18631; public static final int OLD_CRANE_18632 = 18632; public static final int OLD_CRANE_18633 = 18633; public static final int OLD_CRANE_18634 = 18634; public static final int OLD_CRANE_18635 = 18635; public static final int OLD_CRANE_18636 = 18636; public static final int OLD_CRANE_18637 = 18637; public static final int OLD_CRANE_18638 = 18638; public static final int AN_OLD_LEVER_18640 = 18640; public static final int JUNCTION_BOX = 18641; public static final int PRESS_SUPPORT = 18642; public static final int STEAM_PRESS = 18643; public static final int STEAM_PRESS_18644 = 18644; public static final int STEAM_PRESS_18645 = 18645; public static final int WATER_VALVE_18646 = 18646; public static final int WATER_VALVE_18647 = 18647; public static final int AN_OLD_LEVER_18648 = 18648; public static final int CORKSCREW_LEVER = 18649; public static final int PIPING = 18650; public static final int DOOR_18651 = 18651; public static final int DOOR_18652 = 18652; public static final int DOOR_18653 = 18653; public static final int DOOR_18654 = 18654; public static final int DOOR_18655 = 18655; public static final int DOOR_18656 = 18656; public static final int DOOR_18657 = 18657; public static final int DOOR_18658 = 18658; public static final int DOOR_18659 = 18659; public static final int WATER_TANK = 18660; public static final int WATER_TANK_18661 = 18661; public static final int AN_OLD_LEVER_18663 = 18663; public static final int PIN = 18664; public static final int PIN_18665 = 18665; public static final int PIN_18666 = 18666; public static final int COG = 18667; public static final int COG_18668 = 18668; public static final int COG_18669 = 18669; public static final int COG_18670 = 18670; public static final int COG_18671 = 18671; public static final int COG_18672 = 18672; public static final int COG_18673 = 18673; public static final int COG_18674 = 18674; public static final int COG_18675 = 18675; public static final int COG_18676 = 18676; public static final int COG_18677 = 18677; public static final int COG_18678 = 18678; public static final int COG_18679 = 18679; public static final int COG_18680 = 18680; public static final int COG_18681 = 18681; public static final int COG_18682 = 18682; public static final int COG_18683 = 18683; public static final int COG_18684 = 18684; public static final int FAN_BLADE = 18685; public static final int FAN_BLADE_18686 = 18686; public static final int FAN_BLADE_18687 = 18687; public static final int EXTRACTOR_HAT = 18690; public static final int EXTRACTOR_HAT_18691 = 18691; public static final int EXTRACTOR_HATTOP = 18692; public static final int EXTRACTOR_GUN = 18693; public static final int EXTRACTOR_GUN_18694 = 18694; public static final int EXTRACTOR_GUN_18695 = 18695; public static final int EXTRACTOR_GUN_18696 = 18696; public static final int MIND_DOOR = 18698; public static final int MIND_DOOR_18699 = 18699; public static final int MIND_DOOR_18700 = 18700; public static final int MIND_DOOR_18701 = 18701; public static final int DOOR_18702 = 18702; public static final int DOOR_18703 = 18703; public static final int CONNECTION_PIPE = 18704; public static final int CONNECTION_PIPE_18705 = 18705; public static final int CONNECTION_PIPE_18706 = 18706; public static final int CONNECTION_PIPE_18707 = 18707; public static final int STAIRS_18710 = 18710; public static final int SCHEMATIC_CRATE = 18711; public static final int PIPING_18726 = 18726; public static final int MINE_CART_SIGN = 18746; public static final int TRACK_18747 = 18747; public static final int TRACK_18750 = 18750; public static final int TRACK_18751 = 18751; public static final int TUNNEL_ROOF = 18758; public static final int TUNNEL_ROOF_18759 = 18759; public static final int TUNNEL_WALL = 18760; public static final int OAK_CAPE_RACK = 18766; public static final int TEAK_CAPE_RACK = 18767; public static final int MAHOGANY_CAPE_RACK = 18768; public static final int GILDED_CAPE_RACK = 18769; public static final int MARBLE_CAPE_RACK = 18770; public static final int MAGIC_CAPE_RACK = 18771; public static final int FANCY_DRESS_BOX = 18772; public static final int FANCY_DRESS_BOX_18773 = 18773; public static final int FANCY_DRESS_BOX_18774 = 18774; public static final int FANCY_DRESS_BOX_18775 = 18775; public static final int FANCY_DRESS_BOX_18776 = 18776; public static final int FANCY_DRESS_BOX_18777 = 18777; public static final int ARMOUR_CASE = 18778; public static final int ARMOUR_CASE_18779 = 18779; public static final int ARMOUR_CASE_18780 = 18780; public static final int ARMOUR_CASE_18781 = 18781; public static final int ARMOUR_CASE_18782 = 18782; public static final int ARMOUR_CASE_18783 = 18783; public static final int MAGIC_WARDROBE = 18784; public static final int MAGIC_WARDROBE_18785 = 18785; public static final int MAGIC_WARDROBE_18786 = 18786; public static final int MAGIC_WARDROBE_18787 = 18787; public static final int MAGIC_WARDROBE_18788 = 18788; public static final int MAGIC_WARDROBE_18789 = 18789; public static final int MAGIC_WARDROBE_18790 = 18790; public static final int MAGIC_WARDROBE_18791 = 18791; public static final int MAGIC_WARDROBE_18792 = 18792; public static final int MAGIC_WARDROBE_18793 = 18793; public static final int MAGIC_WARDROBE_18794 = 18794; public static final int MAGIC_WARDROBE_18795 = 18795; public static final int MAGIC_WARDROBE_18796 = 18796; public static final int MAGIC_WARDROBE_18797 = 18797; public static final int TOY_BOX = 18798; public static final int TOY_BOX_18799 = 18799; public static final int TOY_BOX_18800 = 18800; public static final int TOY_BOX_18801 = 18801; public static final int TOY_BOX_18802 = 18802; public static final int TOY_BOX_18803 = 18803; public static final int TREASURE_CHEST = 18804; public static final int TREASURE_CHEST_18805 = 18805; public static final int TREASURE_CHEST_18806 = 18806; public static final int TREASURE_CHEST_18807 = 18807; public static final int TREASURE_CHEST_18808 = 18808; public static final int TREASURE_CHEST_18809 = 18809; public static final int CAPE_RACK_SPACE = 18810; public static final int MAGIC_WARDROBE_SPACE = 18811; public static final int TOY_BOX_SPACE = 18812; public static final int TREASURE_CHEST_SPACE = 18813; public static final int FANCY_DRESS_BOX_SPACE = 18814; public static final int ARMOUR_CASE_SPACE = 18815; public static final int ROCKS_18817 = 18817; public static final int HERB_PATCH_18818 = 18818; public static final int HERB_PATCH_18819 = 18819; public static final int HERB_PATCH_18820 = 18820; public static final int HERB_PATCH_18821 = 18821; public static final int HERB_PATCH_18822 = 18822; public static final int HERB_PATCH_18823 = 18823; public static final int HERBS_18824 = 18824; public static final int HERBS_18825 = 18825; public static final int HERBS_18826 = 18826; public static final int DISEASED_HERBS_18827 = 18827; public static final int DISEASED_HERBS_18828 = 18828; public static final int DISEASED_HERBS_18829 = 18829; public static final int DEAD_HERBS_18830 = 18830; public static final int DEAD_HERBS_18831 = 18831; public static final int DEAD_HERBS_18832 = 18832; public static final int TROLL_LADDER = 18833; public static final int TROLL_LADDER_18834 = 18834; public static final int CRATE_18835 = 18835; public static final int TREE_BRANCH = 18836; public static final int GOAT = 18837; public static final int TROLLEY = 18838; public static final int FISH = 18839; public static final int ROCKS_18840 = 18840; public static final int DOLPHIN = 18841; public static final int FISH_18842 = 18842; public static final int LADDER_18843 = 18843; public static final int SOIL_PATCH = 18845; public static final int SOIL_PATCH_18846 = 18846; public static final int WEEDS = 18847; public static final int WEEDS_18848 = 18848; public static final int WEEDS_18849 = 18849; public static final int NEW_FARMING_PATCH = 18850; public static final int HARDY_GOUTWEED = 18851; public static final int DISEASED_HARDY_GOUTWEED = 18852; public static final int DEAD_HARDY_GOUTWEED = 18853; public static final int HARDY_GOUTWEED_18854 = 18854; public static final int HARDY_GOUTWEED_18855 = 18855; public static final int PARASOL = 18856; public static final int DRUNKEN_DWARF = 18864; public static final int BROKEN_BEER_GLASS = 18865; public static final int DECKCHAIR = 18866; public static final int CELL_WALL_WINDOW = 18869; public static final int CELL_WALL_WINDOW_18870 = 18870; public static final int ROCK_18871 = 18871; public static final int ROCK_18872 = 18872; public static final int ROCK_18873 = 18873; public static final int DANGER_SIGN_18874 = 18874; public static final int CACTUS_18875 = 18875; public static final int SIGN_POST = 18876; public static final int FOOTPRINTS = 18877; public static final int FOOTPRINTS_18878 = 18878; public static final int FOOTPRINTS_18879 = 18879; public static final int FOOTPRINTS_18880 = 18880; public static final int FOOTPRINTS_18881 = 18881; public static final int FOOTPRINTS_18882 = 18882; public static final int FOOTPRINTS_18883 = 18883; public static final int FOOTPRINTS_18884 = 18884; public static final int FOOTPRINTS_18885 = 18885; public static final int FOOTPRINTS_18886 = 18886; public static final int BARREL_18887 = 18887; public static final int WINCH_18888 = 18888; public static final int CRATE_18889 = 18889; public static final int CRATE_18890 = 18890; public static final int ROCKSLIDE_18892 = 18892; public static final int ROCKSLIDE_18893 = 18893; public static final int ROCKSLIDE_18894 = 18894; public static final int ROCKSLIDE_18895 = 18895; public static final int FOOTPRINTS_18898 = 18898; public static final int FOOTPRINTS_18899 = 18899; public static final int FOOTPRINTS_18900 = 18900; public static final int TABLE_18902 = 18902; public static final int LADDER_18903 = 18903; public static final int LADDER_18904 = 18904; public static final int CHEST_18907 = 18907; public static final int CRATE_18918 = 18918; public static final int CRATE_18919 = 18919; public static final int BARREL_18920 = 18920; public static final int BARREL_18921 = 18921; public static final int CLIFF_EDGE = 18922; public static final int CLIFF = 18923; public static final int CLIFF_18924 = 18924; public static final int CART_TRACK_SIGN = 18938; public static final int BUFFERS_18946 = 18946; public static final int WINCH_BUCKET_18951 = 18951; public static final int ROCKS_18952 = 18952; public static final int ROCKS_18953 = 18953; public static final int ROCKS_18954 = 18954; public static final int SKELETON_18955 = 18955; public static final int SKELETON_18956 = 18956; public static final int SKELETON_18957 = 18957; public static final int WOODEN_CART = 18958; public static final int WOODEN_CART_18959 = 18959; public static final int CART_CAMEL = 18960; public static final int ROCKS_18961 = 18961; public static final int BARREL_18962 = 18962; public static final int RICKETY_DOOR_18964 = 18964; public static final int RICKETY_DOOR_18965 = 18965; public static final int CLIMBING_ROPE_18967 = 18967; public static final int CLIMBING_ROPE_18968 = 18968; public static final int CLIMBING_ROPE_18969 = 18969; public static final int STAIRS_18973 = 18973; public static final int STAIRS_18974 = 18974; public static final int LEDGE_18982 = 18982; public static final int LADDER_18987 = 18987; public static final int LADDER_18988 = 18988; public static final int LADDER_18989 = 18989; public static final int LADDER_18990 = 18990; public static final int STAIRCASE_18991 = 18991; public static final int STAIRCASE_18992 = 18992; public static final int SKELETON_18997 = 18997; public static final int SKELETON_18998 = 18998; public static final int SKELETON_18999 = 18999; public static final int GRAIN_OF_PLENTY = 19000; public static final int ROPE_19001 = 19001; public static final int ROPE_19002 = 19002; public static final int LADDER_19003 = 19003; public static final int LADDER_19004 = 19004; public static final int PORTAL_19005 = 19005; public static final int PASSAGEWAY_19025 = 19025; public static final int PASSAGEWAY_19026 = 19026; public static final int PASSAGEWAY_19027 = 19027; public static final int PASSAGEWAY_19028 = 19028; public static final int PASSAGEWAY_19029 = 19029; public static final int SNOW_19030 = 19030; public static final int SNOW_19031 = 19031; public static final int UNDERWALL_TUNNEL_19032 = 19032; public static final int SNOW_19033 = 19033; public static final int SNOW_19034 = 19034; public static final int SNOW_19035 = 19035; public static final int UNDERWALL_TUNNEL_19036 = 19036; public static final int CAVE_19037 = 19037; public static final int WINTUMBER_TREE = 19038; public static final int CAVE_19039 = 19039; public static final int STEPPING_STONE_19040 = 19040; public static final int STEPPING_STONE_19042 = 19042; public static final int CREVICE_19043 = 19043; public static final int LADDER_19047 = 19047; public static final int LADDER_19048 = 19048; public static final int LADDER_19049 = 19049; public static final int LADDER_19050 = 19050; public static final int BANK_CHEST_19051 = 19051; public static final int TUNNEL_ENTRANCE_19052 = 19052; public static final int TUNNEL_ENTRANCE_19053 = 19053; public static final int COMPOST_BIN_19054 = 19054; public static final int COMPOST_BIN_19055 = 19055; public static final int COMPOST_BIN_19056 = 19056; public static final int COMPOST_BIN_19057 = 19057; public static final int COMPOST_BIN_19058 = 19058; public static final int COMPOST_BIN_19059 = 19059; public static final int COMPOST_BIN_19060 = 19060; public static final int COMPOST_BIN_19061 = 19061; public static final int COMPOST_BIN_19062 = 19062; public static final int COMPOST_BIN_19063 = 19063; public static final int COMPOST_BIN_19064 = 19064; public static final int COMPOST_BIN_19066 = 19066; public static final int COMPOST_BIN_19067 = 19067; public static final int COMPOST_BIN_19068 = 19068; public static final int COMPOST_BIN_19069 = 19069; public static final int COMPOST_BIN_19070 = 19070; public static final int COMPOST_BIN_19071 = 19071; public static final int COMPOST_BIN_19072 = 19072; public static final int COMPOST_BIN_19073 = 19073; public static final int COMPOST_BIN_19074 = 19074; public static final int COMPOST_BIN_19075 = 19075; public static final int COMPOST_BIN_19076 = 19076; public static final int COMPOST_BIN_19077 = 19077; public static final int COMPOST_BIN_19078 = 19078; public static final int COMPOST_BIN_19079 = 19079; public static final int COMPOST_BIN_19080 = 19080; public static final int COMPOST_BIN_19081 = 19081; public static final int COMPOST_BIN_19082 = 19082; public static final int COMPOST_BIN_19083 = 19083; public static final int COMPOST_BIN_19084 = 19084; public static final int COMPOST_BIN_19085 = 19085; public static final int COMPOST_BIN_19086 = 19086; public static final int COMPOST_BIN_19087 = 19087; public static final int COMPOST_BIN_19088 = 19088; public static final int COMPOST_BIN_19089 = 19089; public static final int COMPOST_BIN_19090 = 19090; public static final int COMPOST_BIN_19091 = 19091; public static final int COMPOST_BIN_19092 = 19092; public static final int COMPOST_BIN_19093 = 19093; public static final int COMPOST_BIN_19094 = 19094; public static final int COMPOST_BIN_19095 = 19095; public static final int COMPOST_BIN_19096 = 19096; public static final int COMPOST_BIN_19097 = 19097; public static final int COMPOST_BIN_19098 = 19098; public static final int COMPOST_BIN_19099 = 19099; public static final int COMPOST_BIN_19100 = 19100; public static final int COMPOST_BIN_19101 = 19101; public static final int COMPOST_BIN_19102 = 19102; public static final int COMPOST_BIN_19103 = 19103; public static final int COMPOST_BIN_19104 = 19104; public static final int COMPOST_BIN_19105 = 19105; public static final int COMPOST_BIN_19106 = 19106; public static final int COMPOST_BIN_19107 = 19107; public static final int COMPOST_BIN_19108 = 19108; public static final int COMPOST_BIN_19109 = 19109; public static final int COMPOST_BIN_19110 = 19110; public static final int COMPOST_BIN_19111 = 19111; public static final int DIRT = 19125; public static final int PLANK_19126 = 19126; public static final int CANDLES_19127 = 19127; public static final int BASKET_19128 = 19128; public static final int BASKET_19129 = 19129; public static final int AIR_BALLOON = 19130; public static final int ROCK_19131 = 19131; public static final int BASKET_19132 = 19132; public static final int ALTAR_19145 = 19145; public static final int BASKET_19156 = 19156; public static final int BED_19157 = 19157; public static final int TABLE_19158 = 19158; public static final int BOOKCASE_19159 = 19159; public static final int BASKET_19161 = 19161; public static final int FRAME = 19162; public static final int BASKET_19164 = 19164; public static final int TREE_19165 = 19165; public static final int TREE_19166 = 19166; public static final int TREE_19167 = 19167; public static final int LOOSE_RAILING_19171 = 19171; public static final int DANGER_SIGN_19172 = 19172; public static final int PASSAGEWAY_19174 = 19174; public static final int STAIRS_19201 = 19201; public static final int STAIRS_19202 = 19202; public static final int GATE_OF_WAR = 19206; public static final int GATE_OF_WAR_19207 = 19207; public static final int GATE_OF_WAR_19209 = 19209; public static final int GATE_OF_WAR_19210 = 19210; public static final int BOULDER_19215 = 19215; public static final int BOULDER_19216 = 19216; public static final int DEADFALL = 19217; public static final int DEADFALL_19218 = 19218; public static final int DEADFALL_19219 = 19219; public static final int PERCH = 19220; public static final int OCCUPIED_PERCH = 19221; public static final int STILE_19222 = 19222; public static final int MAGIC_BOX = 19223; public static final int MAGIC_BOX_FAILED = 19224; public static final int MAGIC_BOX_19225 = 19225; public static final int MAGIC_BOX_19226 = 19226; public static final int PIT_19227 = 19227; public static final int SPIKED_PIT = 19228; public static final int COLLAPSED_TRAP = 19229; public static final int COLLAPSED_TRAP_19230 = 19230; public static final int COLLAPSED_TRAP_19231 = 19231; public static final int COLLAPSED_TRAP_19232 = 19232; public static final int COLLAPSED_TRAP_19233 = 19233; public static final int COLLAPSED_TRAP_19234 = 19234; public static final int COLLAPSED_TRAP_19235 = 19235; public static final int COLLAPSED_TRAP_19236 = 19236; public static final int RABBIT_SNARE = 19333; public static final int BROKEN_SNARE = 19334; public static final int RABBIT_SNARE_19335 = 19335; public static final int RABBIT_SNARE_19336 = 19336; public static final int RABBIT_HOLE = 19337; public static final int RABBITLESS_HOLE = 19338; public static final int PLANT_19339 = 19339; public static final int PLANT_19340 = 19340; public static final int PLANT_19341 = 19341; public static final int PLANT_19342 = 19342; public static final int PLANT_19343 = 19343; public static final int PLANT_19344 = 19344; public static final int PLANT_19345 = 19345; public static final int PLANT_19346 = 19346; public static final int PLANT_19347 = 19347; public static final int PLANT_19348 = 19348; public static final int PLANT_19349 = 19349; public static final int PLANT_19350 = 19350; public static final int PLANT_19351 = 19351; public static final int PLANT_19352 = 19352; public static final int PLANT_19353 = 19353; public static final int PLANT_19354 = 19354; public static final int PLANT_19355 = 19355; public static final int PLANT_19356 = 19356; public static final int PLANT_19357 = 19357; public static final int PLANT_19358 = 19358; public static final int PLANT_19359 = 19359; public static final int PLANT_19360 = 19360; public static final int PLANT_19361 = 19361; public static final int PLANT_19362 = 19362; public static final int PLANT_19363 = 19363; public static final int PLANT_19364 = 19364; public static final int PLANT_19365 = 19365; public static final int PLANT_19366 = 19366; public static final int PLANT_19367 = 19367; public static final int PLANT_19368 = 19368; public static final int PLANT_19369 = 19369; public static final int PLANT_19370 = 19370; public static final int PLANT_19371 = 19371; public static final int PLANT_19372 = 19372; public static final int PLANT_19373 = 19373; public static final int PLANT_19374 = 19374; public static final int PLANT_19375 = 19375; public static final int PLANT_19376 = 19376; public static final int PLANT_19377 = 19377; public static final int PLANT_19378 = 19378; public static final int PLANT_19379 = 19379; public static final int PLANT_19380 = 19380; public static final int PLANT_19381 = 19381; public static final int PLANT_19382 = 19382; public static final int PLANT_19383 = 19383; public static final int PLANT_19384 = 19384; public static final int PLANT_19385 = 19385; public static final int PLANT_19386 = 19386; public static final int PLANT_19387 = 19387; public static final int CACTUS_19388 = 19388; public static final int CACTUS_19389 = 19389; public static final int ROCKSLIDE_19390 = 19390; public static final int CACTUS_19391 = 19391; public static final int CACTUS_19392 = 19392; public static final int ROCKSLIDE_19393 = 19393; public static final int CACTUS_19394 = 19394; public static final int CACTUS_19395 = 19395; public static final int ROCKSLIDE_19396 = 19396; public static final int ROCKSLIDE_19397 = 19397; public static final int CACTUS_19398 = 19398; public static final int CACTUS_19399 = 19399; public static final int ROCKSLIDE_19400 = 19400; public static final int CACTUS_19401 = 19401; public static final int ROCKSLIDE_19402 = 19402; public static final int JUNGLE_PLANT_19403 = 19403; public static final int JUNGLE_PLANT_19404 = 19404; public static final int JUNGLE_PLANT_19405 = 19405; public static final int JUNGLE_PLANT_19406 = 19406; public static final int JUNGLE_PLANT_19407 = 19407; public static final int JUNGLE_PLANT_19408 = 19408; public static final int JUNGLE_PLANT_19409 = 19409; public static final int JUNGLE_PLANT_19410 = 19410; public static final int JUNGLE_PLANT_19411 = 19411; public static final int JUNGLE_PLANT_19412 = 19412; public static final int JUNGLE_PLANT_19413 = 19413; public static final int JUNGLE_PLANT_19414 = 19414; public static final int JUNGLE_PLANT_19415 = 19415; public static final int JUNGLE_PLANT_19416 = 19416; public static final int JUNGLE_PLANT_19417 = 19417; public static final int HOLLOW_LOG_19418 = 19418; public static final int TUNNEL_19419 = 19419; public static final int TUNNEL_19420 = 19420; public static final int TUNNEL_19421 = 19421; public static final int HOLLOW_LOG_19422 = 19422; public static final int TUNNEL_19423 = 19423; public static final int TUNNEL_19424 = 19424; public static final int HOLLOW_LOG_19425 = 19425; public static final int TUNNEL_19426 = 19426; public static final int BUSH_19427 = 19427; public static final int BUSH_19428 = 19428; public static final int BUSH_19429 = 19429; public static final int DISTURBED_SAND = 19430; public static final int TUNNEL_19434 = 19434; public static final int SNOW_DRIFT = 19435; public static final int BURROW = 19438; public static final int BURROW_19439 = 19439; public static final int BURROW_19440 = 19440; public static final int BURROW_19492 = 19492; public static final int BURROW_19493 = 19493; public static final int BURROW_19494 = 19494; public static final int BURROW_19552 = 19552; public static final int BURROW_19553 = 19553; public static final int BURROW_19593 = 19593; public static final int BURROW_19594 = 19594; public static final int HOLE_19640 = 19640; public static final int HOLE_19641 = 19641; public static final int PASSAGEWAY_19680 = 19680; public static final int PASSAGEWAY_19681 = 19681; public static final int STEPS_19690 = 19690; public static final int STEPS_19691 = 19691; public static final int COUNTER_19699 = 19699; public static final int ROCKSLIDE_19752 = 19752; public static final int CAVE_19753 = 19753; public static final int CAVE_19754 = 19754; public static final int CAVE_19759 = 19759; public static final int CAVE_19760 = 19760; public static final int CAVE_19761 = 19761; public static final int CAVE_19762 = 19762; public static final int CAVE_19763 = 19763; public static final int CAVE_19764 = 19764; public static final int CAVE_19791 = 19791; public static final int CAVE_19792 = 19792; public static final int CAVE_19797 = 19797; public static final int CAVE_19798 = 19798; public static final int ROCKSLIDE_19808 = 19808; public static final int CAVE_19809 = 19809; public static final int LARGE_CAVE = 19810; public static final int CAVE_19811 = 19811; public static final int CAVE_19812 = 19812; public static final int FERN_19839 = 19839; public static final int FERN_19840 = 19840; public static final int ROCKY_HANDHOLDS = 19846; public static final int ROCKY_HANDHOLDS_19847 = 19847; public static final int ROCKS_19849 = 19849; public static final int DEADFALL_19851 = 19851; public static final int HILL = 19852; public static final int STONE_GATE = 19870; public static final int STONE_GATE_19871 = 19871; public static final int EAGLE_LEVER = 19877; public static final int EAGLE_LEVER_19878 = 19878; public static final int CAMPFIRE = 19881; public static final int CAMPFIRE_19884 = 19884; public static final int BOOKS = 19885; public static final int BOOKS_19886 = 19886; public static final int CAMPING_EQUIPMENT = 19887; public static final int CAMPING_EQUIPMENT_19888 = 19888; public static final int CAVE_ENTRANCE_19891 = 19891; public static final int TUNNEL_19894 = 19894; public static final int TUNNEL_19897 = 19897; public static final int TUNNEL_19900 = 19900; public static final int TUNNEL_19903 = 19903; public static final int TUNNEL_19906 = 19906; public static final int TUNNEL_19909 = 19909; public static final int STONE_PEDESTAL = 19911; public static final int STONE_DOOR_19914 = 19914; public static final int STONE_DOOR_19915 = 19915; public static final int STONE_DOOR_19916 = 19916; public static final int STONE_DOOR_19917 = 19917; public static final int STONE_DOOR_19918 = 19918; public static final int BIRDSEED_HOLDER = 19919; public static final int BIRD_FEEDER = 19920; public static final int BIRD_FEEDER_19921 = 19921; public static final int GIANT_FEATHERS = 19922; public static final int ROCKY_OUTCROP = 19923; public static final int CAVE_ENTRANCE_19924 = 19924; public static final int ROCKY_OUTCROP_19925 = 19925; public static final int CAVE_ENTRANCE_19926 = 19926; public static final int TABLE_19928 = 19928; public static final int CHAIR_19929 = 19929; public static final int LEFTOVERS = 19930; public static final int CHEST_19931 = 19931; public static final int BOOKCASE_19932 = 19932; public static final int CHAIR_19933 = 19933; public static final int ARMOUR_19934 = 19934; public static final int METAL_BIRD = 19935; public static final int BIRD_FEEDER_19936 = 19936; public static final int BIRD_FEEDER_19937 = 19937; public static final int BIRD_FEEDER_19938 = 19938; public static final int BIRD_FEEDER_19939 = 19939; public static final int BIRD_FEEDER_19940 = 19940; public static final int BIRD_FEEDER_19941 = 19941; public static final int BIRD_FEEDER_19942 = 19942; public static final int BIRD_FEEDER_19943 = 19943; public static final int BIRD_FEEDER_19944 = 19944; public static final int RESET_LEVER = 19945; public static final int STONE_PEDESTAL_19950 = 19950; public static final int OPENING = 19967; public static final int ROCKS_19969 = 19969; public static final int ROCKS_19970 = 19970; public static final int ROCKS_19971 = 19971; public static final int ROCKS_19972 = 19972; public static final int ROCKS_19973 = 19973; public static final int STONE_PEDESTAL_19974 = 19974; public static final int STONE_PEDESTAL_19975 = 19975; public static final int WINCH_19976 = 19976; public static final int WINCH_19977 = 19977; public static final int WINCH_19978 = 19978; public static final int WINCH_19979 = 19979; public static final int PEDESTAL_19980 = 19980; public static final int PEDESTAL_19981 = 19981; public static final int PEDESTAL_19982 = 19982; public static final int PEDESTAL_19983 = 19983; public static final int STONE_PEDESTAL_19984 = 19984; public static final int YOUNG_VINE = 19985; public static final int YOUNG_VINE_19986 = 19986; public static final int GROWING_VINE = 19987; public static final int TALL_VINE = 19988; public static final int TALL_VINE_19989 = 19989; public static final int BURIED_SKELETON_19996 = 19996; public static final int ANIMAL_SKULL_19997 = 19997; public static final int CURVED_BONE_19998 = 19998; public static final int LARGE_BONE_19999 = 19999; public static final int FIRE_20000 = 20000; public static final int FIRE_20001 = 20001; public static final int ROPE_BRIDGE_SUPPORT = 20004; public static final int ROPE_BRIDGE_SUPPORT_20005 = 20005; public static final int ROPE_BRIDGE_SUPPORT_20006 = 20006; public static final int ROPE_BRIDGE_SUPPORT_20007 = 20007; public static final int PILLAR_20022 = 20022; public static final int PILLAR_20023 = 20023; public static final int PILLAR_20024 = 20024; public static final int PILLAR_20026 = 20026; public static final int PILLAR_20027 = 20027; public static final int PILLAR_20028 = 20028; public static final int PILLAR_20030 = 20030; public static final int PILLAR_20031 = 20031; public static final int PILLAR_20032 = 20032; public static final int PILLAR_20034 = 20034; public static final int PILLAR_20035 = 20035; public static final int PILLAR_20036 = 20036; public static final int SWITCH = 20038; public static final int SWITCH_20039 = 20039; public static final int MACHINE_20040 = 20040; public static final int GATE_20045 = 20045; public static final int GATE_20046 = 20046; public static final int GATE_20049 = 20049; public static final int GATE_20050 = 20050; public static final int TRELLIS_20056 = 20056; public static final int TRELLIS_20057 = 20057; public static final int TABLE_20058 = 20058; public static final int STOOL_20059 = 20059; public static final int TABLE_20060 = 20060; public static final int SHELF_20061 = 20061; public static final int SHELF_20062 = 20062; public static final int A_BUNK_BED = 20063; public static final int CHAIR_20065 = 20065; public static final int CASTLE_WALL_20084 = 20084; public static final int HOLE_20085 = 20085; public static final int CITY_GATE_20087 = 20087; public static final int CITY_GATE_20088 = 20088; public static final int CITY_GATE_20089 = 20089; public static final int CITY_GATE_20090 = 20090; public static final int OPEN_CHEST_20095 = 20095; public static final int BED_20096 = 20096; public static final int BED_20097 = 20097; public static final int COMPOST_BIN_20099 = 20099; public static final int COMPOST_BIN_20100 = 20100; public static final int COMPOST_BIN_20101 = 20101; public static final int COMPOST_BIN_20102 = 20102; public static final int COMPOST_BIN_20103 = 20103; public static final int COMPOST_BIN_20104 = 20104; public static final int COMPOST_BIN_20105 = 20105; public static final int COMPOST_BIN_20106 = 20106; public static final int COMPOST_BIN_20107 = 20107; public static final int COMPOST_BIN_20108 = 20108; public static final int COMPOST_BIN_20109 = 20109; public static final int COMPOST_BIN_20110 = 20110; public static final int COMPOST_BIN_20111 = 20111; public static final int COMPOST_BIN_20112 = 20112; public static final int COMPOST_BIN_20113 = 20113; public static final int COMPOST_BIN_20114 = 20114; public static final int COMPOST_BIN_20115 = 20115; public static final int COMPOST_BIN_20116 = 20116; public static final int COMPOST_BIN_20117 = 20117; public static final int COMPOST_BIN_20119 = 20119; public static final int COMPOST_BIN_20120 = 20120; public static final int COMPOST_BIN_20121 = 20121; public static final int COMPOST_BIN_20122 = 20122; public static final int COMPOST_BIN_20123 = 20123; public static final int COMPOST_BIN_20124 = 20124; public static final int COMPOST_BIN_20125 = 20125; public static final int COMPOST_BIN_20126 = 20126; public static final int BANK_COUNTER = 20127; public static final int DEADFALL_20128 = 20128; public static final int DEADFALL_20129 = 20129; public static final int DEADFALL_20130 = 20130; public static final int DEADFALL_20131 = 20131; public static final int EGG_LAUNCHER = 20133; public static final int BLACKBOARD_20134 = 20134; public static final int RUNNER_TRAP2 = 20135; public static final int TRAPDOOR_20136 = 20136; public static final int TRAPDOOR_20137 = 20137; public static final int TRAPDOOR_20138 = 20138; public static final int TRAPDOOR_20139 = 20139; public static final int TRAPDOOR_20140 = 20140; public static final int TRAPDOOR_20141 = 20141; public static final int TRAPDOOR_20142 = 20142; public static final int TRAPDOOR_20143 = 20143; public static final int TRAPDOOR_20144 = 20144; public static final int TRAPDOOR_20145 = 20145; public static final int TRAPDOOR_20146 = 20146; public static final int TRAPDOOR_20147 = 20147; public static final int WINCH_20148 = 20148; public static final int SCROLL_TABLE = 20149; public static final int HEALER_SPRING = 20150; public static final int LURE_CAVE = 20151; public static final int PENANCE_FIGHTER_STATUE = 20164; public static final int PENANCE_HEALER_STATUE = 20165; public static final int PENANCE_RUNNER_STATUE = 20166; public static final int PENANCE_RANGER_STATUE = 20167; public static final int PENANCE_QUEEN_SPAWN_STATUE = 20168; public static final int ONE_20183 = 20183; public static final int TWO_20184 = 20184; public static final int THREE_20185 = 20185; public static final int FOUR_20186 = 20186; public static final int FIVE_20187 = 20187; public static final int SIX_20188 = 20188; public static final int SEVEN_20189 = 20189; public static final int EIGHT_20190 = 20190; public static final int NINE_20191 = 20191; public static final int TEN = 20192; public static final int LADDER_20193 = 20193; public static final int LADDER_20194 = 20194; public static final int DOOR_20199 = 20199; public static final int DOOR_20200 = 20200; public static final int DOOR_20201 = 20201; public static final int DOOR_20202 = 20202; public static final int DOOR_20203 = 20203; public static final int DOOR_20204 = 20204; public static final int DOOR_20205 = 20205; public static final int DOOR_20206 = 20206; public static final int DOOR_20207 = 20207; public static final int DOOR_20208 = 20208; public static final int DOOR_20209 = 20209; public static final int OBSTACLE_PIPE_20210 = 20210; public static final int OBSTACLE_NET_20211 = 20211; public static final int CRATE_20216 = 20216; public static final int BARREL_20217 = 20217; public static final int LADDER_20226 = 20226; public static final int LADDER_20227 = 20227; public static final int COMPOST_BIN_20228 = 20228; public static final int INFORMATION_SCROLL = 20229; public static final int RUNNER_TRAP1 = 20230; public static final int BROKEN_TRAP0 = 20231; public static final int LAVA_CRATER = 20232; public static final int POISON_CRATER = 20233; public static final int LAVA_CRATER_20234 = 20234; public static final int POISON_CRATER_20235 = 20235; public static final int PENANCE_CAVE = 20237; public static final int PENANCE_CAVE_20238 = 20238; public static final int PENANCE_CAVE_20239 = 20239; public static final int ATTACKER_ITEM_MACHINE = 20241; public static final int DEFENDER_ITEM_MACHINE = 20242; public static final int HEALER_ITEM_MACHINE = 20243; public static final int HORN_OF_GLORY = 20247; public static final int PETRIFIED_MUSHROOM = 20250; public static final int PETRIFIED_MUSHROOM_20251 = 20251; public static final int EGG_LAUNCHER_20259 = 20259; public static final int HOPPER_20260 = 20260; public static final int HOPPER_20261 = 20261; public static final int HOPPER_20262 = 20262; public static final int EGG_LAUNCHER_20263 = 20263; public static final int EGG_HOPPER = 20264; public static final int EGG_HOPPER_20265 = 20265; public static final int EGG_HOPPER_20266 = 20266; public static final int FLOOR_20271 = 20271; public static final int ODD_MARKINGS_20272 = 20272; public static final int SPEARTRAP = 20273; public static final int TRAPDOOR_20274 = 20274; public static final int LADDER_20275 = 20275; public static final int LADDER_20277 = 20277; public static final int LADDER_20278 = 20278; public static final int TRAPDOOR_20279 = 20279; public static final int LADDER_20280 = 20280; public static final int LADDER_20281 = 20281; public static final int LADDER_20284 = 20284; public static final int LADDER_20285 = 20285; public static final int LADDER_20286 = 20286; public static final int LADDER_20287 = 20287; public static final int KALEEFS_BODY = 20288; public static final int CORPSE_20297 = 20297; public static final int CORPSE_20298 = 20298; public static final int CORPSE_20299 = 20299; public static final int CORPSE_20300 = 20300; public static final int VAULT = 20322; public static final int PRIVATE_BANK_BOOTH = 20323; public static final int PRIVATE_BANK_BOOTH_20324 = 20324; public static final int BANK_BOOTH_20325 = 20325; public static final int BANK_BOOTH_20326 = 20326; public static final int BANK_BOOTH_20327 = 20327; public static final int BANK_BOOTH_20328 = 20328; public static final int BANK_TABLE_20329 = 20329; public static final int BANK_TABLE_20330 = 20330; public static final int DAGGER_STALL = 20331; public static final int CRAFT_STALL = 20332; public static final int FLOOR_20335 = 20335; public static final int TRAPDOOR_20340 = 20340; public static final int GATE_20341 = 20341; public static final int CART_20342 = 20342; public static final int CART_20343 = 20343; public static final int SILK_STALL_20344 = 20344; public static final int BAKERY_STALL_20345 = 20345; public static final int GEM_STALL_20346 = 20346; public static final int FUR_STALL_20347 = 20347; public static final int SPICE_STALL_20348 = 20348; public static final int MARKET_STALL_20349 = 20349; public static final int TEA_STALL_20350 = 20350; public static final int TABLE_20351 = 20351; public static final int CHAIR_20352 = 20352; public static final int LADDER_20353 = 20353; public static final int LADDER_20354 = 20354; public static final int LADDER_20356 = 20356; public static final int LADDER_20357 = 20357; public static final int SINK_20358 = 20358; public static final int WHEELBARROW_20359 = 20359; public static final int WORK_BENCH = 20360; public static final int SHELF_20362 = 20362; public static final int CLOTHING_SHELVES_20364 = 20364; public static final int SPINNING_WHEEL_20365 = 20365; public static final int CRATE_20367 = 20367; public static final int CRATE_20368 = 20368; public static final int BOXES_20369 = 20369; public static final int LOG_PILE_20370 = 20370; public static final int BROKEN_LOGS_20371 = 20371; public static final int HOLLOW_LOG_20372 = 20372; public static final int LOGS_20373 = 20373; public static final int LOGS_20374 = 20374; public static final int POTTERS_WHEEL_20375 = 20375; public static final int CLOTHES_20376 = 20376; public static final int ALTAR_20377 = 20377; public static final int ALTAR_20378 = 20378; public static final int ALTAR_20379 = 20379; public static final int BED_20386 = 20386; public static final int BED_20387 = 20387; public static final int CLOTH_COVERED_TABLE = 20388; public static final int GATE_20391 = 20391; public static final int BUFFERS_20402 = 20402; public static final int ORE_VEIN = 20407; public static final int ORE_VEIN_20408 = 20408; public static final int ORE_VEIN_20409 = 20409; public static final int ORE_VEIN_20410 = 20410; public static final int ORE_VEIN_20411 = 20411; public static final int ORE_VEIN_20412 = 20412; public static final int ORE_VEIN_20413 = 20413; public static final int ORE_VEIN_20414 = 20414; public static final int ORE_VEIN_20415 = 20415; public static final int ORE_VEIN_20416 = 20416; public static final int ORE_VEIN_20417 = 20417; public static final int ORE_VEIN_20418 = 20418; public static final int ORE_VEIN_20419 = 20419; public static final int ORE_VEIN_20420 = 20420; public static final int ORE_VEIN_20421 = 20421; public static final int ORE_VEIN_20422 = 20422; public static final int ORE_VEIN_20423 = 20423; public static final int ORE_VEIN_20424 = 20424; public static final int ORE_VEIN_20425 = 20425; public static final int STAIRS_20426 = 20426; public static final int CRATE_20429 = 20429; public static final int CRATE_20430 = 20430; public static final int BARREL_20431 = 20431; public static final int CART_TUNNEL_20433 = 20433; public static final int STAIRS_20435 = 20435; public static final int DEPLETED_VEIN = 20439; public static final int DEPLETED_VEIN_20440 = 20440; public static final int DEPLETED_VEIN_20441 = 20441; public static final int DEPLETED_VEIN_20442 = 20442; public static final int ORE_VEIN_20443 = 20443; public static final int ORE_VEIN_20444 = 20444; public static final int ORE_VEIN_20445 = 20445; public static final int ORE_VEIN_20446 = 20446; public static final int ORE_VEIN_20447 = 20447; public static final int ORE_VEIN_20448 = 20448; public static final int ORE_VEIN_20449 = 20449; public static final int ORE_VEIN_20450 = 20450; public static final int ORE_VEIN_20451 = 20451; public static final int PASSAGEWAY_20452 = 20452; public static final int PASSAGEWAY_20453 = 20453; public static final int PASSAGEWAY_20454 = 20454; public static final int PASSAGEWAY_20455 = 20455; public static final int PASSAGEWAY_20482 = 20482; public static final int PASSAGEWAY_20483 = 20483; public static final int STAIRS_20484 = 20484; public static final int PASSAGEWAY_20485 = 20485; public static final int STAIRS_20486 = 20486; public static final int STAIRS_20487 = 20487; public static final int PASSAGEWAY_20488 = 20488; public static final int PASSAGEWAY_20489 = 20489; public static final int PASSAGEWAY_20490 = 20490; public static final int PASSAGEWAY_20491 = 20491; public static final int PASSAGEWAY_20492 = 20492; public static final int PASSAGEWAY_20493 = 20493; public static final int STAIRS_20494 = 20494; public static final int PASSAGEWAY_20495 = 20495; public static final int STAIRS_20496 = 20496; public static final int PASSAGEWAY_20497 = 20497; public static final int PASSAGEWAY_20498 = 20498; public static final int PASSAGEWAY_20499 = 20499; public static final int PASSAGEWAY_20500 = 20500; public static final int PASSAGEWAY_20501 = 20501; public static final int PASSAGEWAY_20502 = 20502; public static final int PASSAGEWAY_20503 = 20503; public static final int PASSAGEWAY_20504 = 20504; public static final int PASSAGEWAY_20505 = 20505; public static final int PASSAGEWAY_20506 = 20506; public static final int PASSAGEWAY_20507 = 20507; public static final int STAIRS_20508 = 20508; public static final int PASSAGEWAY_20509 = 20509; public static final int PASSAGEWAY_20510 = 20510; public static final int PASSAGEWAY_20511 = 20511; public static final int PASSAGEWAY_20512 = 20512; public static final int PASSAGEWAY_20513 = 20513; public static final int PASSAGEWAY_20514 = 20514; public static final int PASSAGEWAY_20515 = 20515; public static final int PASSAGEWAY_20516 = 20516; public static final int PASSAGEWAY_20517 = 20517; public static final int PASSAGEWAY_20518 = 20518; public static final int PASSAGEWAY_20519 = 20519; public static final int PASSAGEWAY_20520 = 20520; public static final int PASSAGEWAY_20521 = 20521; public static final int PASSAGEWAY_20522 = 20522; public static final int PASSAGEWAY_20523 = 20523; public static final int PASSAGEWAY_20524 = 20524; public static final int PASSAGEWAY_20525 = 20525; public static final int PASSAGEWAY_20526 = 20526; public static final int PASSAGEWAY_20527 = 20527; public static final int PASSAGEWAY_20528 = 20528; public static final int PASSAGEWAY_20529 = 20529; public static final int PASSAGEWAY_20530 = 20530; public static final int PASSAGEWAY_20531 = 20531; public static final int PASSAGEWAY_20532 = 20532; public static final int PASSAGEWAY_20533 = 20533; public static final int PASSAGEWAY_20534 = 20534; public static final int PASSAGEWAY_20535 = 20535; public static final int PASSAGEWAY_20536 = 20536; public static final int PASSAGEWAY_20537 = 20537; public static final int PASSAGEWAY_20538 = 20538; public static final int PASSAGEWAY_20539 = 20539; public static final int PILLAR_20540 = 20540; public static final int PILLAR_20541 = 20541; public static final int PILLAR_20542 = 20542; public static final int PILLAR_20543 = 20543; public static final int PILLAR_20544 = 20544; public static final int PILLAR_20545 = 20545; public static final int PILLAR_20546 = 20546; public static final int PILLAR_20547 = 20547; public static final int PILLAR_20548 = 20548; public static final int PILLAR_20549 = 20549; public static final int PILLAR_20550 = 20550; public static final int PILLAR_20551 = 20551; public static final int PILLAR_20552 = 20552; public static final int PILLAR_20553 = 20553; public static final int PILLAR_20554 = 20554; public static final int PILLAR_20555 = 20555; public static final int PILLAR_20556 = 20556; public static final int PILLAR_20557 = 20557; public static final int LEDGE_20558 = 20558; public static final int LEDGE_20559 = 20559; public static final int LEDGE_20560 = 20560; public static final int LEDGE_20561 = 20561; public static final int LEDGE_20562 = 20562; public static final int LEDGE_20563 = 20563; public static final int LEDGE_20564 = 20564; public static final int LEDGE_20565 = 20565; public static final int LEDGE_20566 = 20566; public static final int LEDGE_20567 = 20567; public static final int LEDGE_20568 = 20568; public static final int LEDGE_20569 = 20569; public static final int TRAP_BYPASS = 20570; public static final int HANGING_LOG_20571 = 20571; public static final int HANGING_LOG_20572 = 20572; public static final int HANGING_LOG_20573 = 20573; public static final int HANGING_LOG_20574 = 20574; public static final int FLOOR_20583 = 20583; public static final int FLOOR_20584 = 20584; public static final int FLOOR_20585 = 20585; public static final int FLOOR_20586 = 20586; public static final int FLOOR_20587 = 20587; public static final int WALL_20588 = 20588; public static final int WALL_20589 = 20589; public static final int WALL_20590 = 20590; public static final int WALL_20591 = 20591; public static final int WALL_20592 = 20592; public static final int WALL_20593 = 20593; public static final int WALL_20594 = 20594; public static final int WALL_20595 = 20595; public static final int WALL_20596 = 20596; public static final int WALL_20597 = 20597; public static final int WALL_20598 = 20598; public static final int WALL_20599 = 20599; public static final int WALL_20600 = 20600; public static final int WALL_20601 = 20601; public static final int WALL_20602 = 20602; public static final int WALL_20603 = 20603; public static final int WALL_20604 = 20604; public static final int WALL_20605 = 20605; public static final int WALL_20606 = 20606; public static final int WALL_20607 = 20607; public static final int WALL_20608 = 20608; public static final int WALL_20609 = 20609; public static final int WALL_20610 = 20610; public static final int WALL_20611 = 20611; public static final int WALL_20612 = 20612; public static final int WALL_20613 = 20613; public static final int WALL_20614 = 20614; public static final int WALL_20615 = 20615; public static final int WALL_20616 = 20616; public static final int WALL_20617 = 20617; public static final int WALL_20618 = 20618; public static final int WALL_20619 = 20619; public static final int WALL_20620 = 20620; public static final int WALL_20621 = 20621; public static final int WALL_20622 = 20622; public static final int WALL_20623 = 20623; public static final int FLOOR_20624 = 20624; public static final int FLOOR_20625 = 20625; public static final int FLOOR_20626 = 20626; public static final int FLOOR_20627 = 20627; public static final int FLOOR_20628 = 20628; public static final int FLOOR_20629 = 20629; public static final int FLOOR_20630 = 20630; public static final int FLOOR_20631 = 20631; public static final int FLOOR_20632 = 20632; public static final int FLOOR_20633 = 20633; public static final int FLOOR_20634 = 20634; public static final int FLOOR_20635 = 20635; public static final int FLOOR_20636 = 20636; public static final int FLOOR_20637 = 20637; public static final int FLOOR_20638 = 20638; public static final int FLOOR_20639 = 20639; public static final int GNOME_SKELETON = 20646; public static final int DEADFALL_20647 = 20647; public static final int BOULDER_20648 = 20648; public static final int BOULDER_20649 = 20649; public static final int BOULDER_20650 = 20650; public static final int BOULDER_20651 = 20651; public static final int DEADFALL_20652 = 20652; public static final int GIFT_OF_PEACE = 20656; public static final int SKELETON_20665 = 20665; public static final int WARNING_SIGN_20666 = 20666; public static final int STAIRCASE_20667 = 20667; public static final int STAIRCASE_20668 = 20668; public static final int STAIRCASE_20669 = 20669; public static final int STAIRCASE_20670 = 20670; public static final int STAIRCASE_20671 = 20671; public static final int STAIRCASE_20672 = 20672; public static final int LADDER_20673 = 20673; public static final int DOOR_20678 = 20678; public static final int DOOR_20679 = 20679; public static final int DOOR_20680 = 20680; public static final int DOOR_20697 = 20697; public static final int DOOR_20698 = 20698; public static final int DOOR_20699 = 20699; public static final int STANDING_TORCH_20716 = 20716; public static final int SARCOPHAGUS_20720 = 20720; public static final int SARCOPHAGUS_20721 = 20721; public static final int SARCOPHAGUS_20722 = 20722; public static final int CHEST_20723 = 20723; public static final int CHEST_20724 = 20724; public static final int SKELETON_20725 = 20725; public static final int SKELETON_20726 = 20726; public static final int SKELETON_20727 = 20727; public static final int BED_20740 = 20740; public static final int SARCOPHAGUS_20770 = 20770; public static final int SARCOPHAGUS_20771 = 20771; public static final int SARCOPHAGUS_20772 = 20772; public static final int DOOR_20773 = 20773; public static final int WATERPUMP_20776 = 20776; public static final int SKELETON_20780 = 20780; public static final int SKELETON_20781 = 20781; public static final int SPIKEY_CHAIN_20782 = 20782; public static final int SPIKEY_CHAIN_20783 = 20783; public static final int LADDER_20784 = 20784; public static final int LADDER_20785 = 20785; public static final int PORTAL_20786 = 20786; public static final int DANGER_SIGN_20787 = 20787; public static final int DEAD_EXPLORER = 20788; public static final int LEVER_20789 = 20789; public static final int ENTRANCE_20790 = 20790; public static final int APPLE_BARREL_20791 = 20791; public static final int APPLE_BARREL_20792 = 20792; public static final int BARREL_TAP_20794 = 20794; public static final int EXERCISE_MAT_20801 = 20801; public static final int TARGET_20802 = 20802; public static final int TREE_20803 = 20803; public static final int TREE_20804 = 20804; public static final int OAK_20806 = 20806; public static final int HAY_BALES_20807 = 20807; public static final int HAY_BALES_20808 = 20808; public static final int HAYSTACK_20809 = 20809; public static final int EXERCISE_MAT_20810 = 20810; public static final int EVIL_CLAW = 20811; public static final int CONTROL_PANEL = 20813; public static final int DOOR_20817 = 20817; public static final int CRATES_20820 = 20820; public static final int CRATE_20821 = 20821; public static final int CRATES_20823 = 20823; public static final int COGS_20824 = 20824; public static final int JUNK_20825 = 20825; public static final int RACK_OF_BARRELS_20826 = 20826; public static final int BARREL_20827 = 20827; public static final int BARROW_20828 = 20828; public static final int SACK_PILE_20834 = 20834; public static final int SACK_PILE_20835 = 20835; public static final int LEVER_20836 = 20836; public static final int LOCKED_DOOR_20837 = 20837; public static final int LOCKED_DOOR_20838 = 20838; public static final int ENERGY_BARRIER_20839 = 20839; public static final int EXIT_PORTAL_20843 = 20843; public static final int TREE_20844 = 20844; public static final int TREE_20845 = 20845; public static final int BEEHIVE_PART = 20846; public static final int BEEHIVE_PART_20847 = 20847; public static final int BEEHIVE_PART_20848 = 20848; public static final int BEEHIVE_PART_20849 = 20849; public static final int INTERFACE_SURROUND = 20850; public static final int BUTTON_UP = 20851; public static final int BUTTON_DOWN = 20852; public static final int BUTTON_LEFT = 20853; public static final int BUTTON_RIGHT = 20854; public static final int BUTTON_BUILD = 20855; public static final int BEEHIVE_20856 = 20856; public static final int COMPOST_BIN_20870 = 20870; public static final int COMPOST_BIN_20871 = 20871; public static final int COMPOST_BIN_20872 = 20872; public static final int CAGE_20873 = 20873; public static final int DUNGEON_ENTRANCE_20876 = 20876; public static final int EXIT_20878 = 20878; public static final int LOG_BALANCE_20882 = 20882; public static final int LOG_BALANCE_20884 = 20884; public static final int CRATE_20885 = 20885; public static final int COMPOST_BIN_20886 = 20886; public static final int COMPOST_BIN_20887 = 20887; public static final int COMPOST_BIN_20888 = 20888; public static final int COMPOST_BIN_20889 = 20889; public static final int COMPOST_BIN_20890 = 20890; public static final int COMPOST_BIN_20891 = 20891; public static final int COMPOST_BIN_20892 = 20892; public static final int COMPOST_BIN_20893 = 20893; public static final int COMPOST_BIN_20894 = 20894; public static final int COMPOST_BIN_20895 = 20895; public static final int COMPOST_BIN_20896 = 20896; public static final int COMPOST_BIN_20897 = 20897; public static final int COMPOST_BIN_20898 = 20898; public static final int COMPOST_BIN_20899 = 20899; public static final int COMPOST_BIN_20900 = 20900; public static final int COMPOST_BIN_20901 = 20901; public static final int COMPOST_BIN_20902 = 20902; public static final int COMPOST_BIN_20903 = 20903; public static final int COMPOST_BIN_20904 = 20904; public static final int COMPOST_BIN_20905 = 20905; public static final int COMPOST_BIN_20906 = 20906; public static final int COMPOST_BIN_20907 = 20907; public static final int COMPOST_BIN_20908 = 20908; public static final int COMPOST_BIN_20909 = 20909; public static final int COMPOST_BIN_20910 = 20910; public static final int COMPOST_BIN_20911 = 20911; public static final int COMPOST_BIN_20912 = 20912; public static final int COMPOST_BIN_20913 = 20913; public static final int COMPOST_BIN_20914 = 20914; public static final int COMPOST_BIN_20915 = 20915; public static final int COMPOST_BIN_20916 = 20916; public static final int COMPOST_BIN_20917 = 20917; public static final int COMPOST_BIN_20918 = 20918; public static final int COMPOST_BIN_20919 = 20919; public static final int COMPOST_BIN_20920 = 20920; public static final int COMPOST_BIN_20921 = 20921; public static final int COMPOST_BIN_20922 = 20922; public static final int COMPOST_BIN_20923 = 20923; public static final int COMPOST_BIN_20924 = 20924; public static final int DOOR_20925 = 20925; public static final int FISHING_SPOT_20926 = 20926; public static final int FISHING_SPOT_20927 = 20927; public static final int FISHING_SPOT_20928 = 20928; public static final int FISHING_SPOT_20929 = 20929; public static final int FISHING_SPOT_20930 = 20930; public static final int TOMB_DOOR = 20931; public static final int TOMB_DOOR_20932 = 20932; public static final int GRAND_GOLD_CHEST = 20946; public static final int OPENED_GOLD_CHEST = 20947; public static final int TOMB_DOOR_20948 = 20948; public static final int TOMB_DOOR_20949 = 20949; public static final int BUST = 20953; public static final int BUST_20954 = 20954; public static final int OBELISK_20955 = 20955; public static final int AN_ANONYMOUS_LOOKING_DOOR = 20956; public static final int AN_ANONYMOUS_LOOKING_DOOR_20974 = 20974; public static final int AN_ANONYMOUS_LOOKING_DOOR_20975 = 20975; public static final int AN_ANONYMOUS_LOOKING_DOOR_20976 = 20976; public static final int AN_ANONYMOUS_LOOKING_DOOR_20977 = 20977; public static final int AN_ANONYMOUS_LOOKING_DOOR_20978 = 20978; public static final int AN_ANONYMOUS_LOOKING_DOOR_20979 = 20979; public static final int MUMMY = 20985; public static final int MUMMY_20986 = 20986; public static final int AN_ANONYMOUS_LOOKING_DOOR_20987 = 20987; public static final int GOLFCART = 20995; public static final int TABLE_20996 = 20996; public static final int CHAIR_20999 = 20999; public static final int MAP_21000 = 21000; public static final int INTERROGATION_CHAIR = 21001; public static final int STEAM_GENERATOR = 21002; public static final int DRILL_21008 = 21008; public static final int LATHE_21009 = 21009; public static final int GIGANTIC_PENGUIN = 21010; public static final int CRATE_21013 = 21013; public static final int CRATE_21014 = 21014; public static final int CRATES_21015 = 21015; public static final int BARREL_21016 = 21016; public static final int WORKBENCH_21018 = 21018; public static final int WORKBENCH_21019 = 21019; public static final int BED_21022 = 21022; public static final int LOCKERS = 21023; public static final int FOOT_LOCKERS = 21024; public static final int CELLO = 21025; public static final int GUITAR = 21026; public static final int HARP_21027 = 21027; public static final int FLUTE = 21028; public static final int TRUMPET = 21029; public static final int PIANO_21030 = 21030; public static final int STOOL_21031 = 21031; public static final int CLARINET = 21032; public static final int MUSIC_SCORES = 21033; public static final int CHASM = 21035; public static final int CONTROL_PANEL_21055 = 21055; public static final int DOOR_21065 = 21065; public static final int DOOR_21066 = 21066; public static final int DOOR_21067 = 21067; public static final int DOOR_21068 = 21068; public static final int SPINNING_LIGHT = 21085; public static final int BIG_BUTTON = 21086; public static final int CRAZY_PENGUIN = 21092; public static final int CRAZY_PENGUIN_21093 = 21093; public static final int CRAZY_PENGUIN_21094 = 21094; public static final int ICE_STEPS = 21095; public static final int START = 21106; public static final int SIGN_21107 = 21107; public static final int STEPPING_STONE_21120 = 21120; public static final int STEPPING_STONE_21121 = 21121; public static final int STEPPING_STONE_21122 = 21122; public static final int STEPPING_STONE_21123 = 21123; public static final int STEPPING_STONE_21124 = 21124; public static final int STEPPING_STONE_21126 = 21126; public static final int STEPPING_STONE_21127 = 21127; public static final int STEPPING_STONE_21128 = 21128; public static final int STEPPING_STONE_21129 = 21129; public static final int STEPPING_STONE_21130 = 21130; public static final int STEPPING_STONE_21131 = 21131; public static final int STEPPING_STONE_21132 = 21132; public static final int STEPPING_STONE_21133 = 21133; public static final int ICICLES = 21134; public static final int SNOW_JUMP = 21142; public static final int SNOW_JUMP_21143 = 21143; public static final int WOODEN_PLATFORM = 21147; public static final int ICE = 21148; public static final int ICE_21149 = 21149; public static final int ICE_21150 = 21150; public static final int ICE_21151 = 21151; public static final int ICE_21152 = 21152; public static final int ICE_21153 = 21153; public static final int ICE_21154 = 21154; public static final int ICE_21155 = 21155; public static final int ICE_21156 = 21156; public static final int A_CRACK = 21157; public static final int AVALANCHE = 21158; public static final int AVALANCHE_21159 = 21159; public static final int DOOR_21160 = 21160; public static final int DOOR_21161 = 21161; public static final int DOOR_21162 = 21162; public static final int DOOR_21164 = 21164; public static final int DOOR_21166 = 21166; public static final int DOOR_21167 = 21167; public static final int DOOR_21169 = 21169; public static final int DOOR_21170 = 21170; public static final int DOOR_21171 = 21171; public static final int GATE_21172 = 21172; public static final int BOAT_21175 = 21175; public static final int BOAT_21177 = 21177; public static final int FIRM_SNOW_PATCH = 21179; public static final int BIRD_HIDE_STRUCTURE = 21180; public static final int SNOWY_BIRD_HIDE = 21181; public static final int DESTROYED_BIRD_HIDE = 21182; public static final int SUSPICIOUS_FOOTPRINTS = 21183; public static final int SUSPICIOUS_FOOTPRINTS_21184 = 21184; public static final int SUSPICIOUS_FOOTPRINTS_21185 = 21185; public static final int CHASM_21187 = 21187; public static final int SNOW_21199 = 21199; public static final int SNOW_21200 = 21200; public static final int DOOR_21201 = 21201; public static final int DOOR_21243 = 21243; public static final int COLLECTOR_CONVERTER = 21250; public static final int AN_ANONYMOUS_LOOKING_DOOR_21251 = 21251; public static final int AN_ANONYMOUS_LOOKING_DOOR_21252 = 21252; public static final int AN_ANONYMOUS_LOOKING_DOOR_21253 = 21253; public static final int AN_ANONYMOUS_LOOKING_DOOR_21254 = 21254; public static final int SARCOPHAGUS_21255 = 21255; public static final int SARCOPHAGUS_21256 = 21256; public static final int SARCOPHAGUS_21257 = 21257; public static final int SARCOPHAGUS_21258 = 21258; public static final int SARCOPHAGUS_21259 = 21259; public static final int SARCOPHAGUS_21260 = 21260; public static final int URN_21261 = 21261; public static final int URN_21262 = 21262; public static final int URN_21263 = 21263; public static final int URN_21264 = 21264; public static final int URN_21265 = 21265; public static final int URN_21266 = 21266; public static final int URN_21267 = 21267; public static final int URN_21268 = 21268; public static final int URN_21269 = 21269; public static final int URN_21270 = 21270; public static final int FUNERAL_PYRE_21271 = 21271; public static final int FUNERAL_PYRE_21272 = 21272; public static final int URN_21273 = 21273; public static final int TREE_STUMP_21274 = 21274; public static final int URN_21275 = 21275; public static final int URN_21276 = 21276; public static final int URN_21277 = 21277; public static final int URN_21278 = 21278; public static final int URN_21279 = 21279; public static final int SPEARTRAP_21280 = 21280; public static final int COMPOST_BIN_21281 = 21281; public static final int COMPOST_BIN_21282 = 21282; public static final int COMPOST_BIN_21283 = 21283; public static final int COMPOST_BIN_21284 = 21284; public static final int COMPOST_BIN_21285 = 21285; public static final int COMPOST_BIN_21286 = 21286; public static final int COMPOST_BIN_21287 = 21287; public static final int COMPOST_BIN_21288 = 21288; public static final int COMPOST_BIN_21289 = 21289; public static final int COMPOST_BIN_21290 = 21290; public static final int COMPOST_BIN_21291 = 21291; public static final int COMPOST_BIN_21292 = 21292; public static final int COMPOST_BIN_21293 = 21293; public static final int COMPOST_BIN_21294 = 21294; public static final int COMPOST_BIN_21295 = 21295; public static final int COMPOST_BIN_21296 = 21296; public static final int COMPOST_BIN_21297 = 21297; public static final int COMPOST_BIN_21298 = 21298; public static final int CHEST_21299 = 21299; public static final int CHEST_21300 = 21300; public static final int BANK_CHEST_21301 = 21301; public static final int CLAY_OVEN_21302 = 21302; public static final int CLAY_FORGE = 21303; public static final int SPINNING_WHEEL_21304 = 21304; public static final int WOODCUTTING_STUMP = 21305; public static final int ROPE_BRIDGE_21306 = 21306; public static final int ROPE_BRIDGE_21307 = 21307; public static final int ROPE_BRIDGE_21308 = 21308; public static final int ROPE_BRIDGE_21309 = 21309; public static final int ROPE_BRIDGE_21310 = 21310; public static final int ROPE_BRIDGE_21311 = 21311; public static final int ROPE_BRIDGE_21312 = 21312; public static final int ROPE_BRIDGE_21313 = 21313; public static final int ROPE_BRIDGE_21314 = 21314; public static final int ROPE_BRIDGE_21315 = 21315; public static final int ROPE_BRIDGE_21316 = 21316; public static final int ROPE_BRIDGE_21317 = 21317; public static final int ROPE_BRIDGE_21318 = 21318; public static final int ROPE_BRIDGE_21319 = 21319; public static final int DOOR_21340 = 21340; public static final int DOOR_21341 = 21341; public static final int DOOR_21342 = 21342; public static final int DOOR_21343 = 21343; public static final int CHAIR_21354 = 21354; public static final int LARGE_GEYSER = 21355; public static final int SMALL_GEYSER = 21356; public static final int BANK_TABLE_21358 = 21358; public static final int TABLE_21359 = 21359; public static final int TABLE_21360 = 21360; public static final int SMASHED_CHAIR_21361 = 21361; public static final int BED_21362 = 21362; public static final int TABLE_21388 = 21388; public static final int TABLE_21389 = 21389; public static final int SACKS_21390 = 21390; public static final int THRONE_21393 = 21393; public static final int BELL_21394 = 21394; public static final int LADDER_21395 = 21395; public static final int LADDER_21396 = 21396; public static final int LARGE_DOOR_21397 = 21397; public static final int LARGE_DOOR_21398 = 21398; public static final int LARGE_DOOR_21399 = 21399; public static final int LARGE_DOOR_21400 = 21400; public static final int LARGE_DOOR_21401 = 21401; public static final int LARGE_DOOR_21402 = 21402; public static final int GATE_21403 = 21403; public static final int GATE_21404 = 21404; public static final int GATE_21405 = 21405; public static final int GATE_21406 = 21406; public static final int AXE_CASE = 21437; public static final int SWORD_CASE_21438 = 21438; public static final int SWORDS = 21439; public static final int CHOPPING_TABLE = 21441; public static final int ORE_CRATE = 21442; public static final int ORE_TABLE = 21443; public static final int ORE_STONES = 21444; public static final int SHIELD_DISPLAY_21445 = 21445; public static final int SHIELD_DISPLAY_21446 = 21446; public static final int ARMOUR_DISPLAY = 21447; public static final int BOULDERS_21454 = 21454; public static final int STAIRCASE_21455 = 21455; public static final int ARCH = 21459; public static final int ARCH_21460 = 21460; public static final int ARCH_21461 = 21461; public static final int THRONE_21464 = 21464; public static final int TORCH_21465 = 21465; public static final int BANNER_21500 = 21500; public static final int BANNER_21501 = 21501; public static final int DOOR_21505 = 21505; public static final int DOOR_21506 = 21506; public static final int DOOR_21507 = 21507; public static final int DOOR_21508 = 21508; public static final int ROPE_BRIDGE_21509 = 21509; public static final int BROKEN_ROPE_BRIDGE = 21510; public static final int LADDER_21512 = 21512; public static final int LADDER_21513 = 21513; public static final int LADDER_21514 = 21514; public static final int LADDER_21515 = 21515; public static final int RIFT_21529 = 21529; public static final int RIFT_21530 = 21530; public static final int RIFT_21531 = 21531; public static final int RIFT_21532 = 21532; public static final int RIFT_21533 = 21533; public static final int RIFT_21534 = 21534; public static final int RIFT_21535 = 21535; public static final int RIFT_21536 = 21536; public static final int RIFT_21537 = 21537; public static final int RIFT_21538 = 21538; public static final int RIFT_21539 = 21539; public static final int EXIT_CAVERN = 21560; public static final int MUSHROOMS_21569 = 21569; public static final int MUSHROOMS_21570 = 21570; public static final int ROCK_21571 = 21571; public static final int SMALL_ROCK_21572 = 21572; public static final int ROCK_21573 = 21573; public static final int BOULDERS_21574 = 21574; public static final int BOULDERS_21575 = 21575; public static final int STAIRCASE_21578 = 21578; public static final int CAVE_21580 = 21580; public static final int CAVE_21581 = 21581; public static final int CAVE_21582 = 21582; public static final int CAVE_21583 = 21583; public static final int CAVE_21584 = 21584; public static final int CAVE_21585 = 21585; public static final int CAVE_21586 = 21586; public static final int CAVE_21587 = 21587; public static final int CAVE_21588 = 21588; public static final int CAVE_21589 = 21589; public static final int CAVE_21590 = 21590; public static final int STONE_LADDER_21591 = 21591; public static final int STONE_LADDER_21592 = 21592; public static final int STONE_LADDER_21593 = 21593; public static final int CAVE_OPENING = 21594; public static final int CAVE_OPENING_21595 = 21595; public static final int CAVE_OPENING_21596 = 21596; public static final int CAVE_OPENING_21597 = 21597; public static final int CAVE_OPENING_21598 = 21598; public static final int CAVE_OPENING_21599 = 21599; public static final int GATE_21600 = 21600; public static final int GATE_21601 = 21601; public static final int BROKEN_BARREL_21603 = 21603; public static final int CHAIR_21607 = 21607; public static final int TABLE_21608 = 21608; public static final int TABLE_21609 = 21609; public static final int TABLE_21610 = 21610; public static final int BED_21611 = 21611; public static final int CRATE_21612 = 21612; public static final int SHELF_21614 = 21614; public static final int SHELF_21615 = 21615; public static final int FIRE_21620 = 21620; public static final int ICE_TROLL_KING = 21622; public static final int ICE_TROLL_KING_21623 = 21623; public static final int FREMENNIK_BOAT_21634 = 21634; public static final int STANDARD_21635 = 21635; public static final int STANDARD_21636 = 21636; public static final int STANDARD_21637 = 21637; public static final int TORCH_21667 = 21667; public static final int COMPOST_BIN_21668 = 21668; public static final int COMPOST_BIN_21669 = 21669; public static final int COMPOST_BIN_21670 = 21670; public static final int COMPOST_BIN_21671 = 21671; public static final int COMPOST_BIN_21672 = 21672; public static final int COMPOST_BIN_21673 = 21673; public static final int COMPOST_BIN_21674 = 21674; public static final int COMPOST_BIN_21675 = 21675; public static final int COMPOST_BIN_21676 = 21676; public static final int COMPOST_BIN_21677 = 21677; public static final int COMPOST_BIN_21678 = 21678; public static final int COMPOST_BIN_21679 = 21679; public static final int COMPOST_BIN_21680 = 21680; public static final int COMPOST_BIN_21681 = 21681; public static final int COMPOST_BIN_21682 = 21682; public static final int COMPOST_BIN_21683 = 21683; public static final int COMPOST_BIN_21684 = 21684; public static final int COMPOST_BIN_21685 = 21685; public static final int COMPOST_BIN_21686 = 21686; public static final int COMPOST_BIN_21687 = 21687; public static final int COMPOST_BIN_21688 = 21688; public static final int COMPOST_BIN_21689 = 21689; public static final int COMPOST_BIN_21690 = 21690; public static final int COMPOST_BIN_21691 = 21691; public static final int COMPOST_BIN_21692 = 21692; public static final int COMPOST_BIN_21693 = 21693; public static final int COMPOST_BIN_21694 = 21694; public static final int COMPOST_BIN_21695 = 21695; public static final int STAIRS_21722 = 21722; public static final int STAIRS_21723 = 21723; public static final int STAIRS_21724 = 21724; public static final int STAIRS_21725 = 21725; public static final int STAIRS_21726 = 21726; public static final int PIPE_21727 = 21727; public static final int PIPE_21728 = 21728; public static final int VINES_21731 = 21731; public static final int VINES_21732 = 21732; public static final int VINES_21733 = 21733; public static final int VINES_21734 = 21734; public static final int VINES_21735 = 21735; public static final int STEPPING_STONE_21738 = 21738; public static final int STEPPING_STONE_21739 = 21739; public static final int MUSHROOM_21740 = 21740; public static final int FUNGUS_21741 = 21741; public static final int FUNGUS_21742 = 21742; public static final int FUNGUS_21743 = 21743; public static final int CORPSE_21744 = 21744; public static final int CORPSE_21745 = 21745; public static final int CORPSE_21746 = 21746; public static final int CORPSE_21747 = 21747; public static final int PORTCULLIS_21772 = 21772; public static final int SOUL_DEVOURER = 21773; public static final int LADDER_21781 = 21781; public static final int LADDER_21782 = 21782; public static final int RANGE_21792 = 21792; public static final int TABLE_21793 = 21793; public static final int SHELVES_21794 = 21794; public static final int FIREPLACE_21795 = 21795; public static final int CRACK_21800 = 21800; public static final int CORPSE_21802 = 21802; public static final int CORPSE_21803 = 21803; public static final int TOWER_DOOR = 21814; public static final int WATER_PIPES = 21844; public static final int WATER_PIPES_21845 = 21845; public static final int WATER_PIPES_21846 = 21846; public static final int WATER_PIPES_21847 = 21847; public static final int WATER_PIPES_21848 = 21848; public static final int BARRICADE_21849 = 21849; public static final int RIFT_21868 = 21868; public static final int CAGE_21869 = 21869; public static final int CAGE_21870 = 21870; public static final int STAIRS_21871 = 21871; public static final int STAIRS_21872 = 21872; public static final int PRESSURE_MACHINE = 21873; public static final int HUGE_VAT = 21874; public static final int PIPE_21875 = 21875; public static final int PIPE_21876 = 21876; public static final int PIPE_21877 = 21877; public static final int PIPE_21878 = 21878; public static final int FURNACE_21879 = 21879; public static final int PIPE_MACHINE = 21880; public static final int PIPE_MACHINE_21881 = 21881; public static final int PIPE_21882 = 21882; public static final int PIPE_21883 = 21883; public static final int SUPPORT_21890 = 21890; public static final int SYMBOL_OF_LIFE = 21893; public static final int SYMBOL_OF_LIFE_21894 = 21894; public static final int TUBE = 21901; public static final int MAGIC_WELL = 21902; public static final int MAGIC_WELL_21903 = 21903; public static final int MAGIC_WELL_21904 = 21904; public static final int PIPE_21905 = 21905; public static final int OPERATION_TABLE = 21906; public static final int OPERATION_CHAIR = 21907; public static final int CRATE_21908 = 21908; public static final int CRATE_21909 = 21909; public static final int CRATE_21910 = 21910; public static final int CRATE_21911 = 21911; public static final int CRATE_21912 = 21912; public static final int CRATE_21913 = 21913; public static final int CRATE_21914 = 21914; public static final int CRATE_21915 = 21915; public static final int CRATE_21916 = 21916; public static final int CRATE_21917 = 21917; public static final int MAGIC_TABLE = 21918; public static final int SPINNING_PIPE = 21920; public static final int TRAPDOOR_21921 = 21921; public static final int TRAPDOOR_21922 = 21922; public static final int SPECIMEN = 21923; public static final int PLANT_21924 = 21924; public static final int PIPE_21925 = 21925; public static final int PIPE_21926 = 21926; public static final int TOWER_DOOR_21929 = 21929; public static final int CAGE_21930 = 21930; public static final int CAGE_21931 = 21931; public static final int SHACKLE_TABLE = 21932; public static final int RETORTS = 21933; public static final int EXPERIMENT_TABLE = 21934; public static final int EXPERIMENT_TABLE_21935 = 21935; public static final int EXPERIMENT_TABLE_21936 = 21936; public static final int EXPERIMENT_CABINET = 21937; public static final int CRATE_21938 = 21938; public static final int CRATE_21939 = 21939; public static final int CRATE_21940 = 21940; public static final int LIGHTING_MECHANISM_21945 = 21945; public static final int DOOR_22007 = 22007; public static final int WALL_22091 = 22091; public static final int WALL_22092 = 22092; public static final int WALL_22093 = 22093; public static final int WALL_22094 = 22094; public static final int WALL_22095 = 22095; public static final int WALL_22096 = 22096; public static final int PEEPHOLE = 22097; public static final int RUBBLE_22098 = 22098; public static final int RUBBLE_22099 = 22099; public static final int WALL_22105 = 22105; public static final int WALL_22106 = 22106; public static final int WALL_22107 = 22107; public static final int WALL_22108 = 22108; public static final int COLLAPSED_WALL = 22109; public static final int COLLAPSED_WALL_22110 = 22110; public static final int DOOR_22113 = 22113; public static final int DOOR_22114 = 22114; public static final int DOOR_22115 = 22115; public static final int DOOR_22116 = 22116; public static final int DOOR_22117 = 22117; public static final int DOOR_22118 = 22118; public static final int BENCH_22120 = 22120; public static final int LADDER_22121 = 22121; public static final int LADDER_22122 = 22122; public static final int STAND_22123 = 22123; public static final int STAND_22124 = 22124; public static final int CANDLE_STAND = 22125; public static final int BOOKCASE_22126 = 22126; public static final int BOOKCASE_22127 = 22127; public static final int BOOKCASE_22128 = 22128; public static final int BOOKCASE_22129 = 22129; public static final int BOOKCASE_22131 = 22131; public static final int BED_22132 = 22132; public static final int BED_22133 = 22133; public static final int DRAWERS_22134 = 22134; public static final int DRAWERS_22135 = 22135; public static final int DRAWERS_22136 = 22136; public static final int DRAWERS_22137 = 22137; public static final int DRAWERS_22138 = 22138; public static final int DRAWERS_22139 = 22139; public static final int DRAWERS_22140 = 22140; public static final int DRAWERS_22141 = 22141; public static final int DRAWERS_22142 = 22142; public static final int DRAWERS_22143 = 22143; public static final int WARDROBE_22144 = 22144; public static final int WARDROBE_22145 = 22145; public static final int WARDROBE_22146 = 22146; public static final int WARDROBE_22147 = 22147; public static final int WARDROBE_22148 = 22148; public static final int WARDROBE_22149 = 22149; public static final int WARDROBE_22150 = 22150; public static final int WARDROBE_22151 = 22151; public static final int WARDROBE_22152 = 22152; public static final int WARDROBE_22153 = 22153; public static final int COOKING_RANGE_22154 = 22154; public static final int CLOCK_22155 = 22155; public static final int CHAIR_22156 = 22156; public static final int CHAIR_22157 = 22157; public static final int BENCH_22158 = 22158; public static final int TABLE_22159 = 22159; public static final int TABLE_22160 = 22160; public static final int POTTED_PLANT_22161 = 22161; public static final int LARDER_22162 = 22162; public static final int LADDER_22164 = 22164; public static final int LADDER_22172 = 22172; public static final int LADDER_22173 = 22173; public static final int STAIRS_22247 = 22247; public static final int STAIRS_22248 = 22248; public static final int STAIRS_22250 = 22250; public static final int STAIRS_22252 = 22252; public static final int STAIRS_22253 = 22253; public static final int STAIRS_22254 = 22254; public static final int SUPPORT_22270 = 22270; public static final int CANNON_22271 = 22271; public static final int CANNON_22272 = 22272; public static final int BROKEN_CANNON_22273 = 22273; public static final int LADDER_22274 = 22274; public static final int LADDER_22275 = 22275; public static final int CRATE_22277 = 22277; public static final int BARREL_22278 = 22278; public static final int BARREL_22279 = 22279; public static final int BARREL_22280 = 22280; public static final int LOCKED_DOOR_22281 = 22281; public static final int LOCKED_DOOR_22282 = 22282; public static final int LOCKED_DOOR_22283 = 22283; public static final int LOCKER_22298 = 22298; public static final int LOCKER_22299 = 22299; public static final int WHEAT_22300 = 22300; public static final int CABBAGE_22301 = 22301; public static final int STILE_22302 = 22302; public static final int STATUE_22352 = 22352; public static final int STATUE_22353 = 22353; public static final int STATUE_22354 = 22354; public static final int STAIRS_22365 = 22365; public static final int STAIRS_22366 = 22366; public static final int STAIRS_22367 = 22367; public static final int STAIRS_22368 = 22368; public static final int STAIRS_22369 = 22369; public static final int LADDER_22371 = 22371; public static final int LADDER_22372 = 22372; public static final int GRANARY_WALL = 22373; public static final int GRANARY_WALL_22374 = 22374; public static final int GRANARY_WALL_22375 = 22375; public static final int GRANARY_WALL_22376 = 22376; public static final int GRANARY_WALL_22377 = 22377; public static final int GRANARY_WALL_22378 = 22378; public static final int GRANARY_WALL_22379 = 22379; public static final int GRANARY_WALL_22380 = 22380; public static final int GRANARY_ROOF = 22385; public static final int GRANARY_ROOF_22386 = 22386; public static final int GRANARY_ROOF_22387 = 22387; public static final int GRANARY_ROOF_22388 = 22388; public static final int GRANARY_ROOF_22389 = 22389; public static final int GRANARY_ROOF_22390 = 22390; public static final int GRANARY_ROOF_22391 = 22391; public static final int GRANARY_ROOF_22392 = 22392; public static final int GRANARY_ROOF_22393 = 22393; public static final int GRANARY_ROOF_22394 = 22394; public static final int GRANARY_ROOF_22395 = 22395; public static final int GRANARY_ROOF_22396 = 22396; public static final int GRANARY_ROOF_22397 = 22397; public static final int GRANARY_ROOF_22398 = 22398; public static final int GRANARY_ROOF_22399 = 22399; public static final int GRANARY_ROOF_22400 = 22400; public static final int GRANARY_ROOF_22401 = 22401; public static final int GRANARY_ROOF_22402 = 22402; public static final int GRANARY_ROOF_22403 = 22403; public static final int GRANARY_ROOF_22404 = 22404; public static final int GRANARY_ROOF_22405 = 22405; public static final int GRANARY_ROOF_22406 = 22406; public static final int GRANARY_ROOF_22407 = 22407; public static final int GRANARY_ROOF_22408 = 22408; public static final int GRANARY_ROOF_22409 = 22409; public static final int GRANARY_ROOF_22410 = 22410; public static final int GRANARY_ROOF_22411 = 22411; public static final int GRANARY_ROOF_22412 = 22412; public static final int GRANARY_ROOF_22413 = 22413; public static final int GRANARY_ROOF_22414 = 22414; public static final int GRANARY_ROOF_22415 = 22415; public static final int GRANARY_ROOF_22416 = 22416; public static final int GRANARY_ROOF_22417 = 22417; public static final int SAILS_22418 = 22418; public static final int MILLSTONES_22419 = 22419; public static final int FLOUR_BIN_22420 = 22420; public static final int FLOUR_BIN_22421 = 22421; public static final int HOPPER_22422 = 22422; public static final int LEVER_22424 = 22424; public static final int CRATE_22426 = 22426; public static final int CRATE_22427 = 22427; public static final int SACK_22430 = 22430; public static final int TABLE_22431 = 22431; public static final int LADDER_22432 = 22432; public static final int LADDER_22433 = 22433; public static final int LADDER_22434 = 22434; public static final int LARGE_DOOR_22435 = 22435; public static final int LARGE_DOOR_22436 = 22436; public static final int LARGE_DOOR_22437 = 22437; public static final int LARGE_DOOR_22438 = 22438; public static final int ROCK_WALL_22439 = 22439; public static final int ROCK_WALL_22440 = 22440; public static final int ROCK_WALL_22441 = 22441; public static final int ROCK_WALL_22442 = 22442; public static final int ROCK_WALL_22443 = 22443; public static final int ROCK_WALL_22444 = 22444; public static final int ROCK_WALL_22445 = 22445; public static final int ROCK_WALL_22446 = 22446; public static final int ROCK_WALL_22447 = 22447; public static final int ROCK_WALL_22448 = 22448; public static final int ROCK_WALL_22449 = 22449; public static final int ROCK_WALL_22450 = 22450; public static final int ROCK_WALL_22451 = 22451; public static final int ROCK_WALL_22452 = 22452; public static final int CRATE_22453 = 22453; public static final int CRATE_22454 = 22454; public static final int CRATE_22455 = 22455; public static final int CHEST_OF_CHAMPIONS = 22456; public static final int CRATE_22457 = 22457; public static final int LECTERN_22472 = 22472; public static final int WHEAT_22473 = 22473; public static final int WHEAT_22474 = 22474; public static final int WHEAT_22475 = 22475; public static final int WHEAT_22476 = 22476; public static final int DOOR_22477 = 22477; public static final int WALL_22478 = 22478; public static final int WALL_22479 = 22479; public static final int WALL_22480 = 22480; public static final int WALL_22481 = 22481; public static final int WALL_22482 = 22482; public static final int FUSE_22483 = 22483; public static final int FUSE_22484 = 22484; public static final int PATH_22496 = 22496; public static final int MARV_SICK = 22497; public static final int MARV_VERY_SICK = 22498; public static final int MARV_GHASTLY = 22499; public static final int MARV_SICK_22500 = 22500; public static final int MARV_VERY_SICK_22501 = 22501; public static final int MARV_GHASTLY_22502 = 22502; public static final int MARV_WELL = 22503; public static final int HANK_SICK = 22504; public static final int HANK_VERY_SICK = 22505; public static final int HANK_GHASTLY = 22506; public static final int HANK_SICK_22507 = 22507; public static final int HANK_VERY_SICK_22508 = 22508; public static final int HANK_GHASTLY_22509 = 22509; public static final int HANK_WELL = 22510; public static final int WILF_SICK = 22511; public static final int WILF_VERY_SICK = 22512; public static final int WILF_GHASTLY = 22513; public static final int WILF_SICK_22514 = 22514; public static final int WILF_VERY_SICK_22515 = 22515; public static final int WILF_GHASTLY_22516 = 22516; public static final int WILF_WELL = 22517; public static final int SARAH_SICK = 22518; public static final int SARAH_VERY_SICK = 22519; public static final int SARAH_GHASTLY = 22520; public static final int SARAH_SICK_22521 = 22521; public static final int SARAH_VERY_SICK_22522 = 22522; public static final int SARAH_GHASTLY_22523 = 22523; public static final int SARAH_WELL = 22524; public static final int RACHEL_SICK = 22525; public static final int RACHEL_VERY_SICK = 22526; public static final int RACHEL_GHASTLY = 22527; public static final int RACHEL_SICK_22528 = 22528; public static final int RACHEL_VERY_SICK_22529 = 22529; public static final int RACHEL_GHASTLY_22530 = 22530; public static final int RACHEL_WELL = 22531; public static final int EMPTY_CLOTHES = 22532; public static final int PARTIALLY_BROKEN_BRIDGE_22533 = 22533; public static final int SLIGHTLY_BROKEN_BRIDGE_22534 = 22534; public static final int FIXED_BRIDGE_22535 = 22535; public static final int STALAGMITE_22541 = 22541; public static final int LARGE_STALAGMITE = 22542; public static final int CONNECTED_STALAGMITES = 22543; public static final int MOLANISK = 22545; public static final int ROCK_22549 = 22549; public static final int ROCK_22550 = 22550; public static final int ROCK_22551 = 22551; public static final int JUTTING_WALL_22552 = 22552; public static final int HOLE_22556 = 22556; public static final int TUNNEL_22557 = 22557; public static final int LADDER_22563 = 22563; public static final int LADDER_22564 = 22564; public static final int LADDER_22566 = 22566; public static final int LADDER_22567 = 22567; public static final int CABLE_22568 = 22568; public static final int CABLE_22569 = 22569; public static final int LAMPPOST = 22570; public static final int LAMPPOST_22571 = 22571; public static final int CABLE_22572 = 22572; public static final int CABLE_22576 = 22576; public static final int PYLON = 22589; public static final int PYLON_22590 = 22590; public static final int PYLON_22591 = 22591; public static final int LADDER_22600 = 22600; public static final int LADDER_22601 = 22601; public static final int LADDER_22602 = 22602; public static final int STAIRS_22607 = 22607; public static final int STAIRS_22608 = 22608; public static final int STAIRS_22609 = 22609; public static final int DIAL = 22624; public static final int LEVERS = 22625; public static final int CONSOLE = 22634; public static final int BOILER_22635 = 22635; public static final int STAIRS_22649 = 22649; public static final int STAIRS_22650 = 22650; public static final int STAIRS_22651 = 22651; public static final int BLOCKED_TUNNEL = 22656; public static final int BLOCKED_TUNNEL_22657 = 22657; public static final int OPEN_GATE = 22658; public static final int BLOCKED_TUNNEL_22659 = 22659; public static final int PYLON_22663 = 22663; public static final int PYLON_22664 = 22664; public static final int ROCKS_22665 = 22665; public static final int LADDER_TOP = 22666; public static final int ROCKS_22667 = 22667; public static final int SIGN_22668 = 22668; public static final int BENCH_22669 = 22669; public static final int STOOL_22670 = 22670; public static final int SHELF_22671 = 22671; public static final int TABLE_22672 = 22672; public static final int CHAIR_22676 = 22676; public static final int TABLE_22677 = 22677; public static final int TABLE_22678 = 22678; public static final int BED_22679 = 22679; public static final int BED_22680 = 22680; public static final int CHEST_22681 = 22681; public static final int CHEST_22682 = 22682; public static final int CHEST_22683 = 22683; public static final int LADDER_22684 = 22684; public static final int SHELF_22685 = 22685; public static final int SHELF_22686 = 22686; public static final int TABLE_22690 = 22690; public static final int STOOL_22691 = 22691; public static final int CHAIR_22692 = 22692; public static final int TABLE_22693 = 22693; public static final int TABLE_22694 = 22694; public static final int BED_22695 = 22695; public static final int BED_22696 = 22696; public static final int CHEST_22697 = 22697; public static final int CHEST_22698 = 22698; public static final int CHEST_22699 = 22699; public static final int LADDER_22700 = 22700; public static final int SHELF_22701 = 22701; public static final int SHELF_22702 = 22702; public static final int CHAIR_22703 = 22703; public static final int CHAIR_22704 = 22704; public static final int TABLE_22705 = 22705; public static final int CARVING = 22706; public static final int CARVING_22707 = 22707; public static final int CARVING_22708 = 22708; public static final int STATUE_22709 = 22709; public static final int STATUE_22710 = 22710; public static final int BUST_22711 = 22711; public static final int BUST_22712 = 22712; public static final int RANGE_22713 = 22713; public static final int RANGE_22714 = 22714; public static final int SINK_22715 = 22715; public static final int KITCHEN_TABLE = 22716; public static final int POTS_22717 = 22717; public static final int SHELVES_22718 = 22718; public static final int SHELVES_22719 = 22719; public static final int SHELVES_22720 = 22720; public static final int FURNACE_22721 = 22721; public static final int BELLOWS_22722 = 22722; public static final int CHIMNEY_22723 = 22723; public static final int CHIMNEY_PIPE_22724 = 22724; public static final int ANVIL_22725 = 22725; public static final int SANDPIT_22726 = 22726; public static final int CHIMNEY_22727 = 22727; public static final int WIRE_MACHINE = 22728; public static final int WIRE_MACHINE_22729 = 22729; public static final int WIRE = 22730; public static final int WIRE_22731 = 22731; public static final int COGS_22732 = 22732; public static final int SMOKE_22733 = 22733; public static final int MOTHS = 22734; public static final int ZAPPER = 22735; public static final int ZAPPER_22736 = 22736; public static final int ZAPPER_22737 = 22737; public static final int LAMPPOST_22738 = 22738; public static final int LAMPPOST_22739 = 22739; public static final int LAMPPOST_22740 = 22740; public static final int LAMPPOST_22741 = 22741; public static final int LAMPPOST_22742 = 22742; public static final int LAMPPOST_22743 = 22743; public static final int LAMPPOST_22744 = 22744; public static final int LAMPPOST_22745 = 22745; public static final int LAMPPOST_22746 = 22746; public static final int LAMPPOST_22747 = 22747; public static final int LAMPPOST_22748 = 22748; public static final int LAMPPOST_22749 = 22749; public static final int CABLE_22750 = 22750; public static final int CABLE_22751 = 22751; public static final int CABLE_22752 = 22752; public static final int CABLE_22753 = 22753; public static final int CABLE_22754 = 22754; public static final int CABLE_22755 = 22755; public static final int CABLE_22756 = 22756; public static final int CABLE_22757 = 22757; public static final int CABLE_22758 = 22758; public static final int CABLE_22759 = 22759; public static final int LAMP_22760 = 22760; public static final int LAMP_22761 = 22761; public static final int LAMP_22762 = 22762; public static final int EMPTY_LAMP = 22763; public static final int LAMP_22764 = 22764; public static final int MARKET_STALL_22765 = 22765; public static final int MARKET_STALL_22766 = 22766; public static final int MARKET_STALL_22767 = 22767; public static final int MARKET_STALL_22768 = 22768; public static final int MARKET_STALL_22769 = 22769; public static final int MARKET_STALL_22770 = 22770; public static final int MARKET_STALL_22771 = 22771; public static final int LAMP_STALL = 22772; public static final int LAMP_STILL = 22773; public static final int ARMOUR_STALL = 22774; public static final int BARRIER_22775 = 22775; public static final int BARRIER_22776 = 22776; public static final int GATE_22778 = 22778; public static final int GATE_22779 = 22779; public static final int TOY_RANGE = 22781; public static final int TOY_SINK = 22782; public static final int TOY_TABLE = 22783; public static final int PLAY_BLOCKS = 22784; public static final int PLAY_BLOCKS_22785 = 22785; public static final int PLAY_BLOCKS_22786 = 22786; public static final int CRIB = 22787; public static final int CHALK_PATTERNS = 22788; public static final int CHALK_PATTERNS_22789 = 22789; public static final int CHALK_PATTERNS_22790 = 22790; public static final int CHALK_PATTERNS_22791 = 22791; public static final int CHALK_PATTERNS_22792 = 22792; public static final int CHALK_PATTERNS_22793 = 22793; public static final int SHAPE_PUZZLE = 22794; public static final int SHAPE_PUZZLE_22795 = 22795; public static final int MUSHROOMS_22796 = 22796; public static final int MUSHROOMS_22797 = 22797; public static final int MUSHROOMS_22798 = 22798; public static final int MUSHROOMS_22799 = 22799; public static final int MUSHROOMS_22800 = 22800; public static final int MUSHROOMS_22801 = 22801; public static final int MUSHROOMS_22802 = 22802; public static final int MUSHROOMS_22803 = 22803; public static final int FERN_22804 = 22804; public static final int FERN_22805 = 22805; public static final int FERN_22806 = 22806; public static final int FERN_22807 = 22807; public static final int FLOWERING_FERN = 22808; public static final int FLOWERING_FERN_22809 = 22809; public static final int BOX_22810 = 22810; public static final int COUNTER_22811 = 22811; public static final int BONE_RACK = 22812; public static final int BONE_RACK_22813 = 22813; public static final int BONE_RACK_22814 = 22814; public static final int BONE_RACK_22815 = 22815; public static final int BONE_RACK_22816 = 22816; public static final int BONE_RACK_22817 = 22817; public static final int BONE_RACK_22818 = 22818; public static final int BANK_BOOTH_22819 = 22819; public static final int DESK_22820 = 22820; public static final int DESK_22821 = 22821; public static final int BANK_SAFE = 22822; public static final int THINGYMAJIG = 22823; public static final int OOJIMAFLIP = 22824; public static final int PLINTH_22825 = 22825; public static final int MAGIC_BALL = 22826; public static final int WORKBENCH_22827 = 22827; public static final int BEETLE = 22828; public static final int FROG = 22829; public static final int TABLE_22830 = 22830; public static final int TABLE_22831 = 22831; public static final int TABLE_22832 = 22832; public static final int SHELF_22833 = 22833; public static final int SHELF_22834 = 22834; public static final int FUNGUS_SEAT = 22835; public static final int MOTH = 22836; public static final int BUST_22841 = 22841; public static final int BUST_22842 = 22842; public static final int CHAIR_22843 = 22843; public static final int TABLE_22844 = 22844; public static final int TABLE_22845 = 22845; public static final int TABLE_22846 = 22846; public static final int TABLE_22847 = 22847; public static final int TABLE_22848 = 22848; public static final int TABLE_22849 = 22849; public static final int BOOKSHELF_22855 = 22855; public static final int FUNGUS_DOORMAT = 22856; public static final int FUNGUS_DOORMAT_22857 = 22857; public static final int FUNGUS_DOORMAT_22858 = 22858; public static final int CRATES_22859 = 22859; public static final int CRATE_22860 = 22860; public static final int WATER_22862 = 22862; public static final int WATER_22863 = 22863; public static final int WATER_22864 = 22864; public static final int WATER_22865 = 22865; public static final int DOOR_22913 = 22913; public static final int DOOR_22914 = 22914; public static final int DOOR_22920 = 22920; public static final int DOOR_22921 = 22921; public static final int STAIRS_22931 = 22931; public static final int STAIRS_22932 = 22932; public static final int STAIRS_22933 = 22933; public static final int LADDER_22934 = 22934; public static final int LADDER_22935 = 22935; public static final int LADDER_22936 = 22936; public static final int STAIRS_22937 = 22937; public static final int STAIRS_22938 = 22938; public static final int STAIRS_22939 = 22939; public static final int STAIRS_22940 = 22940; public static final int STAIRS_22941 = 22941; public static final int STAIRS_22942 = 22942; public static final int STAIRS_22943 = 22943; public static final int BONE_DOOR = 22945; public static final int FOUNTAIN_22973 = 22973; public static final int FROG_SPIT = 22974; public static final int SMOKE_22975 = 22975; public static final int LAMP_22976 = 22976; public static final int BROKEN_LAMP = 22977; public static final int TOOLS_23042 = 23042; public static final int TOOLS_23043 = 23043; public static final int METAL = 23044; public static final int TOOLS_23045 = 23045; public static final int FIRE_23046 = 23046; public static final int DOORWAY_23052 = 23052; public static final int TREE_STUMP_23054 = 23054; public static final int BROKEN_CART_23055 = 23055; public static final int DOOR_23056 = 23056; public static final int STATUE_23057 = 23057; public static final int OPEN_STATUE = 23058; public static final int STATUE_23059 = 23059; public static final int STATUE_23060 = 23060; public static final int TENT_23061 = 23061; public static final int TENT_23062 = 23062; public static final int CAMP_FIRE = 23063; public static final int LOCKER_23064 = 23064; public static final int STOOL_23065 = 23065; public static final int SMALL_TABLE_23066 = 23066; public static final int BED_23067 = 23067; public static final int STAIRS_23074 = 23074; public static final int BOOKCASE_23091 = 23091; public static final int BOOKCASE_23092 = 23092; public static final int PORTAL_23093 = 23093; public static final int FLOOR_23094 = 23094; public static final int PORTAL_23095 = 23095; public static final int SOUL_BOAT = 23101; public static final int IRON_WINCH = 23104; public static final int FLAMES = 23105; public static final int UNCOOKING_POT = 23113; public static final int FISHING_SPOT_23114 = 23114; public static final int PORTAL_23115 = 23115; public static final int LEVER_23116 = 23116; public static final int DEVICE = 23117; public static final int ROPE_SWING_23122 = 23122; public static final int ROPE_SWING_23123 = 23123; public static final int ROCK_23124 = 23124; public static final int ROCK_23125 = 23125; public static final int ROCK_23126 = 23126; public static final int ROCK_23127 = 23127; public static final int ROPESWING_23128 = 23128; public static final int ROPESWING_23129 = 23129; public static final int ROPESWING_23130 = 23130; public static final int ROPESWING_23131 = 23131; public static final int ROPESWING_23132 = 23132; public static final int OBSTACLE_NET_23133 = 23133; public static final int OBSTACLE_NET_23134 = 23134; public static final int OBSTACLE_NET_23135 = 23135; public static final int OBSTACLE_PIPE_23136 = 23136; public static final int OBSTACLE_PIPE_23137 = 23137; public static final int OBSTACLE_PIPE_23138 = 23138; public static final int OBSTACLE_PIPE_23139 = 23139; public static final int OBSTACLE_PIPE_23140 = 23140; public static final int LOG_BALANCE_23144 = 23144; public static final int LOG_BALANCE_23145 = 23145; public static final int WALL_23155 = 23155; public static final int PICTURE_WALL = 23156; public static final int CAVE_23157 = 23157; public static final int CAVE_23158 = 23158; public static final int BOULDERS_23163 = 23163; public static final int BOULDERS_23164 = 23164; public static final int ROCK_23165 = 23165; public static final int CAVE_ENTRANCE_23166 = 23166; public static final int CAVE_ENTRANCE_23167 = 23167; public static final int CAVE_23168 = 23168; public static final int CAVE_23169 = 23169; public static final int CAVE_23170 = 23170; public static final int CAVE_23171 = 23171; public static final int DRIP_23172 = 23172; public static final int DRIPS_23173 = 23173; public static final int CAMPING_GEAR = 23174; public static final int CAMPING_FIRE = 23175; public static final int SLEEPING_BAG = 23176; public static final int TABLE_23177 = 23177; public static final int STOOL_23178 = 23178; public static final int STOOL_23179 = 23179; public static final int BARREL_23180 = 23180; public static final int BARREL_23181 = 23181; public static final int BARREL_23182 = 23182; public static final int BARREL_23183 = 23183; public static final int BARREL_23184 = 23184; public static final int WRECK_23185 = 23185; public static final int WRECK_23186 = 23186; public static final int WRECK_23187 = 23187; public static final int WRECK_23188 = 23188; public static final int WRECK_23189 = 23189; public static final int GRAVESTONE_23197 = 23197; public static final int WALKWAY = 23213; public static final int WALKWAY_23214 = 23214; public static final int GATE_23216 = 23216; public static final int GATE_23217 = 23217; public static final int WRECK_23230 = 23230; public static final int WRECK_23231 = 23231; public static final int WRECK_23232 = 23232; public static final int WRECK_23233 = 23233; public static final int WRECK_23234 = 23234; public static final int WRECK_23235 = 23235; public static final int WRECK_23236 = 23236; public static final int WRECK_23237 = 23237; public static final int WRECK_23238 = 23238; public static final int WRECK_23239 = 23239; public static final int WRECK_23240 = 23240; public static final int WRECK_23241 = 23241; public static final int WRECK_23242 = 23242; public static final int WRECK_23243 = 23243; public static final int WRECK_23244 = 23244; public static final int WRECK_23245 = 23245; public static final int WRECK_23246 = 23246; public static final int WRECK_23247 = 23247; public static final int WRECK_23248 = 23248; public static final int WRECK_23249 = 23249; public static final int WRECK_23250 = 23250; public static final int WRECK_23251 = 23251; public static final int WRECK_23252 = 23252; public static final int WRECK_23253 = 23253; public static final int WRECK_23254 = 23254; public static final int WRECK_23255 = 23255; public static final int WRECK_23256 = 23256; public static final int WILDERNESS_DITCH = 23271; public static final int LOG_BALANCE_23274 = 23274; public static final int SIGN_23275 = 23275; public static final int SIGN_23276 = 23276; public static final int LADDER_23279 = 23279; public static final int ROCKS_23280 = 23280; public static final int ROCKS_23281 = 23281; public static final int CRATE_23283 = 23283; public static final int ZANIK_23284 = 23284; public static final int DOORWAY_23285 = 23285; public static final int DOORWAY_23286 = 23286; public static final int DOORWAY_23287 = 23287; public static final int ARTEFACT = 23288; public static final int HOLE_23289 = 23289; public static final int ARTEFACT_23291 = 23291; public static final int HOLE_23292 = 23292; public static final int ARTEFACT_23294 = 23294; public static final int HOLE_23295 = 23295; public static final int ARTEFACT_23297 = 23297; public static final int HOLE_23298 = 23298; public static final int ARTEFACT_23299 = 23299; public static final int HOLE_23300 = 23300; public static final int ARTEFACT_23302 = 23302; public static final int HOLE_23303 = 23303; public static final int SPECIMEN_TABLE = 23305; public static final int GOBLIN_CROWD_23306 = 23306; public static final int GOBLIN_CROWD_23307 = 23307; public static final int GOBLIN_CROWD_23308 = 23308; public static final int GOBLIN_CROWD_23309 = 23309; public static final int GOBLIN_CROWD_23310 = 23310; public static final int GOBLIN_CROWD_23311 = 23311; public static final int GOBLIN_CROWD_23312 = 23312; public static final int GOBLIN_CROWD_23313 = 23313; public static final int GOBLIN_CROWD_23314 = 23314; public static final int CROWD_OF_DWARVES = 23315; public static final int CROWD_OF_DWARVES_23316 = 23316; public static final int CROWD_OF_DWARVES_23317 = 23317; public static final int COUNCIL_MEMBERS = 23318; public static final int CAVE_GOBINS = 23319; public static final int DOOR_23338 = 23338; public static final int DOOR_23339 = 23339; public static final int LARGE_DOOR_23340 = 23340; public static final int LARGE_DOOR_23341 = 23341; public static final int LARGE_DOOR_23342 = 23342; public static final int LARGE_DOOR_23343 = 23343; public static final int WALL_23348 = 23348; public static final int WALL_23349 = 23349; public static final int WALL_23350 = 23350; public static final int CRATE_23356 = 23356; public static final int CRATE_23357 = 23357; public static final int CRATE_23358 = 23358; public static final int BARREL_23366 = 23366; public static final int LADDER_23376 = 23376; public static final int LADDER_23377 = 23377; public static final int DOOR_23378 = 23378; public static final int DOOR_23379 = 23379; public static final int DEAD_TREE_23381 = 23381; public static final int TUNNEL_23499 = 23499; public static final int TUNNEL_23500 = 23500; public static final int LADDER_23504 = 23504; public static final int SAMPLE_TABLE = 23526; public static final int SAMPLE_TABLE_23527 = 23527; public static final int BURIED_ARTEFACT = 23528; public static final int HOLE_23529 = 23529; public static final int CRATE_23530 = 23530; public static final int LADDER_23531 = 23531; public static final int LADDER_23532 = 23532; public static final int CRATE_23533 = 23533; public static final int LOG_BALANCE_23542 = 23542; public static final int CLIMBING_ROCKS_23543 = 23543; public static final int CLIMBING_ROCKS_23544 = 23544; public static final int CLIMBING_ROCKS_23545 = 23545; public static final int BALANCING_LEDGE_23546 = 23546; public static final int BALANCING_LEDGE_23547 = 23547; public static final int BALANCING_LEDGE_23548 = 23548; public static final int SPIKES_23549 = 23549; public static final int SPIKES_23550 = 23550; public static final int GATE_23552 = 23552; public static final int GATE_23554 = 23554; public static final int DOOR_23555 = 23555; public static final int STEPPING_STONE_23556 = 23556; public static final int BALANCING_ROPE_23557 = 23557; public static final int BALANCING_ROPE_23558 = 23558; public static final int TREE_BRANCH_23559 = 23559; public static final int TREE_BRANCH_23560 = 23560; public static final int TREE_BRANCH_23561 = 23561; public static final int STAIRCASE_23562 = 23562; public static final int PILE_OF_RUBBLE_23563 = 23563; public static final int PILE_OF_RUBBLE_23564 = 23564; public static final int MONKEYBARS_23565 = 23565; public static final int MONKEYBARS_23566 = 23566; public static final int MONKEYBARS_23567 = 23567; public static final int ROPESWING_23568 = 23568; public static final int ROPESWING_23569 = 23569; public static final int ROPESWING_23570 = 23570; public static final int ROPESWING_23571 = 23571; public static final int LADDER_23584 = 23584; public static final int LADDER_23585 = 23585; public static final int KALPHITE_QUEEN_LEGS = 23591; public static final int TUNNEL_23596 = 23596; public static final int STALAGMITES_23606 = 23606; public static final int STALAGMITES_23607 = 23607; public static final int COCOON_23611 = 23611; public static final int ROSES_23616 = 23616; public static final int CHAIR_23624 = 23624; public static final int CADAVA_BUSH = 23625; public static final int CADAVA_BUSH_23626 = 23626; public static final int CADAVA_BUSH_23627 = 23627; public static final int REDBERRY_BUSH_23628 = 23628; public static final int REDBERRY_BUSH_23629 = 23629; public static final int REDBERRY_BUSH_23630 = 23630; public static final int DOOR_23631 = 23631; public static final int STAND_23632 = 23632; public static final int NEWSPAPERS = 23633; public static final int DISPLAY_CASE_23634 = 23634; public static final int DISPLAY_CASE_23635 = 23635; public static final int PLAQUE_23636 = 23636; public static final int DOOR_23637 = 23637; public static final int BRANCH = 23638; public static final int LONG_BRANCHED_TREE = 23639; public static final int ROCKS_23640 = 23640; public static final int A_WOODEN_LOG = 23644; public static final int STEPPING_STONES = 23645; public static final int STEPPING_STONES_23646 = 23646; public static final int STEPPING_STONES_23647 = 23647; public static final int OOZING_BARRIER = 23653; public static final int OOZING_BARRIER_23654 = 23654; public static final int OOZING_BARRIER_23656 = 23656; public static final int SKELETON_23667 = 23667; public static final int SKELETON_23668 = 23668; public static final int SKELETON_23669 = 23669; public static final int TELEKINETIC_TELEPORT = 23673; public static final int ENCHANTERS_TELEPORT = 23674; public static final int ALCHEMISTS_TELEPORT = 23675; public static final int GRAVEYARD_TELEPORT = 23676; public static final int EXIT_TELEPORT = 23677; public static final int CUPBOARD_23678 = 23678; public static final int CUPBOARD_23679 = 23679; public static final int CUPBOARD_23680 = 23680; public static final int CUPBOARD_23681 = 23681; public static final int CUPBOARD_23682 = 23682; public static final int CUPBOARD_23683 = 23683; public static final int CUPBOARD_23684 = 23684; public static final int CUPBOARD_23685 = 23685; public static final int CUPBOARD_23686 = 23686; public static final int CUPBOARD_23687 = 23687; public static final int CUPBOARD_23688 = 23688; public static final int CUPBOARD_23689 = 23689; public static final int CUPBOARD_23690 = 23690; public static final int CUPBOARD_23691 = 23691; public static final int CUPBOARD_23692 = 23692; public static final int CUPBOARD_23693 = 23693; public static final int CUBE_PILE = 23694; public static final int CYLINDER_PILE = 23695; public static final int ICOSAHEDRON_PILE = 23696; public static final int PENTAMID_PILE = 23697; public static final int HOLE_23698 = 23698; public static final int STINKING_TENDRILS = 23700; public static final int DRIPPING_TENDRILS = 23701; public static final int TENDRILS = 23702; public static final int GOO_COVERED_VINE = 23703; public static final int GOO_COVERED_VINE_23704 = 23704; public static final int DRIPPING_VINE = 23705; public static final int DRIPPING_VINE_23706 = 23706; public static final int PORTAL_23707 = 23707; public static final int DANGER_SIGN_23708 = 23708; public static final int BOX_OF_HEALTH = 23709; public static final int SULPHUR_VENT_23725 = 23725; public static final int PORTAL_OF_DEATH = 23727; public static final int PORTAL_OF_DEATH_23728 = 23728; public static final int PORTAL_OF_DEATH_23729 = 23729; public static final int PORTAL_OF_DEATH_23730 = 23730; public static final int CRADLE_OF_LIFE = 23731; public static final int BONE_CHAIN = 23732; public static final int GATE_23917 = 23917; public static final int GATE_23918 = 23918; public static final int GATE_23919 = 23919; public static final int BONE_CHAIN_23920 = 23920; public static final int BONEY_LADDER = 23921; public static final int PORTAL_23922 = 23922; public static final int SKELETON_23927 = 23927; public static final int SKELETON_23928 = 23928; public static final int SKELETON_23929 = 23929; public static final int FERMENTING_VAT_23931 = 23931; public static final int FERMENTING_VAT_23932 = 23932; public static final int FERMENTING_VAT_23933 = 23933; public static final int FERMENTING_VAT_23934 = 23934; public static final int FERMENTING_VAT_23935 = 23935; public static final int VALVE_23936 = 23936; public static final int VALVE_23937 = 23937; public static final int FERMENTING_VAT_23938 = 23938; public static final int FERMENTING_VAT_23939 = 23939; public static final int FERMENTING_VAT_23940 = 23940; public static final int FERMENTING_VAT_23941 = 23941; public static final int STATUE_OF_A_WARRIOR_23942 = 23942; public static final int STATUE_OF_A_WARRIOR_23943 = 23943; public static final int STATUE_OF_A_KING_23944 = 23944; public static final int STATUE_OF_A_QUEEN_23945 = 23945; public static final int GNOME_STATUE_23946 = 23946; public static final int STATUE_OF_A_KING_23947 = 23947; public static final int CATAPULT_23950 = 23950; public static final int CATAPULT_23951 = 23951; public static final int CATAPULT_23952 = 23952; public static final int CATAPULT_23953 = 23953; public static final int CATAPULT_23954 = 23954; public static final int MAGICAL_ANIMATOR = 23955; public static final int DUMMY_23958 = 23958; public static final int DUMMY_23959 = 23959; public static final int DUMMY_23960 = 23960; public static final int DUMMY_23961 = 23961; public static final int DUMMY_23962 = 23962; public static final int DUMMY_23963 = 23963; public static final int DUMMY_23964 = 23964; public static final int HOLE_23965 = 23965; public static final int DRAWERS_23966 = 23966; public static final int DRAWERS_23967 = 23967; public static final int STAIRCASE_23968 = 23968; public static final int STAIRCASE_23969 = 23969; public static final int STONE_SIGNPOST = 23970; public static final int STONE_SIGNPOST_23971 = 23971; public static final int DOOR_23972 = 23972; public static final int DOOR_23973 = 23973; public static final int ROCK_23976 = 23976; public static final int ROCK_23977 = 23977; public static final int ROCK_23978 = 23978; public static final int ROCK_23979 = 23979; public static final int ROCK_23980 = 23980; public static final int ROCK_23981 = 23981; public static final int CITY_GATE_23982 = 23982; public static final int CITY_GATE_23983 = 23983; public static final int CITY_GATE_23984 = 23984; public static final int CITY_GATE_23985 = 23985; public static final int CITY_GATE_23986 = 23986; public static final int CITY_GATE_23987 = 23987; public static final int CITY_GATE_23988 = 23988; public static final int CITY_GATE_23989 = 23989; public static final int CITY_GATE_23990 = 23990; public static final int CITY_GATE_23991 = 23991; public static final int CITY_GATE_23992 = 23992; public static final int CITY_GATE_23993 = 23993; public static final int RACK_24000 = 24000; public static final int SHELVES_24001 = 24001; public static final int BARREL_24002 = 24002; public static final int TABLE_24003 = 24003; public static final int WATERPUMP_24004 = 24004; public static final int SHOP_COUNTER_24005 = 24005; public static final int CABINET_24006 = 24006; public static final int FURNACE_24009 = 24009; public static final int SIGN_24017 = 24017; public static final int BANNER_24018 = 24018; public static final int TREADMILL = 24020; public static final int SPINNING_POLE = 24021; public static final int TABLE_24025 = 24025; public static final int STATUE_24036 = 24036; public static final int STATUE_24037 = 24037; public static final int STATUE_24038 = 24038; public static final int STATUE_24039 = 24039; public static final int STATUE_24040 = 24040; public static final int OLD_BOOKSHELF_24041 = 24041; public static final int FLAGPOLE_24042 = 24042; public static final int STATUE_OF_SARADOMIN_24043 = 24043; public static final int STATUE_OF_SARADOMIN_24044 = 24044; public static final int ROCKERY_24049 = 24049; public static final int DOOR_24050 = 24050; public static final int DOOR_24051 = 24051; public static final int DOOR_24052 = 24052; public static final int DOOR_24053 = 24053; public static final int DOOR_24054 = 24054; public static final int DOOR_24055 = 24055; public static final int DOOR_24056 = 24056; public static final int DOOR_24057 = 24057; public static final int DOOR_24058 = 24058; public static final int CASTLE_DOOR = 24059; public static final int CASTLE_DOOR_24060 = 24060; public static final int CASTLE_DOOR_24061 = 24061; public static final int CASTLE_DOOR_24062 = 24062; public static final int CASTLE_DOOR_24063 = 24063; public static final int CASTLE_DOOR_24064 = 24064; public static final int CASTLE_DOOR_24065 = 24065; public static final int CASTLE_DOOR_24066 = 24066; public static final int STAIRCASE_24067 = 24067; public static final int STAIRCASE_24068 = 24068; public static final int LADDER_24070 = 24070; public static final int LADDER_24071 = 24071; public static final int STAIRCASE_24072 = 24072; public static final int STAIRCASE_24074 = 24074; public static final int STAIRCASE_24075 = 24075; public static final int STAIRCASE_24076 = 24076; public static final int STAIRCASE_24077 = 24077; public static final int STAIRCASE_24078 = 24078; public static final int STAIRCASE_24079 = 24079; public static final int STAIRCASE_24080 = 24080; public static final int LARGE_TABLE_24081 = 24081; public static final int LADDER_24082 = 24082; public static final int LADDER_24083 = 24083; public static final int LADDER_24084 = 24084; public static final int LADDER_24085 = 24085; public static final int TABLE_24086 = 24086; public static final int BOXES_24087 = 24087; public static final int CRATES_24088 = 24088; public static final int STOOL_24089 = 24089; public static final int BED_24090 = 24090; public static final int TABLE_24091 = 24091; public static final int TABLE_24092 = 24092; public static final int SUIT_OF_ARMOUR_24096 = 24096; public static final int NOTICE_BOARD = 24098; public static final int NOTICE_BOARD_24099 = 24099; public static final int CHEST_24100 = 24100; public static final int BANK_BOOTH_24101 = 24101; public static final int FOUNTAIN_24102 = 24102; public static final int CHAIR_24103 = 24103; public static final int STATUE_24104 = 24104; public static final int BAR_PUMPS_24105 = 24105; public static final int BAR_24106 = 24106; public static final int PICNIC_TABLE_24107 = 24107; public static final int BARREL_24108 = 24108; public static final int BARREL_24109 = 24109; public static final int BOOKCASE_24110 = 24110; public static final int SHELVES_24111 = 24111; public static final int SHELVES_24112 = 24112; public static final int SHELVES_24113 = 24113; public static final int SHELVES_24114 = 24114; public static final int STANDING_STONE = 24139; public static final int STANDING_STONE_24140 = 24140; public static final int STANDING_STONE_24141 = 24141; public static final int STANDING_STONE_24142 = 24142; public static final int ROCKS_24146 = 24146; public static final int ROCKS_24147 = 24147; public static final int ROCKS_24148 = 24148; public static final int WELL_24150 = 24150; public static final int CHAIR_24151 = 24151; public static final int CHAIR_24152 = 24152; public static final int MIRROR_24153 = 24153; public static final int HEATER = 24156; public static final int BATHTUB_24169 = 24169; public static final int WORK_BENCH_24170 = 24170; public static final int WORK_BENCH_24171 = 24171; public static final int BRICKS_24218 = 24218; public static final int BRICKS_24219 = 24219; public static final int CRUMBLING_WALL_24222 = 24222; public static final int BOW_CABINET_24229 = 24229; public static final int TABLE_24230 = 24230; public static final int STAIRCASE_24248 = 24248; public static final int STAIRCASE_24249 = 24249; public static final int STAIRCASE_24250 = 24250; public static final int STAIRCASE_24251 = 24251; public static final int STAIRCASE_24252 = 24252; public static final int STAIRCASE_24253 = 24253; public static final int STAIRCASE_24254 = 24254; public static final int STAIRCASE_24255 = 24255; public static final int LOCKED_DOOR_24293 = 24293; public static final int LOCKED_DOOR_24294 = 24294; public static final int LEVER_24296 = 24296; public static final int HOLE_24297 = 24297; public static final int HOLE_24298 = 24298; public static final int HOLE_24299 = 24299; public static final int HOLE_24300 = 24300; public static final int HOLE_24301 = 24301; public static final int HOLE_24302 = 24302; public static final int STAIRCASE_24303 = 24303; public static final int DOOR_24306 = 24306; public static final int DOOR_24307 = 24307; public static final int DOOR_24309 = 24309; public static final int DOOR_24310 = 24310; public static final int DOOR_24312 = 24312; public static final int DOOR_24313 = 24313; public static final int DOOR_24315 = 24315; public static final int DOOR_24316 = 24316; public static final int DOOR_24318 = 24318; public static final int DOOR_24319 = 24319; public static final int SCUTTLE_24321 = 24321; public static final int BARSTOOL_24322 = 24322; public static final int BARSTOOL_24323 = 24323; public static final int BAR_24324 = 24324; public static final int BAR_24325 = 24325; public static final int BAR_24326 = 24326; public static final int BAR_24327 = 24327; public static final int BAR_24328 = 24328; public static final int BAR_24329 = 24329; public static final int BAR_24330 = 24330; public static final int BAR_24331 = 24331; public static final int BAR_24332 = 24332; public static final int TABLE_24333 = 24333; public static final int OLD_BOOKSHELF_24340 = 24340; public static final int OLD_BOOKSHELF_24341 = 24341; public static final int OLD_BOOKSHELF_24342 = 24342; public static final int OLD_BOOKSHELF_24343 = 24343; public static final int CRATE_24344 = 24344; public static final int BED_24346 = 24346; public static final int BANK_BOOTH_24347 = 24347; public static final int SHELVES_24349 = 24349; public static final int STEPLADDER_24350 = 24350; public static final int LADDER_24351 = 24351; public static final int LADDER_24352 = 24352; public static final int MANGLE_24353 = 24353; public static final int MANGLE_24354 = 24354; public static final int TABLE_24355 = 24355; public static final int STAIRCASE_24358 = 24358; public static final int STAIRCASE_24359 = 24359; public static final int TABLE_24360 = 24360; public static final int TANNING_LINE_24362 = 24362; public static final int DOOR_24363 = 24363; public static final int DOOR_24364 = 24364; public static final int DOOR_24365 = 24365; public static final int DOOR_24366 = 24366; public static final int DOOR_24367 = 24367; public static final int DOOR_24368 = 24368; public static final int DOOR_24369 = 24369; public static final int MAP_24390 = 24390; public static final int MAP_24391 = 24391; public static final int MAP_24392 = 24392; public static final int STAIRS_24427 = 24427; public static final int STAIRS_24428 = 24428; public static final int INFORMATION_BOOTH = 24452; public static final int CANAL_BARGE = 24455; public static final int CANAL_BARGE_24456 = 24456; public static final int CANAL_BARGE_24457 = 24457; public static final int CANAL_BARGE_24458 = 24458; public static final int CANAL_BARGE_24459 = 24459; public static final int CANAL_BARGE_24460 = 24460; public static final int CANAL_BARGE_24461 = 24461; public static final int CANAL_BARGE_24462 = 24462; public static final int CANAL_BARGE_24463 = 24463; public static final int CANAL_BARGE_24464 = 24464; public static final int CANAL_BARGE_24465 = 24465; public static final int CANAL_BARGE_24466 = 24466; public static final int CANAL_BARGE_24467 = 24467; public static final int CANAL_BARGE_24468 = 24468; public static final int CANAL_BARGE_24469 = 24469; public static final int CANAL_BARGE_24470 = 24470; public static final int CANAL_BARGE_24471 = 24471; public static final int CANAL_BARGE_24472 = 24472; public static final int CANAL_BARGE_24473 = 24473; public static final int CANAL_BARGE_24474 = 24474; public static final int CANAL_BARGE_24475 = 24475; public static final int CANAL_BARGE_24476 = 24476; public static final int CANAL_BARGE_24477 = 24477; public static final int CANAL_BARGE_24478 = 24478; public static final int CANAL_BARGE_24479 = 24479; public static final int CANAL_BARGE_24480 = 24480; public static final int CANAL_BARGE_24481 = 24481; public static final int CANAL_BARGE_24482 = 24482; public static final int CANAL_BARGE_24483 = 24483; public static final int CANAL_BARGE_24484 = 24484; public static final int CANAL_BARGE_24485 = 24485; public static final int CANAL_BARGE_24486 = 24486; public static final int CANAL_WALL = 24487; public static final int CANAL_WALL_24488 = 24488; public static final int TAR_BUCKETS = 24500; public static final int SHORT_PLANKS = 24501; public static final int LONG_PLANKS = 24502; public static final int CANAL_BARGE_24503 = 24503; public static final int CANAL_BARGE_24504 = 24504; public static final int CANAL_BARGE_24505 = 24505; public static final int CANAL_BARGE_24506 = 24506; public static final int CANAL_BARGE_24507 = 24507; public static final int CANAL_BARGE_24508 = 24508; public static final int CANAL_BARGE_24509 = 24509; public static final int CANAL_BARGE_24510 = 24510; public static final int CANAL_BARGE_24511 = 24511; public static final int CANAL_BARGE_24512 = 24512; public static final int CANAL_BARGE_24513 = 24513; public static final int CANAL_BARGE_24514 = 24514; public static final int CANAL_BARGE_24515 = 24515; public static final int CANAL_BARGE_24516 = 24516; public static final int CANAL_BARGE_24517 = 24517; public static final int CANAL_BARGE_24518 = 24518; public static final int CANAL_BARGE_24519 = 24519; public static final int CANAL_BARGE_24520 = 24520; public static final int CANAL_BARGE_24521 = 24521; public static final int CANAL_BARGE_24522 = 24522; public static final int CANAL_BARGE_24523 = 24523; public static final int CANAL_BARGE_24524 = 24524; public static final int CANAL_BARGE_24525 = 24525; public static final int CANAL_BARGE_24526 = 24526; public static final int CANAL_BARGE_24527 = 24527; public static final int CANAL_BARGE_24528 = 24528; public static final int CANAL_BARGE_24529 = 24529; public static final int CANAL_BARGE_24530 = 24530; public static final int CANAL_WALL_24531 = 24531; public static final int CANAL_WALL_24532 = 24532; public static final int STORAGE_CRATE = 24534; public static final int TOOLS_24535 = 24535; public static final int GATE_24536 = 24536; public static final int DISPLAY_CASE_24539 = 24539; public static final int DISPLAY_CASE_24540 = 24540; public static final int DISPLAY_CASE_24541 = 24541; public static final int DISPLAY_CASE_24542 = 24542; public static final int DISPLAY_CASE_24543 = 24543; public static final int DISPLAY_CASE_24544 = 24544; public static final int DISPLAY_CASE_24545 = 24545; public static final int DISPLAY_CASE_24546 = 24546; public static final int DISPLAY_CASE_24547 = 24547; public static final int DISPLAY_CASE_24548 = 24548; public static final int DISPLAY_CASE_24549 = 24549; public static final int DISPLAY_CASE_24550 = 24550; public static final int DISPLAY_CASE_24551 = 24551; public static final int SPECIMEN_TABLE_24555 = 24555; public static final int SPECIMEN_TABLE_24556 = 24556; public static final int DIG_SITE_SPECIMEN_ROCKS = 24557; public static final int DIG_SITE_SPECIMEN_ROCKS_24558 = 24558; public static final int DIG_SITE_SPECIMEN_ROCKS_24559 = 24559; public static final int GATE_24560 = 24560; public static final int GATE_24561 = 24561; public static final int GAP_24562 = 24562; public static final int DOORWAY_24563 = 24563; public static final int GATE_24564 = 24564; public static final int DOOR_24565 = 24565; public static final int DOOR_24566 = 24566; public static final int DOOR_24567 = 24567; public static final int DOOR_24568 = 24568; public static final int SNAKE_24569 = 24569; public static final int MACHINE_24571 = 24571; public static final int MACHINE_24572 = 24572; public static final int MACHINE_24573 = 24573; public static final int MACHINE_24574 = 24574; public static final int MACHINE_24575 = 24575; public static final int MACHINE_24576 = 24576; public static final int MACHINE_24577 = 24577; public static final int MACHINE_24578 = 24578; public static final int MACHINE_24579 = 24579; public static final int MACHINE_24580 = 24580; public static final int MACHINE_24581 = 24581; public static final int MACHINE_24582 = 24582; public static final int MACHINE_24583 = 24583; public static final int MACHINE_24584 = 24584; public static final int MACHINE_24585 = 24585; public static final int MACHINE_24586 = 24586; public static final int MACHINE_24587 = 24587; public static final int BUTTON = 24588; public static final int BUTTON_24589 = 24589; public static final int BUTTON_24590 = 24590; public static final int BUTTON_24591 = 24591; public static final int BUTTON_24592 = 24592; public static final int BUTTON_24593 = 24593; public static final int BUTTON_24594 = 24594; public static final int BUTTON_24595 = 24595; public static final int BUTTON_24596 = 24596; public static final int BUTTON_24597 = 24597; public static final int BUTTON_24598 = 24598; public static final int BUTTON_24599 = 24599; public static final int BUTTON_24600 = 24600; public static final int BUTTON_24601 = 24601; public static final int BUTTON_24602 = 24602; public static final int BUTTON_24603 = 24603; public static final int PLAQUE_24605 = 24605; public static final int PLAQUE_24606 = 24606; public static final int PLAQUE_24607 = 24607; public static final int PLAQUE_24608 = 24608; public static final int PLAQUE_24609 = 24609; public static final int PLAQUE_24610 = 24610; public static final int PLAQUE_24611 = 24611; public static final int PLAQUE_24612 = 24612; public static final int PLAQUE_24613 = 24613; public static final int PLAQUE_24614 = 24614; public static final int PLAQUE_24615 = 24615; public static final int PLAQUE_24616 = 24616; public static final int PLAQUE_24617 = 24617; public static final int PLAQUE_24618 = 24618; public static final int DISPLAY_CASE_24619 = 24619; public static final int PAINTING_24620 = 24620; public static final int DISPLAY_CASE_24621 = 24621; public static final int DISPLAY_CASE_24622 = 24622; public static final int DISPLAY_CASE_24624 = 24624; public static final int DISPLAY_CASE_24625 = 24625; public static final int DISPLAY_CASE_24627 = 24627; public static final int DISPLAY_CASE_24628 = 24628; public static final int DISPLAY_CASE_24629 = 24629; public static final int DISPLAY_CASE_24630 = 24630; public static final int DISPLAY_CASE_24631 = 24631; public static final int DISPLAY_CASE_24632 = 24632; public static final int DISPLAY_CASE_24634 = 24634; public static final int DISPLAY_CASE_24635 = 24635; public static final int DISPLAY_CASE_24637 = 24637; public static final int DISPLAY_CASE_24639 = 24639; public static final int DISPLAY_CASE_24640 = 24640; public static final int DISPLAY_CASE_24641 = 24641; public static final int DISPLAY_CASE_24643 = 24643; public static final int DISPLAY_CASE_24644 = 24644; public static final int DISPLAY_CASE_24645 = 24645; public static final int DISPLAY_CASE_24646 = 24646; public static final int DISPLAY_CASE_24647 = 24647; public static final int DISPLAY_CASE_24648 = 24648; public static final int DISPLAY_CASE_24649 = 24649; public static final int DISPLAY_CASE_24650 = 24650; public static final int DISPLAY_CASE_24651 = 24651; public static final int DISPLAY_CASE_24652 = 24652; public static final int DISPLAY_CASE_24654 = 24654; public static final int DISPLAY_CASE_24655 = 24655; public static final int DISPLAY_CASE_24656 = 24656; public static final int DISPLAY_CASE_24657 = 24657; public static final int DISPLAY_CASE_24658 = 24658; public static final int DISPLAY_CASE_24659 = 24659; public static final int DISPLAY_CASE_24660 = 24660; public static final int DISPLAY_CASE_24661 = 24661; public static final int DISPLAY_CASE_24663 = 24663; public static final int CANDLES_24666 = 24666; public static final int TABLE_24667 = 24667; public static final int WARDROBE_24668 = 24668; public static final int WARDROBE_24669 = 24669; public static final int WARDROBE_24670 = 24670; public static final int WARDROBE_24671 = 24671; public static final int STAIRCASE_24672 = 24672; public static final int STAIRCASE_24673 = 24673; public static final int MIRROR_24674 = 24674; public static final int SHELF_24675 = 24675; public static final int SHELF_24676 = 24676; public static final int CHARMS_24677 = 24677; public static final int BED_24679 = 24679; public static final int DRESSER_24680 = 24680; public static final int DRAWERS_24681 = 24681; public static final int DRAWERS_24682 = 24682; public static final int CHAIR_24683 = 24683; public static final int TABLE_24684 = 24684; public static final int DOOR_24685 = 24685; public static final int DOOR_24686 = 24686; public static final int STAIRCASE_24687 = 24687; public static final int BROKEN_EXPERIMENT_TUBE = 24688; public static final int EXPERIMENT_TUBE = 24689; public static final int BOX_24690 = 24690; public static final int STACKED_BOXES = 24691; public static final int BOXES_24692 = 24692; public static final int ROCK_24693 = 24693; public static final int ROCK_24694 = 24694; public static final int ROCK_24695 = 24695; public static final int ROCK_24696 = 24696; public static final int ROCK_24697 = 24697; public static final int ROCK_24698 = 24698; public static final int ROCK_24699 = 24699; public static final int ROCK_24700 = 24700; public static final int ROCK_24701 = 24701; public static final int SKELETON_24706 = 24706; public static final int SKELETON_24707 = 24707; public static final int SKELETON_24708 = 24708; public static final int BARREL_24709 = 24709; public static final int SACK_24710 = 24710; public static final int SMASHED_CHAIR_24711 = 24711; public static final int BROKEN_CART_WHEEL_24712 = 24712; public static final int MYSTERIOUS_STATUE_24716 = 24716; public static final int LADDER_24717 = 24717; public static final int LADDER_24718 = 24718; public static final int PIANO_24721 = 24721; public static final int PIANO_24722 = 24722; public static final int DRAIN_PIPE = 24723; public static final int GRAMOPHONE = 24724; public static final int GRAMOPHONE_24725 = 24725; public static final int GRAMOPHONE_24726 = 24726; public static final int GRAMOPHONE_24727 = 24727; public static final int MUSIC_STAND = 24728; public static final int MUSIC_STAND_24729 = 24729; public static final int EARTH_MOUND = 24730; public static final int BEAN_MOUND = 24731; public static final int BEANSTALK = 24732; public static final int BEANSTALK_24733 = 24733; public static final int BEANSTALK_24734 = 24734; public static final int BEANSTALK_24735 = 24735; public static final int BEANSTALK_24736 = 24736; public static final int BEANSTALK_24737 = 24737; public static final int BEANSTUMP = 24738; public static final int CRUMBLING_WALL_24749 = 24749; public static final int DOOR_24759 = 24759; public static final int WINDOW_24765 = 24765; public static final int WINDOW_24766 = 24766; public static final int BEARD = 24767; public static final int WINDOW_24768 = 24768; public static final int RUPERT = 24769; public static final int RUPERT_24770 = 24770; public static final int RUPERT_24771 = 24771; public static final int RUPERT_24772 = 24772; public static final int WINDOW_24778 = 24778; public static final int BEARD_24779 = 24779; public static final int PENDANT = 24780; public static final int ROCK_24781 = 24781; public static final int NAILS = 24795; public static final int NAILS_24796 = 24796; public static final int MOUSE_HOLE_24799 = 24799; public static final int GRATE = 24802; public static final int LOCK = 24803; public static final int NAILS_24804 = 24804; public static final int WITCHS_CHARM = 24805; public static final int DRAIN_24808 = 24808; public static final int CHAIR_24814 = 24814; public static final int DOOR_24815 = 24815; public static final int DOOR_24816 = 24816; public static final int BEANSTALK_24819 = 24819; public static final int GRIMGNASH = 24839; public static final int FEATHERS = 24841; public static final int MANHOLE_24842 = 24842; public static final int FLOOR_24843 = 24843; public static final int FLOOR_24844 = 24844; public static final int FLOOR_24845 = 24845; public static final int FLOOR_24846 = 24846; public static final int FLOOR_24847 = 24847; public static final int CHEESE = 24874; public static final int COINS = 24875; public static final int BONES_24876 = 24876; public static final int WITCH_GLYPH = 24877; public static final int WITCH_GLYPH_24878 = 24878; public static final int CRUMBLING_WALL_24880 = 24880; public static final int CAGE_24887 = 24887; public static final int CLOTHES_EQUIPMENT_24907 = 24907; public static final int INFORMATION_SCROLL_24908 = 24908; public static final int INFORMATION_SCROLL_24909 = 24909; public static final int FERMENTING_VAT_24910 = 24910; public static final int FERMENTING_VAT_24911 = 24911; public static final int FERMENTING_VAT_24912 = 24912; public static final int FERMENTING_VAT_24913 = 24913; public static final int FERMENTING_VAT_24914 = 24914; public static final int FERMENTING_VAT_24915 = 24915; public static final int FERMENTING_VAT_24916 = 24916; public static final int FERMENTING_VAT_24917 = 24917; public static final int FERMENTING_VAT_24918 = 24918; public static final int FERMENTING_VAT_24919 = 24919; public static final int FERMENTING_VAT_24920 = 24920; public static final int FERMENTING_VAT_24921 = 24921; public static final int FERMENTING_VAT_24922 = 24922; public static final int FERMENTING_VAT_24923 = 24923; public static final int FERMENTING_VAT_24924 = 24924; public static final int FERMENTING_VAT_24925 = 24925; public static final int FERMENTING_VAT_24926 = 24926; public static final int FERMENTING_VAT_24927 = 24927; public static final int FERMENTING_VAT_24928 = 24928; public static final int FERMENTING_VAT_24929 = 24929; public static final int FERMENTING_VAT_24930 = 24930; public static final int FERMENTING_VAT_24931 = 24931; public static final int FERMENTING_VAT_24932 = 24932; public static final int FERMENTING_VAT_24933 = 24933; public static final int FERMENTING_VAT_24934 = 24934; public static final int FERMENTING_VAT_24935 = 24935; public static final int FERMENTING_VAT_24936 = 24936; public static final int FERMENTING_VAT_24937 = 24937; public static final int FERMENTING_VAT_24938 = 24938; public static final int FERMENTING_VAT_24939 = 24939; public static final int FERMENTING_VAT_24940 = 24940; public static final int FERMENTING_VAT_24941 = 24941; public static final int FERMENTING_VAT_24942 = 24942; public static final int FERMENTING_VAT_24943 = 24943; public static final int FERMENTING_VAT_24944 = 24944; public static final int FERMENTING_VAT_24945 = 24945; public static final int FERMENTING_VAT_24946 = 24946; public static final int FERMENTING_VAT_24947 = 24947; public static final int FERMENTING_VAT_24948 = 24948; public static final int FERMENTING_VAT_24949 = 24949; public static final int FERMENTING_VAT_24950 = 24950; public static final int FERMENTING_VAT_24951 = 24951; public static final int FERMENTING_VAT_24952 = 24952; public static final int FERMENTING_VAT_24953 = 24953; public static final int FERMENTING_VAT_24954 = 24954; public static final int FERMENTING_VAT_24955 = 24955; public static final int DOOR_24958 = 24958; public static final int HOPPER_24960 = 24960; public static final int HOPPER_24961 = 24961; public static final int HOPPER_24962 = 24962; public static final int HOPPER_24963 = 24963; public static final int HOPPER_CONTROLS_24964 = 24964; public static final int HOPPER_CONTROLS_24965 = 24965; public static final int HOPPER_CONTROLS_24966 = 24966; public static final int HOPPER_CONTROLS_24967 = 24967; public static final int KEBAB = 24968; public static final int FIREPLACE_24969 = 24969; public static final int FIREPLACE_24970 = 24970; public static final int FIRE_RIFT = 24971; public static final int EARTH_RIFT = 24972; public static final int BODY_RIFT = 24973; public static final int COSMIC_RIFT = 24974; public static final int NATURE_RIFT = 24975; public static final int CHAOS_RIFT = 24976; public static final int CROP_CIRCLE = 24984; public static final int CROP_CIRCLE_24985 = 24985; public static final int CROP_CIRCLE_24986 = 24986; public static final int CROP_CIRCLE_24987 = 24987; public static final int CENTRE_OF_CROP_CIRCLE = 24988; public static final int MAGIC_WHEAT = 24989; public static final int MAGIC_WHEAT_24990 = 24990; public static final int CENTRE_OF_CROP_CIRCLE_24991 = 24991; public static final int PORTAL_25014 = 25014; public static final int MAGICAL_WHEAT = 25016; public static final int MAGICAL_WHEAT_25017 = 25017; public static final int MAGICAL_WHEAT_25018 = 25018; public static final int MAGICAL_WHEAT_25019 = 25019; public static final int MAGICAL_WHEAT_25020 = 25020; public static final int MAGICAL_WHEAT_25021 = 25021; public static final int GROWING_WHEAT = 25022; public static final int WILTING_WHEAT = 25023; public static final int MAGICAL_WHEAT_25024 = 25024; public static final int MAGICAL_WHEAT_25025 = 25025; public static final int MAGICAL_WHEAT_25026 = 25026; public static final int MAGICAL_WHEAT_25027 = 25027; public static final int MAGICAL_WHEAT_25028 = 25028; public static final int MAGICAL_WHEAT_25029 = 25029; public static final int DRAGONS_HEAD_25033 = 25033; public static final int LAW_RIFT = 25034; public static final int DEATH_RIFT = 25035; public static final int HULL_25037 = 25037; public static final int LADDER_25038 = 25038; public static final int WALL_25039 = 25039; public static final int WARDROBE_25040 = 25040; public static final int WARDROBE_25041 = 25041; public static final int WARDROBE_25042 = 25042; public static final int WARDROBE_25043 = 25043; public static final int WARDROBE_25044 = 25044; public static final int LADDER_25045 = 25045; public static final int BOOKSHELVES_25046 = 25046; public static final int TABLE_25047 = 25047; public static final int CHAIR_25048 = 25048; public static final int COLUMN_25080 = 25080; public static final int COLUMN_25081 = 25081; public static final int COLUMN_25082 = 25082; public static final int STALAGMITE_25083 = 25083; public static final int STALAGMITES_25084 = 25084; public static final int STALAGMITES_25085 = 25085; public static final int SKELETON_25087 = 25087; public static final int SKELETON_25088 = 25088; public static final int SKELETON_25089 = 25089; public static final int SKELETON_25090 = 25090; public static final int SHIELD_25091 = 25091; public static final int MAGIC_DOOR_25115 = 25115; public static final int MAGIC_DOOR_25116 = 25116; public static final int MAGIC_DOOR_25117 = 25117; public static final int MAGIC_DOOR_25118 = 25118; public static final int CANDLE_STAND_25122 = 25122; public static final int CANDLE_STAND_25123 = 25123; public static final int VINES_25129 = 25129; public static final int VINES_25130 = 25130; public static final int VINES_25131 = 25131; public static final int VINES_25132 = 25132; public static final int VINES_25136 = 25136; public static final int PLANT_25137 = 25137; public static final int FUNGUS_25138 = 25138; public static final int FUNGUS_25139 = 25139; public static final int WALL_25148 = 25148; public static final int WALL_25149 = 25149; public static final int WALL_25150 = 25150; public static final int WALL_25151 = 25151; public static final int PILLAR_25152 = 25152; public static final int PILLAR_25153 = 25153; public static final int HOLE_25154 = 25154; public static final int FIRE_25155 = 25155; public static final int FIRE_25156 = 25156; public static final int JENKINS = 25157; public static final int ROCK_25158 = 25158; public static final int ROCK_25159 = 25159; public static final int ROCK_25160 = 25160; public static final int WALL_25161 = 25161; public static final int TREE_25169 = 25169; public static final int WHITE_TREE_25170 = 25170; public static final int TREE_25171 = 25171; public static final int TREE_25172 = 25172; public static final int TREE_25174 = 25174; public static final int FERN_25175 = 25175; public static final int FERN_25176 = 25176; public static final int FERN_25177 = 25177; public static final int FERN_25178 = 25178; public static final int FLOWERING_FERN_25179 = 25179; public static final int FLOWERING_FERN_25180 = 25180; public static final int DEAD_CALQUAT_25181 = 25181; public static final int DISEASED_CALQUAT_25182 = 25182; public static final int TREE_25183 = 25183; public static final int TREE_25184 = 25184; public static final int TREE_25185 = 25185; public static final int TREE_STUMP_25186 = 25186; public static final int A_BURNT_TREE = 25187; public static final int A_BURNT_TREE_25188 = 25188; public static final int TREE_25189 = 25189; public static final int A_TROPICAL_TREE = 25190; public static final int A_TROPICAL_TREE_25191 = 25191; public static final int WEEDS_25192 = 25192; public static final int DRAGON_STATUE = 25194; public static final int CIRCLE = 25199; public static final int BEACON = 25200; public static final int FLAMES_25201 = 25201; public static final int DRAGON_CORPSE = 25202; public static final int DRAGON_CORPSE_25203 = 25203; public static final int A_SHABBY_TENT = 25204; public static final int A_FLAG = 25205; public static final int SUIT_OF_ARMOUR_25206 = 25206; public static final int HOISTED_SAIL_25207 = 25207; public static final int HOISTED_SAIL_25208 = 25208; public static final int MAGIC_DOOR_25210 = 25210; public static final int MAGIC_DOOR_25211 = 25211; public static final int CLIMBING_ROPE_25213 = 25213; public static final int TRAPDOOR_25214 = 25214; public static final int AGED_LOG = 25216; public static final int DOOR_25252 = 25252; public static final int FUNERAL_PYRE_25263 = 25263; public static final int FUNERAL_PYRE_25264 = 25264; public static final int FUNERAL_PYRE_25265 = 25265; public static final int FUNERAL_PYRE_25266 = 25266; public static final int FUNERAL_PYRE_25267 = 25267; public static final int BARBARIAN_BED = 25268; public static final int BARBARIAN_TABLE = 25269; public static final int BARBARIAN_CHAIR = 25270; public static final int WHIRLPOOL_25274 = 25274; public static final int WHIRLPOOL_25275 = 25275; public static final int MIGHTY_TORRENT = 25276; public static final int MIGHTY_TORRENT_25277 = 25277; public static final int MIGHTY_TORRENT_25278 = 25278; public static final int MIGHTY_TORRENT_25279 = 25279; public static final int PYRE_SITE = 25286; public static final int BOAT_STATION = 25287; public static final int CARVED_LOG = 25288; public static final int CARVED_LOG_25289 = 25289; public static final int PYRE_BOAT = 25290; public static final int PYRE_BOAT_25291 = 25291; public static final int PYRE_BOAT_25292 = 25292; public static final int PYRE_BOAT_25293 = 25293; public static final int PYRE_BOAT_25294 = 25294; public static final int PYRE_BOAT_25295 = 25295; public static final int STAIRS_25336 = 25336; public static final int STAIRS_25338 = 25338; public static final int STAIRS_25339 = 25339; public static final int STAIRS_25340 = 25340; public static final int MITHRIL_DOOR = 25341; public static final int BARBARIAN_ANVIL = 25349; public static final int SKELETON_25362 = 25362; public static final int APPARATUS = 25368; public static final int HOLDING_AREA = 25369; public static final int CAMPFIRE_25374 = 25374; public static final int WATER_RIFT = 25376; public static final int SOUL_RIFT = 25377; public static final int AIR_RIFT = 25378; public static final int MIND_RIFT = 25379; public static final int BLOOD_RIFT = 25380; public static final int PASSAGE_25381 = 25381; public static final int BLOCKAGE = 25383; public static final int CHEST_25385 = 25385; public static final int CHEST_25386 = 25386; public static final int CHEST_25387 = 25387; public static final int CHEST_25388 = 25388; public static final int CHEST_25389 = 25389; public static final int CHEST_25390 = 25390; public static final int CHEST_25391 = 25391; public static final int CHEST_25392 = 25392; public static final int TELESCOPE_25393 = 25393; public static final int SIGNPOST_25397 = 25397; public static final int ORRERY = 25401; public static final int BOOKCASE_25402 = 25402; public static final int BOOKCASE_25403 = 25403; public static final int BOOKCASE_25404 = 25404; public static final int BOOKCASE_25405 = 25405; public static final int BOOKCASE_25406 = 25406; public static final int OLD_BOOKSHELF_25407 = 25407; public static final int OLD_BOOKSHELF_25408 = 25408; public static final int PROFESSORS_TABLE = 25411; public static final int STALAGMITES_25415 = 25415; public static final int DOOR_25417 = 25417; public static final int DOOR_25418 = 25418; public static final int BLUEBELLS_25419 = 25419; public static final int SUNFLOWER_25420 = 25420; public static final int SUNFLOWERS_25421 = 25421; public static final int ROCK_25422 = 25422; public static final int ROCK_25423 = 25423; public static final int BROKEN_ROCK = 25424; public static final int TENDRILS_25425 = 25425; public static final int TENDRILS_25426 = 25426; public static final int CHOPPED_TENDRILS = 25427; public static final int GAP_25428 = 25428; public static final int STAIRS_25429 = 25429; public static final int STAIRS_25431 = 25431; public static final int STAIRS_25432 = 25432; public static final int STAIRS_25434 = 25434; public static final int STAIRS_25437 = 25437; public static final int TELESCOPE_25438 = 25438; public static final int TELESCOPE_25439 = 25439; public static final int GOBLIN_STOVE = 25440; public static final int GOBLIN_STOVE_25441 = 25441; public static final int SPIDERWEBS = 25443; public static final int POTENTIAL_FIRE = 25464; public static final int FIRE_25465 = 25465; public static final int DOOR_25526 = 25526; public static final int DOOR_25527 = 25527; public static final int STAR_CHART_25578 = 25578; public static final int STAR_CHART_25579 = 25579; public static final int STAR_CHART_25580 = 25580; public static final int STAR_CHART_25581 = 25581; public static final int STAR_CHART_25582 = 25582; public static final int STAR_CHART_25583 = 25583; public static final int STONE_ARCH = 25588; public static final int BOIL = 25590; public static final int CLOSED_CHEST_25592 = 25592; public static final int OPEN_CHEST_25593 = 25593; public static final int LARGE_DOOR_25594 = 25594; public static final int LARGE_DOOR_25595 = 25595; public static final int SUIT_OF_ARMOUR_25599 = 25599; public static final int BARREL_25600 = 25600; public static final int BENCH_25601 = 25601; public static final int BOW_CABINET_25602 = 25602; public static final int TABLE_25603 = 25603; public static final int STAIRCASE_25604 = 25604; public static final int THRONE_25605 = 25605; public static final int LADDER_25606 = 25606; public static final int BOOKCASE_25607 = 25607; public static final int CABINET_25608 = 25608; public static final int CABINET_25609 = 25609; public static final int WARDROBE_25610 = 25610; public static final int SHELVES_25611 = 25611; public static final int SHELVES_25612 = 25612; public static final int CRYSTAL_BALL_25614 = 25614; public static final int TABLE_25615 = 25615; public static final int CHAIR_25616 = 25616; public static final int NOVICE_FLAG = 25620; public static final int INTERMEDIATE_FLAG = 25621; public static final int VETERAN_FLAG = 25622; public static final int NOVICE_FLAG_25623 = 25623; public static final int INTERMEDIATE_FLAG_25624 = 25624; public static final int VETERAN_FLAG_25625 = 25625; public static final int LADDER_25629 = 25629; public static final int LADDER_25630 = 25630; public static final int GANGPLANK_25631 = 25631; public static final int GANGPLANK_25632 = 25632; public static final int BARRICADE_25636 = 25636; public static final int LARGE_DOOR_25638 = 25638; public static final int LARGE_DOOR_25639 = 25639; public static final int LARGE_DOOR_25640 = 25640; public static final int LARGE_DOOR_25641 = 25641; public static final int DOOR_25642 = 25642; public static final int DOOR_25643 = 25643; public static final int CRATE_25644 = 25644; public static final int CRATE_25645 = 25645; public static final int CANNON_25646 = 25646; public static final int CLOSED_CHEST_25647 = 25647; public static final int DUMMY_25648 = 25648; public static final int RACK_25649 = 25649; public static final int BOW_AND_ARROW_25651 = 25651; public static final int SHELF_25652 = 25652; public static final int SHELF_25653 = 25653; public static final int CHARMS_25654 = 25654; public static final int CRATE_25655 = 25655; public static final int CRATE_25660 = 25660; public static final int CRATE_25661 = 25661; public static final int LADDER_25662 = 25662; public static final int LADDER_25663 = 25663; public static final int SIR_LUCAN = 25664; public static final int SIR_PALOMEDES = 25665; public static final int SIR_LANCELOT = 25666; public static final int SIR_BEDIVERE = 25667; public static final int HEDGE_25668 = 25668; public static final int HEDGE_25669 = 25669; public static final int HEDGE_25670 = 25670; public static final int FOOD_TROUGH_25675 = 25675; public static final int BENCH_25676 = 25676; public static final int BED_25681 = 25681; public static final int STAIRCASE_25682 = 25682; public static final int STAIRCASE_25683 = 25683; public static final int BOOKCASE_25684 = 25684; public static final int CHEST_25685 = 25685; public static final int CHEST_25686 = 25686; public static final int LADDER_25687 = 25687; public static final int LADDER_25688 = 25688; public static final int BOOKCASE_25689 = 25689; public static final int BOOKCASE_25690 = 25690; public static final int BOOKCASE_25691 = 25691; public static final int BOOKCASE_25692 = 25692; public static final int BOOKCASE_25693 = 25693; public static final int BOOKCASE_25694 = 25694; public static final int BOOKCASE_25695 = 25695; public static final int BOOKCASE_25696 = 25696; public static final int BOOKCASE_25697 = 25697; public static final int BOOKCASE_25698 = 25698; public static final int CABINET_25699 = 25699; public static final int CABINET_25700 = 25700; public static final int DRAWERS_25701 = 25701; public static final int DRAWERS_25702 = 25702; public static final int DRAWERS_25703 = 25703; public static final int DRAWERS_25704 = 25704; public static final int DRAWERS_25705 = 25705; public static final int DRAWERS_25706 = 25706; public static final int DRAWERS_25707 = 25707; public static final int DRAWERS_25708 = 25708; public static final int DRAWERS_25709 = 25709; public static final int DRAWERS_25710 = 25710; public static final int DRAWERS_25711 = 25711; public static final int DRAWERS_25712 = 25712; public static final int DRAWERS_25713 = 25713; public static final int DRAWERS_25714 = 25714; public static final int DRAWERS_25715 = 25715; public static final int DOOR_25716 = 25716; public static final int DOOR_25717 = 25717; public static final int DOOR_25718 = 25718; public static final int DOOR_25719 = 25719; public static final int DAIRY_CHURN_25720 = 25720; public static final int BARREL_25721 = 25721; public static final int BARREL_OF_FLOUR = 25722; public static final int ANNAS_BARREL_25723 = 25723; public static final int BOBS_BARREL_25724 = 25724; public static final int CAROLS_BARREL_25725 = 25725; public static final int DAVIDS_BARREL_25726 = 25726; public static final int ELIZABETHS_BARREL_25727 = 25727; public static final int FRANKS_BARREL_25728 = 25728; public static final int SINK_25729 = 25729; public static final int RANGE_25730 = 25730; public static final int GRANDFATHER_CLOCK_25731 = 25731; public static final int DRAGONS_HEAD_25732 = 25732; public static final int TABLE_25733 = 25733; public static final int TABLE_25734 = 25734; public static final int BED_25735 = 25735; public static final int SHELF_25736 = 25736; public static final int SHELF_25737 = 25737; public static final int PAINTING_25738 = 25738; public static final int PORTRAIT_25739 = 25739; public static final int LANDSCAPE_25740 = 25740; public static final int PAINTING_25741 = 25741; public static final int PAINTING_25742 = 25742; public static final int LANDSCAPE_25743 = 25743; public static final int PAINTING_25744 = 25744; public static final int LARGE_DOOR_25748 = 25748; public static final int LARGE_DOOR_25750 = 25750; public static final int BLACKSMITHS_TOOLS_25761 = 25761; public static final int SIGN_25762 = 25762; public static final int CLOCK_25763 = 25763; public static final int PIANO_25764 = 25764; public static final int PIANO_STOOL_25765 = 25765; public static final int DRAWERS_25766 = 25766; public static final int DRAWERS_25767 = 25767; public static final int BENCH_25768 = 25768; public static final int CABINET_25769 = 25769; public static final int CABINET_25770 = 25770; public static final int CHAIR_25771 = 25771; public static final int SMASHED_CHAIR_25772 = 25772; public static final int STOOL_25773 = 25773; public static final int WORKBENCH_25774 = 25774; public static final int CRATE_25775 = 25775; public static final int CRATES_25776 = 25776; public static final int TABLE_25778 = 25778; public static final int STATUE_25779 = 25779; public static final int BARREL_25780 = 25780; public static final int COOKING_SHELVES_25781 = 25781; public static final int OLD_BOOKSHELF_25782 = 25782; public static final int ROCKING_CHAIR_25783 = 25783; public static final int CHAIR_25784 = 25784; public static final int RACK_25785 = 25785; public static final int STAIRCASE_25786 = 25786; public static final int STAIRCASE_25787 = 25787; public static final int LARGE_DOOR_25788 = 25788; public static final int LARGE_DOOR_25789 = 25789; public static final int LARGE_DOOR_25790 = 25790; public static final int LARGE_DOOR_25791 = 25791; public static final int SUIT_OF_ARMOUR_25792 = 25792; public static final int CLOSED_CHEST_25793 = 25793; public static final int OPEN_CHEST_25794 = 25794; public static final int CANNON_25798 = 25798; public static final int DOOR_25799 = 25799; public static final int DOOR_25800 = 25800; public static final int STAIRCASE_25801 = 25801; public static final int LARGE_DOOR_25804 = 25804; public static final int LARGE_DOOR_25805 = 25805; public static final int LARGE_DOOR_25806 = 25806; public static final int LARGE_DOOR_25807 = 25807; public static final int BANK_BOOTH_25808 = 25808; public static final int CLOSED_BOOTH_25809 = 25809; public static final int LARGE_DOOR_25813 = 25813; public static final int LARGE_DOOR_25814 = 25814; public static final int LARGE_DOOR_25815 = 25815; public static final int LARGE_DOOR_25816 = 25816; public static final int STUDY_DESK_25817 = 25817; public static final int CHURCH_ORGAN_25818 = 25818; public static final int DOOR_25819 = 25819; public static final int DOOR_25820 = 25820; public static final int BOW_CABINET_25821 = 25821; public static final int BED_25822 = 25822; public static final int MIRROR_25823 = 25823; public static final int SPINNING_WHEEL_25824 = 25824; public static final int DOOR_25825 = 25825; public static final int DOOR_25826 = 25826; public static final int DOOR_25827 = 25827; public static final int DOOR_25828 = 25828; public static final int CHAIR_25832 = 25832; public static final int CRATE_25836 = 25836; public static final int CRATE_25837 = 25837; public static final int LADDER_25843 = 25843; public static final int LADDER_25844 = 25844; public static final int METAL_DOOR = 25876; public static final int METAL_DOOR_25877 = 25877; public static final int VENT = 25879; public static final int VENT_25880 = 25880; public static final int BED_25885 = 25885; public static final int BED_25886 = 25886; public static final int SIR_TRISTRAM = 25889; public static final int BOOKCASE_25927 = 25927; public static final int TABLE_25928 = 25928; public static final int SINK_25929 = 25929; public static final int TABLE_25930 = 25930; public static final int TABLE_25931 = 25931; public static final int BAR_PUMPS_25932 = 25932; public static final int SHELVES_25933 = 25933; public static final int SHELVES_25934 = 25934; public static final int STAIRCASE_25935 = 25935; public static final int BANK_DEPOSIT_BOX_25937 = 25937; public static final int LADDER_25938 = 25938; public static final int LADDER_25939 = 25939; public static final int LADDER_25940 = 25940; public static final int LADDER_25941 = 25941; public static final int KING_ARTHUR = 25942; public static final int THE_JURY = 25944; public static final int THE_JURY_25945 = 25945; public static final int THE_JURY_25946 = 25946; public static final int THE_JURY_25947 = 25947; public static final int THE_JURY_25948 = 25948; public static final int THE_JURY_25949 = 25949; public static final int THE_JURY_25950 = 25950; public static final int THE_JURY_25951 = 25951; public static final int THE_JURY_25952 = 25952; public static final int ALAN = 25955; public static final int COURT_JUDGE = 25956; public static final int LOCKED_GATE = 25981; public static final int STAIRS_26017 = 26017; public static final int TABLE_26020 = 26020; public static final int GATE_26042 = 26042; public static final int DESK_26043 = 26043; public static final int DESK_26044 = 26044; public static final int CITIZEN = 26045; public static final int CITIZEN_26046 = 26046; public static final int CITIZEN_26047 = 26047; public static final int CITIZEN_26048 = 26048; public static final int CITIZEN_26049 = 26049; public static final int CITIZEN_26050 = 26050; public static final int STAIRS_26051 = 26051; public static final int BOOKCASE_26053 = 26053; public static final int STATUE_26073 = 26073; public static final int TABLE_26074 = 26074; public static final int CHAIR_26075 = 26075; public static final int CHAIR_26076 = 26076; public static final int CHAIR_26077 = 26077; public static final int GATE_26081 = 26081; public static final int GATE_26082 = 26082; public static final int STAIRCASE_26106 = 26106; public static final int LADDER_26107 = 26107; public static final int SPIDERS_NEST = 26109; public static final int SMASHED_WINDOW = 26110; public static final int SMASHED_WINDOW_26111 = 26111; public static final int WINDOW_26112 = 26112; public static final int BOOKCASE_26113 = 26113; public static final int ODD_LOOKING_WALL_26114 = 26114; public static final int ODD_LOOKING_WALL_26115 = 26115; public static final int ODD_LOOKING_WALL_26116 = 26116; public static final int ODD_LOOKING_WALL_26117 = 26117; public static final int LADDER_26118 = 26118; public static final int TRAPDOOR_26119 = 26119; public static final int SINCLAIR_FAMILY_COMPOST_HEAP = 26120; public static final int SINCLAIR_FAMILY_BEEHIVE = 26121; public static final int BARREL_OF_FLOUR_26122 = 26122; public static final int GATE_26130 = 26130; public static final int GATE_26131 = 26131; public static final int GATE_26132 = 26132; public static final int GATE_26133 = 26133; public static final int FLY_PAPER = 26137; public static final int GRAMOPHONE_26140 = 26140; public static final int GRAMOPHONE_26141 = 26141; public static final int TABLE_26142 = 26142; public static final int SPINNING_WHEEL_26143 = 26143; public static final int BOIL_26144 = 26144; public static final int BOIL_26145 = 26145; public static final int EYES = 26146; public static final int EYES_26147 = 26147; public static final int EYES_26148 = 26148; public static final int ABYSSAL_RIFT = 26149; public static final int TENDRILS_26167 = 26167; public static final int TENDRILS_26168 = 26168; public static final int TENDRILS_26169 = 26169; public static final int FIREPLACE_26179 = 26179; public static final int COOKING_POT_26180 = 26180; public static final int RANGE_26181 = 26181; public static final int RANGE_26182 = 26182; public static final int RANGE_26183 = 26183; public static final int RANGE_26184 = 26184; public static final int FIRE_26185 = 26185; public static final int FIRE_26186 = 26186; public static final int CHEST_26193 = 26193; public static final int LEVER_26194 = 26194; public static final int BIRTHDAY_CAKE = 26198; public static final int GRINDER = 26199; public static final int TABLE_26201 = 26201; public static final int TABLE_26202 = 26202; public static final int TABLE_26203 = 26203; public static final int DOOR_26205 = 26205; public static final int SEED_VAULT = 26206; public static final int LARGE_DOOR_26207 = 26207; public static final int WOODEN_BENCH_26210 = 26210; public static final int OAK_BENCH_26211 = 26211; public static final int CARVED_OAK_BENCH_26212 = 26212; public static final int TEAK_BENCH_26213 = 26213; public static final int CARVED_TEAK_BENCH_26214 = 26214; public static final int MAHOGANY_BENCH_26215 = 26215; public static final int GILDED_BENCH_26216 = 26216; public static final int STOOL_26231 = 26231; public static final int STOOL_26232 = 26232; public static final int THRONE_26233 = 26233; public static final int THRONE_26234 = 26234; public static final int THRONE_26235 = 26235; public static final int THRONE_26236 = 26236; public static final int THRONE_26237 = 26237; public static final int THRONE_26238 = 26238; public static final int THRONE_26239 = 26239; public static final int TEAK_BENCH_26240 = 26240; public static final int MAHOGANY_BENCH_26241 = 26241; public static final int GILDED_BENCH_26242 = 26242; public static final int TRAPDOOR_26243 = 26243; public static final int BROKEN_ROPE_BRIDGE_26244 = 26244; public static final int TREE_26248 = 26248; public static final int TREE_26249 = 26249; public static final int BANK_DEPOSIT_BOX_26254 = 26254; public static final int SIGN_26255 = 26255; public static final int ZAPPER_26256 = 26256; public static final int ALTAR_26257 = 26257; public static final int CHAOS_ALTAR_26258 = 26258; public static final int SPIRIT_TREE_26259 = 26259; public static final int SPIRIT_TREE_26260 = 26260; public static final int SPIRIT_TREE_26261 = 26261; public static final int SPIRIT_TREE_26262 = 26262; public static final int SPIRIT_TREE_26263 = 26263; public static final int POWER_SURGE = 26264; public static final int RECURRENT_DAMAGE = 26265; public static final int ULTIMATE_FORCE = 26266; public static final int PLINTH_26267 = 26267; public static final int EMPTY_VIAL = 26268; public static final int POTION = 26269; public static final int SPECTATOR_POTION = 26270; public static final int DOMINICS_COFFER = 26271; public static final int DOMINICS_COFFER_26272 = 26272; public static final int REWARDS_CHEST = 26273; public static final int POTION_26276 = 26276; public static final int SUPER_RANGING_POTION = 26277; public static final int SUPER_MAGIC_POTION = 26278; public static final int OVERLOAD_POTION = 26279; public static final int ABSORPTION_POTION = 26280; public static final int ANTIDRAGON_SHIELD = 26281; public static final int MAGIC_SECATEURS = 26282; public static final int CHAOS_RUNE = 26283; public static final int DEATH_RUNE = 26284; public static final int BLOOD_RUNE = 26285; public static final int AIR_RUNE = 26286; public static final int WATER_RUNE = 26287; public static final int EARTH_RUNE = 26288; public static final int FIRE_RUNE = 26289; public static final int PICKAXE_26290 = 26290; public static final int BEAR_DROPPINGS = 26295; public static final int PET_HOUSE_SPACE = 26296; public static final int OAK_HOUSE = 26297; public static final int TEAK_HOUSE = 26298; public static final int MAHOGANY_HOUSE = 26299; public static final int FURNACE_26300 = 26300; public static final int BATTLE_TOWER = 26306; public static final int BROKEN_CATAPULT = 26307; public static final int CROSSBOW = 26308; public static final int CHAIN_26309 = 26309; public static final int BATTERING_RAM = 26310; public static final int ARROW = 26311; public static final int BROKEN_MAST = 26312; public static final int SKELETON_26313 = 26313; public static final int WHEEL_26314 = 26314; public static final int HAMMER = 26315; public static final int ARMOUR_26316 = 26316; public static final int LADDER_26317 = 26317; public static final int CRATE_26318 = 26318; public static final int ARM = 26319; public static final int BARRELS_26320 = 26320; public static final int OLD_AXE = 26324; public static final int COLUMN_26325 = 26325; public static final int CANNONBALL_26326 = 26326; public static final int SPIKES_26327 = 26327; public static final int CRATE_26328 = 26328; public static final int SPIKES_26329 = 26329; public static final int BARRELS_26330 = 26330; public static final int BARRELS_26331 = 26331; public static final int POLE = 26332; public static final int CATAPULT_26333 = 26333; public static final int CRATES_26334 = 26334; public static final int CRATES_26335 = 26335; public static final int CROSSBOW_26336 = 26336; public static final int CRATES_26337 = 26337; public static final int CRATES_26338 = 26338; public static final int SPIKES_26339 = 26339; public static final int WOOD_26340 = 26340; public static final int SPIKES_26341 = 26341; public static final int STORMRAM = 26342; public static final int SKULLSHIELD = 26343; public static final int BARRELS_26344 = 26344; public static final int BOARDS = 26345; public static final int CRANE_26346 = 26346; public static final int HANDLE = 26347; public static final int FROZEN_WARRIOR = 26348; public static final int FROZEN_WARRIOR_26349 = 26349; public static final int FROZEN_WARRIOR_26350 = 26350; public static final int FROZEN_WARRIOR_26351 = 26351; public static final int FROZEN_WARRIOR_26352 = 26352; public static final int FROZEN_WARRIOR_26353 = 26353; public static final int FROZEN_WARRIOR_26354 = 26354; public static final int FROZEN_WARRIOR_26355 = 26355; public static final int FROZEN_WARRIOR_26356 = 26356; public static final int FROZEN_WARRIOR_26357 = 26357; public static final int FROZEN_DEMON = 26358; public static final int FROZEN_DEMON_26359 = 26359; public static final int FROZEN_ORC = 26360; public static final int FROZEN_ORC_26361 = 26361; public static final int FROZEN_ORC_26362 = 26362; public static final int ZAMORAK_ALTAR = 26363; public static final int SARADOMIN_ALTAR = 26364; public static final int ARMADYL_ALTAR = 26365; public static final int BANDOS_ALTAR = 26366; public static final int BIG_HOLE = 26368; public static final int ROPE_26369 = 26369; public static final int ROPE_26370 = 26370; public static final int ROCK_26372 = 26372; public static final int ROCK_26373 = 26373; public static final int ROPE_26374 = 26374; public static final int ROCK_26376 = 26376; public static final int ROCK_26377 = 26377; public static final int ROPE_26378 = 26378; public static final int PILLAR_26379 = 26379; public static final int PILLAR_26380 = 26380; public static final int LITTLE_CRACK = 26382; public static final int KNIGHT = 26383; public static final int ROCKY_HANDHOLDS_26400 = 26400; public static final int ROCKY_HANDHOLDS_26401 = 26401; public static final int ROCKY_HANDHOLDS_26402 = 26402; public static final int ROCKY_HANDHOLDS_26404 = 26404; public static final int ROCKY_HANDHOLDS_26405 = 26405; public static final int ROCKY_HANDHOLDS_26406 = 26406; public static final int BOULDER_26415 = 26415; public static final int BOULDER_26416 = 26416; public static final int HOLE_26417 = 26417; public static final int HOLE_26418 = 26418; public static final int BROKEN_PILLAR = 26420; public static final int BROKEN_PILLAR_26421 = 26421; public static final int ROPE_26422 = 26422; public static final int FROZEN_DOOR = 26457; public static final int FROZEN_DOOR_26458 = 26458; public static final int BIG_DOOR = 26461; public static final int BARREL_26462 = 26462; public static final int LARGE_GEYSER_26491 = 26491; public static final int POLL_BOOTH = 26492; public static final int SNOWFALL = 26494; public static final int WATERFALL_26495 = 26495; public static final int WATERFALL_26496 = 26496; public static final int WATERFALL_26497 = 26497; public static final int WATERFALL_26498 = 26498; public static final int WATERFALL_26499 = 26499; public static final int BIG_DOOR_26502 = 26502; public static final int BIG_DOOR_26503 = 26503; public static final int BIG_DOOR_26504 = 26504; public static final int BIG_DOOR_26505 = 26505; public static final int ICE_BRIDGE = 26518; public static final int CRATE_26519 = 26519; public static final int CAVE_26564 = 26564; public static final int CAVE_26565 = 26565; public static final int CAVE_26566 = 26566; public static final int CAVE_26567 = 26567; public static final int CAVE_26568 = 26568; public static final int CAVE_26569 = 26569; public static final int BLIGHTED_VINE = 26572; public static final int FIRE_26575 = 26575; public static final int FIRE_26576 = 26576; public static final int FIRE_26577 = 26577; public static final int FIRE_26578 = 26578; public static final int DYED_FABRIC_26594 = 26594; public static final int DYED_FABRIC_26595 = 26595; public static final int DYED_FABRIC_26596 = 26596; public static final int BOOKCASE_26632 = 26632; public static final int STONES_26633 = 26633; public static final int TREASURE_TRAIL_STATISTICS_26634 = 26634; public static final int PLANK_26635 = 26635; public static final int CHALLENGE_PORTAL = 26642; public static final int CHALLENGE_PORTAL_26643 = 26643; public static final int CHALLENGE_PORTAL_26644 = 26644; public static final int FREEFORALL_PORTAL = 26645; public static final int PORTAL_26646 = 26646; public static final int CAVE_26654 = 26654; public static final int TUNNEL_26655 = 26655; public static final int ORE_VEIN_26661 = 26661; public static final int ORE_VEIN_26662 = 26662; public static final int ORE_VEIN_26663 = 26663; public static final int ORE_VEIN_26664 = 26664; public static final int DEPLETED_VEIN_26665 = 26665; public static final int DEPLETED_VEIN_26666 = 26666; public static final int DEPLETED_VEIN_26667 = 26667; public static final int DEPLETED_VEIN_26668 = 26668; public static final int STRUT = 26669; public static final int BROKEN_STRUT = 26670; public static final int WATER_WHEEL_26671 = 26671; public static final int WATER_WHEEL_26672 = 26672; public static final int HOPPER_26674 = 26674; public static final int EMPTY_SACK_26677 = 26677; public static final int SACK_26678 = 26678; public static final int ROCKFALL = 26679; public static final int ROCKFALL_26680 = 26680; public static final int MYSTIC_SYMBOL = 26692; public static final int MYSTIC_SYMBOL_26693 = 26693; public static final int MARKER = 26694; public static final int SUPERMAJORITY_MARKER = 26695; public static final int SUPERMAJORITY_MARKER_26696 = 26696; public static final int DOMINATION_MARKER = 26697; public static final int DOMINATION_MARKER_26698 = 26698; public static final int SNOW_26703 = 26703; public static final int SNOW_26704 = 26704; public static final int BLIGHTED_VINE_26705 = 26705; public static final int BANK_CHEST_26707 = 26707; public static final int CAVE_26709 = 26709; public static final int BANK_CHEST_26711 = 26711; public static final int CREVICE_26712 = 26712; public static final int MOUNTED_INFERNAL_CAPE = 26713; public static final int MOUNTED_MAX_CAPE = 26714; public static final int SACK_26717 = 26717; public static final int SACKS_26718 = 26718; public static final int SACKS_26719 = 26719; public static final int ROOT_26720 = 26720; public static final int ROOT_26721 = 26721; public static final int EXIT_PORTAL_26727 = 26727; public static final int EXIT_PORTAL_26728 = 26728; public static final int BUSH_26729 = 26729; public static final int EXIT_PORTAL_26731 = 26731; public static final int EXIT_PORTAL_26732 = 26732; public static final int EXIT_PORTAL_26733 = 26733; public static final int EXIT_PORTAL_26734 = 26734; public static final int EXIT_PORTAL_26735 = 26735; public static final int EXIT_PORTAL_26736 = 26736; public static final int EXIT_PORTAL_26737 = 26737; public static final int PORTAL_26738 = 26738; public static final int PORTAL_26739 = 26739; public static final int PORTAL_26740 = 26740; public static final int VIEWING_ORB_26741 = 26741; public static final int VIEWING_ORB_26743 = 26743; public static final int VIEWING_ORB_26745 = 26745; public static final int VIEWING_ORB_26747 = 26747; public static final int VIEWING_ORB_26749 = 26749; public static final int TREE_26754 = 26754; public static final int VOLCANIC_FORGE = 26755; public static final int WILDERNESS_STATISTICS = 26756; public static final int CHEST_26757 = 26757; public static final int ARTEFACTS = 26759; public static final int GATE_26760 = 26760; public static final int LEVER_26761 = 26761; public static final int CAVERN = 26762; public static final int CREVICE_26763 = 26763; public static final int CHAOS_RIFT_26765 = 26765; public static final int CAVE_26766 = 26766; public static final int CREVICE_26767 = 26767; public static final int JUTTING_WALL_26768 = 26768; public static final int CREVICE_26769 = 26769; public static final int CREVASSE_26770 = 26770; public static final int CREVASSE_26771 = 26771; public static final int CREVASSE_26772 = 26772; public static final int CREVASSE_26773 = 26773; public static final int CREVASSE_26774 = 26774; public static final int CREVASSE_26775 = 26775; public static final int CREVASSE_26776 = 26776; public static final int CREVASSE_26777 = 26777; public static final int CREVASSE_26778 = 26778; public static final int CREVASSE_26779 = 26779; public static final int CREVASSE_26780 = 26780; public static final int CREVASSE_26781 = 26781; public static final int BARRIER_26784 = 26784; public static final int BARRIER_26785 = 26785; public static final int BARRIER_26786 = 26786; public static final int BARRIER_26787 = 26787; public static final int BARRIER_26788 = 26788; public static final int BARRIER_26789 = 26789; public static final int BARRIER_26790 = 26790; public static final int BARRIER_26791 = 26791; public static final int BARRIER_26792 = 26792; public static final int BARRIER_26793 = 26793; public static final int BARRIER_26794 = 26794; public static final int POLL_BOOTH_26796 = 26796; public static final int POLL_BOOTH_26797 = 26797; public static final int POLL_BOOTH_26798 = 26798; public static final int POLL_BOOTH_26799 = 26799; public static final int POLL_BOOTH_26800 = 26800; public static final int POLL_BOOTH_26801 = 26801; public static final int POLL_BOOTH_26802 = 26802; public static final int POLL_BOOTH_26803 = 26803; public static final int POLL_BOOTH_26804 = 26804; public static final int POLL_BOOTH_26805 = 26805; public static final int POLL_BOOTH_26806 = 26806; public static final int POLL_BOOTH_26807 = 26807; public static final int POLL_BOOTH_26808 = 26808; public static final int POLL_BOOTH_26809 = 26809; public static final int POLL_BOOTH_26810 = 26810; public static final int POLL_BOOTH_26811 = 26811; public static final int POLL_BOOTH_26812 = 26812; public static final int HUTCH_26822 = 26822; public static final int CAGES_26823 = 26823; public static final int CAGE_26824 = 26824; public static final int ANCIENT_FURY_STATUE = 26825; public static final int FATALITY_STATUE = 26826; public static final int HEXIS_STATUE = 26827; public static final int REIGN_OF_TERROR_STATUE = 26828; public static final int STUD_UNIT_STATUE = 26829; public static final int CONSECRATED_HOUSE = 26830; public static final int DESECRATED_HOUSE = 26831; public static final int NATURE_HOUSE = 26832; public static final int HABITAT_SPACE = 26833; public static final int TREE_STUMP_26834 = 26834; public static final int TREE_26835 = 26835; public static final int CACTUS_26836 = 26836; public static final int IGLOO = 26837; public static final int CRATER = 26838; public static final int HABITAT_SPACE_26839 = 26839; public static final int GRASSLAND = 26840; public static final int FOREST_FLOOR = 26841; public static final int SAND_26842 = 26842; public static final int SNOW_26843 = 26843; public static final int BURNT_ROCK = 26844; public static final int HABITAT_SPACE_26845 = 26845; public static final int GRASSLAND_26846 = 26846; public static final int FOREST_FLOOR_26847 = 26847; public static final int SAND_26848 = 26848; public static final int SNOW_26849 = 26849; public static final int BURNT_ROCK_26850 = 26850; public static final int HABITAT_SPACE_26851 = 26851; public static final int GRASSLAND_26852 = 26852; public static final int FOREST_FLOOR_26853 = 26853; public static final int SAND_26854 = 26854; public static final int SNOW_26855 = 26855; public static final int BURNT_ROCK_26856 = 26856; public static final int SCRATCHING_POST_SPACE = 26857; public static final int OAK_SCRATCHING_POST = 26858; public static final int TEAK_SCRATCHING_POST = 26859; public static final int MAHOGANY_SCRATCHING_POST = 26860; public static final int ARENA_SPACE = 26861; public static final int ARENA = 26862; public static final int ARENA_26863 = 26863; public static final int ARENA_26864 = 26864; public static final int ARENA_SPACE_26865 = 26865; public static final int ARENA_26866 = 26866; public static final int PET_LIST_SPACE = 26867; public static final int PET_LIST = 26868; public static final int PET_FEEDER_SPACE = 26869; public static final int OAK_FEEDER = 26870; public static final int TEAK_FEEDER = 26871; public static final int MAHOGANY_FEEDER = 26872; public static final int ROCKS_26873 = 26873; public static final int ROCKS_26874 = 26874; public static final int VINE_26875 = 26875; public static final int VINE_26877 = 26877; public static final int VINE_26880 = 26880; public static final int VINE_26882 = 26882; public static final int VENT_26953 = 26953; public static final int VENT_26954 = 26954; public static final int TENDRILS_27014 = 27014; public static final int TENDRILS_27015 = 27015; public static final int TENDRILS_27016 = 27016; public static final int APPENDAGE = 27027; public static final int APPENDAGE_27028 = 27028; public static final int THE_FONT_OF_CONSUMPTION = 27029; public static final int THE_OVERSEER = 27044; public static final int SLIMY_RESIDUE = 27045; public static final int BOILS = 27046; public static final int OVERSEERS_BOOK = 27047; public static final int PASSAGE_27054 = 27054; public static final int PASSAGE_27055 = 27055; public static final int EVERGREEN_27060 = 27060; public static final int TREE_STUMP_27061 = 27061; public static final int ROCKSLIDE_27062 = 27062; public static final int ROCKSLIDE_27063 = 27063; public static final int OLD_LOG = 27064; public static final int LOG_RAFT_27065 = 27065; public static final int ROW_BOAT_27066 = 27066; public static final int DOOR_HOTSPOT_27068 = 27068; public static final int DOOR_HOTSPOT_27069 = 27069; public static final int WINDOW_SPACE_27070 = 27070; public static final int FLOOR_SPACE_27071 = 27071; public static final int FLOOR_DECORATION_27072 = 27072; public static final int SHUTTERED_WINDOW_27073 = 27073; public static final int DECORATIVE_WINDOW_27074 = 27074; public static final int STAINEDGLASS_WINDOW_27075 = 27075; public static final int DECORATIVE_WINDOW_27076 = 27076; public static final int STAINEDGLASS_WINDOW_27077 = 27077; public static final int DECORATIVE_WINDOW_27078 = 27078; public static final int STAINEDGLASS_WINDOW_27079 = 27079; public static final int DECORATIVE_WINDOW_27080 = 27080; public static final int STAINEDGLASS_WINDOW_27081 = 27081; public static final int DOOR_27084 = 27084; public static final int DOOR_27085 = 27085; public static final int DOOR_27086 = 27086; public static final int DOOR_27087 = 27087; public static final int INSURANCE_STALL = 27092; public static final int LIGHT_27093 = 27093; public static final int CLAN_CUP_PORTAL = 27095; public static final int EXIT_PORTAL_27096 = 27096; public static final int ANTISANTA = 27097; public static final int SOFA = 27098; public static final int CRATE_27100 = 27100; public static final int CRATES_27101 = 27101; public static final int CRATES_27102 = 27102; public static final int CHARCOAL_FURNACE = 27107; public static final int CHARCOAL_FURNACE_27108 = 27108; public static final int CHARCOAL_FURNACE_27109 = 27109; public static final int CHARCOAL_FURNACE_27110 = 27110; public static final int FLOWERS_27117 = 27117; public static final int FLOWERS_27118 = 27118; public static final int FISHING_SPOT_27121 = 27121; public static final int DEAD_MUSHROOM_RING = 27123; public static final int FAIRY_RING_27124 = 27124; public static final int STAIRS_27199 = 27199; public static final int STAIRS_27200 = 27200; public static final int STAIRS_27201 = 27201; public static final int STAIRS_27202 = 27202; public static final int STAIRS_27203 = 27203; public static final int STAIRS_27204 = 27204; public static final int CRATE_27205 = 27205; public static final int TABLE_27209 = 27209; public static final int TABLE_27210 = 27210; public static final int LECTERN_27214 = 27214; public static final int TRAINING_DUMMY = 27215; public static final int ARCHERY_TARGET_27216 = 27216; public static final int ARCHERY_TARGET_27217 = 27217; public static final int ARCHERY_TARGET_27218 = 27218; public static final int ARCHERY_TARGET_27219 = 27219; public static final int BARREL_27220 = 27220; public static final int BARREL_27221 = 27221; public static final int BARREL_27222 = 27222; public static final int CRATE_27223 = 27223; public static final int CRATE_27224 = 27224; public static final int CRATE_27225 = 27225; public static final int CRATE_27226 = 27226; public static final int BARREL_27227 = 27227; public static final int BARREL_27228 = 27228; public static final int BARREL_27229 = 27229; public static final int INFORMATION = 27230; public static final int BANK_BOOTH_27254 = 27254; public static final int CRATE_27256 = 27256; public static final int TUNNEL_27257 = 27257; public static final int TUNNEL_27258 = 27258; public static final int BANK_BOOTH_27260 = 27260; public static final int BONES_27261 = 27261; public static final int BANK_BOOTH_27263 = 27263; public static final int BANK_BOOTH_27265 = 27265; public static final int BANK_BOOTH_27267 = 27267; public static final int DEADMAN_CHEST = 27269; public static final int DEADMAN_CHEST_27271 = 27271; public static final int DEADMAN_CHEST_27275 = 27275; public static final int DEADMAN_CHEST_27277 = 27277; public static final int DEADMAN_CHEST_27280 = 27280; public static final int DEADMAN_CHEST_27282 = 27282; public static final int DEADMAN_CHEST_27284 = 27284; public static final int DEADMAN_CHEST_27286 = 27286; public static final int DEADMAN_CHEST_27288 = 27288; public static final int DEADMAN_CHEST_27290 = 27290; public static final int BANK_BOOTH_27292 = 27292; public static final int BED_27335 = 27335; public static final int BED_27336 = 27336; public static final int TABLE_27337 = 27337; public static final int BED_27338 = 27338; public static final int BED_27339 = 27339; public static final int IVORY_TABLE = 27340; public static final int IVORY_TABLE_27341 = 27341; public static final int IVORY_TABLE_27342 = 27342; public static final int IVORY_TABLE_27343 = 27343; public static final int IVORY_TABLE_27344 = 27344; public static final int IVORY_TABLE_27345 = 27345; public static final int IVORY_TABLE_27346 = 27346; public static final int IVORY_TABLE_27347 = 27347; public static final int IVORY_TABLE_27348 = 27348; public static final int IVORY_TABLE_27349 = 27349; public static final int IVORY_TABLE_27350 = 27350; public static final int IVORY_TABLE_27351 = 27351; public static final int TABLE_27353 = 27353; public static final int TABLE_27354 = 27354; public static final int TABLE_27356 = 27356; public static final int TABLE_27357 = 27357; public static final int BOOKCASE_27358 = 27358; public static final int BOOKCASE_27359 = 27359; public static final int BOOKCASE_27360 = 27360; public static final int BRAZIER_27361 = 27361; public static final int HANDHOLDS = 27362; public static final int WOODEN_CART_27364 = 27364; public static final int BARRICADE_27365 = 27365; public static final int BROKEN_BATTERING_RAM = 27366; public static final int BROKEN_CROSSBOW = 27367; public static final int BROKEN_CATAPULT_27368 = 27368; public static final int CRATES_27369 = 27369; public static final int BARRICADE_27370 = 27370; public static final int CRATES_27371 = 27371; public static final int BROKEN_CROSSBOW_27372 = 27372; public static final int FOOD_CUPBOARD = 27375; public static final int UTENSIL_CUPBOARD = 27376; public static final int MEAT_TABLE = 27377; public static final int BUFFET_TABLE = 27378; public static final int TITHE_PATCH = 27383; public static final int GOLOVANOVA_SEEDLING = 27384; public static final int GOLOVANOVA_SEEDLING_27385 = 27385; public static final int BLIGHTED_GOLOVANOVA_SEEDLING = 27386; public static final int GOLOVANOVA_PLANT = 27387; public static final int GOLOVANOVA_PLANT_27388 = 27388; public static final int BLIGHTED_GOLOVANOVA_PLANT = 27389; public static final int GOLOVANOVA_PLANT_27390 = 27390; public static final int GOLOVANOVA_PLANT_27391 = 27391; public static final int BLIGHTED_GOLOVANOVA_PLANT_27392 = 27392; public static final int GOLOVANOVA_PLANT_27393 = 27393; public static final int BLIGHTED_GOLOVANOVA_PLANT_27394 = 27394; public static final int BOLOGANO_SEEDLING = 27395; public static final int BOLOGANO_SEEDLING_27396 = 27396; public static final int BLIGHTED_BOLOGANO_SEEDLING = 27397; public static final int BOLOGANO_PLANT = 27398; public static final int BOLOGANO_PLANT_27399 = 27399; public static final int BLIGHTED_BOLOGANO_PLANT = 27400; public static final int BOLOGANO_PLANT_27401 = 27401; public static final int BOLOGANO_PLANT_27402 = 27402; public static final int BLIGHTED_BOLOGANO_PLANT_27403 = 27403; public static final int BOLOGANO_PLANT_27404 = 27404; public static final int BLIGHTED_BOLOGANO_PLANT_27405 = 27405; public static final int LOGAVANO_SEEDLING = 27406; public static final int LOGAVANO_SEEDLING_27407 = 27407; public static final int BLIGHTED_LOGAVANO_SEEDLING = 27408; public static final int LOGAVANO_PLANT = 27409; public static final int LOGAVANO_PLANT_27410 = 27410; public static final int BLIGHTED_LOGAVANO_PLANT = 27411; public static final int LOGAVANO_PLANT_27412 = 27412; public static final int LOGAVANO_PLANT_27413 = 27413; public static final int BLIGHTED_LOGAVANO_PLANT_27414 = 27414; public static final int LOGAVANO_PLANT_27415 = 27415; public static final int BLIGHTED_LOGAVANO_PLANT_27416 = 27416; public static final int BLIGHTED_GOLOVANOVA_SEEDLING_27417 = 27417; public static final int BLIGHTED_GOLOVANOVA_PLANT_27418 = 27418; public static final int BLIGHTED_GOLOVANOVA_PLANT_27419 = 27419; public static final int GOLOVANOVA_PLANT_27420 = 27420; public static final int BLIGHTED_BOLOGANO_SEEDLING_27421 = 27421; public static final int BLIGHTED_BOLOGANO_PLANT_27422 = 27422; public static final int BOLOGANO_PLANT_27423 = 27423; public static final int BLIGHTED_BOLOGANO_PLANT_27424 = 27424; public static final int BLIGHTED_LOGAVANO_SEEDLING_27425 = 27425; public static final int BLIGHTED_LOGAVANO_PLANT_27426 = 27426; public static final int BLIGHTED_LOGAVANO_PLANT_27427 = 27427; public static final int LOGAVANO_PLANT_27428 = 27428; public static final int FRUIT_CART = 27429; public static final int SEED_TABLE = 27430; public static final int SACK_27431 = 27431; public static final int SACK_27432 = 27432; public static final int SALTPETRE = 27433; public static final int SALTPETRE_27434 = 27434; public static final int SALTPETRE_27435 = 27435; public static final int SALTPETRE_27436 = 27436; public static final int DOOR_27443 = 27443; public static final int DOOR_27444 = 27444; public static final int FARM_DOOR = 27445; public static final int GLASS_DOOR_27485 = 27485; public static final int GLASS_DOOR_27486 = 27486; public static final int GLASS_DOOR_27487 = 27487; public static final int GLASS_DOOR_27488 = 27488; public static final int MATURE_JUNIPER_TREE = 27499; public static final int STUMP_27500 = 27500; public static final int ALTAR_27501 = 27501; public static final int SKELETON_27502 = 27502; public static final int TREE_27503 = 27503; public static final int GRAPE_ARBOR = 27510; public static final int BENCH_27511 = 27511; public static final int CHAIR_27512 = 27512; public static final int CHAIR_27513 = 27513; public static final int RANGE_27516 = 27516; public static final int RANGE_27517 = 27517; public static final int BAR_27518 = 27518; public static final int BAR_27519 = 27519; public static final int BARREL_RACK = 27520; public static final int EMPTY_BASKET = 27521; public static final int APPLE_BASKET = 27522; public static final int FISH_BASKET = 27523; public static final int ONION_BASKET = 27524; public static final int POTATO_BASKET = 27525; public static final int WOOD_BASKET = 27526; public static final int BED_27527 = 27527; public static final int BED_27528 = 27528; public static final int BED_27529 = 27529; public static final int BENCH_27530 = 27530; public static final int BIG_BEER_BARREL = 27531; public static final int CRATE_27532 = 27532; public static final int CRATE_27533 = 27533; public static final int CUPBOARD_27534 = 27534; public static final int CUPBOARD_27535 = 27535; public static final int FOUNTAIN_27536 = 27536; public static final int FRUIT_STALL = 27537; public static final int FRUIT_STALL_27538 = 27538; public static final int DRAWERS_27539 = 27539; public static final int DRAWERS_27540 = 27540; public static final int PIANO_27541 = 27541; public static final int CUPBOARD_27542 = 27542; public static final int POTS_27543 = 27543; public static final int ROUND_TABLE = 27544; public static final int DRAWERS_27545 = 27545; public static final int STOOL_27546 = 27546; public static final int STOOL_27547 = 27547; public static final int STOOL_27548 = 27548; public static final int BARREL_OF_FISH = 27552; public static final int EMPTY_BARREL = 27553; public static final int COOLING_CHEST = 27554; public static final int FISHING_CRANE = 27555; public static final int FISHING_CRANE_27556 = 27556; public static final int SANDWORM_CASTINGS = 27557; public static final int LADDER_27634 = 27634; public static final int LADDER_27635 = 27635; public static final int LADDER_27636 = 27636; public static final int POST = 27648; public static final int BED_27663 = 27663; public static final int BED_27664 = 27664; public static final int BED_27665 = 27665; public static final int BED_27666 = 27666; public static final int BED_27667 = 27667; public static final int BED_27668 = 27668; public static final int BED_27669 = 27669; public static final int BED_27670 = 27670; public static final int BED_27671 = 27671; public static final int BED_27672 = 27672; public static final int DRAWERS_27673 = 27673; public static final int DRAWERS_27674 = 27674; public static final int DRAWERS_27675 = 27675; public static final int TIN_BATH = 27676; public static final int TIN_BATH_27677 = 27677; public static final int STOOL_27678 = 27678; public static final int STOOL_27679 = 27679; public static final int STOOL_27680 = 27680; public static final int CHAIR_27681 = 27681; public static final int CHAIR_27682 = 27682; public static final int CHAIR_27683 = 27683; public static final int CHAIR_27684 = 27684; public static final int TABLE_27685 = 27685; public static final int TABLE_27686 = 27686; public static final int TABLE_27687 = 27687; public static final int TABLE_27688 = 27688; public static final int TABLE_27689 = 27689; public static final int TABLE_27690 = 27690; public static final int TABLE_27691 = 27691; public static final int TABLE_27692 = 27692; public static final int STAIRS_27696 = 27696; public static final int BEER_BARRELS = 27697; public static final int BROKEN_TABLE = 27698; public static final int TILL = 27699; public static final int SHELVES_27700 = 27700; public static final int SHELVES_27701 = 27701; public static final int SHELVES_27702 = 27702; public static final int CUPBOARD_27703 = 27703; public static final int CUPBOARD_27704 = 27704; public static final int TABLE_27705 = 27705; public static final int TABLE_27706 = 27706; public static final int SINK_27707 = 27707; public static final int SINK_27708 = 27708; public static final int POTS_27709 = 27709; public static final int POTS_27710 = 27710; public static final int BANK_BOOTH_27718 = 27718; public static final int BANK_BOOTH_27719 = 27719; public static final int BANK_BOOTH_27720 = 27720; public static final int BANK_BOOTH_27721 = 27721; public static final int DESTROYED_FURNITURE = 27722; public static final int DESTROYED_FURNITURE_27723 = 27723; public static final int RANGE_27724 = 27724; public static final int BOOKCASE_27726 = 27726; public static final int CRATE_27754 = 27754; public static final int CRATE_27755 = 27755; public static final int CRATE_27756 = 27756; public static final int CRATE_27757 = 27757; public static final int BARREL_27758 = 27758; public static final int ROWBOAT_27759 = 27759; public static final int ROWBOAT_27760 = 27760; public static final int BROKEN_ROWBOAT = 27761; public static final int SUNKEN_ROWBOAT = 27762; public static final int BROKEN_BOAT_27763 = 27763; public static final int BROKEN_BOAT_27764 = 27764; public static final int BROKEN_BOAT_27765 = 27765; public static final int BROKEN_BOAT_27766 = 27766; public static final int BROKEN_BARREL_27768 = 27768; public static final int BROKEN_LOBSTER_TRAP_27769 = 27769; public static final int BROKEN_WEAPONS = 27770; public static final int DRAWERS_27771 = 27771; public static final int DRAWERS_27772 = 27772; public static final int DRAWERS_27773 = 27773; public static final int DRAWERS_27774 = 27774; public static final int DRAWERS_27775 = 27775; public static final int DRAWERS_27776 = 27776; public static final int GANGPLANK_27777 = 27777; public static final int GANGPLANK_27778 = 27778; public static final int ALCHEMICAL_HYDRA = 27779; public static final int SCORE_BOARD = 27780; public static final int GANGPLANK_27781 = 27781; public static final int GANGPLANK_27782 = 27782; public static final int GANGPLANK_27783 = 27783; public static final int GANGPLANK_27784 = 27784; public static final int STATUE_27785 = 27785; public static final int STAIRS_27851 = 27851; public static final int STAIRS_27852 = 27852; public static final int STAIRS_27853 = 27853; public static final int STAIRS_27854 = 27854; public static final int STAIRS_27855 = 27855; public static final int STAIRS_27856 = 27856; public static final int BRIGHT_CRYSTAL = 27878; public static final int DARK_CRYSTAL = 27879; public static final int BLOOD_CRYSTAL = 27880; public static final int BRIGHT_CRYSTAL_27882 = 27882; public static final int DARK_CRYSTAL_27883 = 27883; public static final int BLOOD_CRYSTAL_27884 = 27884; public static final int BRIGHT_CRYSTAL_27886 = 27886; public static final int BLOOD_CRYSTAL_27888 = 27888; public static final int BLOOD_ALTAR = 27978; public static final int DARK_ALTAR = 27979; public static final int SOUL_ALTAR = 27980; public static final int ROCKS_27984 = 27984; public static final int ROCKS_27985 = 27985; public static final int ROCKS_27987 = 27987; public static final int ROCKS_27988 = 27988; public static final int BOULDER_27990 = 27990; public static final int BOOKSHELF_27991 = 27991; public static final int BOOKSHELF_27992 = 27992; public static final int BOOKSHELF_27993 = 27993; public static final int BOOKSHELF_27994 = 27994; public static final int BOOKSHELF_27995 = 27995; public static final int BOOKSHELF_27996 = 27996; public static final int BOOKSHELF_27997 = 27997; public static final int BOOKSHELF_27998 = 27998; public static final int BOOKSHELF_27999 = 27999; public static final int BOOKSHELF_28000 = 28000; public static final int BOOKSHELF_28001 = 28001; public static final int BOOKSHELF_28002 = 28002; public static final int BOOKSHELF_28003 = 28003; public static final int BOOKSHELF_28004 = 28004; public static final int BOOKSHELF_28005 = 28005; public static final int BOOKSHELF_28006 = 28006; public static final int BOOKSHELF_28007 = 28007; public static final int BOOKSHELF_28008 = 28008; public static final int BOOKSHELF_28009 = 28009; public static final int BOOKSHELF_28010 = 28010; public static final int BOOKSHELF_28011 = 28011; public static final int BOOKSHELF_28012 = 28012; public static final int BOOKSHELF_28013 = 28013; public static final int BOOKSHELF_28014 = 28014; public static final int BOOKSHELF_28015 = 28015; public static final int BOOKSHELF_28016 = 28016; public static final int BOOKSHELF_28017 = 28017; public static final int BOOKSHELF_28018 = 28018; public static final int BOOKSHELF_28019 = 28019; public static final int BOOKSHELF_28020 = 28020; public static final int BOOKSHELF_28021 = 28021; public static final int BOOKSHELF_28022 = 28022; public static final int BOOKSHELF_28023 = 28023; public static final int BOOKSHELF_28024 = 28024; public static final int BOOKSHELF_28025 = 28025; public static final int BOOKSHELF_28026 = 28026; public static final int BOOKSHELF_28027 = 28027; public static final int BOOKSHELF_28028 = 28028; public static final int BOOKSHELF_28029 = 28029; public static final int BOOKSHELF_28030 = 28030; public static final int BOOKSHELF_28031 = 28031; public static final int BOOKSHELF_28032 = 28032; public static final int BOOKSHELF_28033 = 28033; public static final int BOOKSHELF_28034 = 28034; public static final int BOOKSHELF_28035 = 28035; public static final int BOOKSHELF_28036 = 28036; public static final int BOOKSHELF_28037 = 28037; public static final int BOOKSHELF_28038 = 28038; public static final int BOOKSHELF_28039 = 28039; public static final int BOOKSHELF_28040 = 28040; public static final int BOOKSHELF_28041 = 28041; public static final int BOOKSHELF_28042 = 28042; public static final int BOOKSHELF_28043 = 28043; public static final int BOOKSHELF_28044 = 28044; public static final int BOOKSHELF_28045 = 28045; public static final int BOOKSHELF_28046 = 28046; public static final int BOOKSHELF_28047 = 28047; public static final int BOOKSHELF_28048 = 28048; public static final int BOOKSHELF_28049 = 28049; public static final int BOOKSHELF_28050 = 28050; public static final int BOOKSHELF_28051 = 28051; public static final int BOOKSHELF_28052 = 28052; public static final int BOOKSHELF_28053 = 28053; public static final int BOOKSHELF_28054 = 28054; public static final int BOOKSHELF_28055 = 28055; public static final int BOOKSHELF_28056 = 28056; public static final int BOOKSHELF_28057 = 28057; public static final int BOOKSHELF_28058 = 28058; public static final int BOOKSHELF_28059 = 28059; public static final int BOOKSHELF_28060 = 28060; public static final int BOOKSHELF_28061 = 28061; public static final int BOOKSHELF_28062 = 28062; public static final int BOOKSHELF_28063 = 28063; public static final int BOOKSHELF_28064 = 28064; public static final int BOOKSHELF_28065 = 28065; public static final int BOOKSHELF_28066 = 28066; public static final int BOOKSHELF_28067 = 28067; public static final int BOOKSHELF_28068 = 28068; public static final int BOOKSHELF_28069 = 28069; public static final int BOOKSHELF_28070 = 28070; public static final int BOOKSHELF_28071 = 28071; public static final int BOOKSHELF_28072 = 28072; public static final int BOOKSHELF_28073 = 28073; public static final int BOOKSHELF_28074 = 28074; public static final int BOOKSHELF_28075 = 28075; public static final int BOOKSHELF_28076 = 28076; public static final int BOOKSHELF_28077 = 28077; public static final int BOOKSHELF_28078 = 28078; public static final int BOOKSHELF_28079 = 28079; public static final int BOOKSHELF_28080 = 28080; public static final int BOOKSHELF_28081 = 28081; public static final int BOOKSHELF_28082 = 28082; public static final int BOOKSHELF_28083 = 28083; public static final int BOOKSHELF_28084 = 28084; public static final int BOOKSHELF_28085 = 28085; public static final int BOOKSHELF_28086 = 28086; public static final int BOOKSHELF_28087 = 28087; public static final int BOOKSHELF_28088 = 28088; public static final int BOOKSHELF_28089 = 28089; public static final int BOOKSHELF_28090 = 28090; public static final int BOOKSHELF_28091 = 28091; public static final int BOOKSHELF_28092 = 28092; public static final int BOOKSHELF_28093 = 28093; public static final int BOOKSHELF_28094 = 28094; public static final int BOOKSHELF_28095 = 28095; public static final int BOOKSHELF_28096 = 28096; public static final int BOOKSHELF_28097 = 28097; public static final int BOOKSHELF_28098 = 28098; public static final int BOOKSHELF_28099 = 28099; public static final int BOOKSHELF_28100 = 28100; public static final int BOOKSHELF_28101 = 28101; public static final int BOOKSHELF_28102 = 28102; public static final int BOOKSHELF_28103 = 28103; public static final int BOOKSHELF_28104 = 28104; public static final int BOOKSHELF_28105 = 28105; public static final int BOOKSHELF_28106 = 28106; public static final int BOOKSHELF_28107 = 28107; public static final int BOOKSHELF_28108 = 28108; public static final int BOOKSHELF_28109 = 28109; public static final int BOOKSHELF_28110 = 28110; public static final int BOOKSHELF_28111 = 28111; public static final int BOOKSHELF_28112 = 28112; public static final int BOOKSHELF_28113 = 28113; public static final int BOOKSHELF_28114 = 28114; public static final int BOOKSHELF_28115 = 28115; public static final int BOOKSHELF_28116 = 28116; public static final int BOOKSHELF_28117 = 28117; public static final int BOOKSHELF_28118 = 28118; public static final int BOOKSHELF_28119 = 28119; public static final int BOOKSHELF_28120 = 28120; public static final int BOOKSHELF_28121 = 28121; public static final int BOOKSHELF_28122 = 28122; public static final int BOOKSHELF_28123 = 28123; public static final int BOOKSHELF_28124 = 28124; public static final int BOOKSHELF_28125 = 28125; public static final int BOOKSHELF_28126 = 28126; public static final int BOOKSHELF_28127 = 28127; public static final int BOOKSHELF_28128 = 28128; public static final int BOOKSHELF_28129 = 28129; public static final int BOOKSHELF_28130 = 28130; public static final int BOOKSHELF_28131 = 28131; public static final int BOOKSHELF_28132 = 28132; public static final int BOOKSHELF_28133 = 28133; public static final int BOOKSHELF_28134 = 28134; public static final int BOOKSHELF_28135 = 28135; public static final int BOOKSHELF_28136 = 28136; public static final int BOOKSHELF_28137 = 28137; public static final int BOOKSHELF_28138 = 28138; public static final int BOOKSHELF_28139 = 28139; public static final int BOOKSHELF_28140 = 28140; public static final int BOOKSHELF_28141 = 28141; public static final int BOOKSHELF_28142 = 28142; public static final int BOOKSHELF_28143 = 28143; public static final int BOOKSHELF_28144 = 28144; public static final int BOOKSHELF_28145 = 28145; public static final int BOOKSHELF_28146 = 28146; public static final int BOOKSHELF_28147 = 28147; public static final int BOOKSHELF_28148 = 28148; public static final int BOOKSHELF_28149 = 28149; public static final int BOOKSHELF_28150 = 28150; public static final int BOOKSHELF_28151 = 28151; public static final int BOOKSHELF_28152 = 28152; public static final int BOOKSHELF_28153 = 28153; public static final int BOOKSHELF_28154 = 28154; public static final int BOOKSHELF_28155 = 28155; public static final int BOOKSHELF_28156 = 28156; public static final int BOOKSHELF_28157 = 28157; public static final int BOOKSHELF_28158 = 28158; public static final int BOOKSHELF_28159 = 28159; public static final int BOOKSHELF_28160 = 28160; public static final int BOOKSHELF_28161 = 28161; public static final int BOOKSHELF_28162 = 28162; public static final int BOOKSHELF_28163 = 28163; public static final int BOOKSHELF_28164 = 28164; public static final int BOOKSHELF_28165 = 28165; public static final int BOOKSHELF_28166 = 28166; public static final int BOOKSHELF_28167 = 28167; public static final int BOOKSHELF_28168 = 28168; public static final int BOOKSHELF_28169 = 28169; public static final int BOOKSHELF_28170 = 28170; public static final int BOOKSHELF_28171 = 28171; public static final int BOOKSHELF_28172 = 28172; public static final int BOOKSHELF_28173 = 28173; public static final int BOOKSHELF_28174 = 28174; public static final int BOOKSHELF_28175 = 28175; public static final int BOOKSHELF_28176 = 28176; public static final int BOOKSHELF_28177 = 28177; public static final int BOOKSHELF_28178 = 28178; public static final int BOOKSHELF_28179 = 28179; public static final int BOOKSHELF_28180 = 28180; public static final int BOOKSHELF_28181 = 28181; public static final int BOOKSHELF_28182 = 28182; public static final int BOOKSHELF_28183 = 28183; public static final int BOOKSHELF_28184 = 28184; public static final int BOOKSHELF_28185 = 28185; public static final int BOOKSHELF_28186 = 28186; public static final int BOOKSHELF_28187 = 28187; public static final int BOOKSHELF_28188 = 28188; public static final int BOOKSHELF_28189 = 28189; public static final int BOOKSHELF_28190 = 28190; public static final int BOOKSHELF_28191 = 28191; public static final int BOOKSHELF_28192 = 28192; public static final int BOOKSHELF_28193 = 28193; public static final int BOOKSHELF_28194 = 28194; public static final int BOOKSHELF_28195 = 28195; public static final int BOOKSHELF_28196 = 28196; public static final int BOOKSHELF_28197 = 28197; public static final int BOOKSHELF_28198 = 28198; public static final int BOOKSHELF_28199 = 28199; public static final int BOOKSHELF_28200 = 28200; public static final int BOOKSHELF_28201 = 28201; public static final int BOOKSHELF_28202 = 28202; public static final int BOOKSHELF_28203 = 28203; public static final int BOOKSHELF_28204 = 28204; public static final int BOOKSHELF_28205 = 28205; public static final int BOOKSHELF_28206 = 28206; public static final int BOOKSHELF_28207 = 28207; public static final int BOOKSHELF_28208 = 28208; public static final int BOOKSHELF_28209 = 28209; public static final int BOOKSHELF_28210 = 28210; public static final int BOOKSHELF_28211 = 28211; public static final int BOOKSHELF_28212 = 28212; public static final int BOOKSHELF_28213 = 28213; public static final int BOOKSHELF_28214 = 28214; public static final int BOOKSHELF_28215 = 28215; public static final int BOOKSHELF_28216 = 28216; public static final int BOOKSHELF_28217 = 28217; public static final int BOOKSHELF_28218 = 28218; public static final int BOOKSHELF_28219 = 28219; public static final int BOOKSHELF_28220 = 28220; public static final int BOOKSHELF_28221 = 28221; public static final int BOOKSHELF_28222 = 28222; public static final int BOOKSHELF_28223 = 28223; public static final int BOOKSHELF_28224 = 28224; public static final int BOOKSHELF_28225 = 28225; public static final int BOOKSHELF_28226 = 28226; public static final int BOOKSHELF_28227 = 28227; public static final int BOOKSHELF_28228 = 28228; public static final int BOOKSHELF_28229 = 28229; public static final int BOOKSHELF_28230 = 28230; public static final int BOOKSHELF_28231 = 28231; public static final int BOOKSHELF_28232 = 28232; public static final int BOOKSHELF_28233 = 28233; public static final int BOOKSHELF_28234 = 28234; public static final int BOOKSHELF_28235 = 28235; public static final int BOOKSHELF_28236 = 28236; public static final int BOOKSHELF_28237 = 28237; public static final int BOOKSHELF_28238 = 28238; public static final int BOOKSHELF_28239 = 28239; public static final int BOOKSHELF_28240 = 28240; public static final int BOOKSHELF_28241 = 28241; public static final int BOOKSHELF_28242 = 28242; public static final int BOOKSHELF_28243 = 28243; public static final int BOOKSHELF_28244 = 28244; public static final int BOOKSHELF_28245 = 28245; public static final int BOOKSHELF_28246 = 28246; public static final int BOOKSHELF_28247 = 28247; public static final int BOOKSHELF_28248 = 28248; public static final int BOOKSHELF_28249 = 28249; public static final int BOOKSHELF_28250 = 28250; public static final int BOOKSHELF_28251 = 28251; public static final int BOOKSHELF_28252 = 28252; public static final int BOOKSHELF_28253 = 28253; public static final int BOOKSHELF_28254 = 28254; public static final int BOOKSHELF_28255 = 28255; public static final int BOOKSHELF_28256 = 28256; public static final int BOOKSHELF_28257 = 28257; public static final int BOOKSHELF_28258 = 28258; public static final int BOOKSHELF_28259 = 28259; public static final int BOOKSHELF_28260 = 28260; public static final int BOOKSHELF_28261 = 28261; public static final int BOOKSHELF_28262 = 28262; public static final int BOOKSHELF_28263 = 28263; public static final int BOOKSHELF_28264 = 28264; public static final int BOOKSHELF_28265 = 28265; public static final int BOOKSHELF_28266 = 28266; public static final int BOOKSHELF_28267 = 28267; public static final int BOOKSHELF_28268 = 28268; public static final int BOOKSHELF_28269 = 28269; public static final int BOOKSHELF_28270 = 28270; public static final int BOOKSHELF_28271 = 28271; public static final int BOOKSHELF_28272 = 28272; public static final int BOOKSHELF_28273 = 28273; public static final int BOOKSHELF_28274 = 28274; public static final int BOOKSHELF_28275 = 28275; public static final int BOOKSHELF_28276 = 28276; public static final int BOOKSHELF_28277 = 28277; public static final int BOOKSHELF_28278 = 28278; public static final int BOOKSHELF_28279 = 28279; public static final int BOOKSHELF_28280 = 28280; public static final int BOOKSHELF_28281 = 28281; public static final int BOOKSHELF_28282 = 28282; public static final int BOOKSHELF_28283 = 28283; public static final int BOOKSHELF_28284 = 28284; public static final int BOOKSHELF_28285 = 28285; public static final int BOOKSHELF_28286 = 28286; public static final int BOOKSHELF_28287 = 28287; public static final int BOOKSHELF_28288 = 28288; public static final int BOOKSHELF_28289 = 28289; public static final int BOOKSHELF_28290 = 28290; public static final int BOOKSHELF_28291 = 28291; public static final int BOOKSHELF_28292 = 28292; public static final int BOOKSHELF_28293 = 28293; public static final int BOOKSHELF_28294 = 28294; public static final int BOOKSHELF_28295 = 28295; public static final int BOOKSHELF_28296 = 28296; public static final int BOOKSHELF_28297 = 28297; public static final int BOOKSHELF_28298 = 28298; public static final int BOOKSHELF_28299 = 28299; public static final int BOOKSHELF_28300 = 28300; public static final int BOOKSHELF_28301 = 28301; public static final int BOOKSHELF_28302 = 28302; public static final int BOOKSHELF_28303 = 28303; public static final int BOOKSHELF_28304 = 28304; public static final int BOOKSHELF_28305 = 28305; public static final int BOOKSHELF_28306 = 28306; public static final int BOOKSHELF_28307 = 28307; public static final int BOOKSHELF_28308 = 28308; public static final int BOOKSHELF_28309 = 28309; public static final int BOOKSHELF_28310 = 28310; public static final int BOOKSHELF_28311 = 28311; public static final int BOOKSHELF_28312 = 28312; public static final int BOOKSHELF_28313 = 28313; public static final int BOOKSHELF_28314 = 28314; public static final int BOOKSHELF_28315 = 28315; public static final int BOOKSHELF_28316 = 28316; public static final int BOOKSHELF_28317 = 28317; public static final int BOOKSHELF_28318 = 28318; public static final int BOOKSHELF_28319 = 28319; public static final int BOOKSHELF_28320 = 28320; public static final int BOOKSHELF_28321 = 28321; public static final int BOOKSHELF_28322 = 28322; public static final int BOOKSHELF_28323 = 28323; public static final int BOOKSHELF_28324 = 28324; public static final int BOOKSHELF_28325 = 28325; public static final int BOOKSHELF_28326 = 28326; public static final int BOOKSHELF_28327 = 28327; public static final int BOOKSHELF_28328 = 28328; public static final int BOOKSHELF_28329 = 28329; public static final int BOOKSHELF_28330 = 28330; public static final int BOOKSHELF_28331 = 28331; public static final int BOOKSHELF_28332 = 28332; public static final int BOOKSHELF_28333 = 28333; public static final int BOOKSHELF_28334 = 28334; public static final int BOOKSHELF_28335 = 28335; public static final int BOOKSHELF_28336 = 28336; public static final int BOOKSHELF_28337 = 28337; public static final int BOOKSHELF_28338 = 28338; public static final int BOOKSHELF_28339 = 28339; public static final int BOOKSHELF_28340 = 28340; public static final int BOOKSHELF_28341 = 28341; public static final int BOOKSHELF_28342 = 28342; public static final int BOOKSHELF_28343 = 28343; public static final int BOOKSHELF_28344 = 28344; public static final int BOOKSHELF_28345 = 28345; public static final int BOOKSHELF_28346 = 28346; public static final int BOOKSHELF_28347 = 28347; public static final int BOOKSHELF_28348 = 28348; public static final int BOOKSHELF_28349 = 28349; public static final int BOOKSHELF_28350 = 28350; public static final int TABLE_28363 = 28363; public static final int TABLE_28364 = 28364; public static final int TABLE_28365 = 28365; public static final int TABLE_28366 = 28366; public static final int TABLE_28367 = 28367; public static final int TABLE_28368 = 28368; public static final int PARCHMENT = 28385; public static final int PARCHMENT_28386 = 28386; public static final int PARCHMENT_28387 = 28387; public static final int PARCHMENT_28388 = 28388; public static final int PARCHMENT_28389 = 28389; public static final int PARCHMENT_28390 = 28390; public static final int PARCHMENT_28391 = 28391; public static final int PARCHMENT_28392 = 28392; public static final int VIALS = 28393; public static final int VIALS_28394 = 28394; public static final int BOOKCASE_28395 = 28395; public static final int BOOKCASE_28396 = 28396; public static final int BOOKCASE_28397 = 28397; public static final int BOOKS_28398 = 28398; public static final int BOOKS_28399 = 28399; public static final int BOOKS_28400 = 28400; public static final int TABLE_28401 = 28401; public static final int TABLE_28402 = 28402; public static final int TABLE_28403 = 28403; public static final int TABLE_28404 = 28404; public static final int SPIRIT_PUMP = 28406; public static final int SPIRIT_PUMP_28407 = 28407; public static final int BARREL_28408 = 28408; public static final int BARREL_28409 = 28409; public static final int TABLE_28411 = 28411; public static final int TABLE_28412 = 28412; public static final int TABLE_28413 = 28413; public static final int TABLE_28414 = 28414; public static final int TABLE_28415 = 28415; public static final int TABLE_28416 = 28416; public static final int TABLE_28417 = 28417; public static final int TABLE_28418 = 28418; public static final int BED_28419 = 28419; public static final int BED_28420 = 28420; public static final int BED_28421 = 28421; public static final int SHELF_28422 = 28422; public static final int SHELF_28423 = 28423; public static final int SHELF_28424 = 28424; public static final int SHELF_28425 = 28425; public static final int TABLE_28426 = 28426; public static final int TABLE_28427 = 28427; public static final int TABLE_28428 = 28428; public static final int BANK_BOOTH_28429 = 28429; public static final int BANK_BOOTH_28430 = 28430; public static final int BANK_BOOTH_28431 = 28431; public static final int BANK_BOOTH_28432 = 28432; public static final int BANK_BOOTH_28433 = 28433; public static final int GRAVE_28434 = 28434; public static final int GRAVE_28435 = 28435; public static final int GRAVE_28436 = 28436; public static final int GRAVE_28437 = 28437; public static final int GRAVE_28438 = 28438; public static final int GRAVE_28439 = 28439; public static final int GRAVE_28440 = 28440; public static final int GRAVE_28441 = 28441; public static final int GRAVE_28442 = 28442; public static final int GRAVE_28443 = 28443; public static final int GRAVE_28444 = 28444; public static final int GRAVE_28445 = 28445; public static final int GRAVE_28446 = 28446; public static final int GRAVE_28447 = 28447; public static final int GRAVE_28448 = 28448; public static final int GRAVE_28449 = 28449; public static final int GRAVE_28450 = 28450; public static final int GRAVE_28451 = 28451; public static final int ALTAR_28455 = 28455; public static final int DOOR_28456 = 28456; public static final int DOOR_28457 = 28457; public static final int DOOR_28458 = 28458; public static final int DOOR_28459 = 28459; public static final int DOOR_28460 = 28460; public static final int DOOR_28461 = 28461; public static final int DOOR_28462 = 28462; public static final int DOOR_28463 = 28463; public static final int DOOR_28464 = 28464; public static final int DOOR_28465 = 28465; public static final int DOOR_28466 = 28466; public static final int DOOR_28467 = 28467; public static final int DOOR_28468 = 28468; public static final int DOOR_28469 = 28469; public static final int DOOR_28470 = 28470; public static final int DOOR_28471 = 28471; public static final int DOOR_28479 = 28479; public static final int DOOR_28480 = 28480; public static final int DOOR_28481 = 28481; public static final int DOOR_28482 = 28482; public static final int VOLCANIC_SULPHUR = 28496; public static final int VOLCANIC_SULPHUR_28497 = 28497; public static final int VOLCANIC_SULPHUR_28498 = 28498; public static final int BED_28515 = 28515; public static final int BED_28516 = 28516; public static final int BED_28517 = 28517; public static final int DOUBLE_BED = 28518; public static final int DOUBLE_BED_28519 = 28519; public static final int DOUBLE_BED_28520 = 28520; public static final int SLEEPING_BAG_28521 = 28521; public static final int GLASS_TABLE = 28522; public static final int TABLE_28523 = 28523; public static final int WORK_TABLE = 28524; public static final int SMALL_TABLE_28525 = 28525; public static final int WHEELY_TABLE = 28526; public static final int VELVET_STOOL = 28527; public static final int VELVET_STOOL_28528 = 28528; public static final int VELVET_CHAIR = 28529; public static final int WOODEN_CHAIR = 28530; public static final int VELVET_ROUND_CHAIR = 28531; public static final int WARDROBE_28532 = 28532; public static final int WARDROBE_28533 = 28533; public static final int WARDROBE_28534 = 28534; public static final int DRAWERS_28535 = 28535; public static final int DRAWERS_28536 = 28536; public static final int DRAWERS_28537 = 28537; public static final int SINK_28538 = 28538; public static final int METAL_LADDER = 28539; public static final int METAL_LADDER_28540 = 28540; public static final int BANK_BOOTH_28546 = 28546; public static final int BANK_BOOTH_28547 = 28547; public static final int BANK_BOOTH_28548 = 28548; public static final int BANK_BOOTH_28549 = 28549; public static final int CLOSED_BOOTH_28550 = 28550; public static final int BANK_LIGHT = 28551; public static final int BANK_LIGHT_28552 = 28552; public static final int BANK_PAPERS = 28553; public static final int ARMOUR_STAND_28559 = 28559; public static final int ARMOUR_STAND_28560 = 28560; public static final int DRAWERS_28561 = 28561; public static final int LOVAKITE_FURNACE = 28562; public static final int ANVIL_28563 = 28563; public static final int ORNAMENTAL_ANVIL = 28564; public static final int FURNACE_28565 = 28565; public static final int ALTAR_28566 = 28566; public static final int CHURCH_PEW_28567 = 28567; public static final int HARD_ROCK = 28579; public static final int HARD_ROCK_28580 = 28580; public static final int CAVITY = 28581; public static final int CAVITY_28582 = 28582; public static final int POT_OF_DYNAMITE = 28583; public static final int POT_OF_DYNAMITE_28584 = 28584; public static final int POT_OF_DYNAMITE_28585 = 28585; public static final int POT_OF_DYNAMITE_28586 = 28586; public static final int SHATTERED_ROCKFACE = 28587; public static final int SHATTERED_ROCKFACE_28588 = 28588; public static final int ORE_SACK = 28592; public static final int BANK_CHEST_28594 = 28594; public static final int BANK_CHEST_28595 = 28595; public static final int ROCKS_28596 = 28596; public static final int ROCKS_28597 = 28597; public static final int PLATFORM_SUPPORT = 28604; public static final int PLATFORM_SUPPORT_28605 = 28605; public static final int PLATFORM_SUPPORT_28606 = 28606; public static final int PLATFORM_SUPPORT_28607 = 28607; public static final int PLATFORM_SUPPORT_28608 = 28608; public static final int PLATFORM_SUPPORT_28609 = 28609; public static final int PLATFORM_SUPPORT_28610 = 28610; public static final int PLATFORM_SUPPORT_28611 = 28611; public static final int PLATFORM_SUPPORT_28612 = 28612; public static final int PLATFORM_SUPPORT_28613 = 28613; public static final int PLATFORM_SUPPORT_28614 = 28614; public static final int PLATFORM_SUPPORT_28615 = 28615; public static final int PLATFORM_SUPPORT_28616 = 28616; public static final int PLATFORM_SUPPORT_28617 = 28617; public static final int LADDER_28618 = 28618; public static final int LADDER_28619 = 28619; public static final int LADDER_28620 = 28620; public static final int COMPROMISED_SUPPORT = 28621; public static final int COMPROMISED_SUPPORT_28622 = 28622; public static final int COMPROMISED_FLOORBOARDS = 28623; public static final int COMPROMISED_FLOORBOARDS_28624 = 28624; public static final int GAS_CYLINDER = 28625; public static final int GAS_CYLINDER_28626 = 28626; public static final int CRATE_28639 = 28639; public static final int CRATES_28640 = 28640; public static final int CRATES_28641 = 28641; public static final int CRATES_28642 = 28642; public static final int CRATES_28643 = 28643; public static final int CRATES_28644 = 28644; public static final int BARREL_28645 = 28645; public static final int BARREL_28646 = 28646; public static final int ANCHOR_28647 = 28647; public static final int CELL_WALL = 28648; public static final int PIPE_28649 = 28649; public static final int WINDOW_28650 = 28650; public static final int DOOR_28651 = 28651; public static final int CRATE_28652 = 28652; public static final int BARREL_28653 = 28653; public static final int VINE_28654 = 28654; public static final int FENCE_28655 = 28655; public static final int OPENING_28656 = 28656; public static final int TREE_28657 = 28657; public static final int TREE_28658 = 28658; public static final int TREE_28660 = 28660; public static final int FIRE_REMAINS_28661 = 28661; public static final int FIRE_REMAINS_28662 = 28662; public static final int CUPBOARD_28664 = 28664; public static final int CUPBOARD_28665 = 28665; public static final int GNOME_CRATES_28666 = 28666; public static final int GNOME_BARRELS_28667 = 28667; public static final int CANDLES_28668 = 28668; public static final int GNOME_TABLE_28669 = 28669; public static final int GNOME_STATUE_28670 = 28670; public static final int TRACKS_28671 = 28671; public static final int TRACKS_28672 = 28672; public static final int JUNGLE_GRASS_28673 = 28673; public static final int JUNGLE_GRASS_28674 = 28674; public static final int KRUK = 28675; public static final int BAMBOO_LADDER_28676 = 28676; public static final int ROWBOAT_28677 = 28677; public static final int ROWBOAT_28678 = 28678; public static final int ROWBOAT_28679 = 28679; public static final int WALL_28681 = 28681; public static final int PASSAGE_28682 = 28682; public static final int PASSAGE_28683 = 28683; public static final int CAVERN_ENTRANCE = 28684; public static final int CAVERN_EXIT = 28685; public static final int CAVERN_ENTRANCE_28686 = 28686; public static final int ROPE_28687 = 28687; public static final int RUPTURED_CAVERN = 28717; public static final int RUPTURED_CAVERN_28718 = 28718; public static final int RUPTURED_CAVERN_28719 = 28719; public static final int RUPTURED_CAVERN_28720 = 28720; public static final int BOULDER_28721 = 28721; public static final int GRAVESTONE_28723 = 28723; public static final int MONKEYBARS_28724 = 28724; public static final int MONKEYBARS_28727 = 28727; public static final int ROCKS_28752 = 28752; public static final int ROCKS_28753 = 28753; public static final int VINE_28754 = 28754; public static final int VINE_28755 = 28755; public static final int WALL_SUPPORT_28756 = 28756; public static final int ROCKY_LEDGE_28757 = 28757; public static final int PRESSURE_PAD_28758 = 28758; public static final int PILLAR_28759 = 28759; public static final int LOG_BALANCE_28763 = 28763; public static final int HOLE_28764 = 28764; public static final int GAP_28765 = 28765; public static final int GAP_28766 = 28766; public static final int DODGY_GROUND = 28767; public static final int DODGY_GROUND_28768 = 28768; public static final int BROKEN_GROUND = 28769; public static final int HOLE_28772 = 28772; public static final int ROPE_28775 = 28775; public static final int TRIPWIRE_28776 = 28776; public static final int FLOOR_SPIKES_28777 = 28777; public static final int DART_TRAP = 28778; public static final int BLADE_28779 = 28779; public static final int BLADE_28780 = 28780; public static final int BLADE_28781 = 28781; public static final int SPINNING_BLADES_28782 = 28782; public static final int DOOR_28783 = 28783; public static final int LOCKED_CHEST = 28785; public static final int ROCKFALL_28786 = 28786; public static final int ROCKSLIDE_28788 = 28788; public static final int WEB_28789 = 28789; public static final int SLICED_WEB_28790 = 28790; public static final int FIRE_28791 = 28791; public static final int CHEST_28792 = 28792; public static final int CHEST_28793 = 28793; public static final int BRONZE_DOOR = 28794; public static final int CHEST_28796 = 28796; public static final int CHEST_28797 = 28797; public static final int WALL_28798 = 28798; public static final int PASSAGE_28799 = 28799; public static final int TREE_28801 = 28801; public static final int LECTERN_28802 = 28802; public static final int JUNGLE_PLANT_28804 = 28804; public static final int BANK_CHEST_28816 = 28816; public static final int BRAZIER_28817 = 28817; public static final int BURNING_BRAZIER = 28818; public static final int RUPTURED_CAVERN_28820 = 28820; public static final int RUPTURED_CAVERN_28821 = 28821; public static final int PORTAL_28822 = 28822; public static final int FRUIT_STALL_28823 = 28823; public static final int LARGE_BOULDER = 28824; public static final int LARGE_BOULDER_28825 = 28825; public static final int LARGE_BOULDER_28826 = 28826; public static final int MONKEY_TRAP = 28827; public static final int MONKEY_TRAP_28828 = 28828; public static final int MONKEY_TRAP_28829 = 28829; public static final int LARGE_BOULDER_28830 = 28830; public static final int LARGE_BOULDER_28831 = 28831; public static final int MONKEY_TRAP_28832 = 28832; public static final int MONKEY_TRAP_28833 = 28833; public static final int MONKEY_TRAP_28834 = 28834; public static final int MINECART = 28835; public static final int CONTROL_PANEL_28837 = 28837; public static final int LOOSE_RAILING_28849 = 28849; public static final int GATE_28851 = 28851; public static final int GATE_28852 = 28852; public static final int CAVE_28855 = 28855; public static final int VINE_28856 = 28856; public static final int ROPE_LADDER_28857 = 28857; public static final int ROPE_LADDER_28858 = 28858; public static final int SERVANTS_MONEYBAG = 28859; public static final int BANK_CHEST_28861 = 28861; public static final int TABLE_28862 = 28862; public static final int TABLE_28863 = 28863; public static final int COUNTER_28864 = 28864; public static final int FUNERAL_PYRE_28865 = 28865; public static final int FUNERAL_PYRE_28866 = 28866; public static final int ROCKS_28890 = 28890; public static final int CRACK_28892 = 28892; public static final int STONE_28893 = 28893; public static final int VINE_LADDER = 28894; public static final int VINE_28895 = 28895; public static final int VINE_28896 = 28896; public static final int VINE_28897 = 28897; public static final int VINE_28898 = 28898; public static final int ALTAR_28900 = 28900; public static final int BOULDER_28901 = 28901; public static final int BOULDER_28904 = 28904; public static final int STEEP_ROOF = 28912; public static final int GAP_28913 = 28913; public static final int MYSTERIOUS_RUINS = 28914; public static final int HOLE_28915 = 28915; public static final int INANIMATE_ALTAR = 28922; public static final int AWAKENED_ALTAR = 28923; public static final int ALTAR_28924 = 28924; public static final int PORTAL_28925 = 28925; public static final int JUNA = 28928; public static final int JUNA_28929 = 28929; public static final int BROKEN_CART_28930 = 28930; public static final int BROKEN_CART_28931 = 28931; public static final int ASGARNIAN_ALE_28932 = 28932; public static final int STASH_MEDIUM_28933 = 28933; public static final int INCONSPICUOUS_BUSH_HARD = 28934; public static final int STASH_HARD = 28935; public static final int INCONSPICUOUS_HOLE_HARD = 28936; public static final int STASH_HARD_28937 = 28937; public static final int INCONSPICUOUS_ROCKS_HARD = 28938; public static final int STASH_HARD_28939 = 28939; public static final int INCONSPICUOUS_CRATE_HARD = 28940; public static final int STASH_HARD_28941 = 28941; public static final int INCONSPICUOUS_BUSH_ELITE = 28942; public static final int STASH_ELITE = 28943; public static final int INCONSPICUOUS_HOLE_ELITE = 28944; public static final int STASH_ELITE_28945 = 28945; public static final int INCONSPICUOUS_ROCKS_ELITE = 28946; public static final int STASH_ELITE_28947 = 28947; public static final int INCONSPICUOUS_CRATE_ELITE = 28948; public static final int STASH_ELITE_28949 = 28949; public static final int INCONSPICUOUS_BUSH_MASTER = 28950; public static final int STASH_MASTER = 28951; public static final int INCONSPICUOUS_HOLE_MASTER = 28952; public static final int STASH_MASTER_28953 = 28953; public static final int INCONSPICUOUS_ROCKS_MASTER = 28954; public static final int STASH_MASTER_28955 = 28955; public static final int INCONSPICUOUS_CRATE_MASTER = 28956; public static final int STASH_MASTER_28957 = 28957; public static final int STAIRS_29061 = 29061; public static final int LADDER_29062 = 29062; public static final int REWARD_CHEST = 29063; public static final int SCOREBOARD_29064 = 29064; public static final int PLINTH_29065 = 29065; public static final int DOOR_29066 = 29066; public static final int DOOR_29067 = 29067; public static final int DOOR_29068 = 29068; public static final int CHEST_29069 = 29069; public static final int CHEST_29070 = 29070; public static final int CHEST_29071 = 29071; public static final int CHEST_29072 = 29072; public static final int DRAWERS_29073 = 29073; public static final int DRAWERS_29074 = 29074; public static final int DRAWERS_29075 = 29075; public static final int DRAWERS_29076 = 29076; public static final int CUPBOARD_29077 = 29077; public static final int CUPBOARD_29078 = 29078; public static final int CUPBOARD_29079 = 29079; public static final int CUPBOARD_29080 = 29080; public static final int CRATE_29081 = 29081; public static final int ROWBOAT_29082 = 29082; public static final int STEPPING_STONE_29083 = 29083; public static final int CAMPFIRE_29085 = 29085; public static final int COFFER = 29087; public static final int SHRINE = 29088; public static final int LADDER_29089 = 29089; public static final int MYSTERIOUS_RUINS_29090 = 29090; public static final int VENDING_SHRINE = 29091; public static final int LADDER_29092 = 29092; public static final int MYSTERIOUS_RUINS_29094 = 29094; public static final int MYSTERIOUS_RUINS_29095 = 29095; public static final int MYSTERIOUS_RUINS_29096 = 29096; public static final int MYSTERIOUS_RUINS_29097 = 29097; public static final int MYSTERIOUS_RUINS_29098 = 29098; public static final int MYSTERIOUS_RUINS_29099 = 29099; public static final int WELL_29100 = 29100; public static final int BARREL_29101 = 29101; public static final int ROCK_29102 = 29102; public static final int BANK_DEPOSIT_BOX_29103 = 29103; public static final int BANK_DEPOSIT_BOX_29104 = 29104; public static final int BANK_DEPOSIT_BOX_29105 = 29105; public static final int BANK_DEPOSIT_BOX_29106 = 29106; public static final int POT_29107 = 29107; public static final int BANK_DEPOSIT_POT = 29108; public static final int TEAK_BENCH_29111 = 29111; public static final int TEAK_BENCH_29112 = 29112; public static final int GNOME_BENCH = 29113; public static final int GNOME_BENCH_29114 = 29114; public static final int MARBLE_BENCH = 29115; public static final int MARBLE_BENCH_29116 = 29116; public static final int OBSIDIAN_BENCH = 29117; public static final int OBSIDIAN_BENCH_29118 = 29118; public static final int TIP_JAR_SPACE = 29119; public static final int TELEPORT_SPACE = 29120; public static final int TOPIARY_SPACE = 29121; public static final int POOL_SPACE = 29122; public static final int THEME_SPACE = 29123; public static final int THEME_SPACE_29124 = 29124; public static final int THEME_SPACE_29125 = 29125; public static final int THEME_SPACE_29126 = 29126; public static final int THEME_SPACE_29127 = 29127; public static final int THEME_SPACE_29128 = 29128; public static final int THEME_SPACE_29129 = 29129; public static final int THEME_SPACE_29130 = 29130; public static final int FENCE_SPACE = 29131; public static final int FENCE_SPACE_29132 = 29132; public static final int FENCE_SPACE_29133 = 29133; public static final int SEATING_SPACE_29136 = 29136; public static final int SEATING_SPACE_29137 = 29137; public static final int SEATING_SPACE_29138 = 29138; public static final int SEATING_SPACE_29139 = 29139; public static final int ALTAR_SPACE_29140 = 29140; public static final int ADVENTURE_LOG_SPACE = 29141; public static final int JEWELLERY_BOX_SPACE = 29142; public static final int BOSS_LAIR_SPACE = 29143; public static final int DISPLAY_SPACE = 29144; public static final int QUEST_LIST_SPACE = 29145; public static final int TIP_JAR = 29146; public static final int ANCIENT_ALTAR = 29147; public static final int LUNAR_ALTAR = 29148; public static final int DARK_ALTAR_29149 = 29149; public static final int MAHOGANY_ADVENTURE_LOG = 29151; public static final int GILDED_ADVENTURE_LOG = 29152; public static final int MARBLE_ADVENTURE_LOG = 29153; public static final int BASIC_JEWELLERY_BOX = 29154; public static final int FANCY_JEWELLERY_BOX = 29155; public static final int ORNATE_JEWELLERY_BOX = 29156; public static final int BOSS_LAIR_DISPLAY = 29157; public static final int KRAKEN_DISPLAY = 29158; public static final int ZULRAH_DISPLAY = 29159; public static final int KALPHITE_QUEEN_DISPLAY = 29160; public static final int CERBERUS_DISPLAY = 29161; public static final int ABYSSAL_SIRE_DISPLAY = 29162; public static final int SKOTIZO_DISPLAY = 29163; public static final int MOUNTED_EMBLEM = 29164; public static final int MOUNTED_COINS = 29165; public static final int CAPE_HANGER = 29166; public static final int MOUNTED_ACHIEVEMENT_DIARY_CAPE = 29167; public static final int MOUNTED_ACHIEVEMENT_DIARY_CAPE_29168 = 29168; public static final int MOUNTED_FIRE_CAPE = 29169; public static final int MOUNTED_MAX_CAPE_29170 = 29170; public static final int MOUNTED_MAX_CAPE_29171 = 29171; public static final int MOUNTED_MAX_CAPE_29172 = 29172; public static final int MOUNTED_MAX_CAPE_29173 = 29173; public static final int MOUNTED_MAX_CAPE_29174 = 29174; public static final int MOUNTED_MAX_CAPE_29175 = 29175; public static final int MOUNTED_MUSIC_CAPE = 29176; public static final int MOUNTED_MUSIC_CAPE_29177 = 29177; public static final int MOUNTED_QUEST_CAPE = 29178; public static final int MOUNTED_QUEST_CAPE_29179 = 29179; public static final int MOUNTED_AGILITY_CAPE = 29180; public static final int MOUNTED_AGILITY_CAPE_T = 29181; public static final int MOUNTED_ATTACK_CAPE = 29182; public static final int MOUNTED_ATTACK_CAPE_T = 29183; public static final int MOUNTED_CONSTRUCTION_CAPE = 29184; public static final int MOUNTED_CONSTRUCTION_CAPE_T = 29185; public static final int MOUNTED_COOKING_CAPE = 29186; public static final int MOUNTED_COOKING_CAPE_T = 29187; public static final int MOUNTED_CRAFTING_CAPE = 29188; public static final int MOUNTED_CRAFTING_CAPE_T = 29189; public static final int MOUNTED_DEFENCE_CAPE = 29190; public static final int MOUNTED_DEFENCE_CAPE_T = 29191; public static final int MOUNTED_FARMING_CAPE = 29192; public static final int MOUNTED_FARMING_CAPE_T = 29193; public static final int MOUNTED_FIREMAKING_CAPE = 29194; public static final int MOUNTED_FIREMAKING_CAPE_T = 29195; public static final int MOUNTED_FISHING_CAPE = 29196; public static final int MOUNTED_FISHING_CAPE_T = 29197; public static final int MOUNTED_FLETCHING_CAPE = 29198; public static final int MOUNTED_FLETCHING_CAPE_T = 29199; public static final int MOUNTED_HERBLORE_CAPE = 29200; public static final int MOUNTED_HERBLORE_CAPE_T = 29201; public static final int MOUNTED_HITPOINTS_CAPE = 29202; public static final int MOUNTED_HITPOINTS_CAPE_T = 29203; public static final int MOUNTED_HUNTING_CAPE = 29204; public static final int MOUNTED_HUNTING_CAPE_T = 29205; public static final int MOUNTED_MAGIC_CAPE = 29206; public static final int MOUNTED_MAGIC_CAPE_T = 29207; public static final int MOUNTED_MINING_CAPE = 29208; public static final int MOUNTED_MINING_CAPE_T = 29209; public static final int MOUNTED_PRAYER_CAPE = 29210; public static final int MOUNTED_PRAYER_CAPE_T = 29211; public static final int MOUNTED_RANGED_CAPE = 29212; public static final int MOUNTED_RANGED_CAPE_T = 29213; public static final int MOUNTED_RUNECRAFTING_CAPE = 29214; public static final int MOUNTED_RUNECRAFTING_CAPE_T = 29215; public static final int MOUNTED_SLAYER_CAPE = 29216; public static final int MOUNTED_SLAYER_CAPE_T = 29217; public static final int MOUNTED_SMITHING_CAPE = 29218; public static final int MOUNTED_SMITHING_CAPE_T = 29219; public static final int MOUNTED_STRENGTH_CAPE = 29220; public static final int MOUNTED_STRENGTH_CAPE_T = 29221; public static final int MOUNTED_THIEVING_CAPE = 29222; public static final int MOUNTED_THIEVING_CAPE_T = 29223; public static final int MOUNTED_WOODCUTTING_CAPE = 29224; public static final int MOUNTED_WOODCUTTING_CAPE_T = 29225; public static final int QUEST_LIST = 29226; public static final int SPIRIT_TREE_29227 = 29227; public static final int TOPIARY_BUSH = 29230; public static final int KRAKEN_TOPIARY = 29231; public static final int ZULRAH_TOPIARY = 29232; public static final int KALPHITE_QUEEN_TOPIARY = 29233; public static final int CERBERUS_TOPIARY = 29234; public static final int ABYSSAL_SIRE_TOPIARY = 29235; public static final int SKOTIZO_TOPIARY = 29236; public static final int POOL_OF_RESTORATION = 29237; public static final int POOL_OF_REVITALISATION = 29238; public static final int POOL_OF_REJUVENATION = 29239; public static final int FANCY_REJUVENATION_POOL = 29240; public static final int ORNATE_REJUVENATION_POOL = 29241; public static final int ZEN_GARDEN = 29242; public static final int ZEN_GARDEN_29243 = 29243; public static final int ZEN_GARDEN_29244 = 29244; public static final int ZEN_GARDEN_29245 = 29245; public static final int ZEN_GARDEN_29246 = 29246; public static final int ZEN_THEME = 29247; public static final int OTHERWORLDLY_GARDEN = 29248; public static final int OTHERWORLDLY_GARDEN_29249 = 29249; public static final int OTHERWORLDLY_GARDEN_29250 = 29250; public static final int OTHERWORLDLY_GARDEN_29251 = 29251; public static final int OTHERWORLDLY_GARDEN_29252 = 29252; public static final int OTHERWORLDLY_THEME = 29253; public static final int VOLCANIC_GARDEN = 29254; public static final int VOLCANIC_GARDEN_29255 = 29255; public static final int VOLCANIC_GARDEN_29256 = 29256; public static final int VOLCANIC_GARDEN_29257 = 29257; public static final int VOLCANIC_GARDEN_29258 = 29258; public static final int VOLCANIC_GARDEN_29259 = 29259; public static final int VOLCANIC_GARDEN_29260 = 29260; public static final int VOLCANIC_THEME = 29261; public static final int REDWOOD_FENCE = 29262; public static final int REDWOOD_FENCE_POST = 29263; public static final int REDWOOD_FENCE_POST_29264 = 29264; public static final int OBSIDIAN_FENCE = 29267; public static final int OBSIDIAN_FENCE_POST = 29268; public static final int OBSIDIAN_FENCE_POST_29269 = 29269; public static final int TEAK_BENCH_29270 = 29270; public static final int TEAK_BENCH_29271 = 29271; public static final int GNOME_BENCH_29272 = 29272; public static final int GNOME_BENCH_29273 = 29273; public static final int MARBLE_BENCH_29274 = 29274; public static final int MARBLE_BENCH_29275 = 29275; public static final int OBSIDIAN_BENCH_29276 = 29276; public static final int OBSIDIAN_BENCH_29277 = 29277; public static final int BONFIRE = 29300; public static final int CRATE_29301 = 29301; public static final int CRATE_29302 = 29302; public static final int CRATE_29303 = 29303; public static final int CRATE_29304 = 29304; public static final int CRATE_29305 = 29305; public static final int TENT_29306 = 29306; public static final int TENT_29307 = 29307; public static final int HOWLING_SNOW_STORM = 29308; public static final int QUIESCENT_SNOW_STORM = 29309; public static final int ORNAMENTAL_ANVIL_29310 = 29310; public static final int BRUMA_ROOTS = 29311; public static final int BRAZIER_29312 = 29312; public static final int BRAZIER_29313 = 29313; public static final int BURNING_BRAZIER_29314 = 29314; public static final int SPROUTING_ROOTS = 29315; public static final int CRATE_29316 = 29316; public static final int CRATE_29317 = 29317; public static final int CRATE_29318 = 29318; public static final int CRATE_29319 = 29319; public static final int CRATE_29320 = 29320; public static final int BANK_CHEST_29321 = 29321; public static final int DOORS_OF_DINH = 29322; public static final int GAP_29326 = 29326; public static final int BANK_DEPOSIT_BOX_29327 = 29327; public static final int COFFER_29328 = 29328; public static final int COFFER_29329 = 29329; public static final int GOLDEN_GNOME = 29331; public static final int CART_TUNNEL_29332 = 29332; public static final int CART_TUNNEL_29333 = 29333; public static final int TABLE_29334 = 29334; public static final int COMBAT_DUMMY_SPACE = 29335; public static final int COMBAT_DUMMY = 29336; public static final int UNDEAD_COMBAT_DUMMY = 29337; public static final int KHARYRLL_PORTAL = 29338; public static final int LUNAR_ISLE_PORTAL = 29339; public static final int SENNTISTEN_PORTAL = 29340; public static final int ANNAKARL_PORTAL = 29341; public static final int WATERBIRTH_ISLAND_PORTAL = 29342; public static final int FISHING_GUILD_PORTAL = 29343; public static final int MARIM_PORTAL = 29344; public static final int KOUREND_PORTAL = 29345; public static final int KHARYRLL_PORTAL_29346 = 29346; public static final int LUNAR_ISLE_PORTAL_29347 = 29347; public static final int SENNTISTEN_PORTAL_29348 = 29348; public static final int ANNAKARL_PORTAL_29349 = 29349; public static final int WATERBIRTH_ISLAND_PORTAL_29350 = 29350; public static final int FISHING_GUILD_PORTAL_29351 = 29351; public static final int MARIM_PORTAL_29352 = 29352; public static final int KOUREND_PORTAL_29353 = 29353; public static final int KHARYRLL_PORTAL_29354 = 29354; public static final int LUNAR_ISLE_PORTAL_29355 = 29355; public static final int SENNTISTEN_PORTAL_29356 = 29356; public static final int ANNAKARL_PORTAL_29357 = 29357; public static final int WATERBIRTH_ISLAND_PORTAL_29358 = 29358; public static final int FISHING_GUILD_PORTAL_29359 = 29359; public static final int MARIM_PORTAL_29360 = 29360; public static final int KOUREND_PORTAL_29361 = 29361; public static final int FAIRY_RING_29362 = 29362; public static final int FAIRY_RING_29363 = 29363; public static final int FAIRY_RING_29364 = 29364; public static final int FAIRY_RING_29365 = 29365; public static final int FAIRY_RING_29366 = 29366; public static final int FAIRY_RING_29367 = 29367; public static final int FAIRY_RING_29368 = 29368; public static final int FAIRY_RING_29369 = 29369; public static final int FAIRY_RING_29370 = 29370; public static final int FAIRY_RING_29371 = 29371; public static final int FAIRY_RING_29372 = 29372; public static final int FAIRY_RING_29373 = 29373; public static final int FAIRY_RING_29374 = 29374; public static final int FAIRY_RING_29375 = 29375; public static final int FAIRY_RING_29376 = 29376; public static final int FAIRY_RING_29377 = 29377; public static final int FAIRY_RING_29378 = 29378; public static final int FAIRY_RING_29379 = 29379; public static final int FAIRY_RING_29380 = 29380; public static final int FAIRY_RING_29381 = 29381; public static final int FAIRY_RING_29382 = 29382; public static final int FAIRY_RING_29383 = 29383; public static final int FAIRY_RING_29384 = 29384; public static final int FAIRY_RING_29385 = 29385; public static final int FAIRY_RING_29386 = 29386; public static final int FAIRY_RING_29387 = 29387; public static final int FAIRY_RING_29388 = 29388; public static final int FAIRY_RING_29389 = 29389; public static final int FAIRY_RING_29390 = 29390; public static final int FAIRY_RING_29391 = 29391; public static final int FAIRY_RING_29392 = 29392; public static final int FAIRY_RING_29393 = 29393; public static final int FAIRY_RING_29394 = 29394; public static final int FAIRY_RING_29395 = 29395; public static final int FAIRY_RING_29396 = 29396; public static final int FAIRY_RING_29397 = 29397; public static final int FAIRY_RING_29398 = 29398; public static final int FAIRY_RING_29399 = 29399; public static final int FAIRY_RING_29400 = 29400; public static final int FAIRY_RING_29401 = 29401; public static final int FAIRY_RING_29402 = 29402; public static final int FAIRY_RING_29403 = 29403; public static final int FAIRY_RING_29404 = 29404; public static final int FAIRY_RING_29405 = 29405; public static final int FAIRY_RING_29406 = 29406; public static final int FAIRY_RING_29407 = 29407; public static final int FAIRY_RING_29408 = 29408; public static final int FAIRY_RING_29409 = 29409; public static final int FAIRY_RING_29410 = 29410; public static final int FAIRY_RING_29411 = 29411; public static final int FAIRY_RING_29412 = 29412; public static final int FAIRY_RING_29413 = 29413; public static final int FAIRY_RING_29414 = 29414; public static final int FAIRY_RING_29415 = 29415; public static final int FAIRY_RING_29416 = 29416; public static final int FAIRY_RING_29417 = 29417; public static final int FAIRY_RING_29418 = 29418; public static final int FAIRY_RING_29419 = 29419; public static final int FAIRY_RING_29420 = 29420; public static final int FAIRY_RING_29421 = 29421; public static final int SPIRITUAL_FAIRY_TREE = 29422; public static final int SPIRITUAL_FAIRY_TREE_29423 = 29423; public static final int SPIRITUAL_FAIRY_TREE_29424 = 29424; public static final int SPIRITUAL_FAIRY_TREE_29425 = 29425; public static final int SPIRITUAL_FAIRY_TREE_29426 = 29426; public static final int SPIRITUAL_FAIRY_TREE_29427 = 29427; public static final int SPIRITUAL_FAIRY_TREE_29428 = 29428; public static final int SPIRITUAL_FAIRY_TREE_29429 = 29429; public static final int SPIRITUAL_FAIRY_TREE_29430 = 29430; public static final int SPIRITUAL_FAIRY_TREE_29431 = 29431; public static final int SPIRITUAL_FAIRY_TREE_29432 = 29432; public static final int SPIRITUAL_FAIRY_TREE_29433 = 29433; public static final int SPIRITUAL_FAIRY_TREE_29434 = 29434; public static final int SPIRITUAL_FAIRY_TREE_29435 = 29435; public static final int SPIRITUAL_FAIRY_TREE_29436 = 29436; public static final int SPIRITUAL_FAIRY_TREE_29437 = 29437; public static final int SPIRITUAL_FAIRY_TREE_29438 = 29438; public static final int SPIRITUAL_FAIRY_TREE_29439 = 29439; public static final int SPIRITUAL_FAIRY_TREE_29440 = 29440; public static final int SPIRITUAL_FAIRY_TREE_29441 = 29441; public static final int SPIRITUAL_FAIRY_TREE_29442 = 29442; public static final int SPIRITUAL_FAIRY_TREE_29443 = 29443; public static final int SPIRITUAL_FAIRY_TREE_29444 = 29444; public static final int SPIRITUAL_FAIRY_TREE_29445 = 29445; public static final int SPIRITUAL_FAIRY_TREE_29446 = 29446; public static final int SPIRITUAL_FAIRY_TREE_29447 = 29447; public static final int SPIRITUAL_FAIRY_TREE_29448 = 29448; public static final int SPIRITUAL_FAIRY_TREE_29449 = 29449; public static final int SPIRITUAL_FAIRY_TREE_29450 = 29450; public static final int SPIRITUAL_FAIRY_TREE_29451 = 29451; public static final int SPIRITUAL_FAIRY_TREE_29452 = 29452; public static final int SPIRITUAL_FAIRY_TREE_29453 = 29453; public static final int SPIRITUAL_FAIRY_TREE_29454 = 29454; public static final int SPIRITUAL_FAIRY_TREE_29455 = 29455; public static final int SPIRITUAL_FAIRY_TREE_29456 = 29456; public static final int SPIRITUAL_FAIRY_TREE_29457 = 29457; public static final int SPIRITUAL_FAIRY_TREE_29458 = 29458; public static final int SPIRITUAL_FAIRY_TREE_29459 = 29459; public static final int SPIRITUAL_FAIRY_TREE_29460 = 29460; public static final int SPIRITUAL_FAIRY_TREE_29461 = 29461; public static final int SPIRITUAL_FAIRY_TREE_29462 = 29462; public static final int SPIRITUAL_FAIRY_TREE_29463 = 29463; public static final int SPIRITUAL_FAIRY_TREE_29464 = 29464; public static final int SPIRITUAL_FAIRY_TREE_29465 = 29465; public static final int SPIRITUAL_FAIRY_TREE_29466 = 29466; public static final int SPIRITUAL_FAIRY_TREE_29467 = 29467; public static final int SPIRITUAL_FAIRY_TREE_29468 = 29468; public static final int SPIRITUAL_FAIRY_TREE_29469 = 29469; public static final int SPIRITUAL_FAIRY_TREE_29470 = 29470; public static final int SPIRITUAL_FAIRY_TREE_29471 = 29471; public static final int SPIRITUAL_FAIRY_TREE_29472 = 29472; public static final int SPIRITUAL_FAIRY_TREE_29473 = 29473; public static final int SPIRITUAL_FAIRY_TREE_29474 = 29474; public static final int SPIRITUAL_FAIRY_TREE_29475 = 29475; public static final int SPIRITUAL_FAIRY_TREE_29476 = 29476; public static final int SPIRITUAL_FAIRY_TREE_29477 = 29477; public static final int SPIRITUAL_FAIRY_TREE_29478 = 29478; public static final int SPIRITUAL_FAIRY_TREE_29479 = 29479; public static final int SPIRITUAL_FAIRY_TREE_29480 = 29480; public static final int SPIRITUAL_FAIRY_TREE_29481 = 29481; public static final int SPIRITUAL_FAIRY_TREE_29482 = 29482; public static final int SPIRITUAL_FAIRY_TREE_29483 = 29483; public static final int SPIRITUAL_FAIRY_TREE_29484 = 29484; public static final int SPIRITUAL_FAIRY_TREE_29485 = 29485; public static final int GATE_29486 = 29486; public static final int GATE_29487 = 29487; public static final int GATE_29488 = 29488; public static final int GATE_29489 = 29489; public static final int ROCKS_29491 = 29491; public static final int CORPSE_29492 = 29492; public static final int CORPSE_29493 = 29493; public static final int SKELETON_29494 = 29494; public static final int FAIRY_RING_29496 = 29496; public static final int FAIRY_RING_29497 = 29497; public static final int FAIRY_RING_29498 = 29498; public static final int FAIRY_RING_29499 = 29499; public static final int FAIRY_RING_29500 = 29500; public static final int FAIRY_RING_29501 = 29501; public static final int FAIRY_RING_29502 = 29502; public static final int FAIRY_RING_29503 = 29503; public static final int FAIRY_RING_29504 = 29504; public static final int FAIRY_RING_29505 = 29505; public static final int FAIRY_RING_29506 = 29506; public static final int FAIRY_RING_29507 = 29507; public static final int FAIRY_RING_29508 = 29508; public static final int FAIRY_RING_29509 = 29509; public static final int FAIRY_RING_29510 = 29510; public static final int FAIRY_RING_29511 = 29511; public static final int FAIRY_RING_29512 = 29512; public static final int FAIRY_RING_29513 = 29513; public static final int FAIRY_RING_29514 = 29514; public static final int FAIRY_RING_29515 = 29515; public static final int FAIRY_RING_29516 = 29516; public static final int FAIRY_RING_29517 = 29517; public static final int FAIRY_RING_29518 = 29518; public static final int FAIRY_RING_29519 = 29519; public static final int FAIRY_RING_29520 = 29520; public static final int FAIRY_RING_29521 = 29521; public static final int FAIRY_RING_29522 = 29522; public static final int FAIRY_RING_29523 = 29523; public static final int FAIRY_RING_29524 = 29524; public static final int FAIRY_RING_29525 = 29525; public static final int FAIRY_RING_29526 = 29526; public static final int FAIRY_RING_29527 = 29527; public static final int FAIRY_RING_29528 = 29528; public static final int FAIRY_RING_29529 = 29529; public static final int FAIRY_RING_29530 = 29530; public static final int FAIRY_RING_29531 = 29531; public static final int FAIRY_RING_29532 = 29532; public static final int FAIRY_RING_29533 = 29533; public static final int FAIRY_RING_29534 = 29534; public static final int FAIRY_RING_29535 = 29535; public static final int FAIRY_RING_29536 = 29536; public static final int FAIRY_RING_29537 = 29537; public static final int FAIRY_RING_29538 = 29538; public static final int FAIRY_RING_29539 = 29539; public static final int FAIRY_RING_29540 = 29540; public static final int FAIRY_RING_29541 = 29541; public static final int FAIRY_RING_29542 = 29542; public static final int FAIRY_RING_29543 = 29543; public static final int FAIRY_RING_29544 = 29544; public static final int FAIRY_RING_29545 = 29545; public static final int FAIRY_RING_29546 = 29546; public static final int FAIRY_RING_29547 = 29547; public static final int FAIRY_RING_29548 = 29548; public static final int FAIRY_RING_29549 = 29549; public static final int FAIRY_RING_29550 = 29550; public static final int FAIRY_RING_29551 = 29551; public static final int FAIRY_RING_29552 = 29552; public static final int FAIRY_RING_29553 = 29553; public static final int FAIRY_RING_29554 = 29554; public static final int FAIRY_RING_29555 = 29555; public static final int FAIRY_RING_29556 = 29556; public static final int FAIRY_RING_29557 = 29557; public static final int FAIRY_RING_29558 = 29558; public static final int FAIRY_RING_29559 = 29559; public static final int FAIRY_RING_29561 = 29561; public static final int FAIRY_RING_29562 = 29562; public static final int FAIRY_RING_29563 = 29563; public static final int FAIRY_RING_29564 = 29564; public static final int FAIRY_RING_29565 = 29565; public static final int FAIRY_RING_29566 = 29566; public static final int FAIRY_RING_29567 = 29567; public static final int FAIRY_RING_29568 = 29568; public static final int FAIRY_RING_29569 = 29569; public static final int FAIRY_RING_29570 = 29570; public static final int FAIRY_RING_29571 = 29571; public static final int FAIRY_RING_29572 = 29572; public static final int FAIRY_RING_29573 = 29573; public static final int FAIRY_RING_29574 = 29574; public static final int FAIRY_RING_29575 = 29575; public static final int FAIRY_RING_29576 = 29576; public static final int FAIRY_RING_29577 = 29577; public static final int FAIRY_RING_29578 = 29578; public static final int FAIRY_RING_29579 = 29579; public static final int FAIRY_RING_29580 = 29580; public static final int FAIRY_RING_29581 = 29581; public static final int FAIRY_RING_29582 = 29582; public static final int FAIRY_RING_29583 = 29583; public static final int FAIRY_RING_29584 = 29584; public static final int FAIRY_RING_29585 = 29585; public static final int FAIRY_RING_29586 = 29586; public static final int FAIRY_RING_29587 = 29587; public static final int FAIRY_RING_29588 = 29588; public static final int FAIRY_RING_29589 = 29589; public static final int FAIRY_RING_29590 = 29590; public static final int FAIRY_RING_29591 = 29591; public static final int FAIRY_RING_29592 = 29592; public static final int FAIRY_RING_29593 = 29593; public static final int FAIRY_RING_29594 = 29594; public static final int FAIRY_RING_29595 = 29595; public static final int FAIRY_RING_29596 = 29596; public static final int FAIRY_RING_29597 = 29597; public static final int FAIRY_RING_29598 = 29598; public static final int FAIRY_RING_29599 = 29599; public static final int FAIRY_RING_29600 = 29600; public static final int FAIRY_RING_29601 = 29601; public static final int FAIRY_RING_29602 = 29602; public static final int FAIRY_RING_29603 = 29603; public static final int FAIRY_RING_29604 = 29604; public static final int FAIRY_RING_29605 = 29605; public static final int FAIRY_RING_29606 = 29606; public static final int FAIRY_RING_29607 = 29607; public static final int FAIRY_RING_29608 = 29608; public static final int FAIRY_RING_29609 = 29609; public static final int FAIRY_RING_29610 = 29610; public static final int FAIRY_RING_29611 = 29611; public static final int FAIRY_RING_29612 = 29612; public static final int FAIRY_RING_29613 = 29613; public static final int FAIRY_RING_29614 = 29614; public static final int FAIRY_RING_29615 = 29615; public static final int FAIRY_RING_29616 = 29616; public static final int FAIRY_RING_29617 = 29617; public static final int FAIRY_RING_29618 = 29618; public static final int FAIRY_RING_29619 = 29619; public static final int FAIRY_RING_29620 = 29620; public static final int FAIRY_RING_29621 = 29621; public static final int FAIRY_RING_29622 = 29622; public static final int FAIRY_RING_29623 = 29623; public static final int FAIRY_RING_29624 = 29624; public static final int MOUNTED_MAX_CAPE_29625 = 29625; public static final int CRACK_29626 = 29626; public static final int CRACK_29627 = 29627; public static final int RUNECRAFTING_ALTAR = 29631; public static final int LADDER_29635 = 29635; public static final int LADDER_29636 = 29636; public static final int CLAN_WARS_PORTAL = 29667; public static final int REDWOOD = 29668; public static final int REDWOOD_29669 = 29669; public static final int REDWOOD_29670 = 29670; public static final int REDWOOD_29671 = 29671; public static final int CARVED_REDWOOD = 29680; public static final int CARVED_REDWOOD_29681 = 29681; public static final int CARVED_REDWOOD_29682 = 29682; public static final int CRACK_29705 = 29705; public static final int BANNER_29706 = 29706; public static final int BANQUET_TABLE_29708 = 29708; public static final int PRESENT_TABLE = 29709; public static final int BIRTHDAY_HAT_TABLE = 29710; public static final int NOTICEBOARD_29718 = 29718; public static final int BALLISTA_29719 = 29719; public static final int STAIRCASE_29720 = 29720; public static final int ANCIENT_MACHINERY = 29721; public static final int STRANGE_SHELL = 29722; public static final int GANGPLANK_29723 = 29723; public static final int GANGPLANK_29724 = 29724; public static final int LARGE_TABLE_29725 = 29725; public static final int PORTCULLIS_29726 = 29726; public static final int LETTER = 29727; public static final int STEPPING_STONE_29728 = 29728; public static final int STEPPING_STONE_29729 = 29729; public static final int STEPPING_STONE_29730 = 29730; public static final int PAINTING_29731 = 29731; public static final int CRATE_29732 = 29732; public static final int HOLE_29734 = 29734; public static final int HOLE_29735 = 29735; public static final int ROTTEN_SAPLING = 29736; public static final int ROTTEN_STUMP = 29737; public static final int ROCKS_29738 = 29738; public static final int RUBBLE_29739 = 29739; public static final int BOULDER_29740 = 29740; public static final int MARK_OF_POWER = 29741; public static final int CHEST_29742 = 29742; public static final int CHEST_29743 = 29743; public static final int CHEST_29744 = 29744; public static final int CHEST_29745 = 29745; public static final int TROUGH_29746 = 29746; public static final int BRAZIER_29747 = 29747; public static final int BRAZIER_29748 = 29748; public static final int SHIMMERING_BARRIER = 29749; public static final int TIGHTROPE_29750 = 29750; public static final int KEYSTONE_CRYSTAL = 29751; public static final int GLOWING_CARVING = 29752; public static final int DARK_CRYSTAL_29753 = 29753; public static final int FAIRLY_DARK_CRYSTAL = 29754; public static final int SLIGHTLY_DARK_CRYSTAL = 29755; public static final int DIM_CRYSTAL = 29756; public static final int GLOWING_CRYSTAL = 29757; public static final int BLACK_CRYSTAL = 29758; public static final int CYAN_CRYSTAL = 29759; public static final int MAGENTA_CRYSTAL = 29760; public static final int YELLOW_CRYSTAL = 29761; public static final int WHITE_CRYSTAL = 29762; public static final int SAPLING = 29763; public static final int STUMP_29764 = 29764; public static final int HERB_PATCH_29765 = 29765; public static final int CRYSTAL_BOMB = 29766; public static final int NOXIOUS_TENDRILS = 29767; public static final int SPIRIT_TENDRILS = 29768; public static final int STORAGE_UNIT = 29769; public static final int SMALL_STORAGE_UNIT = 29770; public static final int OLD_TOOLS = 29771; public static final int GOURD_TREE = 29772; public static final int WEEDS_29773 = 29773; public static final int RECRUITING_BOARD = 29776; public static final int CHAMBERS_OF_XERIC = 29777; public static final int STEPS_29778 = 29778; public static final int MEDIUM_STORAGE_UNIT = 29779; public static final int LARGE_STORAGE_UNIT = 29780; public static final int PASSAGE_29789 = 29789; public static final int LARGE_CRYSTAL = 29794; public static final int CARVED_HEAD = 29811; public static final int TIGHTROPE_29834 = 29834; public static final int TIGHTROPE_29835 = 29835; public static final int SHADOW_ROOT = 29864; public static final int SHADOW_ROOT_29865 = 29865; public static final int CARVING_29866 = 29866; public static final int GIANT_ANVIL = 29867; public static final int TROUGH_29874 = 29874; public static final int CREATURE_KEEPER = 29875; public static final int ICE_STORM = 29876; public static final int GEYSER = 29878; public static final int MYSTICAL_BARRIER = 29879; public static final int LARGE_HOLE = 29880; public static final int LARGE_HOLE_29881 = 29881; public static final int LARGE_HOLE_29882 = 29882; public static final int LARGE_ROCK_29883 = 29883; public static final int LARGE_ROCK_29884 = 29884; public static final int LARGE_ROCK_29885 = 29885; public static final int CRYSTALLINE_STRUCTURE = 29886; public static final int CRYSTALLINE_STRUCTURE_29887 = 29887; public static final int CRYSTAL_STRUCTURE = 29888; public static final int BUBBLES_29889 = 29889; public static final int FALLEN_SOLDIER = 29897; public static final int BEACON_29920 = 29920; public static final int XERICIAN_STATUE = 29937; public static final int ALTAR_29941 = 29941; public static final int GREAT_OLMIC_STATUE = 29944; public static final int GREAT_OLMIC_STATUE_29945 = 29945; public static final int GREAT_OLMIC_STATUE_29946 = 29946; public static final int DRAINED_CRYSTAL = 29947; public static final int DRAINED_CRYSTAL_29948 = 29948; public static final int RUBBLE_29949 = 29949; public static final int RUBBLE_29950 = 29950; public static final int RUBBLE_29951 = 29951; public static final int RUBBLE_29952 = 29952; public static final int FALLEN_SOLDIER_29975 = 29975; public static final int FALLEN_SOLDIER_29976 = 29976; public static final int FALLEN_SOLDIER_29977 = 29977; public static final int FALLEN_SOLDIER_29978 = 29978; public static final int LIZARDMAN_CORPSE = 29983; public static final int LIZARDMAN_CORPSE_29984 = 29984; public static final int LIZARDMAN_CORPSE_29985 = 29985; public static final int LIZARDMAN_HEAD = 29986; public static final int LIZARDMAN_HEAD_29987 = 29987; public static final int LIZARDMAN_HEAD_29988 = 29988; public static final int LIZARDMAN_HEAD_29989 = 29989; public static final int LIZARDMAN_LAIR = 29990; public static final int SWAMPY_LAMP = 29991; public static final int STEPS_29993 = 29993; public static final int ROPE_29995 = 29995; public static final int ROPE_29996 = 29996; public static final int HERB_PATCH_29997 = 29997; public static final int HERB_PATCH_29998 = 29998; public static final int HERB_PATCH_29999 = 29999; public static final int HERB_PATCH_30000 = 30000; public static final int HERB_PATCH_30001 = 30001; public static final int HERB_PATCH_30002 = 30002; public static final int HERB_PATCH_30003 = 30003; public static final int HERB_PATCH_30004 = 30004; public static final int HERB_PATCH_30005 = 30005; public static final int HERB_PATCH_30006 = 30006; public static final int HERB_PATCH_30007 = 30007; public static final int HERB_PATCH_30008 = 30008; public static final int HERB_PATCH_30009 = 30009; public static final int HERB_PATCH_30010 = 30010; public static final int HERB_PATCH_30011 = 30011; public static final int ROCKS_30012 = 30012; public static final int MEAT_TREE = 30013; public static final int BLOOD_CRYSTAL_30014 = 30014; public static final int CRYSTAL_30015 = 30015; public static final int CRYSTAL_30016 = 30016; public static final int CRYSTAL_30017 = 30017; public static final int CRYSTAL_30018 = 30018; public static final int MAGICAL_FIRE = 30019; public static final int NISTIRIOS_MANIFESTO = 30020; public static final int FIRE_30021 = 30021; public static final int TEKTONS_JOURNAL = 30022; public static final int SEPTIC_TENDRILS = 30024; public static final int TRANSDIMENSIONAL_NOTES = 30025; public static final int VANGUARD_JUDGEMENT = 30026; public static final int CRYSTAL_30027 = 30027; public static final int ANCIENT_CHEST = 30028; public static final int HOUNDMASTERS_DIARY = 30031; public static final int ACID_POOL = 30032; public static final int SMALL_CRYSTALS = 30033; public static final int LARGE_CRYSTALS = 30034; public static final int CARVED_HEAD_30035 = 30035; public static final int ENERGY_WELL = 30066; public static final int MEDIVAEMIA_ROOT = 30068; public static final int MEDIVAEMIA_ROOT_30069 = 30069; public static final int BOIL_30070 = 30070; public static final int BURST_BOIL = 30071; public static final int SLIMY_PILLARS = 30072; public static final int SLIMY_PILLARS_30073 = 30073; public static final int BUCKET_OF_BLOOD = 30085; public static final int STRANGE_BELLS = 30086; public static final int BANK_CHEST_30087 = 30087; public static final int BOOKSHELF_30091 = 30091; public static final int BOOKSHELF_30092 = 30092; public static final int BOOKSHELF_30093 = 30093; public static final int BOOKSHELF_30094 = 30094; public static final int TIMELINE = 30095; public static final int ANCIENT_RELIC = 30096; public static final int THE_GREAT_EXPEDITION = 30097; public static final int WINTERS_END = 30098; public static final int A_SHAYZIEN_STATE = 30099; public static final int ARMED_FORCES_REPORT = 30100; public static final int OFFICIAL_ORDER_OF_CONSTRUCTION = 30101; public static final int CHRONICLES_OF_XERIC = 30102; public static final int ROYAL_WEDDING_INVITATION = 30103; public static final int STORAGE_UNIT_30107 = 30107; public static final int ROWBOAT_30108 = 30108; public static final int ROWBOAT_30109 = 30109; public static final int LARGE_DOOR_30110 = 30110; public static final int LARGE_DOOR_30111 = 30111; public static final int DOOR_30112 = 30112; public static final int DOOR_30113 = 30113; public static final int DOOR_30114 = 30114; public static final int DOOR_30115 = 30115; public static final int DOOR_30116 = 30116; public static final int DOOR_30117 = 30117; public static final int DOOR_30118 = 30118; public static final int DOOR_30119 = 30119; public static final int NOTE_30120 = 30120; public static final int NOTE_30121 = 30121; public static final int NOTE_30122 = 30122; public static final int BARREL_30123 = 30123; public static final int A_BARREL_OF_RAINWATER_30124 = 30124; public static final int PAINTING_30125 = 30125; public static final int PAINTING_30126 = 30126; public static final int BARREL_30127 = 30127; public static final int BARREL_30128 = 30128; public static final int UNLIT_CANDLE = 30129; public static final int CANDLE_30130 = 30130; public static final int DAMAGED_WALL_30131 = 30131; public static final int DAMAGED_WALL_30132 = 30132; public static final int DAMAGED_WALL_30133 = 30133; public static final int PIANO_30134 = 30134; public static final int PIANO_30135 = 30135; public static final int FIREPLACE_30136 = 30136; public static final int FIREPLACE_30137 = 30137; public static final int FIREPLACE_30138 = 30138; public static final int STAIRCASE_30139 = 30139; public static final int WARDROBE_30141 = 30141; public static final int WARDROBE_30142 = 30142; public static final int TABLE_30145 = 30145; public static final int SHELVES_30146 = 30146; public static final int BUCKET_30147 = 30147; public static final int FERN_30148 = 30148; public static final int FERN_30149 = 30149; public static final int DEAD_TREE_30150 = 30150; public static final int PAINTING_30151 = 30151; public static final int PAINTING_30152 = 30152; public static final int PORTRAIT_30153 = 30153; public static final int PAINTING_30154 = 30154; public static final int PAINTING_30155 = 30155; public static final int FURNACE_30157 = 30157; public static final int FURNACE_30158 = 30158; public static final int PARTY_BALLOONS = 30161; public static final int CRACK_30169 = 30169; public static final int ROOT_30170 = 30170; public static final int PORTAL_30172 = 30172; public static final int PORTAL_30173 = 30173; public static final int TUNNEL_30174 = 30174; public static final int TUNNEL_30175 = 30175; public static final int SMOKY_CAVE = 30176; public static final int CAVE_ENTRANCE_30177 = 30177; public static final int CAVE_EXIT_30178 = 30178; public static final int HOLE_30179 = 30179; public static final int CAVE_30180 = 30180; public static final int CHEST_30185 = 30185; public static final int BUCKET_30187 = 30187; public static final int CANDLE_30188 = 30188; public static final int STEPS_30189 = 30189; public static final int STEPS_30190 = 30190; public static final int LADDER_30191 = 30191; public static final int LADDER_30192 = 30192; public static final int CHEST_30193 = 30193; public static final int BROKEN_FURNACE_30194 = 30194; public static final int RACK_30195 = 30195; public static final int CHAIN_30196 = 30196; public static final int CREVICE_30198 = 30198; public static final int HOLE_30199 = 30199; public static final int ROPE_30200 = 30200; public static final int CREVICE_30201 = 30201; public static final int ROPE_30234 = 30234; public static final int CHASM_30236 = 30236; public static final int ROCKSLIDE_30254 = 30254; public static final int ROCKSLIDE_30255 = 30255; public static final int ROCKSLIDE_30256 = 30256; public static final int ROCKSLIDE_30257 = 30257; public static final int LIFT_30258 = 30258; public static final int LIFT_30259 = 30259; public static final int GIBBET = 30260; public static final int HOT_VENT_DOOR_30266 = 30266; public static final int BANK_CHEST_30267 = 30267; public static final int BANK_DEPOSIT_BOX_30268 = 30268; public static final int TERMINAL = 30269; public static final int TERMINAL_30270 = 30270; public static final int NODE = 30271; public static final int HAARTOK = 30274; public static final int HAARTOK_30275 = 30275; public static final int HAARTOK_30276 = 30276; public static final int HAARTOK_30277 = 30277; public static final int SHOP_COUNTER_30278 = 30278; public static final int SHOP_COUNTER_30279 = 30279; public static final int SHOP_COUNTER_30280 = 30280; public static final int THE_INFERNO = 30281; public static final int THE_INFERNO_30282 = 30282; public static final int CAVE_EXIT_30283 = 30283; public static final int ROCKY_SUPPORT = 30284; public static final int ROCKY_SUPPORT_30285 = 30285; public static final int ROCKY_SUPPORT_30286 = 30286; public static final int ROCKY_SUPPORT_30287 = 30287; public static final int ROOF = 30331; public static final int ANCESTRAL_GLYPH = 30338; public static final int FALLING_ROCK = 30343; public static final int FALLING_ROCK_30344 = 30344; public static final int BARREL_30358 = 30358; public static final int DOOR_30364 = 30364; public static final int DOOR_30365 = 30365; public static final int DOOR_30366 = 30366; public static final int LADDER_30367 = 30367; public static final int MYSTERIOUS_RUINS_30371 = 30371; public static final int MYSTERIOUS_RUINS_30372 = 30372; public static final int MYSTERIOUS_RUINS_30373 = 30373; public static final int CAVE_30374 = 30374; public static final int TUNNEL_30375 = 30375; public static final int ROW_BOAT_30376 = 30376; public static final int ROW_BOAT_30377 = 30377; public static final int LIZARDMAN_LAIR_30380 = 30380; public static final int CREVICE_30381 = 30381; public static final int CREVICE_30382 = 30382; public static final int CREVICE_30383 = 30383; public static final int CREVICE_30384 = 30384; public static final int CREVICE_30385 = 30385; public static final int CASTLE_WARS_PORTAL = 30386; public static final int LARGE_DOOR_30387 = 30387; public static final int LARGE_DOOR_30388 = 30388; public static final int GRAND_EXCHANGE_BOOTH_30390 = 30390; public static final int IRON_LADDER_30391 = 30391; public static final int IRON_LADDER_30392 = 30392; public static final int MYSTERIOUS_POOL = 30395; public static final int SHIMMERING_BARRIER_30396 = 30396; public static final int SHIMMERING_BARRIER_30397 = 30397; public static final int SHIMMERING_BARRIER_30398 = 30398; public static final int SHIMMERING_BARRIER_30399 = 30399; public static final int SHIMMERING_BARRIER_30400 = 30400; public static final int MOUNTED_CHAMPIONS_CAPE = 30403; public static final int MAHOGANY_SAPLING = 30406; public static final int MAHOGANY_TREE = 30407; public static final int MAHOGANY_TREE_30408 = 30408; public static final int MAHOGANY_TREE_30409 = 30409; public static final int MAHOGANY_TREE_30410 = 30410; public static final int MAHOGANY_TREE_30411 = 30411; public static final int MAHOGANY_TREE_30412 = 30412; public static final int MAHOGANY_TREE_30413 = 30413; public static final int MAHOGANY_TREE_30414 = 30414; public static final int MAHOGANY_TREE_30415 = 30415; public static final int MAHOGANY_TREE_30416 = 30416; public static final int MAHOGANY_TREE_30417 = 30417; public static final int MAHOGANY_TREE_STUMP = 30418; public static final int DISEASED_MAHOGANY = 30419; public static final int DISEASED_MAHOGANY_30420 = 30420; public static final int DISEASED_MAHOGANY_30421 = 30421; public static final int DISEASED_MAHOGANY_30422 = 30422; public static final int DISEASED_MAHOGANY_30423 = 30423; public static final int DISEASED_MAHOGANY_30424 = 30424; public static final int DISEASED_MAHOGANY_30425 = 30425; public static final int DISEASED_MAHOGANY_30426 = 30426; public static final int DISEASED_MAHOGANY_30427 = 30427; public static final int DEAD_MAHOGANY = 30428; public static final int DEAD_MAHOGANY_30429 = 30429; public static final int DEAD_MAHOGANY_30430 = 30430; public static final int DEAD_MAHOGANY_30431 = 30431; public static final int DEAD_MAHOGANY_30432 = 30432; public static final int DEAD_MAHOGANY_30433 = 30433; public static final int DEAD_MAHOGANY_30434 = 30434; public static final int DEAD_MAHOGANY_30435 = 30435; public static final int DEAD_MAHOGANY_30436 = 30436; public static final int TEAK_TREE = 30437; public static final int TEAK_TREE_30438 = 30438; public static final int TEAK_TREE_30439 = 30439; public static final int TEAK_TREE_30440 = 30440; public static final int TEAK_TREE_30441 = 30441; public static final int TEAK_TREE_30442 = 30442; public static final int TEAK_TREE_30443 = 30443; public static final int TEAK_TREE_30444 = 30444; public static final int TEAK_TREE_30445 = 30445; public static final int TREE_STUMP_30446 = 30446; public static final int DISEASED_TEAK = 30447; public static final int DISEASED_TEAK_30448 = 30448; public static final int DISEASED_TEAK_30449 = 30449; public static final int DISEASED_TEAK_30450 = 30450; public static final int DISEASED_TEAK_30451 = 30451; public static final int DISEASED_TEAK_30452 = 30452; public static final int DEAD_TEAK = 30453; public static final int DEAD_TEAK_30454 = 30454; public static final int DEAD_TEAK_30455 = 30455; public static final int DEAD_TEAK_30456 = 30456; public static final int DEAD_TEAK_30457 = 30457; public static final int DEAD_TEAK_30458 = 30458; public static final int DEAD_TEAK_30459 = 30459; public static final int DEAD_TEAK_30474 = 30474; public static final int DEAD_TEAK_30475 = 30475; public static final int TREE_PATCH_30476 = 30476; public static final int TREE_PATCH_30477 = 30477; public static final int TREE_PATCH_30478 = 30478; public static final int TREE_PATCH_30479 = 30479; public static final int SEAWEED_PATCH = 30483; public static final int SEAWEED_PATCH_30484 = 30484; public static final int SEAWEED_PATCH_30485 = 30485; public static final int SEAWEED_PATCH_30486 = 30486; public static final int SEAWEED = 30487; public static final int SEAWEED_30488 = 30488; public static final int SEAWEED_30489 = 30489; public static final int SEAWEED_30490 = 30490; public static final int SEAWEED_30491 = 30491; public static final int SEAWEED_30492 = 30492; public static final int SEAWEED_30493 = 30493; public static final int DISEASED_SEAWEED = 30494; public static final int DISEASED_SEAWEED_30495 = 30495; public static final int DISEASED_SEAWEED_30496 = 30496; public static final int DEAD_SEAWEED = 30497; public static final int DEAD_SEAWEED_30498 = 30498; public static final int DEAD_SEAWEED_30499 = 30499; public static final int COMPOST_BIN_30502 = 30502; public static final int COMPOST_BIN_30503 = 30503; public static final int COMPOST_BIN_30504 = 30504; public static final int COMPOST_BIN_30505 = 30505; public static final int COMPOST_BIN_30506 = 30506; public static final int COMPOST_BIN_30507 = 30507; public static final int COMPOST_BIN_30508 = 30508; public static final int COMPOST_BIN_30509 = 30509; public static final int COMPOST_BIN_30510 = 30510; public static final int COMPOST_BIN_30511 = 30511; public static final int COMPOST_BIN_30512 = 30512; public static final int COMPOST_BIN_30513 = 30513; public static final int COMPOST_BIN_30514 = 30514; public static final int COMPOST_BIN_30515 = 30515; public static final int COMPOST_BIN_30516 = 30516; public static final int ROCK_30519 = 30519; public static final int MUSHROOM_30520 = 30520; public static final int ROCK_30521 = 30521; public static final int ROCK_30522 = 30522; public static final int DRIFTWOOD_30523 = 30523; public static final int TUNNEL_30532 = 30532; public static final int MUDDY_PATCH = 30533; public static final int MUSHROOM_30534 = 30534; public static final int SMELLY_MUSHROOM = 30535; public static final int MUDDY_PATCH_30536 = 30536; public static final int SEAWEED_30537 = 30537; public static final int SEAWEED_30538 = 30538; public static final int MUSHROOM_30539 = 30539; public static final int SMELLY_MUSHROOM_30540 = 30540; public static final int SMELLY_MUSHROOM_30541 = 30541; public static final int SEAWEED_30542 = 30542; public static final int MUDDY_PATCH_30543 = 30543; public static final int MUDDY_PATCH_30544 = 30544; public static final int SMELLY_MUSHROOM_30545 = 30545; public static final int MUDDY_PATCH_30546 = 30546; public static final int MUDDY_PATCH_30547 = 30547; public static final int MUSHROOM_30548 = 30548; public static final int MUDDY_PATCH_30549 = 30549; public static final int SEAWEED_30550 = 30550; public static final int SEAWEED_30551 = 30551; public static final int SPACE = 30552; public static final int BIRDHOUSE_EMPTY = 30553; public static final int BIRDHOUSE = 30554; public static final int BIRDHOUSE_30555 = 30555; public static final int OAK_BIRDHOUSE_EMPTY = 30556; public static final int OAK_BIRDHOUSE = 30557; public static final int OAK_BIRDHOUSE_30558 = 30558; public static final int WILLOW_BIRDHOUSE_EMPTY = 30559; public static final int WILLOW_BIRDHOUSE = 30560; public static final int WILLOW_BIRDHOUSE_30561 = 30561; public static final int TEAK_BIRDHOUSE_EMPTY = 30562; public static final int TEAK_BIRDHOUSE = 30563; public static final int TEAK_BIRDHOUSE_30564 = 30564; public static final int BARGE_CONTROLS = 30569; public static final int BARGE_CONTROLS_30570 = 30570; public static final int TRAPDOOR_30587 = 30587; public static final int SULLIUSCEP = 30602; public static final int SULLIUSCEP_SPROUT = 30603; public static final int MUD_PIT = 30604; public static final int MUSHY_BED = 30605; public static final int RUBBER_CAP_MUSHROOM = 30606; public static final int VINES_30644 = 30644; public static final int TENDRILS_30645 = 30645; public static final int THICK_VINE = 30646; public static final int STUMP_30647 = 30647; public static final int THICK_VINES = 30648; public static final int STUMP_30649 = 30649; public static final int VINES_30650 = 30650; public static final int SKROOM = 30656; public static final int SKROOM_30657 = 30657; public static final int SKROOM_30658 = 30658; public static final int SKROOM_30659 = 30659; public static final int SKROOM_30660 = 30660; public static final int SKROOM_30661 = 30661; public static final int GRIM_LILLY = 30662; public static final int SPINE_MUSHROOM = 30663; public static final int SPINE_MUSHROOM_30664 = 30664; public static final int PITCHER_PLANT = 30665; public static final int A_DARK_CRYSTAL = 30666; public static final int SWAMP_BUBBLES_30667 = 30667; public static final int GRIM_LILLY_30668 = 30668; public static final int BELLSHROOM = 30670; public static final int BELLSHROOM_30671 = 30671; public static final int STAIRS_30681 = 30681; public static final int STAIRS_30682 = 30682; public static final int HOOK_BRIAR = 30704; public static final int HOOK_BRIAR_30705 = 30705; public static final int PILE_OF_ANCIENT_BOOKS = 30715; public static final int PILE_OF_ANCIENT_BOOKS_30716 = 30716; public static final int GIANT_VIAL = 30717; public static final int GIANT_VIAL_30718 = 30718; public static final int GIANT_VIAL_30719 = 30719; public static final int STONE_CHEST = 30720; public static final int STONE_CHEST_30721 = 30721; public static final int STONE_CRATE = 30722; public static final int STONE_CRATE_30723 = 30723; public static final int STONE_CRATE_30724 = 30724; public static final int TRAPDOOR_30725 = 30725; public static final int TRAPDOOR_30726 = 30726; public static final int LADDER_30727 = 30727; public static final int STRANGE_STONE = 30728; public static final int STRANGE_BLOCKS = 30729; public static final int CLAM = 30748; public static final int ANCHOR_30749 = 30749; public static final int OBSTACLE = 30766; public static final int OBSTACLE_30767 = 30767; public static final int BLOCKAGE_30774 = 30774; public static final int PLANT_30775 = 30775; public static final int PLANT_30776 = 30776; public static final int PLANT_30777 = 30777; public static final int PLANT_30778 = 30778; public static final int PLANT_30779 = 30779; public static final int PLANT_30780 = 30780; public static final int PLANT_30781 = 30781; public static final int PLANT_30782 = 30782; public static final int CURRENT = 30783; public static final int BANK_CHESTWRECK = 30796; public static final int SEAWEED_PILE = 30797; public static final int FUNGUS_30798 = 30798; public static final int FUNGI = 30799; public static final int MUSHTREE = 30801; public static final int MUSHTREE_30804 = 30804; public static final int ANCIENT_BUSH = 30805; public static final int BED_30806 = 30806; public static final int CRATE_30810 = 30810; public static final int CRATE_30811 = 30811; public static final int REINFORCED_CRATE = 30812; public static final int REINFORCED_CRATE_30814 = 30814; public static final int BOXES_30816 = 30816; public static final int BOXES_30817 = 30817; public static final int BARREL_30818 = 30818; public static final int BARREL_30819 = 30819; public static final int BARREL_30820 = 30820; public static final int BARREL_30821 = 30821; public static final int MUSHROOMS_30822 = 30822; public static final int MUSHROOMS_30823 = 30823; public static final int MUSHROOMS_30824 = 30824; public static final int MUSHROOMS_30825 = 30825; public static final int RED_STAR_FUNGI = 30826; public static final int RED_STAR_FUNGI_30827 = 30827; public static final int PAGODA_FUNGUS = 30828; public static final int PAGODA_FUNGUS_30829 = 30829; public static final int BLOOD_STINKHORN = 30830; public static final int BLOOD_STINKHORN_30831 = 30831; public static final int BLOOD_STINKHORN_30832 = 30832; public static final int BASKET_FUNGI = 30833; public static final int MUSHTREE_30834 = 30834; public static final int MUSHTREE_30835 = 30835; public static final int MUSHTREE_30836 = 30836; public static final int FALLEN_TREE_30837 = 30837; public static final int MUSHTREE_30838 = 30838; public static final int MUSHTREE_30839 = 30839; public static final int BLOOD_STINKTREE = 30840; public static final int LIFELILLY = 30841; public static final int TRAP_DOOR = 30842; public static final int DRIFTWOOD_30843 = 30843; public static final int EXIT_30844 = 30844; public static final int STAIRS_30845 = 30845; public static final int STAIRS_30846 = 30846; public static final int STAIRS_30847 = 30847; public static final int STAIRS_30849 = 30849; public static final int STAIRS_30850 = 30850; public static final int SHRINE_30851 = 30851; public static final int BURNT_TREE = 30852; public static final int BURNT_TREE_30853 = 30853; public static final int BURNT_TREE_30854 = 30854; public static final int DEAD_TREE_STUMP = 30855; public static final int DEAD_TREE_STUMP_30856 = 30856; public static final int ROCK_30857 = 30857; public static final int ROCK_30858 = 30858; public static final int WILHELM = 30865; public static final int SKELETON_30866 = 30866; public static final int CHEST_30867 = 30867; public static final int SKROOM_30868 = 30868; public static final int CAVE_ENTRANCE_30869 = 30869; public static final int TABLE_30871 = 30871; public static final int BROKEN_TABLE_30872 = 30872; public static final int CAVE_EXIT_30878 = 30878; public static final int ROWBOAT_30914 = 30914; public static final int ROWBOAT_30915 = 30915; public static final int ROPE_ANCHOR = 30916; public static final int ROPE_ANCHOR_30917 = 30917; public static final int ROWBOAT_30919 = 30919; public static final int MAGIC_MUSHTREE = 30920; public static final int MAGIC_MUSHTREE_30922 = 30922; public static final int MAGIC_MUSHTREE_30924 = 30924; public static final int BANK_CHEST_30926 = 30926; public static final int CHEST_PIECES = 30927; public static final int FOSSIL_CLEANING_BENCH = 30928; public static final int TABLE_PARTS = 30929; public static final int WELL_30930 = 30930; public static final int RING_OF_STONES = 30931; public static final int COOKING_POT_30932 = 30932; public static final int FIRE_PIT = 30933; public static final int SPINNING_WHEEL_30934 = 30934; public static final int BROKEN_SPINNING_WHEEL = 30935; public static final int LOOM_30936 = 30936; public static final int HALFBUILT_LOOM = 30937; public static final int LADDER_30938 = 30938; public static final int LADDER_30939 = 30939; public static final int LADDER_30940 = 30940; public static final int LADDER_30941 = 30941; public static final int CRATE_30942 = 30942; public static final int STRANGE_MACHINE_30943 = 30943; public static final int STRANGE_MACHINE_30944 = 30944; public static final int STRANGE_MACHINE_30945 = 30945; public static final int PILE_OF_ANCIENT_BOOKS_30946 = 30946; public static final int POT_OF_GOLD = 30947; public static final int ANCHOR_ROPE = 30948; public static final int ANCHOR_30949 = 30949; public static final int ANCHOR_30950 = 30950; public static final int ANCHOR_ROPE_30951 = 30951; public static final int DRIFT_NET_ANCHORS = 30952; public static final int DRIFT_NET_ANCHORS_30953 = 30953; public static final int DRIFT_NET_ANCHORS_30954 = 30954; public static final int DRIFT_NET_FULL = 30955; public static final int TUNNEL_30959 = 30959; public static final int PLANT_DOOR = 30960; public static final int PLANT_DOOR_30961 = 30961; public static final int OBSTACLE_30962 = 30962; public static final int OBSTACLE_30964 = 30964; public static final int HOLE_30966 = 30966; public static final int PILE_OF_FISHBOWLS = 30967; public static final int PILE_OF_FISHBOWLS_30968 = 30968; public static final int CLAM_30969 = 30969; public static final int CLAM_30970 = 30970; public static final int CHEST_30971 = 30971; public static final int CHEST_30972 = 30972; public static final int HOPPER_30973 = 30973; public static final int SLUICE_GATE = 30974; public static final int SLUICE_GATE_30975 = 30975; public static final int RINSING_POOL = 30976; public static final int RINSING_POOL_30977 = 30977; public static final int ANCIENT_SHROOM = 30980; public static final int ASH_PILE = 30985; public static final int EMPTY_ASH_PILE = 30986; public static final int FOSSIL_STORAGE = 30987; public static final int FOSSIL_STORAGE_30988 = 30988; public static final int BANK_CHEST_30989 = 30989; public static final int LAVA_30997 = 30997; public static final int STAIRCASE_31029 = 31029; public static final int STAIRCASE_31030 = 31030; public static final int VOLCANO_ENTRANCE = 31031; public static final int EXIT_31032 = 31032; public static final int GIANT_BOULDER = 31034; public static final int GIANT_BOULDER_31035 = 31035; public static final int LARGE_BOULDER_31036 = 31036; public static final int MEDIUM_BOULDER = 31037; public static final int SMALL_BOULDER = 31038; public static final int WHIRLPOOL_31039 = 31039; public static final int VOLCANIC_VENT = 31040; public static final int HEAT = 31042; public static final int VOLCANIC_CHAMBER = 31043; public static final int BLOCKED_VOLCANIC_CHAMBER = 31044; public static final int LARGE_ROCK_31045 = 31045; public static final int DEPLETED_ROCK = 31046; public static final int GAS_HOLE_31047 = 31047; public static final int GAS_HOLE_31048 = 31048; public static final int GAS_HOLE_31049 = 31049; public static final int GAS_HOLE_31050 = 31050; public static final int GAS_HOLE_31051 = 31051; public static final int GAS_HOLE_31052 = 31052; public static final int LEVIATHAN = 31053; public static final int LEVIATHAN_31054 = 31054; public static final int LEVIATHAN_31055 = 31055; public static final int LEVIATHAN_31056 = 31056; public static final int LEVIATHAN_31057 = 31057; public static final int LEVIATHAN_31058 = 31058; public static final int LARGE_FOSSIL_SUPPORT = 31059; public static final int LARGE_FOSSIL_SUPPORT_31060 = 31060; public static final int LARGE_FOSSIL_SUPPORT_31061 = 31061; public static final int LARGE_FOSSIL_SUPPORT_31062 = 31062; public static final int LARGE_FOSSIL_SUPPORT_31063 = 31063; public static final int LARGE_FOSSIL_SUPPORT_31064 = 31064; public static final int LEVIATHAN_31065 = 31065; public static final int LEVIATHAN_31066 = 31066; public static final int LEVIATHAN_31067 = 31067; public static final int LEVIATHAN_31068 = 31068; public static final int LEVIATHAN_31069 = 31069; public static final int LEVIATHAN_31070 = 31070; public static final int LARGE_FOSSIL_SUPPORT_31071 = 31071; public static final int LARGE_FOSSIL_SUPPORT_31072 = 31072; public static final int LARGE_FOSSIL_SUPPORT_31073 = 31073; public static final int LARGE_FOSSIL_SUPPORT_31074 = 31074; public static final int LARGE_FOSSIL_SUPPORT_31075 = 31075; public static final int LEVIATHAN_31076 = 31076; public static final int LEVIATHAN_31077 = 31077; public static final int LEVIATHAN_31078 = 31078; public static final int LEVIATHAN_31079 = 31079; public static final int LEVIATHAN_31080 = 31080; public static final int LEVIATHAN_31081 = 31081; public static final int LEVIATHAN_31082 = 31082; public static final int LARGE_FOSSIL_SUPPORT_31083 = 31083; public static final int LARGE_FOSSIL_SUPPORT_31084 = 31084; public static final int LARGE_FOSSIL_SUPPORT_31085 = 31085; public static final int LARGE_FOSSIL_SUPPORT_31086 = 31086; public static final int LARGE_FOSSIL_SUPPORT_31087 = 31087; public static final int LEVIATHAN_31088 = 31088; public static final int LEVIATHAN_31089 = 31089; public static final int LEVIATHAN_31090 = 31090; public static final int LEVIATHAN_31091 = 31091; public static final int LEVIATHAN_31092 = 31092; public static final int LEVIATHAN_31093 = 31093; public static final int LEVIATHAN_31094 = 31094; public static final int LARGE_FOSSIL_SUPPORT_31095 = 31095; public static final int LARGE_FOSSIL_SUPPORT_31096 = 31096; public static final int LARGE_FOSSIL_SUPPORT_31097 = 31097; public static final int LARGE_FOSSIL_SUPPORT_31098 = 31098; public static final int LARGE_FOSSIL_SUPPORT_31099 = 31099; public static final int LEVIATHAN_31100 = 31100; public static final int LARGE_FOSSIL_DISPLAY = 31101; public static final int LARGE_FOSSIL_SUPPORT_31102 = 31102; public static final int LARGE_FOSSIL_SUPPORT_31103 = 31103; public static final int LARGE_FOSSIL_SUPPORT_31104 = 31104; public static final int LARGE_FOSSIL_SUPPORT_31105 = 31105; public static final int LEVIATHAN_31106 = 31106; public static final int PLANT_FOSSIL_DISPLAY = 31107; public static final int PLANT_FOSSIL_DISPLAY_31108 = 31108; public static final int PLANT_FOSSIL_DISPLAY_31109 = 31109; public static final int PLANT_FOSSIL_DISPLAY_31110 = 31110; public static final int PLANT_FOSSIL_DISPLAY_31111 = 31111; public static final int PETRIFIED_MUSHTREE = 31112; public static final int PLANT_FOSSIL_DISPLAY_31113 = 31113; public static final int PLANT_FOSSIL_DISPLAY_31114 = 31114; public static final int PLANT_FOSSIL_DISPLAY_31115 = 31115; public static final int PLANT_FOSSIL_DISPLAY_31116 = 31116; public static final int PLANT_FOSSIL_DISPLAY_31117 = 31117; public static final int PETRIFIED_PITCHER = 31118; public static final int PLANT_FOSSIL_DISPLAY_31119 = 31119; public static final int PLANT_FOSSIL_DISPLAY_31120 = 31120; public static final int PLANT_FOSSIL_DISPLAY_31121 = 31121; public static final int PLANT_FOSSIL_DISPLAY_31122 = 31122; public static final int PLANT_FOSSIL_DISPLAY_31123 = 31123; public static final int SKROOM_31124 = 31124; public static final int PLANT_FOSSIL_DISPLAY_31125 = 31125; public static final int PLANT_FOSSIL_DISPLAY_31126 = 31126; public static final int PLANT_FOSSIL_DISPLAY_31127 = 31127; public static final int PLANT_FOSSIL_DISPLAY_31128 = 31128; public static final int PLANT_FOSSIL_DISPLAY_31129 = 31129; public static final int PETRIFIED_SPINE_PLANT = 31130; public static final int PLANT_FOSSIL_DISPLAY_31131 = 31131; public static final int PLANT_FOSSIL_DISPLAY_31132 = 31132; public static final int PLANT_FOSSIL_DISPLAY_31133 = 31133; public static final int PLANT_FOSSIL_DISPLAY_31134 = 31134; public static final int PLANT_FOSSIL_DISPLAY_31135 = 31135; public static final int PETRIFIED_LARGE_MUSHROOM = 31136; public static final int SMALL_FOSSIL_DISPLAY = 31137; public static final int SMALL_FOSSIL_DISPLAY_31138 = 31138; public static final int SMALL_FOSSIL_DISPLAY_31139 = 31139; public static final int SMALL_FOSSIL_DISPLAY_31140 = 31140; public static final int SMALL_FOSSIL_DISPLAY_31141 = 31141; public static final int MERFOLK_SKELETON = 31142; public static final int SMALL_FOSSIL_DISPLAY_31143 = 31143; public static final int SMALL_FOSSIL_DISPLAY_31144 = 31144; public static final int SMALL_FOSSIL_DISPLAY_31145 = 31145; public static final int SMALL_FOSSIL_DISPLAY_31146 = 31146; public static final int SMALL_FOSSIL_DISPLAY_31147 = 31147; public static final int PETRIFIED_PUFFERFISH = 31148; public static final int SMALL_FOSSIL_DISPLAY_31149 = 31149; public static final int SMALL_FOSSIL_DISPLAY_31150 = 31150; public static final int SMALL_FOSSIL_DISPLAY_31151 = 31151; public static final int SMALL_FOSSIL_DISPLAY_31152 = 31152; public static final int SMALL_FOSSIL_DISPLAY_31153 = 31153; public static final int HOOP_SNAKE = 31154; public static final int SMALL_FOSSIL_DISPLAY_31155 = 31155; public static final int SMALL_FOSSIL_DISPLAY_31156 = 31156; public static final int SMALL_FOSSIL_DISPLAY_31157 = 31157; public static final int SMALL_FOSSIL_DISPLAY_31158 = 31158; public static final int SMALL_FOSSIL_DISPLAY_31159 = 31159; public static final int WYVERN_EGG = 31160; public static final int SMALL_FOSSIL_DISPLAY_31161 = 31161; public static final int SMALL_FOSSIL_DISPLAY_31162 = 31162; public static final int SMALL_FOSSIL_DISPLAY_31163 = 31163; public static final int SMALL_FOSSIL_DISPLAY_31164 = 31164; public static final int SMALL_FOSSIL_DISPLAY_31165 = 31165; public static final int CRAB_SHELL = 31166; public static final int SMALL_FOSSIL_DISPLAY_31167 = 31167; public static final int SMALL_FOSSIL_DISPLAY_31168 = 31168; public static final int SMALL_FOSSIL_DISPLAY_31169 = 31169; public static final int SMALL_FOSSIL_DISPLAY_31170 = 31170; public static final int SMALL_FOSSIL_DISPLAY_31171 = 31171; public static final int FOSSIL_FUEL = 31172; public static final int SMALL_FOSSIL_DISPLAY_31173 = 31173; public static final int SMALL_FOSSIL_DISPLAY_31174 = 31174; public static final int SMALL_FOSSIL_DISPLAY_31175 = 31175; public static final int SMALL_FOSSIL_DISPLAY_31176 = 31176; public static final int SMALL_FOSSIL_DISPLAY_31177 = 31177; public static final int BIG_FOOT_PRINT = 31178; public static final int SMALL_FOSSIL_DISPLAY_31179 = 31179; public static final int SMALL_FOSSIL_DISPLAY_31180 = 31180; public static final int SMALL_FOSSIL_DISPLAY_31181 = 31181; public static final int SMALL_FOSSIL_DISPLAY_31182 = 31182; public static final int SMALL_FOSSIL_DISPLAY_31183 = 31183; public static final int ANCIENT_ZYGOMITE = 31184; public static final int SMALL_FOSSIL_DISPLAY_31185 = 31185; public static final int SMALL_FOSSIL_DISPLAY_31186 = 31186; public static final int SMALL_FOSSIL_DISPLAY_31187 = 31187; public static final int SMALL_FOSSIL_DISPLAY_31188 = 31188; public static final int SMALL_FOSSIL_DISPLAY_31189 = 31189; public static final int A_CLAM_SHELL = 31190; public static final int SMALL_FOSSIL_DISPLAY_31191 = 31191; public static final int SMALL_FOSSIL_DISPLAY_31192 = 31192; public static final int SMALL_FOSSIL_DISPLAY_31193 = 31193; public static final int SMALL_FOSSIL_DISPLAY_31194 = 31194; public static final int SMALL_FOSSIL_DISPLAY_31195 = 31195; public static final int A_PECULIAR_FOOT_PRINT = 31196; public static final int SMALL_FOSSIL_DISPLAY_31197 = 31197; public static final int SMALL_FOSSIL_DISPLAY_31198 = 31198; public static final int SMALL_FOSSIL_DISPLAY_31199 = 31199; public static final int SMALL_FOSSIL_DISPLAY_31200 = 31200; public static final int SMALL_FOSSIL_DISPLAY_31201 = 31201; public static final int A_PRIMITIVE_JOKE = 31202; public static final int SMALL_FOSSIL_DISPLAY_31203 = 31203; public static final int SMALL_FOSSIL_DISPLAY_31204 = 31204; public static final int SMALL_FOSSIL_DISPLAY_31205 = 31205; public static final int SMALL_FOSSIL_DISPLAY_31206 = 31206; public static final int SMALL_FOSSIL_DISPLAY_31207 = 31207; public static final int ANCIENT_CAVE_PAINTING = 31208; public static final int SMALL_FOSSIL_DISPLAY_31209 = 31209; public static final int SMALL_FOSSIL_DISPLAY_31210 = 31210; public static final int SMALL_FOSSIL_DISPLAY_31211 = 31211; public static final int SMALL_FOSSIL_DISPLAY_31212 = 31212; public static final int SMALL_FOSSIL_DISPLAY_31213 = 31213; public static final int BICLOPSE = 31214; public static final int SMALL_FOSSIL_DISPLAY_31215 = 31215; public static final int SMALL_FOSSIL_DISPLAY_31216 = 31216; public static final int SMALL_FOSSIL_DISPLAY_31217 = 31217; public static final int SMALL_FOSSIL_DISPLAY_31218 = 31218; public static final int SMALL_FOSSIL_DISPLAY_31219 = 31219; public static final int WYVERN_SKULL = 31220; public static final int MEDIUM_FOSSIL_DISPLAY = 31221; public static final int MEDIUM_FOSSIL_DISPLAY_31222 = 31222; public static final int MEDIUM_FOSSIL_DISPLAY_31223 = 31223; public static final int MEDIUM_FOSSIL_DISPLAY_31224 = 31224; public static final int MEDIUM_FOSSIL_DISPLAY_31225 = 31225; public static final int LOBSTROSITY = 31226; public static final int MEDIUM_FOSSIL_DISPLAY_31227 = 31227; public static final int MEDIUM_FOSSIL_DISPLAY_31228 = 31228; public static final int MEDIUM_FOSSIL_DISPLAY_31229 = 31229; public static final int MEDIUM_FOSSIL_DISPLAY_31230 = 31230; public static final int MEDIUM_FOSSIL_DISPLAY_31231 = 31231; public static final int TAR_THING = 31232; public static final int MEDIUM_FOSSIL_DISPLAY_31233 = 31233; public static final int MEDIUM_FOSSIL_DISPLAY_31234 = 31234; public static final int MEDIUM_FOSSIL_DISPLAY_31235 = 31235; public static final int MEDIUM_FOSSIL_DISPLAY_31236 = 31236; public static final int MEDIUM_FOSSIL_DISPLAY_31237 = 31237; public static final int GOBLN_MERFSH = 31238; public static final int MEDIUM_FOSSIL_DISPLAY_31239 = 31239; public static final int MEDIUM_FOSSIL_DISPLAY_31240 = 31240; public static final int MEDIUM_FOSSIL_DISPLAY_31241 = 31241; public static final int MEDIUM_FOSSIL_DISPLAY_31242 = 31242; public static final int MEDIUM_FOSSIL_DISPLAY_31243 = 31243; public static final int TWOCAN = 31244; public static final int MEDIUM_FOSSIL_DISPLAY_31245 = 31245; public static final int MEDIUM_FOSSIL_DISPLAY_31246 = 31246; public static final int MEDIUM_FOSSIL_DISPLAY_31247 = 31247; public static final int MEDIUM_FOSSIL_DISPLAY_31248 = 31248; public static final int MEDIUM_FOSSIL_DISPLAY_31249 = 31249; public static final int TERROR_SNAIL = 31250; public static final int MEDIUM_FOSSIL_DISPLAY_31251 = 31251; public static final int MEDIUM_FOSSIL_DISPLAY_31252 = 31252; public static final int MEDIUM_FOSSIL_DISPLAY_31253 = 31253; public static final int MEDIUM_FOSSIL_DISPLAY_31254 = 31254; public static final int MEDIUM_FOSSIL_DISPLAY_31255 = 31255; public static final int MUSHTOISE = 31256; public static final int MEDIUM_FOSSIL_DISPLAY_31257 = 31257; public static final int MEDIUM_FOSSIL_DISPLAY_31258 = 31258; public static final int MEDIUM_FOSSIL_DISPLAY_31259 = 31259; public static final int MEDIUM_FOSSIL_DISPLAY_31260 = 31260; public static final int MEDIUM_FOSSIL_DISPLAY_31261 = 31261; public static final int SHARK_BEAST = 31262; public static final int MEDIUM_FOSSIL_DISPLAY_31263 = 31263; public static final int MEDIUM_FOSSIL_DISPLAY_31264 = 31264; public static final int MEDIUM_FOSSIL_DISPLAY_31265 = 31265; public static final int MEDIUM_FOSSIL_DISPLAY_31266 = 31266; public static final int MEDIUM_FOSSIL_DISPLAY_31267 = 31267; public static final int MUSHROO = 31268; public static final int MEDIUM_FOSSIL_DISPLAY_31269 = 31269; public static final int MEDIUM_FOSSIL_DISPLAY_31270 = 31270; public static final int MEDIUM_FOSSIL_DISPLAY_31271 = 31271; public static final int MEDIUM_FOSSIL_DISPLAY_31272 = 31272; public static final int MEDIUM_FOSSIL_DISPLAY_31273 = 31273; public static final int SABERTOOTH_SQUIRREL = 31274; public static final int MEDIUM_FOSSIL_DISPLAY_31275 = 31275; public static final int MEDIUM_FOSSIL_DISPLAY_31276 = 31276; public static final int MEDIUM_FOSSIL_DISPLAY_31277 = 31277; public static final int MEDIUM_FOSSIL_DISPLAY_31278 = 31278; public static final int MEDIUM_FOSSIL_DISPLAY_31279 = 31279; public static final int MANDIBULAR_MAXIMUS = 31280; public static final int MEDIUM_FOSSIL_DISPLAY_31281 = 31281; public static final int MEDIUM_FOSSIL_DISPLAY_31282 = 31282; public static final int MEDIUM_FOSSIL_DISPLAY_31283 = 31283; public static final int MEDIUM_FOSSIL_DISPLAY_31284 = 31284; public static final int MEDIUM_FOSSIL_DISPLAY_31285 = 31285; public static final int DRAGONFLY = 31286; public static final int MEDIUM_FOSSIL_DISPLAY_31287 = 31287; public static final int MEDIUM_FOSSIL_DISPLAY_31288 = 31288; public static final int MEDIUM_FOSSIL_DISPLAY_31289 = 31289; public static final int MEDIUM_FOSSIL_DISPLAY_31290 = 31290; public static final int MEDIUM_FOSSIL_DISPLAY_31291 = 31291; public static final int DRAGONFLY_31292 = 31292; public static final int MEDIUM_FOSSIL_DISPLAY_31293 = 31293; public static final int MEDIUM_FOSSIL_DISPLAY_31294 = 31294; public static final int MEDIUM_FOSSIL_DISPLAY_31295 = 31295; public static final int MEDIUM_FOSSIL_DISPLAY_31296 = 31296; public static final int MEDIUM_FOSSIL_DISPLAY_31297 = 31297; public static final int LAVA_MONSTER = 31298; public static final int VIEWER = 31299; public static final int MUDDY_PATCH_31479 = 31479; public static final int MUDDY_PATCH_31480 = 31480; public static final int HOLE_31481 = 31481; public static final int HOLE_31482 = 31482; public static final int DEADMAN_CHEST_31484 = 31484; public static final int STAIRS_31485 = 31485; public static final int OBELISK_31554 = 31554; public static final int CAVERN_31555 = 31555; public static final int CAVERN_31556 = 31556; public static final int OPENING_31557 = 31557; public static final int OPENING_31558 = 31558; public static final int PILLAR_31561 = 31561; public static final int BUSH_31571 = 31571; public static final int LOG_STORAGE = 31572; public static final int LADDER_31579 = 31579; public static final int LADDER_31580 = 31580; public static final int TABLE_31581 = 31581; public static final int BANK_COUNTER_31582 = 31582; public static final int DEADMAN_SUPPLY_CHEST = 31583; public static final int MYSTERIOUS_RUINS_31584 = 31584; public static final int SPADE_31585 = 31585; public static final int TABLE_31587 = 31587; public static final int CAVE_ENTRANCE_31606 = 31606; public static final int MYSTERIOUS_RUINS_31607 = 31607; public static final int STAIRS_31609 = 31609; public static final int STAIRS_31610 = 31610; public static final int LADDER_31611 = 31611; public static final int LADDER_31612 = 31612; public static final int LADDER_31613 = 31613; public static final int MAGICAL_BARRIER = 31616; public static final int MAGICAL_BARRIER_31617 = 31617; public static final int PORTAL_OF_CHAMPIONS = 31618; public static final int GRAVESTONE_31619 = 31619; public static final int BUSH_31620 = 31620; public static final int PORTAL_OF_HEROES = 31621; public static final int PORTAL_OF_LEGENDS = 31622; public static final int ANVIL_31623 = 31623; public static final int ALTAR_31624 = 31624; public static final int FOUNTAIN_OF_UHLD = 31625; public static final int MYTHIC_STATUE = 31626; public static final int STAIRS_31627 = 31627; public static final int BOOKSHELF_31629 = 31629; public static final int BOOKSHELF_31630 = 31630; public static final int RANGE_31631 = 31631; public static final int TELESCOPE_31632 = 31632; public static final int TINDERBOX = 31634; public static final int STONE_PLINTH = 31670; public static final int STONE_PLINTH_31671 = 31671; public static final int ROOF_ENTRANCE = 31672; public static final int ROOF_ENTRANCE_31673 = 31673; public static final int ROOF_EXIT = 31674; public static final int MAGICAL_CHEST = 31675; public static final int DUSK = 31676; public static final int DAWN = 31677; public static final int ENERGY_SPHERE = 31678; public static final int ENERGY_SPHERE_31679 = 31679; public static final int ENERGY_SPHERE_31680 = 31680; public static final int THE_CLOISTER_BELL = 31684; public static final int THE_CLOISTER_BELL_31685 = 31685; public static final int THE_GROTESQUE_GUARDIANS_DISPLAY = 31689; public static final int CAVE_31690 = 31690; public static final int SAND_PILE_31691 = 31691; public static final int TUNNEL_ENTRANCE_31692 = 31692; public static final int ROPE_31693 = 31693; public static final int ROPE_31694 = 31694; public static final int CREVICE_31695 = 31695; public static final int CREVICE_31696 = 31696; public static final int ROCKS_31697 = 31697; public static final int ROCKS_31698 = 31698; public static final int STEPPING_STONE_31699 = 31699; public static final int CHEST_31703 = 31703; public static final int LADDER_31704 = 31704; public static final int LADDER_31705 = 31705; public static final int MANHOLE_31706 = 31706; public static final int MANHOLE_31707 = 31707; public static final int LADDER_31708 = 31708; public static final int DOORWAY_31709 = 31709; public static final int CHEST_31710 = 31710; public static final int CHEST_31711 = 31711; public static final int FISH_STALL_31712 = 31712; public static final int THRONE_31713 = 31713; public static final int OLD_MEMORIAL = 31714; public static final int LANCALLIUMS = 31715; public static final int GRAVESTONE_31716 = 31716; public static final int OLD_STALL = 31717; public static final int SAND_31718 = 31718; public static final int SAND_31719 = 31719; public static final int DRIFTWOOD_31721 = 31721; public static final int BURNING_DRIFTWOOD = 31722; public static final int WET_DRIFTWOOD = 31723; public static final int MYSTERIOUS_RUINS_31725 = 31725; public static final int BANK_DEPOSIT_BOX_31726 = 31726; public static final int TRAPDOOR_31731 = 31731; public static final int CURTAIN_31732 = 31732; public static final int STAIRS_31733 = 31733; public static final int STAIRS_31734 = 31734; public static final int STAIRS_31735 = 31735; public static final int CHEST_31748 = 31748; public static final int SIGN_31749 = 31749; public static final int THRONE_31754 = 31754; public static final int HOLE_31755 = 31755; public static final int GANGPLANK_31756 = 31756; public static final int ROCKS_31757 = 31757; public static final int ROCKS_31758 = 31758; public static final int ROCKS_31759 = 31759; public static final int CANNON_31761 = 31761; public static final int STUMP_CHAIR = 31762; public static final int EQUIPMENT = 31763; public static final int ROPE_31764 = 31764; public static final int HOLE_31765 = 31765; public static final int CAVE_31766 = 31766; public static final int ROCK_31781 = 31781; public static final int ROCK_31782 = 31782; public static final int ROCK_31783 = 31783; public static final int ROCK_31784 = 31784; public static final int ROCK_31785 = 31785; public static final int ROCK_31786 = 31786; public static final int ROCK_31787 = 31787; public static final int ROCK_31788 = 31788; public static final int ROCK_31789 = 31789; public static final int VINE_LADDER_31790 = 31790; public static final int HOLE_31791 = 31791; public static final int ROOTS_31792 = 31792; public static final int ROOT_31796 = 31796; public static final int OGRE_BED = 31797; public static final int FIRE_31798 = 31798; public static final int CLOSED_CHEST_31799 = 31799; public static final int STANDARD_31800 = 31800; public static final int CAVE_31806 = 31806; public static final int CAVE_31807 = 31807; public static final int MAGICAL_BARRIER_31808 = 31808; public static final int PILLAR_31809 = 31809; public static final int PALADIN = 31814; public static final int PALADIN_31815 = 31815; public static final int WHITE_KNIGHT = 31816; public static final int WHITE_KNIGHT_31817 = 31817; public static final int SOLDIER = 31818; public static final int SOLDIER_31819 = 31819; public static final int ICE_CHUNKS_31822 = 31822; public static final int ICE_CHUNKS_31824 = 31824; public static final int POOL_OF_DREAMS = 31825; public static final int DREAM_LIST = 31826; public static final int MAPLE_BIRDHOUSE_EMPTY = 31827; public static final int MAPLE_BIRDHOUSE = 31828; public static final int MAPLE_BIRDHOUSE_31829 = 31829; public static final int MAHOGANY_BIRDHOUSE_EMPTY = 31830; public static final int MAHOGANY_BIRDHOUSE = 31831; public static final int MAHOGANY_BIRDHOUSE_31832 = 31832; public static final int YEW_BIRDHOUSE_EMPTY = 31833; public static final int YEW_BIRDHOUSE = 31834; public static final int YEW_BIRDHOUSE_31835 = 31835; public static final int MAGIC_BIRDHOUSE_EMPTY = 31836; public static final int MAGIC_BIRDHOUSE = 31837; public static final int MAGIC_BIRDHOUSE_31838 = 31838; public static final int REDWOOD_BIRDHOUSE_EMPTY = 31839; public static final int REDWOOD_BIRDHOUSE = 31840; public static final int REDWOOD_BIRDHOUSE_31841 = 31841; public static final int DECAYING_TRUNK = 31842; public static final int ANNETTE = 31843; public static final int TUNNEL_31844 = 31844; public static final int TUNNEL_31845 = 31845; public static final int NOTICE_BOARD_31846 = 31846; public static final int ROCKS_31848 = 31848; public static final int ROCKS_31850 = 31850; public static final int ROPE_31853 = 31853; public static final int ROCKS_31854 = 31854; public static final int MANNEQUIN_31856 = 31856; public static final int MANNEQUIN_31857 = 31857; public static final int ALTAR_OF_THE_OCCULT = 31858; public static final int ALTAR_OF_THE_OCCULT_31859 = 31859; public static final int ALTAR_OF_THE_OCCULT_31860 = 31860; public static final int ALTAR_OF_THE_OCCULT_31861 = 31861; public static final int BRONZE_AXE_31862 = 31862; public static final int COMPOST_BIN_31863 = 31863; public static final int COMPOST_BIN_31864 = 31864; public static final int COMPOST_BIN_31865 = 31865; public static final int COMPOST_BIN_31866 = 31866; public static final int COMPOST_BIN_31867 = 31867; public static final int COMPOST_BIN_31868 = 31868; public static final int COMPOST_BIN_31869 = 31869; public static final int COMPOST_BIN_31870 = 31870; public static final int COMPOST_BIN_31871 = 31871; public static final int COMPOST_BIN_31872 = 31872; public static final int COMPOST_BIN_31873 = 31873; public static final int COMPOST_BIN_31874 = 31874; public static final int COMPOST_BIN_31875 = 31875; public static final int COMPOST_BIN_31876 = 31876; public static final int COMPOST_BIN_31877 = 31877; public static final int TOTEM_POLE_31878 = 31878; public static final int TOTEM_POLE_31879 = 31879; public static final int FOUNTAIN_OF_HEROES = 31880; public static final int FOUNTAIN_OF_HEROES_31881 = 31881; public static final int TABLE_31882 = 31882; public static final int CURTAIN_31885 = 31885; public static final int SHELVES_31887 = 31887; public static final int BRAZIER_31888 = 31888; public static final int CANDLE_STAND_31890 = 31890; public static final int OLD_PASSAGEWAY = 31891; public static final int OLD_PASSAGEWAY_31892 = 31892; public static final int VELVET_CHAIR_31898 = 31898; public static final int GOBLIN_CROWD_31900 = 31900; public static final int GOBLIN_CROWD_31901 = 31901; public static final int SLAYER_HELMET_DISPLAY_CASE = 31902; public static final int BANDOS_ARMOUR_DISPLAY_CASE = 31903; public static final int ARMADYL_ARMOUR_DISPLAY_CASE = 31904; public static final int KOUREND_MAP_DISPLAY_CASE = 31905; public static final int KRAKEN_DISPLAY_31906 = 31906; public static final int ZULRAH_DISPLAY_31907 = 31907; public static final int CERBERUS_DISPLAY_31908 = 31908; public static final int ABYSSAL_SIRE_DISPLAY_31909 = 31909; public static final int SKOTIZO_DISPLAY_31910 = 31910; public static final int THE_GROTESQUE_GUARDIANS_DISPLAY_31911 = 31911; public static final int VORKATH_DISPLAY = 31912; public static final int ACHIEVEMENT_DIARY_DISPLAY = 31913; public static final int ACHIEVEMENT_DIARY_DISPLAY_31914 = 31914; public static final int ELITE_CLUE_SCROLL_DISPLAY = 31915; public static final int MASTER_CLUE_SCROLL_DISPLAY = 31916; public static final int RUNITE_MINOR = 31917; public static final int GREAT_OLM_DISPLAY = 31918; public static final int TZKALZUK_DISPLAY = 31919; public static final int GENERAL_GRAARDOR_DISPLAY = 31920; public static final int CORPOREAL_BEAST_DISPLAY = 31921; public static final int GILDED_ADVENTURE_LOG_31922 = 31922; public static final int ALTAR_OF_THE_OCCULT_31923 = 31923; public static final int ORNATE_JEWELLERY_BOX_31924 = 31924; public static final int MOUNTED_MAX_CAPE_31925 = 31925; public static final int BURNING_BRAZIER_31926 = 31926; public static final int PYROMANCER = 31927; public static final int DEADMAN_DISPLAY = 31928; public static final int DEADMAN_DISPLAY_31929 = 31929; public static final int WORLD_MAP_DISPLAY = 31930; public static final int FOSSIL_ISLAND_DISPLAY_CASE = 31931; public static final int IRONMAN__ULTIMATE_IRONWOMAN = 31932; public static final int HARDCORE_IRONMAN = 31933; public static final int MONKEY_MADNESS_2_DISPLAY = 31934; public static final int ROOFTOP_AGILITY_DISPLAY = 31935; public static final int NIGHTMARE_ZONE_DISPLAY = 31936; public static final int GRAND_EXCHANGE_DISPLAY = 31939; public static final int COG_31940 = 31940; public static final int FOUNTAIN_OF_RUNE = 31941; public static final int FOUNTAIN_OF_RUNE_31942 = 31942; public static final int CRATE_31943 = 31943; public static final int CHEST_OF_CHAMPIONS_31944 = 31944; public static final int RAY_OF_LIGHT = 31946; public static final int RAY_OF_LIGHT_31947 = 31947; public static final int BANK_BOX = 31948; public static final int BANK_BOX_31949 = 31949; public static final int BEARHEAD = 31950; public static final int CELL_GATE = 31953; public static final int CELL_GATE_31954 = 31954; public static final int CELL_GATE_31955 = 31955; public static final int CELL_GATE_31956 = 31956; public static final int CYAN_CRYSTAL_31957 = 31957; public static final int MAGENTA_CRYSTAL_31958 = 31958; public static final int YELLOW_CRYSTAL_31959 = 31959; public static final int WHITE_CRYSTAL_31960 = 31960; public static final int PORTAL_31961 = 31961; public static final int SKELETON_31962 = 31962; public static final int SKELETON_31963 = 31963; public static final int CREVICE_31965 = 31965; public static final int CREVICE_31966 = 31966; public static final int ROPE_31967 = 31967; public static final int ROPE_31968 = 31968; public static final int CRYSTAL_31969 = 31969; public static final int CRYSTAL_31970 = 31970; public static final int BED_31971 = 31971; public static final int IVORY_TABLE_31972 = 31972; public static final int IVORY_TABLE_31973 = 31973; public static final int BRAZIER_31974 = 31974; public static final int PLANT_31975 = 31975; public static final int VORKATH_HEAD = 31977; public static final int VORKATH_DISPLAY_31978 = 31978; public static final int MOUNTED_MAX_CAPE_31979 = 31979; public static final int MOUNTED_MAX_CAPE_31980 = 31980; public static final int MOUNTED_MAX_CAPE_31981 = 31981; public static final int MOUNTED_MAX_CAPE_31982 = 31982; public static final int MOUNTED_MYTHICAL_CAPE = 31983; public static final int RUNE_DRAGON = 31984; public static final int VORKATH_TOPIARY = 31985; public static final int MYTHICAL_CAPE = 31986; public static final int CLOSED_CHEST_31987 = 31987; public static final int OPEN_CHEST_31988 = 31988; public static final int FREMENNIK_BOAT_31989 = 31989; public static final int ICE_CHUNKS_31990 = 31990; public static final int ICE_CHUNKS_31991 = 31991; public static final int ICE_CHUNKS_31992 = 31992; public static final int ICE_CHUNKS_31993 = 31993; public static final int ICE_CHUNKS_31994 = 31994; public static final int ICE_CHUNKS_31995 = 31995; public static final int ICE_CHUNKS_31996 = 31996; public static final int ICE_CHUNKS_31997 = 31997; public static final int ICE_CHUNKS_31998 = 31998; public static final int CAVE_31999 = 31999; public static final int ACID_POOL_32000 = 32000; public static final int ICE_CHUNKS_32009 = 32009; public static final int ICE_CHUNKS_32010 = 32010; public static final int ICE_CHUNKS_32011 = 32011; public static final int ICE_CHUNKS_32012 = 32012; public static final int ICE_BLOCKAGE = 32015; public static final int CAVE_ENTRANCE_32047 = 32047; public static final int DOOR_32052 = 32052; public static final int STONE_CHEST_32053 = 32053; public static final int STONE_CHEST_32054 = 32054; public static final int LEVER_32055 = 32055; public static final int LEVER_32056 = 32056; public static final int STONE_CHEST_32057 = 32057; public static final int STONE_CRATE_32067 = 32067; public static final int STONE_CRATE_32068 = 32068; public static final int STONE_CRATE_32069 = 32069; public static final int ANCIENT_MACHINERY_32073 = 32073; public static final int ANCIENT_MACHINERY_32074 = 32074; public static final int ANCIENT_EQUIPMENT = 32075; public static final int ANCIENT_INCUBATOR = 32076; public static final int ANCIENT_EQUIPMENT_32077 = 32077; public static final int ANCIENT_INCUBATOR_32078 = 32078; public static final int ROWBOAT_32079 = 32079; public static final int STAIRCASE_32080 = 32080; public static final int STAIRS_32081 = 32081; public static final int STAIRS_32082 = 32082; public static final int LADDER_32083 = 32083; public static final int TRAPDOOR_32084 = 32084; public static final int STAIRS_32089 = 32089; public static final int SKELETON_32090 = 32090; public static final int SKELETON_32091 = 32091; public static final int STAIRCASE_32112 = 32112; public static final int STAIRCASE_32113 = 32113; public static final int GRANDIOSE_DOORS = 32114; public static final int GRANDIOSE_DOORS_32115 = 32115; public static final int GRANDIOSE_DOORS_32116 = 32116; public static final int BROKEN_GRANDIOSE_DOORS = 32117; public static final int TORCH_32118 = 32118; public static final int BRAZIER_32119 = 32119; public static final int BONES_32125 = 32125; public static final int PILE_OF_ANCIENT_BOOKS_32126 = 32126; public static final int PILE_OF_ANCIENT_BOOKS_32127 = 32127; public static final int CANDLE_32128 = 32128; public static final int BROKEN_GRANDIOSE_DOORS_32132 = 32132; public static final int GRANDIOSE_DOORS_32133 = 32133; public static final int MACHINERY_32139 = 32139; public static final int GENERATOR = 32141; public static final int MURAL = 32143; public static final int MURAL_32144 = 32144; public static final int ANCIENT_MACHINERY_32147 = 32147; public static final int STRANGE_MACHINE_32148 = 32148; public static final int GENERATOR_32151 = 32151; public static final int BARRIER_32153 = 32153; public static final int DRAGON = 32154; public static final int MACHINERY_32156 = 32156; public static final int MACHINERY_32157 = 32157; public static final int ANCIENT_MACHINERY_32158 = 32158; public static final int INCUBATOR = 32159; public static final int INCUBATOR_32160 = 32160; public static final int MACHINERY_32161 = 32161; public static final int STONE_CRATE_32162 = 32162; public static final int WALL_32163 = 32163; public static final int WALL_32164 = 32164; public static final int BLOCKAGE_32165 = 32165; public static final int BLOCKAGE_32166 = 32166; public static final int BLOCKAGE_32167 = 32167; public static final int BLOCKAGE_32168 = 32168; public static final int TUNNEL_32169 = 32169; public static final int TUNNEL_32170 = 32170; public static final int ANCIENT_MACHINERY_32185 = 32185; public static final int LARGE_CAGE = 32186; public static final int STONE_CRATE_32187 = 32187; public static final int STONE_CRATE_32188 = 32188; public static final int STONE_CRATE_32189 = 32189; public static final int STONE_CHEST_32190 = 32190; public static final int GIANT_VIAL_32191 = 32191; public static final int CAVE_ENTRANCE_32198 = 32198; public static final int STRANGE_EGG = 32199; public static final int STRANGE_EGG_32200 = 32200; public static final int STRANGE_EGG_32201 = 32201; public static final int STRANGE_EGG_32202 = 32202; public static final int ANCIENT_MURAL = 32203; public static final int LADDER_32205 = 32205; public static final int STAIRS_32206 = 32206; public static final int MITHRIL_DOOR_32208 = 32208; public static final int ORB = 32209; public static final int ORB_32210 = 32210; public static final int ROUGH_HEWN_STEPS = 32211; public static final int ROUGH_HEWN_STEPS_32212 = 32212; public static final int DRAGON_HEAD_32213 = 32213; public static final int DRAGON_HEAD_32214 = 32214; public static final int ANVIL_32215 = 32215; public static final int ANVIL_32216 = 32216; public static final int HAMMERS = 32293; public static final int WATER_CONTAINERS = 32294; public static final int SWAMP_PASTE = 32295; public static final int POTIONS = 32296; public static final int FIRE_32297 = 32297; public static final int LEAK_32298 = 32298; public static final int FREMENNIK_WARRIOR = 32299; public static final int FREMENNIK_WARRIOR_32300 = 32300; public static final int FREMENNIK_WARRIOR_32301 = 32301; public static final int FREMENNIK_WARRIOR_32302 = 32302; public static final int FREMENNIK_DRUMMER = 32303; public static final int MAST_32304 = 32304; public static final int DAMAGED_MAST = 32305; public static final int FREMENNIK_WARRIOR_32307 = 32307; public static final int FREMENNIK_WARRIOR_32308 = 32308; public static final int DAMAGED_MAST_32309 = 32309; public static final int GAP_32312 = 32312; public static final int GAP_32313 = 32313; public static final int SHIP = 32314; public static final int DEBRIS = 32316; public static final int DEBRIS_32317 = 32317; public static final int WRECKAGE = 32319; public static final int SHIP_32320 = 32320; public static final int ROPE_LADDER_32321 = 32321; public static final int ROPE_LADDER_32322 = 32322; public static final int ROPE_LADDER_32323 = 32323; public static final int ROPE_32324 = 32324; public static final int SHIP_32325 = 32325; public static final int SHIP_32326 = 32326; public static final int BOWSPRIT = 32327; public static final int BOWSPRIT_32328 = 32328; public static final int DEBRIS_32374 = 32374; public static final int DEBRIS_32375 = 32375; public static final int DEBRIS_32376 = 32376; public static final int DEBRIS_32377 = 32377; public static final int FIRE_TRAP = 32378; public static final int TOMB_32392 = 32392; public static final int STAIRCASE_32393 = 32393; public static final int STAIRCASE_32394 = 32394; public static final int LADDER_32395 = 32395; public static final int LADDER_32396 = 32396; public static final int LADDER_32397 = 32397; public static final int LADDER_32398 = 32398; public static final int LADDER_32399 = 32399; public static final int LADDER_32400 = 32400; public static final int LADDER_32401 = 32401; public static final int LADDER_32402 = 32402; public static final int CRYPT_ENTRANCE = 32403; public static final int LARGE_DOORS = 32404; public static final int LARGE_DOORS_32405 = 32405; public static final int LARGE_DOORS_32406 = 32406; public static final int LARGE_DOORS_32407 = 32407; public static final int TOMB_32410 = 32410; public static final int TOMB_32411 = 32411; public static final int TOMB_32412 = 32412; public static final int BUST_32413 = 32413; public static final int BUST_32414 = 32414; public static final int BUST_32415 = 32415; public static final int BUST_32416 = 32416; public static final int BUST_32417 = 32417; public static final int BUST_32418 = 32418; public static final int BUST_32419 = 32419; public static final int BUST_32420 = 32420; public static final int PLINTH_32421 = 32421; public static final int PLINTH_32422 = 32422; public static final int PLINTH_32423 = 32423; public static final int PLINTH_32424 = 32424; public static final int PLINTH_32425 = 32425; public static final int PLINTH_32426 = 32426; public static final int ITEM_CHEST = 32440; public static final int STRANGE_GRID = 32441; public static final int INCOMPLETE_MAP = 32442; public static final int INCOMPLETE_MAP_32443 = 32443; public static final int MAP_32444 = 32444; public static final int STONE_CHEST_32445 = 32445; public static final int STONE_CHEST_32446 = 32446; public static final int STONE_CHEST_32447 = 32447; public static final int STONE_CHEST_32448 = 32448; public static final int FUNGI_32449 = 32449; public static final int FUNGI_32450 = 32450; public static final int HOOK_BRIAR_32451 = 32451; public static final int HOOK_BRIAR_32452 = 32452; public static final int MUSHTREE_32453 = 32453; public static final int MUSHTREE_32454 = 32454; public static final int ROWBOAT_SPACE = 32455; public static final int ROWBOAT_32456 = 32456; public static final int ENERGY_BARRIER_32457 = 32457; public static final int HISTORY = 32458; public static final int PILLAR_32459 = 32459; public static final int FREMENNIK_BOAT_32460 = 32460; public static final int FREMENNIK_BOAT_32461 = 32461; public static final int BOOKCASE_32462 = 32462; public static final int DOOR_32464 = 32464; public static final int DOOR_32465 = 32465; public static final int ROCKS_32466 = 32466; public static final int GRAVE_32467 = 32467; public static final int GRAVE_32468 = 32468; public static final int CAVE_32479 = 32479; public static final int STAIRCASE_32480 = 32480; public static final int TRAP_32481 = 32481; public static final int TRAP_32482 = 32482; public static final int TRAP_32483 = 32483; public static final int TRAP_32484 = 32484; public static final int PLINTH_32485 = 32485; public static final int PLINTH_32486 = 32486; public static final int PLINTH_32487 = 32487; public static final int SKELETON_32488 = 32488; public static final int MYSTERIOUS_RUINS_32489 = 32489; public static final int MYSTERIOUS_RUINS_32490 = 32490; public static final int MYSTERIOUS_RUINS_32491 = 32491; public static final int MYSTERIOUS_RUINS_32492 = 32492; public static final int GLOWING_ORB = 32501; public static final int ROCKFALL_32503 = 32503; public static final int BOULDER_32504 = 32504; public static final int BOULDER_32505 = 32505; public static final int OBELISK_32506 = 32506; public static final int MAGIC_GATE = 32507; public static final int UNSTABLE_ALTAR = 32508; public static final int TABLE_32509 = 32509; public static final int BROKEN_BED = 32511; public static final int BROKEN_TABLE_32513 = 32513; public static final int BROKEN_BRAZIER = 32516; public static final int BROKEN_PLANTPOT = 32518; public static final int GLOWING_CARVING_32524 = 32524; public static final int BALL = 32532; public static final int LEAFLET = 32533; public static final int GATE_32534 = 32534; public static final int ROCK_PILE_32535 = 32535; public static final int LOGS_32536 = 32536; public static final int MOUNTED_XERICS_GUARD = 32537; public static final int MOUNTED_XERICS_WARRIOR = 32538; public static final int MOUNTED_XERICS_SENTINEL = 32539; public static final int MOUNTED_XERICS_GENERAL = 32540; public static final int MOUNTED_XERICS_CHAMPION = 32541; public static final int HOLE_32542 = 32542; public static final int ROPE_32543 = 32543; public static final int SCORE_BOARD_32544 = 32544; public static final int POLL_BOOTH_32546 = 32546; public static final int POLL_BOOTH_32547 = 32547; public static final int WINDOW_32548 = 32548; public static final int RUBBLE_32549 = 32549; public static final int RUBBLE_32550 = 32550; public static final int VENT_32551 = 32551; public static final int DAMAGED_VENT = 32552; public static final int ROOF_32553 = 32553; public static final int ROOF_32554 = 32554; public static final int ROOF_32555 = 32555; public static final int BROKEN_FOUNTAIN = 32557; public static final int BROKEN_FOUNTAIN_32558 = 32558; public static final int BED_32559 = 32559; public static final int STAIRS_32560 = 32560; public static final int STAIRS_32561 = 32561; public static final int DOOR_32562 = 32562; public static final int BARREL_32564 = 32564; public static final int BARREL_32565 = 32565; public static final int CRATE_32566 = 32566; public static final int CRATE_32567 = 32567; public static final int CRATE_32568 = 32568; public static final int CRATE_32569 = 32569; public static final int CRATES_32570 = 32570; public static final int CRATES_32571 = 32571; public static final int CHEST_32572 = 32572; public static final int CHEST_32573 = 32573; public static final int CRATE_32574 = 32574; public static final int CRATE_32575 = 32575; public static final int CRATE_32576 = 32576; public static final int TRAPDOOR_32577 = 32577; public static final int TRAPDOOR_32578 = 32578; public static final int LADDER_32579 = 32579; public static final int MEIYERDITCH_CITIZEN = 32580; public static final int MEIYERDITCH_CITIZEN_32581 = 32581; public static final int MEIYERDITCH_CITIZEN_32582 = 32582; public static final int MEIYERDITCH_CITIZEN_32583 = 32583; public static final int MEIYERDITCH_CITIZEN_32584 = 32584; public static final int MEIYERDITCH_CITIZEN_32585 = 32585; public static final int MEIYERDITCH_CITIZEN_32586 = 32586; public static final int MEIYERDITCH_CITIZEN_32587 = 32587; public static final int MEIYERDITCH_CITIZEN_32588 = 32588; public static final int MEIYERDITCH_CITIZEN_32589 = 32589; public static final int MEIYERDITCH_CITIZEN_32590 = 32590; public static final int MEIYERDITCH_CITIZEN_32591 = 32591; public static final int OLD_MAN_RAL = 32592; public static final int KAEL_FORSHAW = 32593; public static final int THEATRE_OF_BLOOD = 32594; public static final int NOTICE_BOARD_32595 = 32595; public static final int CHEST_32596 = 32596; public static final int RANIS_DRAKAN = 32600; public static final int ROW_BOAT_32601 = 32601; public static final int ROW_BOAT_32602 = 32602; public static final int BELL_32619 = 32619; public static final int CHEST_32624 = 32624; public static final int COFFIN_32625 = 32625; public static final int CLOAK_RACK = 32626; public static final int DRAPES = 32627; public static final int PORTRAIT_32628 = 32628; public static final int LARGE_GRAVE_32629 = 32629; public static final int ALTAR_OF_ZAMORAK = 32630; public static final int SIMPLE_STOVE = 32631; public static final int HIDDEN_STATUE = 32632; public static final int ZAMORAKS_STATUE_32633 = 32633; public static final int STONE_TABLET_32634 = 32634; public static final int CHURCH_ORGAN_32635 = 32635; public static final int CRATE_32636 = 32636; public static final int LADDER_32637 = 32637; public static final int LADDER_32638 = 32638; public static final int LADDER_32639 = 32639; public static final int LADDER_32640 = 32640; public static final int TRAPDOOR_32641 = 32641; public static final int LADDER_32642 = 32642; public static final int TRAPDOOR_32643 = 32643; public static final int LADDER_32644 = 32644; public static final int STAIRCASE_32645 = 32645; public static final int STAIRCASE_32646 = 32646; public static final int STAIRS_32647 = 32647; public static final int STAIRS_32648 = 32648; public static final int MEIYERDITCH_CITIZEN_32652 = 32652; public static final int THEATRE_OF_BLOOD_32653 = 32653; public static final int VYRE_WELL = 32654; public static final int NOTICE_BOARD_32655 = 32655; public static final int CHEST_32656 = 32656; public static final int DOOR_32659 = 32659; public static final int DOOR_32660 = 32660; public static final int BANK_DEPOSIT_BOX_32665 = 32665; public static final int BANK_BOOTH_32666 = 32666; public static final int CLOSED_BANK_BOOTH_32667 = 32667; public static final int EASEL_32685 = 32685; public static final int VERZIKS_THRONE = 32686; public static final int SUPPORTING_PILLAR = 32687; public static final int VERZIK_VITUR = 32690; public static final int SKELETON_32735 = 32735; public static final int VERZIKS_THRONE_32737 = 32737; public static final int TREASURE_ROOM = 32738; public static final int COOKING_RANGE_32739 = 32739; public static final int SKELETON_32741 = 32741; public static final int SKELETON_32742 = 32742; public static final int EXHUMED = 32743; public static final int ACIDIC_MIASMA = 32744; public static final int DOOR_32751 = 32751; public static final int MERCENARY = 32754; public static final int BARRIER_32755 = 32755; public static final int VYRE_ORATOR = 32756; public static final int VYRE_ORATOR_32757 = 32757; public static final int CHEST_32758 = 32758; public static final int CHEST_32759 = 32759; public static final int SUPPORT_32862 = 32862; public static final int SUPPORT_32863 = 32863; public static final int BROKEN_SUPPORT = 32864; public static final int MERCENARY_32938 = 32938; public static final int TWISTED_BOW = 32940; public static final int HANGING_HAND = 32951; public static final int HANGING_HAND_32952 = 32952; public static final int CHAMBER = 32957; public static final int OPERATING_TABLE_32958 = 32958; public static final int MERCENARY_32968 = 32968; public static final int CORPSE_32969 = 32969; public static final int THE_MAIDEN_OF_SUGADINTI = 32972; public static final int POOL_OF_BLOOD = 32973; public static final int VYRE_WELL_32985 = 32985; public static final int TATTY_TOY = 32986; public static final int SCOREBOARD_32987 = 32987; public static final int MONUMENTAL_CHEST = 32990; public static final int MONUMENTAL_CHEST_32991 = 32991; public static final int MONUMENTAL_CHEST_32992 = 32992; public static final int MONUMENTAL_CHEST_32993 = 32993; public static final int MONUMENTAL_CHEST_32994 = 32994; public static final int STAIRS_32995 = 32995; public static final int TELEPORT_CRYSTAL = 32996; public static final int GRAND_BOOKSHELF = 33000; public static final int GRAND_BOOKSHELF_33001 = 33001; public static final int GRAND_BOOKSHELF_33002 = 33002; public static final int GRAND_BOOKSHELF_33003 = 33003; public static final int WAR_TABLE = 33011; public static final int JUSTICIAR_ARMOUR = 33012; public static final int JUSTICIAR_ARMOUR_33013 = 33013; public static final int STRATEGY_TABLE = 33014; public static final int SMALL_CHEST_33016 = 33016; public static final int WEAPON_RACK_33020 = 33020; public static final int TILE = 33033; public static final int TILE_33034 = 33034; public static final int TILE_33035 = 33035; public static final int TILE_33036 = 33036; public static final int PORTAL_33037 = 33037; public static final int VYRE_WELL_33081 = 33081; public static final int VYRE_WELL_33082 = 33082; public static final int GRAVE_33083 = 33083; public static final int VARROCK_PORTAL = 33092; public static final int GRAND_EXCHANGE_PORTAL = 33093; public static final int CAMELOT_PORTAL = 33094; public static final int SEERS_VILLAGE_PORTAL = 33095; public static final int YANILLE_WATCHTOWER_PORTAL = 33096; public static final int YANILLE_PORTAL = 33097; public static final int VARROCK_PORTAL_33098 = 33098; public static final int GRAND_EXCHANGE_PORTAL_33099 = 33099; public static final int CAMELOT_PORTAL_33100 = 33100; public static final int SEERS_VILLAGE_PORTAL_33101 = 33101; public static final int YANILLE_PORTAL_33102 = 33102; public static final int YANILLE_PORTAL_33103 = 33103; public static final int VARROCK_PORTAL_33104 = 33104; public static final int GRAND_EXCHANGE_PORTAL_33105 = 33105; public static final int CAMELOT_PORTAL_33106 = 33106; public static final int SEERS_VILLAGE_PORTAL_33107 = 33107; public static final int YANILLE_WATCHTOWER_PORTAL_33108 = 33108; public static final int YANILLE_PORTAL_33109 = 33109; public static final int ARENA_33111 = 33111; public static final int ARENA_33112 = 33112; public static final int FORMIDABLE_PASSAGE = 33113; public static final int DEADMAN_SUPPLY_CHEST_33114 = 33114; public static final int DEADMAN_SUPPLY_CHEST_33115 = 33115; public static final int DEADMAN_SUPPLY_CHEST_33116 = 33116; public static final int DEADMAN_SUPPLY_CHEST_33117 = 33117; public static final int DEADMAN_SUPPLY_CHEST_33118 = 33118; public static final int DEADMAN_SUPPLY_CHEST_33119 = 33119; public static final int DEADMAN_SUPPLY_CHEST_33120 = 33120; public static final int DEADMAN_SUPPLY_CHEST_33121 = 33121; public static final int DEADMAN_SUPPLY_CHEST_33122 = 33122; public static final int DEADMAN_SUPPLY_CHEST_33123 = 33123; public static final int DEADMAN_SUPPLY_CHEST_33124 = 33124; public static final int DEADMAN_SUPPLY_CHEST_33125 = 33125; public static final int BLUE_BANNER = 33126; public static final int RED_BANNER = 33127; public static final int YELLOW_BANNER = 33128; public static final int GREEN_BANNER = 33129; public static final int HORN_OF_DEATH = 33143; public static final int DRUMMER = 33144; public static final int CRANE_33145 = 33145; public static final int ICE_CRYSTAL = 33146; public static final int BLOOD_CRYSTAL_33147 = 33147; public static final int SHADOW_CRYSTAL = 33148; public static final int SMOKE_CRYSTAL = 33149; public static final int ICY_ROCKS = 33177; public static final int TROLL_STRONGHOLD_PORTAL = 33179; public static final int TROLL_STRONGHOLD_PORTAL_33180 = 33180; public static final int TROLL_STRONGHOLD_PORTAL_33181 = 33181; public static final int BOAT_33182 = 33182; public static final int ROCKSLIDE_33184 = 33184; public static final int ROCKSLIDE_33185 = 33185; public static final int TREE_33186 = 33186; public static final int ROPED_TREE = 33187; public static final int ROPE_33188 = 33188; public static final int CLIFF_33189 = 33189; public static final int LEDGE_33190 = 33190; public static final int ROCKSLIDE_33191 = 33191; public static final int FALLEN_TREE_33192 = 33192; public static final int CAVE_ENTRANCE_33193 = 33193; public static final int CAVE_ENTRANCE_33194 = 33194; public static final int WRECKED_BOAT = 33195; public static final int SKELETON_33196 = 33196; public static final int FLOWER_33198 = 33198; public static final int MOTHER = 33199; public static final int DONT_KNOW_WHAT = 33200; public static final int BOULDER_33201 = 33201; public static final int ROOT_33202 = 33202; public static final int ICICLE_33203 = 33203; public static final int DRIFTWOOD_33204 = 33204; public static final int PEBBLE = 33205; public static final int GOAT_POO = 33206; public static final int YELLOW_SNOW = 33207; public static final int BUTTERFLY = 33208; public static final int ODD_STONE = 33209; public static final int SQUIRREL = 33210; public static final int MOUNTAIN_GOAT = 33211; public static final int ICE_WOLF = 33212; public static final int SQUIRREL_33213 = 33213; public static final int GOAT_POO_33214 = 33214; public static final int FENCE_33219 = 33219; public static final int TE_SALT = 33222; public static final int URT_SALT = 33223; public static final int EFH_SALT = 33224; public static final int HOLE_33227 = 33227; public static final int THRONE_OF_WEISS = 33232; public static final int WEISS_BANNER = 33233; public static final int STAIRS_33234 = 33234; public static final int STONE_LADDER_33235 = 33235; public static final int RAMP = 33236; public static final int NARROW_GAP = 33237; public static final int WATERS_EDGE = 33238; public static final int WATERS_EDGE_33239 = 33239; public static final int STEPPING_STONE_33240 = 33240; public static final int STEPPING_STONE_33241 = 33241; public static final int STEPPING_STONE_33242 = 33242; public static final int STEPPING_STONE_33243 = 33243; public static final int STEPPING_STONE_33244 = 33244; public static final int STEPPING_STONE_33245 = 33245; public static final int CAVE_EXIT_33246 = 33246; public static final int CAVE_EXIT_33247 = 33247; public static final int DANGER_SIGN_33252 = 33252; public static final int ROCKS_33253 = 33253; public static final int ROCKS_33254 = 33254; public static final int ROCKS_33255 = 33255; public static final int ROCKS_33256 = 33256; public static final int ROCKS_33257 = 33257; public static final int CELL_DOOR_33258 = 33258; public static final int MINE_DOOR = 33259; public static final int MINE_DOOR_33260 = 33260; public static final int STEPS_33261 = 33261; public static final int SMELLY_HOLE = 33262; public static final int COFFIN_HOTSPOT = 33263; public static final int COFFIN_33264 = 33264; public static final int OLD_MANS_COFFIN = 33265; public static final int OLD_SHRINE = 33307; public static final int BARREL_OF_WATER = 33308; public static final int BUCKETS = 33309; public static final int FIRE_PIT_33310 = 33310; public static final int FIRE_33311 = 33311; public static final int LITTLE_BOULDER = 33312; public static final int NEW_FARMING_PATCH_33314 = 33314; public static final int HARDY_GOUTWEED_33315 = 33315; public static final int HARDY_GOUTWEED_33316 = 33316; public static final int OLD_FIRE_PIT = 33317; public static final int FIRE_OF_DOMINATION = 33318; public static final int FIRE_OF_NOURISHMENT = 33319; public static final int FIRE_OF_ETERNAL_LIGHT = 33320; public static final int FIRE_OF_UNSEASONAL_WARMTH = 33321; public static final int FIRE_OF_DEHUMIDIFICATION = 33322; public static final int PILE_OF_RUBBLE_33340 = 33340; public static final int PILE_OF_RUBBLE_33341 = 33341; public static final int LARRANS_SMALL_CHEST = 33343; public static final int BROKEN_WALL_33344 = 33344; public static final int PORTAL_NEXUS_SPACE = 33346; public static final int RUG_SPACE_33347 = 33347; public static final int BIG_WINDOW = 33348; public static final int RUG_SPACE_33349 = 33349; public static final int RUG_SPACE_33350 = 33350; public static final int CURTAIN_SPACE_33351 = 33351; public static final int AMULET_SPACE = 33352; public static final int AMULET_SPACE_33353 = 33353; public static final int PORTAL_NEXUS = 33354; public static final int PORTAL_NEXUS_33355 = 33355; public static final int PORTAL_NEXUS_33356 = 33356; public static final int PORTAL_NEXUS_33357 = 33357; public static final int PORTAL_NEXUS_33358 = 33358; public static final int PORTAL_NEXUS_33359 = 33359; public static final int PORTAL_NEXUS_33360 = 33360; public static final int PORTAL_NEXUS_33361 = 33361; public static final int PORTAL_NEXUS_33362 = 33362; public static final int PORTAL_NEXUS_33363 = 33363; public static final int PORTAL_NEXUS_33364 = 33364; public static final int PORTAL_NEXUS_33365 = 33365; public static final int PORTAL_NEXUS_33366 = 33366; public static final int PORTAL_NEXUS_33367 = 33367; public static final int PORTAL_NEXUS_33368 = 33368; public static final int PORTAL_NEXUS_33369 = 33369; public static final int PORTAL_NEXUS_33370 = 33370; public static final int PORTAL_NEXUS_33371 = 33371; public static final int PORTAL_NEXUS_33372 = 33372; public static final int PORTAL_NEXUS_33373 = 33373; public static final int PORTAL_NEXUS_33374 = 33374; public static final int PORTAL_NEXUS_33375 = 33375; public static final int PORTAL_NEXUS_33376 = 33376; public static final int PORTAL_NEXUS_33377 = 33377; public static final int PORTAL_NEXUS_33378 = 33378; public static final int PORTAL_NEXUS_33379 = 33379; public static final int PORTAL_NEXUS_33380 = 33380; public static final int PORTAL_NEXUS_33381 = 33381; public static final int PORTAL_NEXUS_33382 = 33382; public static final int PORTAL_NEXUS_33383 = 33383; public static final int PORTAL_NEXUS_33384 = 33384; public static final int PORTAL_NEXUS_33385 = 33385; public static final int PORTAL_NEXUS_33386 = 33386; public static final int PORTAL_NEXUS_33387 = 33387; public static final int PORTAL_NEXUS_33388 = 33388; public static final int PORTAL_NEXUS_33389 = 33389; public static final int PORTAL_NEXUS_33390 = 33390; public static final int PORTAL_NEXUS_33391 = 33391; public static final int PORTAL_NEXUS_33392 = 33392; public static final int PORTAL_NEXUS_33393 = 33393; public static final int PORTAL_NEXUS_33394 = 33394; public static final int PORTAL_NEXUS_33395 = 33395; public static final int PORTAL_NEXUS_33396 = 33396; public static final int PORTAL_NEXUS_33397 = 33397; public static final int PORTAL_NEXUS_33398 = 33398; public static final int PORTAL_NEXUS_33399 = 33399; public static final int PORTAL_NEXUS_33400 = 33400; public static final int PORTAL_NEXUS_33401 = 33401; public static final int PORTAL_NEXUS_33402 = 33402; public static final int PORTAL_NEXUS_33403 = 33403; public static final int PORTAL_NEXUS_33404 = 33404; public static final int PORTAL_NEXUS_33405 = 33405; public static final int PORTAL_NEXUS_33406 = 33406; public static final int PORTAL_NEXUS_33407 = 33407; public static final int PORTAL_NEXUS_33408 = 33408; public static final int PORTAL_NEXUS_33409 = 33409; public static final int PORTAL_NEXUS_33410 = 33410; public static final int XERICS_TALISMAN = 33411; public static final int XERICS_TALISMAN_33412 = 33412; public static final int XERICS_TALISMAN_33413 = 33413; public static final int XERICS_TALISMAN_33414 = 33414; public static final int XERICS_TALISMAN_33415 = 33415; public static final int DIGSITE_PENDANT = 33416; public static final int DIGSITE_PENDANT_33417 = 33417; public static final int DIGSITE_PENDANT_33418 = 33418; public static final int XERICS_TALISMAN_33419 = 33419; public static final int DIGSITE_PENDANT_33420 = 33420; public static final int ROCKS_33422 = 33422; public static final int PORTAL_NEXUS_33423 = 33423; public static final int PORTAL_NEXUS_33424 = 33424; public static final int PORTAL_NEXUS_33425 = 33425; public static final int PORTAL_NEXUS_33426 = 33426; public static final int PORTAL_NEXUS_33427 = 33427; public static final int PORTAL_NEXUS_33428 = 33428; public static final int PORTAL_NEXUS_33429 = 33429; public static final int PORTAL_NEXUS_33430 = 33430; public static final int PORTAL_NEXUS_33431 = 33431; public static final int CATHERBY_PORTAL = 33432; public static final int GHORROCK_PORTAL = 33433; public static final int CARRALLANGAR_PORTAL = 33434; public static final int CATHERBY_PORTAL_33435 = 33435; public static final int GHORROCK_PORTAL_33436 = 33436; public static final int CARRALLANGAR_PORTAL_33437 = 33437; public static final int CATHERBY_PORTAL_33438 = 33438; public static final int GHORROCK_PORTAL_33439 = 33439; public static final int CARRALLANGAR_PORTAL_33440 = 33440; public static final int SCRYING_ORB = 33441; public static final int SUPPLIES_33442 = 33442; public static final int PORTAL_33443 = 33443; public static final int PORTAL_33444 = 33444; public static final int BRAZIER_33454 = 33454; public static final int HEROIC_STATUE = 33455; public static final int CHALICE_33456 = 33456; public static final int ICE_THRONE_33477 = 33477; public static final int PEAR_TREE = 33480; public static final int POLL_BOOTH_33481 = 33481; public static final int POLL_BOOTH_33482 = 33482; public static final int LADDER_33483 = 33483; public static final int LADDER_33484 = 33484; public static final int LADDER_33485 = 33485; public static final int LADDER_33486 = 33486; public static final int DISPLAY_CASE_33487 = 33487; public static final int DISPLAY_CASE_33488 = 33488; public static final int DISPLAY_CASE_33489 = 33489; public static final int DISPLAY_CASE_33490 = 33490; public static final int DOOR_33491 = 33491; public static final int STEAM_GENERATOR_33493 = 33493; public static final int STEAM_GENERATOR_33494 = 33494; public static final int STEAM_GENERATOR_33495 = 33495; public static final int CRATE_33496 = 33496; public static final int CRATES_33497 = 33497; public static final int CRATE_33498 = 33498; public static final int POWER_GRID = 33499; public static final int POWER_GRID_33500 = 33500; public static final int POWER_GRID_33501 = 33501; public static final int FURNACE_33502 = 33502; public static final int FURNACE_33503 = 33503; public static final int FURNACE_33504 = 33504; public static final int COOLANT_DISPENSER = 33506; public static final int COOLANT_DISPENSER_33507 = 33507; public static final int FURNACE_COOLANT = 33508; public static final int FURNACE_COOLANT_33509 = 33509; public static final int FURNACE_COOLANT_33510 = 33510; public static final int CUPBOARD_33513 = 33513; public static final int CUPBOARD_33514 = 33514; public static final int CUPBOARD_33515 = 33515; public static final int REFINERY = 33516; public static final int REFINERY_33517 = 33517; public static final int REFINERY_33518 = 33518; public static final int REFINERY_33519 = 33519; public static final int TABLE_33520 = 33520; public static final int TABLE_33521 = 33521; public static final int CUPBOARD_33522 = 33522; public static final int RUNIC_ALTAR = 33523; public static final int RUNIC_ALTAR_33524 = 33524; public static final int ENERGY_PYLON = 33525; public static final int ENERGY_PYLON_33526 = 33526; public static final int ENERGY_PYLON_33527 = 33527; public static final int ENERGY_PYLON_33528 = 33528; public static final int ENERGY_PYLON_33529 = 33529; public static final int ENERGY_PYLON_33530 = 33530; public static final int ENERGY_PYLON_33531 = 33531; public static final int ENERGY_PYLON_33532 = 33532; public static final int ENERGY_PYLON_33533 = 33533; public static final int ENERGY_PYLON_33534 = 33534; public static final int ENERGY_PYLON_33535 = 33535; public static final int ENERGY_PYLON_33536 = 33536; public static final int ENERGY_PYLON_33537 = 33537; public static final int ENERGY_PYLON_33538 = 33538; public static final int ENERGY_PYLON_33539 = 33539; public static final int ENERGY_PYLON_33540 = 33540; public static final int ENERGY_PYLON_33541 = 33541; public static final int ENERGY_PYLON_33542 = 33542; public static final int SHELF_33548 = 33548; public static final int STAIRCASE_33549 = 33549; public static final int STAIRCASE_33550 = 33550; public static final int STAIRCASE_33551 = 33551; public static final int STAIRCASE_33552 = 33552; public static final int DOOR_33556 = 33556; public static final int DOOR_33557 = 33557; public static final int CRATE_33558 = 33558; public static final int CRATES_33559 = 33559; public static final int TABLE_33560 = 33560; public static final int TABLE_33561 = 33561; public static final int TABLE_33562 = 33562; public static final int TABLE_33563 = 33563; public static final int CRATE_33565 = 33565; public static final int DEAD_BODY = 33567; public static final int THANA = 33568; public static final int BRIGHT_CRYSTAL_33569 = 33569; public static final int DOOR_33570 = 33570; public static final int DOOR_33571 = 33571; public static final int DOOR_33572 = 33572; public static final int DOOR_33573 = 33573; public static final int STAIRS_33574 = 33574; public static final int STAIRS_33575 = 33575; public static final int STAIRS_33576 = 33576; public static final int STAIRS_33577 = 33577; public static final int ANCIENT_GRAVE = 33578; public static final int ANCIENT_GRAVE_33579 = 33579; public static final int TREE_STUMP_33583 = 33583; public static final int TREE_STUMP_33584 = 33584; public static final int BUSH_33585 = 33585; public static final int BUSH_33586 = 33586; public static final int PLANT_33587 = 33587; public static final int PLANT_33588 = 33588; public static final int PLANT_33589 = 33589; public static final int PLANT_33590 = 33590; public static final int PLANT_33591 = 33591; public static final int PLANT_33592 = 33592; public static final int ROCKS_33593 = 33593; public static final int ROCKS_33594 = 33594; public static final int ROCKS_33595 = 33595; public static final int ROCKS_33596 = 33596; public static final int BOOKSHELF_33597 = 33597; public static final int BOOKSHELF_33598 = 33598; public static final int BOOKSHELF_33599 = 33599; public static final int BOOKSHELF_33600 = 33600; public static final int BOOKSHELF_33601 = 33601; public static final int BOOKSHELF_33602 = 33602; public static final int BOOKSHELF_33603 = 33603; public static final int BOOKSHELF_33604 = 33604; public static final int BOOKSHELF_33605 = 33605; public static final int BOOKSHELF_33606 = 33606; public static final int BOOKSHELF_33607 = 33607; public static final int MACHINERY_33608 = 33608; public static final int MACHINERY_33609 = 33609; public static final int UNOCCUPIED_CORMORANT_PERCH = 33612; public static final int OCCUPIED_CORMORANT_PERCH = 33613; public static final int BOATY = 33614; public static final int BUSH_33638 = 33638; public static final int SEED_STALL_33639 = 33639; public static final int SWAMP_BUBBLES_33640 = 33640; public static final int WHITE_LILY = 33650; public static final int WHITE_LILY_33651 = 33651; public static final int WHITE_LILY_33652 = 33652; public static final int WHITE_LILY_33653 = 33653; public static final int WHITE_LILY_33654 = 33654; public static final int WHITE_LILY_33655 = 33655; public static final int WHITE_LILY_33656 = 33656; public static final int WHITE_LILY_33657 = 33657; public static final int WHITE_LILY_33658 = 33658; public static final int DISEASED_WHITE_LILY = 33659; public static final int DISEASED_WHITE_LILY_33660 = 33660; public static final int DISEASED_WHITE_LILY_33661 = 33661; public static final int DEAD_WHITE_LILY = 33662; public static final int DEAD_WHITE_LILY_33663 = 33663; public static final int DEAD_WHITE_LILY_33664 = 33664; public static final int DEAD_WHITE_LILY_33665 = 33665; public static final int SNAPE_GRASS_SEEDLING = 33666; public static final int SNAPE_GRASS_PLANT = 33667; public static final int SNAPE_GRASS_PLANT_33668 = 33668; public static final int SNAPE_GRASS_PLANT_33669 = 33669; public static final int SNAPE_GRASS_PLANT_33670 = 33670; public static final int SNAPE_GRASS_PLANT_33671 = 33671; public static final int SNAPE_GRASS_PLANT_33672 = 33672; public static final int SNAPE_GRASS_PLANT_33673 = 33673; public static final int SNAPE_GRASS_SEEDLING_33674 = 33674; public static final int SNAPE_GRASS_PLANT_33675 = 33675; public static final int SNAPE_GRASS_PLANT_33676 = 33676; public static final int SNAPE_GRASS_PLANT_33677 = 33677; public static final int SNAPE_GRASS_PLANT_33678 = 33678; public static final int SNAPE_GRASS_PLANT_33679 = 33679; public static final int SNAPE_GRASS_PLANT_33680 = 33680; public static final int DISEASED_SNAPE_GRASS = 33681; public static final int DISEASED_SNAPE_GRASS_33682 = 33682; public static final int DISEASED_SNAPE_GRASS_33683 = 33683; public static final int DISEASED_SNAPE_GRASS_33684 = 33684; public static final int DISEASED_SNAPE_GRASS_33685 = 33685; public static final int DISEASED_SNAPE_GRASS_33686 = 33686; public static final int DEAD_SNAPE_GRASS = 33687; public static final int DEAD_SNAPE_GRASS_33688 = 33688; public static final int DEAD_SNAPE_GRASS_33689 = 33689; public static final int DEAD_SNAPE_GRASS_33690 = 33690; public static final int DEAD_SNAPE_GRASS_33691 = 33691; public static final int DEAD_SNAPE_GRASS_33692 = 33692; public static final int CELASTRUS_PATCH = 33695; public static final int CELASTRUS_PATCH_33696 = 33696; public static final int CELASTRUS_PATCH_33697 = 33697; public static final int CELASTRUS_PATCH_33698 = 33698; public static final int CELASTRUS_TREE = 33699; public static final int CELASTRUS_TREE_33700 = 33700; public static final int CELASTRUS_TREE_33701 = 33701; public static final int CELASTRUS_TREE_33702 = 33702; public static final int CELASTRUS_TREE_33703 = 33703; public static final int CELASTRUS_TREE_33704 = 33704; public static final int DISEASED_CELASTRUS_TREE = 33705; public static final int DISEASED_CELASTRUS_TREE_33706 = 33706; public static final int DISEASED_CELASTRUS_TREE_33707 = 33707; public static final int DISEASED_CELASTRUS_TREE_33708 = 33708; public static final int DISEASED_CELASTRUS_TREE_33709 = 33709; public static final int DISEASED_CELASTRUS_TREE_33710 = 33710; public static final int DEAD_CELASTRUS_TREE = 33711; public static final int DEAD_CELASTRUS_TREE_33712 = 33712; public static final int DEAD_CELASTRUS_TREE_33713 = 33713; public static final int DEAD_CELASTRUS_TREE_33714 = 33714; public static final int DEAD_CELASTRUS_TREE_33715 = 33715; public static final int DEAD_CELASTRUS_TREE_33716 = 33716; public static final int CELASTRUS_TREE_33717 = 33717; public static final int CELASTRUS_TREE_33718 = 33718; public static final int CELASTRUS_TREE_33719 = 33719; public static final int HARVESTED_CELASTRUS_TREE = 33720; public static final int CELASTRUS_TREE_STUMP = 33721; public static final int HESPORI_PATCH = 33722; public static final int HESPORI_PATCH_33723 = 33723; public static final int HESPORI_PATCH_33724 = 33724; public static final int HESPORI_PATCH_33725 = 33725; public static final int HESPORI = 33726; public static final int HESPORI_33727 = 33727; public static final int HESPORI_33728 = 33728; public static final int HESPORI_33729 = 33729; public static final int HESPORI_33730 = 33730; public static final int POTATO_CACTUS = 33734; public static final int POTATO_CACTUS_33735 = 33735; public static final int POTATO_CACTUS_33736 = 33736; public static final int POTATO_CACTUS_33737 = 33737; public static final int POTATO_CACTUS_33738 = 33738; public static final int POTATO_CACTUS_33739 = 33739; public static final int POTATO_CACTUS_33740 = 33740; public static final int POTATO_CACTUS_33741 = 33741; public static final int POTATO_CACTUS_33742 = 33742; public static final int POTATO_CACTUS_33743 = 33743; public static final int POTATO_CACTUS_33744 = 33744; public static final int POTATO_CACTUS_33745 = 33745; public static final int POTATO_CACTUS_33746 = 33746; public static final int POTATO_CACTUS_33747 = 33747; public static final int POTATO_CACTUS_33748 = 33748; public static final int DISEASED_POTATO_CACTUS = 33749; public static final int DISEASED_POTATO_CACTUS_33750 = 33750; public static final int DISEASED_POTATO_CACTUS_33751 = 33751; public static final int DISEASED_POTATO_CACTUS_33752 = 33752; public static final int DISEASED_POTATO_CACTUS_33753 = 33753; public static final int DISEASED_POTATO_CACTUS_33754 = 33754; public static final int DEAD_POTATO_CACTUS = 33755; public static final int DEAD_POTATO_CACTUS_33756 = 33756; public static final int DEAD_POTATO_CACTUS_33757 = 33757; public static final int DEAD_POTATO_CACTUS_33758 = 33758; public static final int DEAD_POTATO_CACTUS_33759 = 33759; public static final int DEAD_POTATO_CACTUS_33760 = 33760; public static final int BIG_COMPOST_BIN = 33762; public static final int BIG_COMPOST_BIN_33763 = 33763; public static final int BIG_COMPOST_BIN_33764 = 33764; public static final int BIG_COMPOST_BIN_33765 = 33765; public static final int BIG_COMPOST_BIN_33766 = 33766; public static final int BIG_COMPOST_BIN_33767 = 33767; public static final int BIG_COMPOST_BIN_33768 = 33768; public static final int BIG_COMPOST_BIN_33769 = 33769; public static final int BIG_COMPOST_BIN_33770 = 33770; public static final int BIG_COMPOST_BIN_33771 = 33771; public static final int BIG_COMPOST_BIN_33772 = 33772; public static final int BIG_COMPOST_BIN_33773 = 33773; public static final int BIG_COMPOST_BIN_33774 = 33774; public static final int BIG_COMPOST_BIN_33775 = 33775; public static final int BIG_COMPOST_BIN_33776 = 33776; public static final int BIG_COMPOST_BIN_33777 = 33777; public static final int BIG_COMPOST_BIN_33778 = 33778; public static final int BIG_COMPOST_BIN_33779 = 33779; public static final int BIG_COMPOST_BIN_33780 = 33780; public static final int BIG_COMPOST_BIN_33781 = 33781; public static final int BIG_COMPOST_BIN_33782 = 33782; public static final int BIG_COMPOST_BIN_33783 = 33783; public static final int BIG_COMPOST_BIN_33784 = 33784; public static final int BIG_COMPOST_BIN_33785 = 33785; public static final int BIG_COMPOST_BIN_33786 = 33786; public static final int BIG_COMPOST_BIN_33787 = 33787; public static final int BIG_COMPOST_BIN_33788 = 33788; public static final int BIG_COMPOST_BIN_33789 = 33789; public static final int BIG_COMPOST_BIN_33790 = 33790; public static final int BIG_COMPOST_BIN_33791 = 33791; public static final int BIG_COMPOST_BIN_33792 = 33792; public static final int BIG_COMPOST_BIN_33793 = 33793; public static final int BIG_COMPOST_BIN_33794 = 33794; public static final int BIG_COMPOST_BIN_33795 = 33795; public static final int BIG_COMPOST_BIN_33796 = 33796; public static final int BIG_COMPOST_BIN_33797 = 33797; public static final int BIG_COMPOST_BIN_33798 = 33798; public static final int BIG_COMPOST_BIN_33799 = 33799; public static final int BIG_COMPOST_BIN_33800 = 33800; public static final int BIG_COMPOST_BIN_33801 = 33801; public static final int BIG_COMPOST_BIN_33802 = 33802; public static final int BIG_COMPOST_BIN_33803 = 33803; public static final int BIG_COMPOST_BIN_33804 = 33804; public static final int BIG_COMPOST_BIN_33805 = 33805; public static final int BIG_COMPOST_BIN_33806 = 33806; public static final int BIG_COMPOST_BIN_33807 = 33807; public static final int BIG_COMPOST_BIN_33808 = 33808; public static final int BIG_COMPOST_BIN_33809 = 33809; public static final int BIG_COMPOST_BIN_33810 = 33810; public static final int BIG_COMPOST_BIN_33811 = 33811; public static final int BIG_COMPOST_BIN_33812 = 33812; public static final int BIG_COMPOST_BIN_33813 = 33813; public static final int BIG_COMPOST_BIN_33814 = 33814; public static final int BIG_COMPOST_BIN_33815 = 33815; public static final int BIG_COMPOST_BIN_33816 = 33816; public static final int BIG_COMPOST_BIN_33817 = 33817; public static final int BIG_COMPOST_BIN_33818 = 33818; public static final int BIG_COMPOST_BIN_33819 = 33819; public static final int BIG_COMPOST_BIN_33820 = 33820; public static final int BIG_COMPOST_BIN_33821 = 33821; public static final int BIG_COMPOST_BIN_33822 = 33822; public static final int BIG_COMPOST_BIN_33823 = 33823; public static final int BIG_COMPOST_BIN_33824 = 33824; public static final int BIG_COMPOST_BIN_33825 = 33825; public static final int BIG_COMPOST_BIN_33826 = 33826; public static final int BIG_COMPOST_BIN_33827 = 33827; public static final int BIG_COMPOST_BIN_33828 = 33828; public static final int BIG_COMPOST_BIN_33829 = 33829; public static final int BIG_COMPOST_BIN_33830 = 33830; public static final int BIG_COMPOST_BIN_33831 = 33831; public static final int BIG_COMPOST_BIN_33832 = 33832; public static final int BIG_COMPOST_BIN_33833 = 33833; public static final int BIG_COMPOST_BIN_33834 = 33834; public static final int BIG_COMPOST_BIN_33835 = 33835; public static final int BIG_COMPOST_BIN_33836 = 33836; public static final int BIG_COMPOST_BIN_33837 = 33837; public static final int BIG_COMPOST_BIN_33838 = 33838; public static final int BIG_COMPOST_BIN_33839 = 33839; public static final int BIG_COMPOST_BIN_33840 = 33840; public static final int BIG_COMPOST_BIN_33841 = 33841; public static final int BIG_COMPOST_BIN_33842 = 33842; public static final int BIG_COMPOST_BIN_33843 = 33843; public static final int BIG_COMPOST_BIN_33844 = 33844; public static final int BIG_COMPOST_BIN_33845 = 33845; public static final int BIG_COMPOST_BIN_33846 = 33846; public static final int BIG_COMPOST_BIN_33847 = 33847; public static final int BIG_COMPOST_BIN_33848 = 33848; public static final int BIG_COMPOST_BIN_33849 = 33849; public static final int BIG_COMPOST_BIN_33850 = 33850; public static final int BIG_COMPOST_BIN_33851 = 33851; public static final int BIG_COMPOST_BIN_33852 = 33852; public static final int BIG_COMPOST_BIN_33853 = 33853; public static final int BIG_COMPOST_BIN_33854 = 33854; public static final int BIG_COMPOST_BIN_33855 = 33855; public static final int BIG_COMPOST_BIN_33856 = 33856; public static final int BIG_COMPOST_BIN_33857 = 33857; public static final int BIG_COMPOST_BIN_33858 = 33858; public static final int BIG_COMPOST_BIN_33859 = 33859; public static final int BIG_COMPOST_BIN_33860 = 33860; public static final int BIG_COMPOST_BIN_33861 = 33861; public static final int BIG_COMPOST_BIN_33862 = 33862; public static final int BIG_COMPOST_BIN_33863 = 33863; public static final int BIG_COMPOST_BIN_33864 = 33864; public static final int BIG_COMPOST_BIN_33865 = 33865; public static final int BIG_COMPOST_BIN_33866 = 33866; public static final int BIG_COMPOST_BIN_33867 = 33867; public static final int BIG_COMPOST_BIN_33868 = 33868; public static final int BIG_COMPOST_BIN_33869 = 33869; public static final int BIG_COMPOST_BIN_33870 = 33870; public static final int BIG_COMPOST_BIN_33871 = 33871; public static final int BIG_COMPOST_BIN_33872 = 33872; public static final int BIG_COMPOST_BIN_33873 = 33873; public static final int BIG_COMPOST_BIN_33874 = 33874; public static final int BIG_COMPOST_BIN_33875 = 33875; public static final int BIG_COMPOST_BIN_33876 = 33876; public static final int BIG_COMPOST_BIN_33877 = 33877; public static final int BIG_COMPOST_BIN_33878 = 33878; public static final int BIG_COMPOST_BIN_33879 = 33879; public static final int BIG_COMPOST_BIN_33880 = 33880; public static final int BIG_COMPOST_BIN_33881 = 33881; public static final int BIG_COMPOST_BIN_33882 = 33882; public static final int BIG_COMPOST_BIN_33883 = 33883; public static final int BIG_COMPOST_BIN_33884 = 33884; public static final int BIG_COMPOST_BIN_33885 = 33885; public static final int BIG_COMPOST_BIN_33886 = 33886; public static final int BIG_COMPOST_BIN_33887 = 33887; public static final int BIG_COMPOST_BIN_33888 = 33888; public static final int BIG_COMPOST_BIN_33889 = 33889; public static final int BIG_COMPOST_BIN_33890 = 33890; public static final int BIG_COMPOST_BIN_33891 = 33891; public static final int BIG_COMPOST_BIN_33892 = 33892; public static final int BIG_COMPOST_BIN_33893 = 33893; public static final int BIG_COMPOST_BIN_33894 = 33894; public static final int BIG_COMPOST_BIN_33895 = 33895; public static final int BIG_COMPOST_BIN_33896 = 33896; public static final int BIG_COMPOST_BIN_33897 = 33897; public static final int BIG_COMPOST_BIN_33898 = 33898; public static final int BIG_COMPOST_BIN_33899 = 33899; public static final int BIG_COMPOST_BIN_33900 = 33900; public static final int BIG_COMPOST_BIN_33901 = 33901; public static final int BIG_COMPOST_BIN_33902 = 33902; public static final int BIG_COMPOST_BIN_33903 = 33903; public static final int BIG_COMPOST_BIN_33904 = 33904; public static final int BIG_COMPOST_BIN_33905 = 33905; public static final int BIG_COMPOST_BIN_33906 = 33906; public static final int BIG_COMPOST_BIN_33907 = 33907; public static final int BIG_COMPOST_BIN_33908 = 33908; public static final int BIG_COMPOST_BIN_33909 = 33909; public static final int BIG_COMPOST_BIN_33910 = 33910; public static final int BIG_COMPOST_BIN_33911 = 33911; public static final int BIG_COMPOST_BIN_33912 = 33912; public static final int BIG_COMPOST_BIN_33913 = 33913; public static final int BIG_COMPOST_BIN_33914 = 33914; public static final int BIG_COMPOST_BIN_33915 = 33915; public static final int BIG_COMPOST_BIN_33916 = 33916; public static final int BIG_COMPOST_BIN_33917 = 33917; public static final int BIG_COMPOST_BIN_33918 = 33918; public static final int BIG_COMPOST_BIN_33919 = 33919; public static final int BIG_COMPOST_BIN_33920 = 33920; public static final int BIG_COMPOST_BIN_33921 = 33921; public static final int BIG_COMPOST_BIN_33922 = 33922; public static final int BIG_COMPOST_BIN_33923 = 33923; public static final int BIG_COMPOST_BIN_33924 = 33924; public static final int BIG_COMPOST_BIN_33925 = 33925; public static final int BIG_COMPOST_BIN_33926 = 33926; public static final int BIG_COMPOST_BIN_33927 = 33927; public static final int BIG_COMPOST_BIN_33928 = 33928; public static final int BIG_COMPOST_BIN_33929 = 33929; public static final int BIG_COMPOST_BIN_33930 = 33930; public static final int BIG_COMPOST_BIN_33931 = 33931; public static final int BIG_COMPOST_BIN_33932 = 33932; public static final int BIG_COMPOST_BIN_33933 = 33933; public static final int BIG_COMPOST_BIN_33934 = 33934; public static final int BIG_COMPOST_BIN_33935 = 33935; public static final int BIG_COMPOST_BIN_33936 = 33936; public static final int BIG_COMPOST_BIN_33937 = 33937; public static final int BIG_COMPOST_BIN_33938 = 33938; public static final int BIG_COMPOST_BIN_33939 = 33939; public static final int BIG_COMPOST_BIN_33940 = 33940; public static final int BIG_COMPOST_BIN_33941 = 33941; public static final int BIG_COMPOST_BIN_33942 = 33942; public static final int BIG_COMPOST_BIN_33943 = 33943; public static final int BIG_COMPOST_BIN_33944 = 33944; public static final int BIG_COMPOST_BIN_33945 = 33945; public static final int BIG_COMPOST_BIN_33946 = 33946; public static final int BIG_COMPOST_BIN_33947 = 33947; public static final int BIG_COMPOST_BIN_33948 = 33948; public static final int BIG_COMPOST_BIN_33949 = 33949; public static final int BIG_COMPOST_BIN_33950 = 33950; public static final int BIG_COMPOST_BIN_33951 = 33951; public static final int BIG_COMPOST_BIN_33952 = 33952; public static final int BIG_COMPOST_BIN_33953 = 33953; public static final int BIG_COMPOST_BIN_33954 = 33954; public static final int BIG_COMPOST_BIN_33955 = 33955; public static final int BIG_COMPOST_BIN_33956 = 33956; public static final int BIG_COMPOST_BIN_33957 = 33957; public static final int BIG_COMPOST_BIN_33958 = 33958; public static final int BIG_COMPOST_BIN_33959 = 33959; public static final int BIG_COMPOST_BIN_33960 = 33960; public static final int BIG_COMPOST_BIN_33961 = 33961; public static final int BIG_COMPOST_BIN_33962 = 33962; public static final int BIG_COMPOST_BIN_33963 = 33963; public static final int BIG_COMPOST_BIN_33964 = 33964; public static final int BIG_COMPOST_BIN_33965 = 33965; public static final int BIG_COMPOST_BIN_33966 = 33966; public static final int BIG_COMPOST_BIN_33967 = 33967; public static final int BIG_COMPOST_BIN_33968 = 33968; public static final int BIG_COMPOST_BIN_33969 = 33969; public static final int BIG_COMPOST_BIN_33970 = 33970; public static final int BIG_COMPOST_BIN_33971 = 33971; public static final int BIG_COMPOST_BIN_33972 = 33972; public static final int BIG_COMPOST_BIN_33973 = 33973; public static final int BIG_COMPOST_BIN_33974 = 33974; public static final int BIG_COMPOST_BIN_33975 = 33975; public static final int BIG_COMPOST_BIN_33976 = 33976; public static final int BIG_COMPOST_BIN_33977 = 33977; public static final int BIG_COMPOST_BIN_33978 = 33978; public static final int ANIMA_PATCH = 33980; public static final int ANIMA_PATCH_33981 = 33981; public static final int ANIMA_PATCH_33982 = 33982; public static final int ANIMA_PATCH_33983 = 33983; public static final int IASOR_PLANT = 33984; public static final int IASOR_PLANT_33985 = 33985; public static final int IASOR_PLANT_33986 = 33986; public static final int IASOR_PLANT_33987 = 33987; public static final int IASOR_PLANT_33988 = 33988; public static final int WITHERING_IASOR_PLANT = 33989; public static final int DEAD_IASOR_PLANT = 33990; public static final int ATTAS_PLANT = 33991; public static final int ATTAS_PLANT_33992 = 33992; public static final int ATTAS_PLANT_33993 = 33993; public static final int ATTAS_PLANT_33994 = 33994; public static final int ATTAS_PLANT_33995 = 33995; public static final int WITHERING_ATTAS_PLANT = 33996; public static final int DEAD_ATTAS_PLANT = 33997; public static final int KRONOS_PLANT = 33999; public static final int KRONOS_PLANT_34000 = 34000; public static final int KRONOS_PLANT_34001 = 34001; public static final int KRONOS_PLANT_34002 = 34002; public static final int KRONOS_PLANT_34003 = 34003; public static final int WITHERING_KRONOS_PLANT = 34004; public static final int DEAD_KRONOS_PLANT = 34005; public static final int DRAGONFRUIT_TREE = 34008; public static final int DRAGONFRUIT_TREE_34009 = 34009; public static final int DRAGONFRUIT_TREE_34010 = 34010; public static final int DRAGONFRUIT_TREE_34011 = 34011; public static final int DRAGONFRUIT_TREE_34012 = 34012; public static final int DRAGONFRUIT_TREE_34013 = 34013; public static final int DRAGONFRUIT_TREE_34014 = 34014; public static final int DRAGONFRUIT_TREE_34015 = 34015; public static final int DRAGONFRUIT_TREE_34016 = 34016; public static final int DRAGONFRUIT_TREE_34017 = 34017; public static final int DRAGONFRUIT_TREE_34018 = 34018; public static final int DRAGONFRUIT_TREE_34019 = 34019; public static final int DRAGONFRUIT_TREE_34020 = 34020; public static final int DRAGONFRUIT_TREE_34021 = 34021; public static final int DISEASED_DRAGONFRUIT_PLANT = 34022; public static final int DISEASED_DRAGONFRUIT_PLANT_34023 = 34023; public static final int DISEASED_DRAGONFRUIT_PLANT_34024 = 34024; public static final int DISEASED_DRAGONFRUIT_PLANT_34025 = 34025; public static final int DISEASED_DRAGONFRUIT_PLANT_34026 = 34026; public static final int DISEASED_DRAGONFRUIT_PLANT_34027 = 34027; public static final int DEAD_DRAGONFRUIT_PLANT = 34028; public static final int DEAD_DRAGONFRUIT_PLANT_34029 = 34029; public static final int DEAD_DRAGONFRUIT_PLANT_34030 = 34030; public static final int DEAD_DRAGONFRUIT_PLANT_34031 = 34031; public static final int DEAD_DRAGONFRUIT_PLANT_34032 = 34032; public static final int DEAD_DRAGONFRUIT_PLANT_34033 = 34033; public static final int DRAGONFRUIT_TREE_STUMP = 34034; public static final int REDWOOD_TREE_PATCH = 34035; public static final int REDWOOD_TREE_PATCH_34036 = 34036; public static final int REDWOOD_TREE_PATCH_34037 = 34037; public static final int REDWOOD_TREE_PATCH_34038 = 34038; public static final int REDWOOD_TREE_PATCH_34039 = 34039; public static final int REDWOOD_TREE_PATCH_34040 = 34040; public static final int REDWOOD_TREE_PATCH_34041 = 34041; public static final int REDWOOD_TREE_PATCH_34042 = 34042; public static final int REDWOOD_TREE_PATCH_34043 = 34043; public static final int REDWOOD_TREE_PATCH_34044 = 34044; public static final int REDWOOD_TREE_PATCH_34045 = 34045; public static final int REDWOOD_TREE_PATCH_34046 = 34046; public static final int REDWOOD_TREE_PATCH_34047 = 34047; public static final int REDWOOD_TREE_PATCH_34048 = 34048; public static final int REDWOOD_TREE_PATCH_34049 = 34049; public static final int REDWOOD_TREE_PATCH_34050 = 34050; public static final int DEAD_REDWOOD_TREE = 34060; public static final int DEAD_REDWOOD_TREE_34061 = 34061; public static final int DEAD_REDWOOD_TREE_34062 = 34062; public static final int DEAD_REDWOOD_TREE_34063 = 34063; public static final int DEAD_REDWOOD_TREE_34064 = 34064; public static final int DEAD_REDWOOD_TREE_34065 = 34065; public static final int DEAD_REDWOOD_TREE_34066 = 34066; public static final int DEAD_REDWOOD_TREE_34067 = 34067; public static final int DEAD_REDWOOD_TREE_34068 = 34068; public static final int DEAD_REDWOOD_TREE_34069 = 34069; public static final int DEAD_REDWOOD_TREE_34070 = 34070; public static final int DEAD_REDWOOD_TREE_34071 = 34071; public static final int DEAD_REDWOOD_TREE_34072 = 34072; public static final int DEAD_REDWOOD_TREE_34073 = 34073; public static final int DEAD_REDWOOD_TREE_34074 = 34074; public static final int DEAD_REDWOOD_TREE_34075 = 34075; public static final int DEAD_REDWOOD_TREE_34076 = 34076; public static final int DEAD_REDWOOD_TREE_34077 = 34077; public static final int DEAD_REDWOOD_TREE_34078 = 34078; public static final int DEAD_REDWOOD_TREE_34079 = 34079; public static final int DEAD_REDWOOD_TREE_34080 = 34080; public static final int DEAD_REDWOOD_TREE_34081 = 34081; public static final int DEAD_REDWOOD_TREE_34082 = 34082; public static final int DEAD_REDWOOD_TREE_34083 = 34083; public static final int DEAD_REDWOOD_TREE_34084 = 34084; public static final int DEAD_REDWOOD_TREE_34085 = 34085; public static final int DEAD_REDWOOD_TREE_34086 = 34086; public static final int DEAD_REDWOOD_TREE_34087 = 34087; public static final int DEAD_REDWOOD_TREE_34088 = 34088; public static final int DEAD_REDWOOD_TREE_34089 = 34089; public static final int DEAD_REDWOOD_TREE_34090 = 34090; public static final int DEAD_REDWOOD_TREE_34091 = 34091; public static final int DEAD_REDWOOD_TREE_34092 = 34092; public static final int DEAD_REDWOOD_TREE_34093 = 34093; public static final int DEAD_REDWOOD_TREE_34094 = 34094; public static final int DEAD_REDWOOD_TREE_34095 = 34095; public static final int DEAD_REDWOOD_TREE_34096 = 34096; public static final int DEAD_REDWOOD_TREE_34097 = 34097; public static final int DEAD_REDWOOD_TREE_34098 = 34098; public static final int DEAD_REDWOOD_TREE_34099 = 34099; public static final int DEAD_REDWOOD_TREE_34100 = 34100; public static final int DEAD_REDWOOD_TREE_34101 = 34101; public static final int DEAD_REDWOOD_TREE_34102 = 34102; public static final int DEAD_REDWOOD_TREE_34103 = 34103; public static final int DEAD_REDWOOD_TREE_34104 = 34104; public static final int DEAD_REDWOOD_TREE_34105 = 34105; public static final int DEAD_REDWOOD_TREE_34106 = 34106; public static final int DEAD_REDWOOD_TREE_34107 = 34107; public static final int DEAD_REDWOOD_TREE_34108 = 34108; public static final int DEAD_REDWOOD_TREE_34109 = 34109; public static final int DEAD_REDWOOD_TREE_34110 = 34110; public static final int DEAD_REDWOOD_TREE_34111 = 34111; public static final int DEAD_REDWOOD_TREE_34112 = 34112; public static final int DEAD_REDWOOD_TREE_34113 = 34113; public static final int DEAD_REDWOOD_TREE_34114 = 34114; public static final int DEAD_REDWOOD_TREE_34115 = 34115; public static final int DEAD_REDWOOD_TREE_34116 = 34116; public static final int DEAD_REDWOOD_TREE_34117 = 34117; public static final int DEAD_REDWOOD_TREE_34118 = 34118; public static final int DEAD_REDWOOD_TREE_34119 = 34119; public static final int DEAD_REDWOOD_TREE_34120 = 34120; public static final int DEAD_REDWOOD_TREE_34121 = 34121; public static final int DEAD_REDWOOD_TREE_34122 = 34122; public static final int DEAD_REDWOOD_TREE_34123 = 34123; public static final int DEAD_REDWOOD_TREE_34124 = 34124; public static final int DEAD_REDWOOD_TREE_34125 = 34125; public static final int DEAD_REDWOOD_TREE_34126 = 34126; public static final int DEAD_REDWOOD_TREE_34127 = 34127; public static final int DEAD_REDWOOD_TREE_34128 = 34128; public static final int DISEASED_REDWOOD_TREE = 34129; public static final int DISEASED_REDWOOD_TREE_34130 = 34130; public static final int DISEASED_REDWOOD_TREE_34131 = 34131; public static final int DISEASED_REDWOOD_TREE_34132 = 34132; public static final int DISEASED_REDWOOD_TREE_34133 = 34133; public static final int DISEASED_REDWOOD_TREE_34134 = 34134; public static final int DISEASED_REDWOOD_TREE_34135 = 34135; public static final int DISEASED_REDWOOD_TREE_34136 = 34136; public static final int DISEASED_REDWOOD_TREE_34137 = 34137; public static final int DISEASED_REDWOOD_TREE_34138 = 34138; public static final int DISEASED_REDWOOD_TREE_34139 = 34139; public static final int DISEASED_REDWOOD_TREE_34140 = 34140; public static final int DISEASED_REDWOOD_TREE_34141 = 34141; public static final int DISEASED_REDWOOD_TREE_34142 = 34142; public static final int DISEASED_REDWOOD_TREE_34143 = 34143; public static final int DISEASED_REDWOOD_TREE_34144 = 34144; public static final int DISEASED_REDWOOD_TREE_34145 = 34145; public static final int DISEASED_REDWOOD_TREE_34146 = 34146; public static final int DISEASED_REDWOOD_TREE_34147 = 34147; public static final int DISEASED_REDWOOD_TREE_34148 = 34148; public static final int DISEASED_REDWOOD_TREE_34149 = 34149; public static final int DISEASED_REDWOOD_TREE_34150 = 34150; public static final int DISEASED_REDWOOD_TREE_34151 = 34151; public static final int DISEASED_REDWOOD_TREE_34152 = 34152; public static final int DISEASED_REDWOOD_TREE_34153 = 34153; public static final int DISEASED_REDWOOD_TREE_34154 = 34154; public static final int DISEASED_REDWOOD_TREE_34155 = 34155; public static final int DISEASED_REDWOOD_TREE_34156 = 34156; public static final int DISEASED_REDWOOD_TREE_34157 = 34157; public static final int DISEASED_REDWOOD_TREE_34158 = 34158; public static final int DISEASED_REDWOOD_TREE_34159 = 34159; public static final int DISEASED_REDWOOD_TREE_34160 = 34160; public static final int DISEASED_REDWOOD_TREE_34161 = 34161; public static final int DISEASED_REDWOOD_TREE_34162 = 34162; public static final int DISEASED_REDWOOD_TREE_34163 = 34163; public static final int DISEASED_REDWOOD_TREE_34164 = 34164; public static final int DISEASED_REDWOOD_TREE_34165 = 34165; public static final int DISEASED_REDWOOD_TREE_34166 = 34166; public static final int DISEASED_REDWOOD_TREE_34167 = 34167; public static final int DISEASED_REDWOOD_TREE_34168 = 34168; public static final int DISEASED_REDWOOD_TREE_34169 = 34169; public static final int DISEASED_REDWOOD_TREE_34170 = 34170; public static final int DISEASED_REDWOOD_TREE_34171 = 34171; public static final int DISEASED_REDWOOD_TREE_34172 = 34172; public static final int DISEASED_REDWOOD_TREE_34173 = 34173; public static final int DISEASED_REDWOOD_TREE_34174 = 34174; public static final int DISEASED_REDWOOD_TREE_34175 = 34175; public static final int DISEASED_REDWOOD_TREE_34176 = 34176; public static final int DISEASED_REDWOOD_TREE_34177 = 34177; public static final int DISEASED_REDWOOD_TREE_34178 = 34178; public static final int DISEASED_REDWOOD_TREE_34179 = 34179; public static final int DISEASED_REDWOOD_TREE_34180 = 34180; public static final int DISEASED_REDWOOD_TREE_34181 = 34181; public static final int DISEASED_REDWOOD_TREE_34182 = 34182; public static final int DISEASED_REDWOOD_TREE_34183 = 34183; public static final int DISEASED_REDWOOD_TREE_34184 = 34184; public static final int DISEASED_REDWOOD_TREE_34185 = 34185; public static final int DISEASED_REDWOOD_TREE_34186 = 34186; public static final int DISEASED_REDWOOD_TREE_34187 = 34187; public static final int DISEASED_REDWOOD_TREE_34188 = 34188; public static final int DISEASED_REDWOOD_TREE_34189 = 34189; public static final int DISEASED_REDWOOD_TREE_34190 = 34190; public static final int DISEASED_REDWOOD_TREE_34191 = 34191; public static final int DISEASED_REDWOOD_TREE_34192 = 34192; public static final int DISEASED_REDWOOD_TREE_34193 = 34193; public static final int DISEASED_REDWOOD_TREE_34194 = 34194; public static final int DISEASED_REDWOOD_TREE_34195 = 34195; public static final int DISEASED_REDWOOD_TREE_34196 = 34196; public static final int DISEASED_REDWOOD_TREE_34197 = 34197; public static final int REDWOOD_TREE = 34198; public static final int REDWOOD_TREE_34199 = 34199; public static final int DISEASED_REDWOOD_TREE_34200 = 34200; public static final int DEAD_REDWOOD_TREE_34201 = 34201; public static final int REDWOOD_TREE_34202 = 34202; public static final int DISEASED_REDWOOD_TREE_34203 = 34203; public static final int DEAD_REDWOOD_TREE_34204 = 34204; public static final int REDWOOD_TREE_34205 = 34205; public static final int REDWOOD_TREE_34206 = 34206; public static final int REDWOOD_TREE_34207 = 34207; public static final int REDWOOD_TREE_34208 = 34208; public static final int REDWOOD_TREE_34209 = 34209; public static final int REDWOOD_TREE_34210 = 34210; public static final int REDWOOD_TREE_34211 = 34211; public static final int REDWOOD_TREE_34212 = 34212; public static final int REDWOOD_TREE_34213 = 34213; public static final int REDWOOD_TREE_34214 = 34214; public static final int REDWOOD_TREE_34215 = 34215; public static final int REDWOOD_TREE_34216 = 34216; public static final int REDWOOD_TREE_34217 = 34217; public static final int REDWOOD_TREE_34218 = 34218; public static final int REDWOOD_TREE_34219 = 34219; public static final int REDWOOD_TREE_34220 = 34220; public static final int REDWOOD_TREE_34221 = 34221; public static final int REDWOOD_TREE_34222 = 34222; public static final int REDWOOD_TREE_34223 = 34223; public static final int REDWOOD_TREE_34224 = 34224; public static final int REDWOOD_TREE_34225 = 34225; public static final int REDWOOD_TREE_34226 = 34226; public static final int REDWOOD_TREE_34227 = 34227; public static final int REDWOOD_TREE_34228 = 34228; public static final int REDWOOD_TREE_34229 = 34229; public static final int REDWOOD_TREE_34230 = 34230; public static final int REDWOOD_TREE_34231 = 34231; public static final int REDWOOD_TREE_34232 = 34232; public static final int REDWOOD_TREE_34233 = 34233; public static final int REDWOOD_TREE_34234 = 34234; public static final int REDWOOD_TREE_34235 = 34235; public static final int REDWOOD_TREE_34236 = 34236; public static final int REDWOOD_TREE_34237 = 34237; public static final int REDWOOD_TREE_34238 = 34238; public static final int REDWOOD_TREE_34239 = 34239; public static final int REDWOOD_TREE_34240 = 34240; public static final int REDWOOD_TREE_34241 = 34241; public static final int REDWOOD_TREE_34242 = 34242; public static final int REDWOOD_TREE_34243 = 34243; public static final int REDWOOD_TREE_34244 = 34244; public static final int REDWOOD_TREE_34245 = 34245; public static final int REDWOOD_TREE_34246 = 34246; public static final int REDWOOD_TREE_34247 = 34247; public static final int REDWOOD_TREE_34248 = 34248; public static final int REDWOOD_TREE_34249 = 34249; public static final int REDWOOD_TREE_34250 = 34250; public static final int REDWOOD_TREE_34251 = 34251; public static final int REDWOOD_TREE_34252 = 34252; public static final int REDWOOD_TREE_34253 = 34253; public static final int REDWOOD_TREE_34254 = 34254; public static final int REDWOOD_TREE_34255 = 34255; public static final int REDWOOD_TREE_34256 = 34256; public static final int REDWOOD_TREE_34257 = 34257; public static final int REDWOOD_TREE_34258 = 34258; public static final int REDWOOD_TREE_34259 = 34259; public static final int REDWOOD_TREE_34260 = 34260; public static final int REDWOOD_TREE_34261 = 34261; public static final int REDWOOD_TREE_34262 = 34262; public static final int REDWOOD_TREE_34263 = 34263; public static final int REDWOOD_TREE_34264 = 34264; public static final int REDWOOD_TREE_34265 = 34265; public static final int REDWOOD_TREE_34266 = 34266; public static final int REDWOOD_TREE_34267 = 34267; public static final int REDWOOD_TREE_34268 = 34268; public static final int REDWOOD_TREE_34269 = 34269; public static final int REDWOOD_TREE_34270 = 34270; public static final int REDWOOD_TREE_34271 = 34271; public static final int REDWOOD_TREE_34272 = 34272; public static final int REDWOOD_TREE_34273 = 34273; public static final int REDWOOD_TREE_34274 = 34274; public static final int REDWOOD_TREE_34275 = 34275; public static final int REDWOOD_TREE_34276 = 34276; public static final int REDWOOD_TREE_34277 = 34277; public static final int REDWOOD_TREE_34278 = 34278; public static final int REDWOOD_TREE_34279 = 34279; public static final int REDWOOD_TREE_34280 = 34280; public static final int REDWOOD_TREE_34281 = 34281; public static final int REDWOOD_TREE_34282 = 34282; public static final int REDWOOD_TREE_34283 = 34283; public static final int REDWOOD_TREE_34284 = 34284; public static final int REDWOOD_TREE_34285 = 34285; public static final int REDWOOD_TREE_34286 = 34286; public static final int REDWOOD_TREE_34287 = 34287; public static final int REDWOOD_TREE_34288 = 34288; public static final int REDWOOD_TREE_34289 = 34289; public static final int REDWOOD_TREE_34290 = 34290; public static final int REDWOOD_TREE_34291 = 34291; public static final int REDWOOD_TREE_34292 = 34292; public static final int REDWOOD_TREE_34293 = 34293; public static final int REDWOOD_TREE_34294 = 34294; public static final int REDWOOD_TREE_34295 = 34295; public static final int REDWOOD_TREE_34296 = 34296; public static final int REDWOOD_TREE_34297 = 34297; public static final int REDWOOD_TREE_34298 = 34298; public static final int REDWOOD_TREE_34299 = 34299; public static final int REDWOOD_TREE_34300 = 34300; public static final int REDWOOD_TREE_34301 = 34301; public static final int REDWOOD_TREE_34302 = 34302; public static final int REDWOOD_TREE_34303 = 34303; public static final int REDWOOD_TREE_34304 = 34304; public static final int REDWOOD_TREE_34305 = 34305; public static final int REDWOOD_TREE_34306 = 34306; public static final int REDWOOD_TREE_34307 = 34307; public static final int REDWOOD_TREE_34308 = 34308; public static final int REDWOOD_TREE_34309 = 34309; public static final int REDWOOD_TREE_34310 = 34310; public static final int REDWOOD_TREE_34311 = 34311; public static final int REDWOOD_TREE_34312 = 34312; public static final int REDWOOD_TREE_34313 = 34313; public static final int REDWOOD_TREE_34314 = 34314; public static final int REDWOOD_TREE_34315 = 34315; public static final int SPIKE_DEFENCE_34316 = 34316; public static final int GLASS_TABLE_34319 = 34319; public static final int DEAD_TREE_34334 = 34334; public static final int SULPHUR_VENT_34335 = 34335; public static final int VOLCANIC_FURNACE = 34342; public static final int BANK_CHEST_34343 = 34343; public static final int BANK_DEPOSIT_BOX_34344 = 34344; public static final int TORCH_34345 = 34345; public static final int STANDING_TORCH_34346 = 34346; public static final int EMPTY_CHEST = 34349; public static final int BARREL_OF_MUD = 34350; public static final int BARREL_OF_SPEARS = 34351; public static final int ELEVATOR_CONTROLS = 34356; public static final int ELEVATOR = 34359; public static final int ROCKS_34396 = 34396; public static final int ROCKS_34397 = 34397; public static final int OLMIC_PILLAR = 34401; public static final int LIZARD_DWELLING = 34402; public static final int LIZARD_DWELLING_34403 = 34403; public static final int LIZARD_DWELLING_34404 = 34404; public static final int LIZARD_DWELLING_34405 = 34405; public static final int STONE_TABLE_34406 = 34406; public static final int DRIP_34417 = 34417; public static final int DRIPS_34418 = 34418; public static final int LIZARDMAN_EGGS = 34419; public static final int LIZARDMAN_EGGS_34420 = 34420; public static final int LIGHT_34421 = 34421; public static final int STRANGE_HOLE = 34422; public static final int CAT = 34423; public static final int STONE_CHEST_34424 = 34424; public static final int STONE_CHEST_34425 = 34425; public static final int STONE_CHEST_34426 = 34426; public static final int VASE_34427 = 34427; public static final int VASE_34428 = 34428; public static final int STONE_CHEST_34429 = 34429; public static final int STONE_CHEST_34430 = 34430; public static final int STONE_CHEST_34431 = 34431; public static final int MYSTICAL_BARRIER_34432 = 34432; public static final int MYSTICAL_BARRIER_ORANGE = 34433; public static final int MYSTICAL_BARRIER_RED = 34434; public static final int CAVE_34435 = 34435; public static final int CAVE_34436 = 34436; public static final int HESPORI_34437 = 34437; public static final int WATER_TAP = 34445; public static final int CHEST_34446 = 34446; public static final int DOOR_34463 = 34463; public static final int DOOR_34464 = 34464; public static final int GATE_34469 = 34469; public static final int GATE_34470 = 34470; public static final int GATE_34473 = 34473; public static final int GATE_34474 = 34474; public static final int ROPE_LADDER_34477 = 34477; public static final int ROPE_LADDER_34478 = 34478; public static final int BLUEBELLS_34481 = 34481; public static final int BLUEBELLS_34482 = 34482; public static final int MARIGOLD_34483 = 34483; public static final int MARIGOLD_34484 = 34484; public static final int ROSES_34485 = 34485; public static final int TREE_34486 = 34486; public static final int TREE_34487 = 34487; public static final int TREE_34488 = 34488; public static final int TREE_34489 = 34489; public static final int TALL_REEDS_34497 = 34497; public static final int STATUE_34498 = 34498; public static final int CAVE_34499 = 34499; public static final int CHICKEN_COOP = 34500; public static final int BED_34501 = 34501; public static final int STAIRCASE_34502 = 34502; public static final int STAIRCASE_34503 = 34503; public static final int CRATE_34504 = 34504; public static final int SHELVES_34505 = 34505; public static final int SHELVES_34506 = 34506; public static final int SHELVES_34507 = 34507; public static final int CRATE_34508 = 34508; public static final int CRATE_34509 = 34509; public static final int CRATE_34510 = 34510; public static final int CHEMICAL_POOL = 34511; public static final int CHEMICAL_POOL_34512 = 34512; public static final int ELEVATOR_CONTROLS_34513 = 34513; public static final int CAVE_EXIT_34514 = 34514; public static final int LAVA_GAP = 34515; public static final int TUNNEL_34516 = 34516; public static final int STEPS_34530 = 34530; public static final int STEPS_34531 = 34531; public static final int ROCKS_34544 = 34544; public static final int ROCKS_34548 = 34548; public static final int ALCHEMICAL_DOOR = 34553; public static final int ALCHEMICAL_DOOR_34554 = 34554; public static final int BLUE_CHEMICAL = 34562; public static final int GREEN_CHEMICAL = 34563; public static final int RED_CHEMICAL = 34564; public static final int CHEMICAL_VENT_RED = 34568; public static final int CHEMICAL_VENT_GREEN = 34569; public static final int CHEMICAL_VENT_BLUE = 34570; public static final int STONE_CHEST_34580 = 34580; public static final int STONE_CHEST_34581 = 34581; public static final int STONE_CHEST_34582 = 34582; public static final int STONE_CHEST_34583 = 34583; public static final int STONE_CHEST_34584 = 34584; public static final int STONE_CHEST_34585 = 34585; public static final int STONE_CHEST_34586 = 34586; public static final int BROKEN_MACHINERY = 34587; public static final int KING_WORM = 34648; public static final int MACHINERY_34649 = 34649; public static final int ALCHEMICAL_HYDRA_DISPLAY = 34653; public static final int ALCHEMICAL_TOPIARY = 34654; public static final int MYSTERIOUS_PIPE = 34655; public static final int CHEMICAL_WASTE_PIPE = 34656; public static final int HILLSIDE_ENTRANCE_34658 = 34658; public static final int THE_SHEARED_RAM = 34659; public static final int BRIMSTONE_CHEST = 34660; public static final int BRIMSTONE_CHEST_34661 = 34661; public static final int RUBBLE_34663 = 34663; public static final int RUBBLE_34664 = 34664; public static final int RUBBLE_34665 = 34665; public static final int RUBBLE_34666 = 34666; public static final int GANGPLANK_34667 = 34667; public static final int GANGPLANK_34668 = 34668; public static final int GANGPLANK_34669 = 34669; public static final int GANGPLANK_34670 = 34670; public static final int GANGPLANK_34671 = 34671; public static final int GANGPLANK_34672 = 34672; public static final int HILLSIDE_ENTRANCE_34674 = 34674; public static final int VERZIK_VITUR_DISPLAY = 34677; public static final int MAKING_FRIENDS_WITH_MY_ARM_DISPLAY = 34681; public static final int FIRE_34682 = 34682; public static final int MAGIC_MIRROR = 34683; public static final int ALCHEMICAL_HYDRA_DISPLAY_34684 = 34684; public static final int ATTAS_PLANT_DISPLAY = 34685; public static final int LEATHER_SHIELDS = 34686; public static final int BRYOPHYTA_DISPLAY = 34687; public static final int BANNER_34688 = 34688; public static final int BLOOMING_HESPORI_SPROUT = 34705; public static final int SHRIVELLED_PLANT = 34706; public static final int TWISTED_BUSH = 34712; public static final int DUNGEON_ENTRANCE_34713 = 34713; public static final int KEYHOLE_34727 = 34727; public static final int COINS_34728 = 34728; public static final int SWEETS = 34729; public static final int SWEET = 34730; public static final int SWEETS_34731 = 34731; public static final int AMULET_OF_GLORY_34732 = 34732; public static final int STRANGE_CASKET = 34733; public static final int INCONSPICUOUS_BUSH_BEGINNER = 34734; public static final int STASH_BEGINNER = 34735; public static final int ROCKS_34741 = 34741; public static final int MYSTERIOUS_RUINS_34742 = 34742; public static final int MYSTERIOUS_RUINS_34743 = 34743; public static final int MYSTERIOUS_RUINS_34744 = 34744; public static final int MYSTERIOUS_RUINS_34745 = 34745; public static final int MYSTERIOUS_RUINS_34746 = 34746; public static final int MYSTERIOUS_RUINS_34747 = 34747; public static final int PORTAL_34748 = 34748; public static final int PORTAL_34749 = 34749; public static final int PORTAL_34750 = 34750; public static final int PORTAL_34751 = 34751; public static final int PORTAL_34752 = 34752; public static final int PORTAL_34753 = 34753; public static final int PORTAL_34754 = 34754; public static final int PORTAL_34755 = 34755; public static final int PORTAL_34756 = 34756; public static final int PORTAL_34757 = 34757; public static final int PORTAL_34758 = 34758; public static final int PORTAL_34759 = 34759; public static final int ALTAR_34760 = 34760; public static final int ALTAR_34761 = 34761; public static final int ALTAR_34762 = 34762; public static final int ALTAR_34763 = 34763; public static final int ALTAR_34764 = 34764; public static final int ALTAR_34765 = 34765; public static final int ALTAR_34766 = 34766; public static final int ALTAR_34767 = 34767; public static final int ALTAR_34768 = 34768; public static final int ALTAR_34769 = 34769; public static final int ALTAR_34770 = 34770; public static final int ALTAR_34771 = 34771; public static final int ALTAR_34772 = 34772; public static final int RUNE_ESSENCE_34773 = 34773; public static final int PORTAL_34774 = 34774; public static final int PORTAL_34775 = 34775; public static final int PORTAL_34776 = 34776; public static final int PORTAL_34777 = 34777; public static final int PORTAL_34778 = 34778; public static final int PILLAR_34780 = 34780; public static final int PILLAR_34781 = 34781; public static final int PILLAR_34782 = 34782; public static final int PILLAR_34783 = 34783; public static final int PILLAR_34784 = 34784; public static final int PILLAR_34785 = 34785; public static final int MYSTERIOUS_STONE = 34788; public static final int MYSTERIOUS_GLOW = 34789; public static final int MYSTERIOUS_GLOW_34790 = 34790; public static final int MYSTERIOUS_GLOW_34791 = 34791; public static final int MYSTERIOUS_GLOW_34792 = 34792; public static final int MYSTERIOUS_GLOW_34793 = 34793; public static final int MYSTERIOUS_GLOW_34794 = 34794; public static final int RUINED_PILLAR = 34795; public static final int RUINED_PILLAR_34796 = 34796; public static final int PILLAR_34797 = 34797; public static final int RUINED_PILLAR_34798 = 34798; public static final int PILLAR_34799 = 34799; public static final int RUINED_PILLAR_34800 = 34800; public static final int RUINED_PILLAR_34801 = 34801; public static final int RUINED_PILLAR_34802 = 34802; public static final int RUBBLE_34803 = 34803; public static final int RUBBLE_34804 = 34804; public static final int RUBBLE_34805 = 34805; public static final int JADFEST_PORTAL = 34826; public static final int HUB_PORTAL = 34827; public static final int LARRANS_SMALL_CHEST_34828 = 34828; public static final int LARRANS_BIG_CHEST = 34829; public static final int LARRANS_BIG_CHEST_34830 = 34830; public static final int SARACHNIS_DISPLAY = 34833; public static final int STRANGE_FLOOR_34834 = 34834; public static final int ANCIENT_FIRE = 34835; public static final int CURSED_ALTAR = 34836; public static final int ALTAR_34837 = 34837; public static final int GRUBBY_CHEST = 34838; public static final int GRUBBY_CHEST_34839 = 34839; public static final int GRUBBY_DOOR = 34840; public static final int TEMPLE_DOOR_34842 = 34842; public static final int TEMPLE_DOOR_34843 = 34843; public static final int DOOR_34844 = 34844; public static final int LEVER_34845 = 34845; public static final int LEVER_34846 = 34846; public static final int MUSTY_BOOKSHELF = 34847; public static final int MUSTY_BOOKSHELF_34848 = 34848; public static final int MUSTY_BOOKSHELF_34849 = 34849; public static final int MUSTY_BOOKSHELF_34850 = 34850; public static final int STONE_RELIEF = 34851; public static final int STONE_RELIEF_34852 = 34852; public static final int PASSAGE_34853 = 34853; public static final int WALL_34854 = 34854; public static final int SACRED_BONE_BURNER = 34855; public static final int TORCH_34856 = 34856; public static final int DRAGON_EGG_34857 = 34857; public static final int THICK_WEB = 34858; public static final int THICK_WEB_34859 = 34859; public static final int STRANGE_PASSAGE = 34860; public static final int STRANGE_WALL_34861 = 34861; public static final int LADDER_34862 = 34862; public static final int LADDER_34863 = 34863; public static final int STAIRCASE_34864 = 34864; public static final int STAIRCASE_34865 = 34865; public static final int CAULDRON_34866 = 34866; public static final int EGG_SAC = 34867; public static final int EMPTY_SAC = 34868; public static final int STONE_PILE_34870 = 34870; public static final int STONE_PILE_34871 = 34871; public static final int BROKEN_SUN_ALTAR = 34872; public static final int EMPTY_SARCOPHAGUS = 34873; public static final int FLOOR_TILE = 34874; public static final int BLOOD_34896 = 34896; public static final int WEB_34897 = 34897; public static final int WEB_34898 = 34898; public static final int SLASHED_WEB_34899 = 34899; public static final int FOG_MARKER = 34905; /* This file is automatically generated. Do not edit. */ }
package org.knowm.xchange; import static org.assertj.core.api.Assertions.assertThat; import java.io.IOException; import java.math.BigDecimal; import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; import org.junit.Before; import org.junit.Test; import org.knowm.xchange.currency.CurrencyPair; import org.knowm.xchange.dto.Order.OrderType; import org.knowm.xchange.dto.marketdata.OrderBook; import org.knowm.xchange.dto.marketdata.OrderBookUpdate; import org.knowm.xchange.dto.trade.LimitOrder; import org.knowm.xchange.utils.ObjectMapperHelper; public class OrderBookTest { private OrderBook orderBook; @Before public void setUp() throws Exception { LimitOrder askOrder = new LimitOrder( OrderType.ASK, BigDecimal.ONE, CurrencyPair.BTC_USD, "", null, BigDecimal.TEN.add(BigDecimal.ONE)); LimitOrder bidOrder = new LimitOrder( OrderType.BID, BigDecimal.ONE, CurrencyPair.BTC_USD, "", null, BigDecimal.TEN); List<LimitOrder> asks = new ArrayList<>(Arrays.asList(askOrder)); List<LimitOrder> bids = new ArrayList<>(Arrays.asList(bidOrder)); Date timeStamp = new Date(); orderBook = new OrderBook(timeStamp, asks, bids); } @Test public void testSerializeDeserialize() throws IOException { OrderBook jsonCopy = ObjectMapperHelper.viaJSON(orderBook); assertThat(jsonCopy.getTimeStamp()).isEqualTo(orderBook.getTimeStamp()); } @Test public void testUpdateAddOrder() { Date timeStamp = new Date(0); OrderBookUpdate lowerBidUpdate = new OrderBookUpdate( OrderType.BID, BigDecimal.ONE, CurrencyPair.BTC_USD, BigDecimal.TEN.subtract(BigDecimal.ONE), timeStamp, BigDecimal.ONE); orderBook.update(lowerBidUpdate); assertThat(orderBook.getBids().size()).isEqualTo(2); } @Test public void testUpdateRemoveOrder() { Date timeStamp = new Date(0); OrderBookUpdate lowerBidUpdate = new OrderBookUpdate( OrderType.BID, BigDecimal.ONE, CurrencyPair.BTC_USD, BigDecimal.TEN, timeStamp, BigDecimal.ZERO); orderBook.update(lowerBidUpdate); assertThat(orderBook.getBids().size()).isEqualTo(0); } @Test public void testUpdateRemoveSingleOrder() { Date timeStamp = new Date(0); LimitOrder limitOrder = new LimitOrder.Builder(OrderType.BID, CurrencyPair.BTC_USD) .originalAmount(BigDecimal.ONE) .limitPrice(BigDecimal.TEN) .timestamp(timeStamp) .cumulativeAmount(BigDecimal.ONE) // remaining amount is now 0 .build(); orderBook.update(limitOrder); assertThat(orderBook.getBids().size()).isEqualTo(0); } @Test public void testUpdateAddVolume() { Date timeStamp = new Date(0); OrderBookUpdate lowerBidUpdate = new OrderBookUpdate( OrderType.BID, BigDecimal.ONE, CurrencyPair.BTC_USD, BigDecimal.TEN, timeStamp, BigDecimal.TEN); orderBook.update(lowerBidUpdate); assertThat(orderBook.getBids().size()).isEqualTo(1); assertThat(orderBook.getBids().get(0).getOriginalAmount()).isEqualTo(BigDecimal.TEN); } @Test public void testDateSame() { Date timeStamp = new Date(0); OrderBookUpdate lowerBidUpdate = new OrderBookUpdate( OrderType.BID, BigDecimal.ONE, CurrencyPair.BTC_USD, BigDecimal.TEN, timeStamp, BigDecimal.TEN); Date oldDate = orderBook.getTimeStamp(); orderBook.update(lowerBidUpdate); assertThat(orderBook.getTimeStamp()).isEqualTo(oldDate); } @Test public void testDateOther() { Date timeStamp = Date.from(orderBook.getTimeStamp().toInstant().plus(Duration.ofDays(10))); OrderBookUpdate lowerBidUpdate = new OrderBookUpdate( OrderType.BID, BigDecimal.ONE, CurrencyPair.BTC_USD, BigDecimal.TEN, timeStamp, BigDecimal.TEN); Date oldDate = orderBook.getTimeStamp(); orderBook.update(lowerBidUpdate); assertThat(orderBook.getTimeStamp()).isAfter(oldDate); assertThat(orderBook.getTimeStamp()).isEqualTo(timeStamp); } }
package io.digdag.cli; import java.util.List; import java.util.Map; import java.util.ArrayList; import java.util.HashMap; import java.util.Date; import java.util.stream.Collectors; import io.digdag.core.repository.WorkflowSource; import io.digdag.core.repository.WorkflowSourceList; import io.digdag.core.workflow.SessionOptions; import io.digdag.core.workflow.StoredSession; import io.digdag.core.workflow.StoredTask; import io.digdag.core.workflow.TaskStateCode; import joptsimple.OptionParser; import joptsimple.OptionSet; import java.io.File; import com.google.common.base.*; import com.google.common.collect.*; import com.google.inject.Injector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import io.digdag.core.*; import io.digdag.DigdagEmbed; import io.digdag.cli.Main.SystemExitException; import io.digdag.core.config.Config; import io.digdag.core.config.ConfigFactory; import io.digdag.core.config.YamlConfigLoader; import static io.digdag.cli.Main.systemExit; import static java.util.Arrays.asList; public class Run { private static Logger logger = LoggerFactory.getLogger(Run.class); public static void main(String command, String[] args) throws Exception { OptionParser parser = Main.parser(); parser.acceptsAll(asList("f", "from")).withRequiredArg().ofType(String.class); parser.acceptsAll(asList("r", "resume-state")).withRequiredArg().ofType(String.class); parser.acceptsAll(asList("p", "param")).withRequiredArg().ofType(String.class); parser.acceptsAll(asList("P", "params-file")).withRequiredArg().ofType(String.class); parser.acceptsAll(asList("s", "show")).withRequiredArg().ofType(String.class); OptionSet op = Main.parse(parser, args); List<String> argv = Main.nonOptions(op); if (op.has("help") || argv.size() != 1) { throw usage(null); } Optional<String> fromTaskName = Optional.fromNullable((String) op.valueOf("f")); Optional<File> resumeStateFilePath = Optional.fromNullable((String) op.valueOf("r")).transform(it -> new File(it)); Optional<File> paramsFilePath = Optional.fromNullable((String) op.valueOf("P")).transform(it -> new File(it)); Optional<File> visualizePath = Optional.fromNullable((String) op.valueOf("s")).transform(it -> new File(it)); File workflowPath = new File(argv.get(0)); Map<String, String> params = new HashMap<>(); for (Object kv : op.valuesOf("p")) { String[] pair = kv.toString().split("=", 2); String key = pair[0]; String value = (pair.length > 1 ? pair[1] : "true"); params.put(key, value); } new Run(workflowPath, fromTaskName, resumeStateFilePath, params, paramsFilePath, visualizePath).run(); } private static SystemExitException usage(String error) { System.err.println("Usage: digdag run <workflow.yml> [options...]"); System.err.println(" Options:"); System.err.println(" -f, --from +NAME skip tasks before this task"); System.err.println(" -r, --resume-state PATH.yml path to resume state file"); System.err.println(" -p, --param KEY=VALUE add a session parameter (use multiple times to set many parameters)"); System.err.println(" -P, --params-file PATH.yml read session parameters from a YAML file"); System.err.println(" -s, --show PATH.png visualize result of execution and create a PNG file"); // TODO add -p, --param K=V Main.showCommonOptions(); System.err.println(""); return systemExit(error); } static WorkflowSource loadFirstWorkflowSource(final Config ast) { List<WorkflowSource> workflowSources = ast.convert(WorkflowSourceList.class).get(); if (workflowSources.size() != 1) { if (workflowSources.isEmpty()) { throw new RuntimeException("Workflow file doesn't include definitions"); } else { throw new RuntimeException("Workflow file includes more than one definitions"); } } return workflowSources.get(0); } private final File workflowPath; private final Optional<String> fromTaskName; private final Optional<File> resumeStateFilePath; private final Map<String, String> params; private final Optional<File> paramsFilePath; private final Optional<File> visualizePath; public Run(File workflowPath, Optional<String> fromTaskName, Optional<File> resumeStateFilePath, Map<String, String> params, Optional<File> paramsFilePath, Optional<File> visualizePath) { this.workflowPath = workflowPath; this.fromTaskName = fromTaskName; this.resumeStateFilePath = resumeStateFilePath; this.params = params; this.paramsFilePath = paramsFilePath; this.visualizePath = visualizePath; } public void run() throws Exception { DigdagEmbed embed = Main.embed(); try { run(embed.getInjector()); } finally { // close explicitly so that ResumeStateFileManager.preDestroy runs before closing h2 database embed.destroy(); } } public void run(Injector injector) throws Exception { LocalSite localSite = injector.getInstance(LocalSite.class); localSite.initialize(); final ConfigFactory cf = injector.getInstance(ConfigFactory.class); final YamlConfigLoader loader = injector.getInstance(YamlConfigLoader.class); final FileMapper mapper = injector.getInstance(FileMapper.class); final ResumeStateFileManager rsm = injector.getInstance(ResumeStateFileManager.class); Config sessionParams = cf.create(); if (paramsFilePath.isPresent()) { sessionParams.setAll(mapper.readFile(paramsFilePath.get(), Config.class)); } for (Map.Entry<String, String> pair : params.entrySet()) { sessionParams.set(pair.getKey(), pair.getValue()); } Optional<ResumeState> resumeState = Optional.absent(); if (resumeStateFilePath.isPresent() && mapper.checkExists(resumeStateFilePath.get())) { resumeState = Optional.of(mapper.readFile(resumeStateFilePath.get(), ResumeState.class)); } WorkflowSource workflowSource = loadFirstWorkflowSource(loader.loadFile(workflowPath)); SessionOptions options = SessionOptions.builder() .skipTaskMap(resumeState.transform(it -> it.getReports()).or(ImmutableMap.of())) .build(); List<StoredSession> sessions = localSite.startWorkflows( ImmutableList.of(workflowSource), fromTaskName, sessionParams, options, new Date()); if (sessions.isEmpty()) { throw systemExit("No workflows to start"); } StoredSession session = sessions.get(0); logger.debug("Submitting {}", session); localSite.startLocalAgent(); localSite.startMonitor(); // if resumeStateFilePath is not set, use workflow.yml.resume.yml File resumeResultPath = resumeStateFilePath.or(new File(workflowPath.toString() + ".resume.yml")); rsm.startUpdate(resumeResultPath, session); localSite.runUntilAny(); ArrayList<StoredTask> failedTasks = new ArrayList<>(); for (StoredTask task : localSite.getSessionStore().getTasks(session.getId(), 100, Optional.absent())) { // TODO paging if (task.getState() == TaskStateCode.ERROR) { failedTasks.add(task); } logger.debug(" Task["+task.getId()+"]: "+task.getFullName()); logger.debug(" parent: "+task.getParentId().transform(it -> Long.toString(it)).or("(root)")); logger.debug(" upstreams: "+task.getUpstreams().stream().map(it -> Long.toString(it)).collect(Collectors.joining(","))); logger.debug(" state: "+task.getState()); logger.debug(" retryAt: "+task.getRetryAt()); logger.debug(" config: "+task.getConfig()); logger.debug(" taskType: "+task.getTaskType()); logger.debug(" stateParams: "+task.getStateParams()); logger.debug(" carryParams: "+task.getReport().transform(report -> report.getCarryParams()).or(cf.create())); logger.debug(" in: "+task.getReport().transform(report -> report.getInputs()).or(ImmutableList.of())); logger.debug(" out: "+task.getReport().transform(report -> report.getOutputs()).or(ImmutableList.of())); logger.debug(" error: "+task.getError()); } if (visualizePath.isPresent()) { Show.show( localSite.getSessionStore().getTasks(session.getId(), 1024, Optional.absent()) .stream() .map(it -> WorkflowVisualizerNode.of(it)) .collect(Collectors.toList()), visualizePath.get()); } if (!failedTasks.isEmpty()) { StringBuilder sb = new StringBuilder(); for (StoredTask task : failedTasks) { sb.append(String.format("Task %s failed.%n", task.getFullName())); } sb.append(String.format("Use `digdag run %s -r %s` to restart this workflow.", workflowPath, resumeResultPath)); throw systemExit(sb.toString()); } } }
package com.thoughtworks.xstream.io.xml; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Reader; import java.io.UnsupportedEncodingException; import java.io.Writer; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.FactoryConfigurationError; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import com.thoughtworks.xstream.io.HierarchicalStreamReader; import com.thoughtworks.xstream.io.HierarchicalStreamWriter; import com.thoughtworks.xstream.io.StreamException; public class DomDriver extends AbstractXmlDriver { private final String encoding; private final DocumentBuilderFactory documentBuilderFactory; public DomDriver() { this("UTF-8"); } public DomDriver(String encoding) { this(encoding, new XmlFriendlyReplacer()); } /** * @since 1.2 */ public DomDriver(String encoding, XmlFriendlyReplacer replacer) { super(replacer); documentBuilderFactory = DocumentBuilderFactory.newInstance(); this.encoding = encoding; } public HierarchicalStreamReader createReader(Reader xml) { return createReader(new InputSource(xml)); } public HierarchicalStreamReader createReader(InputStream xml) { return createReader(new InputSource(xml)); } private HierarchicalStreamReader createReader(InputSource source) { try { DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); source.setEncoding(encoding); Document document = documentBuilder.parse(source); return new DomReader(document, xmlFriendlyReplacer()); } catch (FactoryConfigurationError e) { throw new StreamException(e); } catch (ParserConfigurationException e) { throw new StreamException(e); } catch (SAXException e) { throw new StreamException(e); } catch (IOException e) { throw new StreamException(e); } } public HierarchicalStreamWriter createWriter(Writer out) { return new PrettyPrintWriter(out, xmlFriendlyReplacer()); } public HierarchicalStreamWriter createWriter(OutputStream out) { try { return createWriter(new OutputStreamWriter(out, this.encoding)); } catch (UnsupportedEncodingException e) { throw new StreamException(e); } } }
package org.openecard.sal; import iso.std.iso_iec._24727.tech.schema.ACLList; import iso.std.iso_iec._24727.tech.schema.ACLListResponse; import iso.std.iso_iec._24727.tech.schema.ACLModify; import iso.std.iso_iec._24727.tech.schema.ACLModifyResponse; import iso.std.iso_iec._24727.tech.schema.AlgorithmInfoType; import iso.std.iso_iec._24727.tech.schema.AuthorizationServiceActionName; import iso.std.iso_iec._24727.tech.schema.CardApplicationConnect; import iso.std.iso_iec._24727.tech.schema.CardApplicationConnectResponse; import iso.std.iso_iec._24727.tech.schema.CardApplicationCreate; import iso.std.iso_iec._24727.tech.schema.CardApplicationCreateResponse; import iso.std.iso_iec._24727.tech.schema.CardApplicationDelete; import iso.std.iso_iec._24727.tech.schema.CardApplicationDeleteResponse; import iso.std.iso_iec._24727.tech.schema.CardApplicationDisconnect; import iso.std.iso_iec._24727.tech.schema.CardApplicationDisconnectResponse; import iso.std.iso_iec._24727.tech.schema.CardApplicationEndSession; import iso.std.iso_iec._24727.tech.schema.CardApplicationEndSessionResponse; import iso.std.iso_iec._24727.tech.schema.CardApplicationList; import iso.std.iso_iec._24727.tech.schema.CardApplicationListResponse; import iso.std.iso_iec._24727.tech.schema.CardApplicationListResponse.CardApplicationNameList; import iso.std.iso_iec._24727.tech.schema.CardApplicationPath; import iso.std.iso_iec._24727.tech.schema.CardApplicationPathResponse; import iso.std.iso_iec._24727.tech.schema.CardApplicationPathResponse.CardAppPathResultSet; import iso.std.iso_iec._24727.tech.schema.CardApplicationPathType; import iso.std.iso_iec._24727.tech.schema.CardApplicationSelect; import iso.std.iso_iec._24727.tech.schema.CardApplicationSelectResponse; import iso.std.iso_iec._24727.tech.schema.CardApplicationServiceActionName; import iso.std.iso_iec._24727.tech.schema.CardApplicationServiceCreate; import iso.std.iso_iec._24727.tech.schema.CardApplicationServiceCreateResponse; import iso.std.iso_iec._24727.tech.schema.CardApplicationServiceDelete; import iso.std.iso_iec._24727.tech.schema.CardApplicationServiceDeleteResponse; import iso.std.iso_iec._24727.tech.schema.CardApplicationServiceDescribe; import iso.std.iso_iec._24727.tech.schema.CardApplicationServiceDescribeResponse; import iso.std.iso_iec._24727.tech.schema.CardApplicationServiceList; import iso.std.iso_iec._24727.tech.schema.CardApplicationServiceListResponse; import iso.std.iso_iec._24727.tech.schema.CardApplicationServiceListResponse.CardApplicationServiceNameList; import iso.std.iso_iec._24727.tech.schema.CardApplicationServiceLoad; import iso.std.iso_iec._24727.tech.schema.CardApplicationServiceLoadResponse; import iso.std.iso_iec._24727.tech.schema.CardApplicationServiceType; import iso.std.iso_iec._24727.tech.schema.CardApplicationStartSession; import iso.std.iso_iec._24727.tech.schema.CardApplicationStartSessionResponse; import iso.std.iso_iec._24727.tech.schema.CardApplicationType; import iso.std.iso_iec._24727.tech.schema.ChannelHandleType; import iso.std.iso_iec._24727.tech.schema.Connect; import iso.std.iso_iec._24727.tech.schema.ConnectResponse; import iso.std.iso_iec._24727.tech.schema.ConnectionHandleType; import iso.std.iso_iec._24727.tech.schema.ConnectionServiceActionName; import iso.std.iso_iec._24727.tech.schema.CreateSession; import iso.std.iso_iec._24727.tech.schema.CreateSessionResponse; import iso.std.iso_iec._24727.tech.schema.DIDAuthenticate; import iso.std.iso_iec._24727.tech.schema.DIDAuthenticateResponse; import iso.std.iso_iec._24727.tech.schema.DIDAuthenticationDataType; import iso.std.iso_iec._24727.tech.schema.DIDCreate; import iso.std.iso_iec._24727.tech.schema.DIDCreateResponse; import iso.std.iso_iec._24727.tech.schema.DIDDelete; import iso.std.iso_iec._24727.tech.schema.DIDDeleteResponse; import iso.std.iso_iec._24727.tech.schema.DIDGet; import iso.std.iso_iec._24727.tech.schema.DIDGetResponse; import iso.std.iso_iec._24727.tech.schema.DIDInfoType; import iso.std.iso_iec._24727.tech.schema.DIDList; import iso.std.iso_iec._24727.tech.schema.DIDListResponse; import iso.std.iso_iec._24727.tech.schema.DIDNameListType; import iso.std.iso_iec._24727.tech.schema.DIDQualifierType; import iso.std.iso_iec._24727.tech.schema.DIDScopeType; import iso.std.iso_iec._24727.tech.schema.DIDStructureType; import iso.std.iso_iec._24727.tech.schema.DIDUpdate; import iso.std.iso_iec._24727.tech.schema.DIDUpdateDataType; import iso.std.iso_iec._24727.tech.schema.DIDUpdateResponse; import iso.std.iso_iec._24727.tech.schema.DSICreate; import iso.std.iso_iec._24727.tech.schema.DSICreateResponse; import iso.std.iso_iec._24727.tech.schema.DSIDelete; import iso.std.iso_iec._24727.tech.schema.DSIDeleteResponse; import iso.std.iso_iec._24727.tech.schema.DSIList; import iso.std.iso_iec._24727.tech.schema.DSIListResponse; import iso.std.iso_iec._24727.tech.schema.DSINameListType; import iso.std.iso_iec._24727.tech.schema.DSIRead; import iso.std.iso_iec._24727.tech.schema.DSIReadResponse; import iso.std.iso_iec._24727.tech.schema.DSIType; import iso.std.iso_iec._24727.tech.schema.DSIWrite; import iso.std.iso_iec._24727.tech.schema.DSIWriteResponse; import iso.std.iso_iec._24727.tech.schema.DataSetCreate; import iso.std.iso_iec._24727.tech.schema.DataSetCreateResponse; import iso.std.iso_iec._24727.tech.schema.DataSetDelete; import iso.std.iso_iec._24727.tech.schema.DataSetDeleteResponse; import iso.std.iso_iec._24727.tech.schema.DataSetInfoType; import iso.std.iso_iec._24727.tech.schema.DataSetList; import iso.std.iso_iec._24727.tech.schema.DataSetListResponse; import iso.std.iso_iec._24727.tech.schema.DataSetNameListType; import iso.std.iso_iec._24727.tech.schema.DataSetSelect; import iso.std.iso_iec._24727.tech.schema.DataSetSelectResponse; import iso.std.iso_iec._24727.tech.schema.Decipher; import iso.std.iso_iec._24727.tech.schema.DecipherResponse; import iso.std.iso_iec._24727.tech.schema.DestroySession; import iso.std.iso_iec._24727.tech.schema.DestroySessionResponse; import iso.std.iso_iec._24727.tech.schema.DifferentialIdentityServiceActionName; import iso.std.iso_iec._24727.tech.schema.Disconnect; import iso.std.iso_iec._24727.tech.schema.DisconnectResponse; import iso.std.iso_iec._24727.tech.schema.EmptyResponseDataType; import iso.std.iso_iec._24727.tech.schema.Encipher; import iso.std.iso_iec._24727.tech.schema.EncipherResponse; import iso.std.iso_iec._24727.tech.schema.ExecuteAction; import iso.std.iso_iec._24727.tech.schema.ExecuteActionResponse; import iso.std.iso_iec._24727.tech.schema.GetRandom; import iso.std.iso_iec._24727.tech.schema.GetRandomResponse; import iso.std.iso_iec._24727.tech.schema.Hash; import iso.std.iso_iec._24727.tech.schema.HashResponse; import iso.std.iso_iec._24727.tech.schema.Initialize; import iso.std.iso_iec._24727.tech.schema.InitializeResponse; import iso.std.iso_iec._24727.tech.schema.NamedDataServiceActionName; import iso.std.iso_iec._24727.tech.schema.PathType; import iso.std.iso_iec._24727.tech.schema.PathType.TagRef; import iso.std.iso_iec._24727.tech.schema.Sign; import iso.std.iso_iec._24727.tech.schema.SignResponse; import iso.std.iso_iec._24727.tech.schema.TargetNameType; import iso.std.iso_iec._24727.tech.schema.Terminate; import iso.std.iso_iec._24727.tech.schema.TerminateResponse; import iso.std.iso_iec._24727.tech.schema.VerifyCertificate; import iso.std.iso_iec._24727.tech.schema.VerifyCertificateResponse; import iso.std.iso_iec._24727.tech.schema.VerifySignature; import iso.std.iso_iec._24727.tech.schema.VerifySignatureResponse; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.TreeSet; import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.openecard.addon.AddonManager; import org.openecard.addon.AddonNotFoundException; import org.openecard.addon.AddonSelector; import org.openecard.addon.HighestVersionSelector; import org.openecard.addon.manifest.AddonSpecification; import org.openecard.addon.manifest.ProtocolPluginSpecification; import org.openecard.addon.sal.FunctionType; import org.openecard.addon.sal.SALProtocol; import org.openecard.common.ECardConstants; import org.openecard.common.ECardException; import org.openecard.common.ThreadTerminateException; import org.openecard.common.WSHelper; import org.openecard.common.apdu.DeleteFile; import org.openecard.common.apdu.EraseBinary; import org.openecard.common.apdu.EraseRecord; import org.openecard.common.apdu.GetData; import org.openecard.common.apdu.GetResponse; import org.openecard.common.apdu.ReadBinary; import org.openecard.common.apdu.ReadRecord; import org.openecard.common.apdu.Select; import org.openecard.common.apdu.UpdateBinary; import org.openecard.common.apdu.UpdateRecord; import org.openecard.common.apdu.WriteBinary; import org.openecard.common.apdu.WriteRecord; import org.openecard.common.apdu.common.CardCommandAPDU; import org.openecard.common.apdu.common.CardResponseAPDU; import org.openecard.common.apdu.common.TrailerConstants; import org.openecard.common.apdu.utils.CardUtils; import org.openecard.common.interfaces.Environment; import org.openecard.common.interfaces.InvocationTargetExceptionUnchecked; import org.openecard.common.interfaces.Publish; import org.openecard.common.sal.Assert; import org.openecard.common.sal.exception.InappropriateProtocolForActionException; import org.openecard.common.sal.exception.IncorrectParameterException; import org.openecard.common.sal.exception.NameExistsException; import org.openecard.common.sal.exception.NamedEntityNotFoundException; import org.openecard.common.sal.exception.PrerequisitesNotSatisfiedException; import org.openecard.common.sal.exception.SecurityConditionNotSatisfiedException; import org.openecard.common.sal.exception.UnknownConnectionHandleException; import org.openecard.common.sal.exception.UnknownProtocolException; import org.openecard.common.sal.state.CardEntry; import org.openecard.common.sal.state.ConnectedCardEntry; import org.openecard.common.sal.state.NoSuchSession; import org.openecard.common.sal.state.SalStateManager; import org.openecard.common.sal.state.SessionAlreadyExists; import org.openecard.common.sal.state.StateEntry; import org.openecard.common.sal.state.cif.CardApplicationWrapper; import org.openecard.common.sal.state.cif.CardInfoWrapper; import org.openecard.common.sal.util.SALUtils; import org.openecard.common.tlv.TLV; import org.openecard.common.tlv.TLVException; import org.openecard.common.tlv.iso7816.DataElements; import org.openecard.common.tlv.iso7816.FCP; import org.openecard.common.util.ByteUtils; import org.openecard.crypto.common.sal.did.CryptoMarkerType; import org.openecard.gui.UserConsent; import org.openecard.ws.SAL; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class TinySAL implements SAL { private static final Logger LOG = LoggerFactory.getLogger(TinySAL.class); private static final byte[] MF = new byte[] {(byte) 0x3F, (byte) 0x00}; private final Environment env; private final SalStateManager salStates; // private final CardStateMap states = null; // TODO: replace with SalStateManager private byte[] ifdCtx; private AddonManager addonManager; private AddonSelector protocolSelector; private UserConsent userConsent; private SalEventManager evtMan; /** * Creates a new TinySAL. * * @param env Environment */ public TinySAL(Environment env) { this.env = env; this.salStates = new SalStateManager(); } public void setAddonManager(AddonManager manager) { this.addonManager = manager; protocolSelector = new AddonSelector(manager); protocolSelector.setStrategy(new HighestVersionSelector()); // TODO: check if returnSALProtocol must be called when the entry is removed. // states.setProtocolSelector(protocolSelector); } @Override public Set<String> supportedProtocols() { TreeSet<String> protos = new TreeSet<>(); for (AddonSpecification aSpec : addonManager.getRegistry().listAddons()) { for (ProtocolPluginSpecification pSpec : aSpec.getSalActions()) { protos.add(pSpec.getUri()); } } return protos; } public void setIfdCtx(byte[] ctx) { this.ifdCtx = ByteUtils.clone(ctx); } /** * The Initialize function is executed when the ISO24727-3-Interface is invoked for the first time. * The interface is initialised with this function. * See BSI-TR-03112-4, version 1.1.2, section 3.1.1. * * @param request Initialize * @return InitializeResponse */ @Override public InitializeResponse initialize(Initialize request) { evtMan = new SalEventManager(salStates, env, ifdCtx); InitializeResponse res = WSHelper.makeResponse(InitializeResponse.class, WSHelper.makeResultOK()); evtMan.initialize(); return res; } /** * The Terminate function is executed when the ISO24727-3-Interface is terminated. * This function closes all established connections and open sessions. * See BSI-TR-03112-4, version 1.1.2, section 3.1.2. * * @param request Terminate * @return TerminateResponse */ @Override public TerminateResponse terminate(Terminate request) { if (evtMan != null) { evtMan.terminate(); } TerminateResponse res = WSHelper.makeResponse(TerminateResponse.class, WSHelper.makeResultOK()); return res; } @Override public CreateSessionResponse createSession(CreateSession parameters) { CreateSessionResponse response = new CreateSessionResponse(); if (parameters == null || parameters.getSessionIdentifier() == null) { StateEntry entry = this.salStates.createSession(this.ifdCtx); response.setConnectionHandle(entry.copyHandle()); response.setResult(WSHelper.makeResultOK()); } else { try { StateEntry entry = this.salStates.createSession(parameters.getSessionIdentifier(), this.ifdCtx); response.setConnectionHandle(entry.copyHandle()); response.setResult(WSHelper.makeResultOK()); } catch (SessionAlreadyExists ex) { // TODO: Add minor error code and message response.setResult(WSHelper.makeResultError("DUPLICATE_SESSION_IDENTIFIER", "The given session identifier is not unique.")); } } return response; } @Override public DestroySessionResponse destroySession(DestroySession parameters) { byte[] contextHandle = null; if (parameters != null) { ConnectionHandleType connectionHandle = parameters.getConnectionHandle(); if (connectionHandle != null) { contextHandle = connectionHandle.getContextHandle(); } } DestroySessionResponse response = new DestroySessionResponse(); boolean didRemoveSession = this.salStates.destroySessionByContextHandle(contextHandle); if (didRemoveSession) { response.setResult(WSHelper.makeResultOK()); } else { response.setResult(WSHelper.makeResultError("NO_SESSION_MATCHED_GIVEN_CONTEXT_HANDLE_HANDLE", "No session was found for the given context handle.")); } return response; } /** * The CardApplicationPath function determines a path between the client application and a card application. * See BSI-TR-03112-4, version 1.1.2, section 3.1.3. * * @param request CardApplicationPath * @return CardApplicationPathResponse */ @Override public CardApplicationPathResponse cardApplicationPath(CardApplicationPath request) { CardApplicationPathResponse response = WSHelper.makeResponse(CardApplicationPathResponse.class, WSHelper.makeResultOK()); try { CardApplicationPathType cardAppPath = request.getCardAppPathRequest(); Assert.assertIncorrectParameter(cardAppPath, "The parameter CardAppPathRequest is empty."); ChannelHandleType reqChannelHandle = cardAppPath.getChannelHandle(); boolean hasSessionIdentifier = reqChannelHandle.getSessionIdentifier() != null; // Set<CardStateEntry> entries = states.getMatchingEntries(cardAppPath); List<CardEntry> entries = SALUtils.filterEntries(cardAppPath, salStates.listCardEntries()); // Copy entries to result set CardAppPathResultSet resultSet = new CardAppPathResultSet(); List<CardApplicationPathType> resultPaths = resultSet.getCardApplicationPathResult(); for (CardEntry entry : entries) { CardApplicationPathType pathCopy = entry.copyHandle(); final byte[] cardApplication = cardAppPath.getCardApplication(); if (cardApplication != null) { pathCopy.setCardApplication(cardApplication); } else { final byte[] implicitApplication = entry.getCif().getImplicitlySelectedApplication(); if (implicitApplication != null) { pathCopy.setCardApplication(implicitApplication); } else { LOG.warn("No CardApplication and ImplicitlySelectedApplication available using MF now."); pathCopy.setCardApplication(MF); } } if (hasSessionIdentifier) { ChannelHandleType copyChannelHandle = pathCopy.getChannelHandle(); if (copyChannelHandle == null) { copyChannelHandle = new ChannelHandleType(); pathCopy.setChannelHandle(copyChannelHandle); } copyChannelHandle.setSessionIdentifier(reqChannelHandle.getSessionIdentifier()); } resultPaths.add(pathCopy); } response.setCardAppPathResultSet(resultSet); } catch (IncorrectParameterException e) { response.setResult(e.getResult()); } return response; } /** * The CardApplicationConnect function establishes an unauthenticated connection between the client * application and the card application. * See BSI-TR-03112-4, version 1.1.2, section 3.2.1. * * @param request CardApplicationConnect * @return CardApplicationConnectResponse */ @Override public CardApplicationConnectResponse cardApplicationConnect(CardApplicationConnect request) { CardApplicationConnectResponse response = WSHelper.makeResponse(CardApplicationConnectResponse.class, WSHelper.makeResultOK()); try { Assert.assertIncorrectParameter(request, "The parameter CardApplicationConnect is empty."); CardApplicationPathType cardAppPath = request.getCardApplicationPath(); Assert.assertIncorrectParameter(cardAppPath, "The parameter CardAppPathRequest is empty."); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); /* * [TR-03112-4] If the provided path fragments are valid for more than one card application * the eCard-API-Framework SHALL return any of the possible choices. */ // CardStateEntry cardStateEntry = cardStateEntrySet.iterator().next(); CardEntry baseCardStateEntry = SALUtils.getMatchingEntry(cardAppPath, salStates); Assert.assertIncorrectParameter(baseCardStateEntry, "The given ConnectionHandle is invalid."); byte[] applicationID = cardAppPath.getCardApplication(); if (applicationID == null) { byte[] implicitlySelectedApplication = baseCardStateEntry.getCif().getImplicitlySelectedApplication(); if (implicitlySelectedApplication != null) { applicationID = implicitlySelectedApplication; } else { applicationID = MF; } } Assert.securityConditionApplication(baseCardStateEntry.getCif(), new HashSet<>(), applicationID, ConnectionServiceActionName.CARD_APPLICATION_CONNECT); // Connect to the card // ConnectionHandleType handle = cardStateEntry.handleCopy(); // cardStateEntry = cardStateEntry.derive(handle); ConnectionHandleType handle = baseCardStateEntry.copyHandle(); Connect connect = new Connect(); connect.setContextHandle(handle.getContextHandle()); connect.setIFDName(handle.getIFDName()); connect.setSlot(handle.getSlotIndex()); ConnectResponse connectResponse = (ConnectResponse) env.getDispatcher().safeDeliver(connect); WSHelper.checkResult(connectResponse); // Select the card application CardCommandAPDU select; final byte[] slotHandle = connectResponse.getSlotHandle(); // TODO: proper determination of path, file and app id if (applicationID.length == 2) { select = new Select.File(applicationID); List<byte[]> responses = new ArrayList<>(); responses.add(TrailerConstants.Success.OK()); responses.add(TrailerConstants.Error.WRONG_P1_P2()); CardResponseAPDU resp = select.transmit(env.getDispatcher(), slotHandle, responses); if (Arrays.equals(resp.getTrailer(), TrailerConstants.Error.WRONG_P1_P2())) { select = new Select.AbsolutePath(applicationID); select.transmit(env.getDispatcher(), slotHandle); } } else { select = new Select.Application(applicationID); select.transmit(env.getDispatcher(), slotHandle); } ConnectedCardEntry connectedCardEntry = stateEntry.setConnectedCard(slotHandle, applicationID, baseCardStateEntry); // reset the ef FCP connectedCardEntry.unsetFCPOfSelectedEF(); salStates.addCard(connectedCardEntry); response.setConnectionHandle(stateEntry.copyHandle()); response.getConnectionHandle().setCardApplication(applicationID); } catch (ECardException e) { response.setResult(e.getResult()); } return response; } @Override public CardApplicationSelectResponse cardApplicationSelect(CardApplicationSelect request) { CardApplicationSelectResponse response = WSHelper.makeResponse(CardApplicationSelectResponse.class, WSHelper.makeResultOK()); try { byte[] slotHandle = request.getSlotHandle(); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle); StateEntry stateEntry = salStates.getSessionBySlotHandle(slotHandle); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); byte[] reqApplicationID = request.getCardApplication(); Assert.assertIncorrectParameter(reqApplicationID, "The parameter CardApplication is empty."); CardInfoWrapper cardInfoWrapper = cardStateEntry.getCif(); CardApplicationWrapper appInfo = cardInfoWrapper.getCardApplication(reqApplicationID); Assert.assertNamedEntityNotFound(appInfo, "The given Application cannot be found."); Assert.securityConditionApplication(cardInfoWrapper, cardStateEntry.getAuthenticatedDIDs(), reqApplicationID, ConnectionServiceActionName.CARD_APPLICATION_CONNECT); // check if the currently selected application is already what the caller wants byte[] curApplicationID = cardStateEntry.getCurrentCardApplication().getApplicationIdentifier(); if (! ByteUtils.compare(reqApplicationID, curApplicationID)) { // Select the card application CardCommandAPDU select; // TODO: proper determination of path, file and app id if (reqApplicationID.length == 2) { select = new Select.File(reqApplicationID); List<byte[]> responses = new ArrayList<>(); responses.add(TrailerConstants.Success.OK()); responses.add(TrailerConstants.Error.WRONG_P1_P2()); CardResponseAPDU resp = select.transmit(env.getDispatcher(), slotHandle, responses); if (Arrays.equals(resp.getTrailer(), TrailerConstants.Error.WRONG_P1_P2())) { select = new Select.AbsolutePath(reqApplicationID); select.transmit(env.getDispatcher(), slotHandle); } } else { select = new Select.Application(reqApplicationID); select.transmit(env.getDispatcher(), slotHandle); } cardStateEntry.setCurrentCardApplication(reqApplicationID); // reset the ef FCP cardStateEntry.unsetFCPOfSelectedEF(); } response.setConnectionHandle(stateEntry.copyHandle()); } catch (ECardException e) { response.setResult(e.getResult()); } return response; } /** * The CardApplicationDisconnect function terminates the connection to a card application. * See BSI-TR-03112-4, version 1.1.2, section 3.2.2. * * @param request CardApplicationDisconnect * @return CardApplicationDisconnectResponse */ @Override public CardApplicationDisconnectResponse cardApplicationDisconnect(CardApplicationDisconnect request) { CardApplicationDisconnectResponse response = WSHelper.makeResponse(CardApplicationDisconnectResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); byte[] slotHandle = connectionHandle.getSlotHandle(); // check existence of required parameters if (slotHandle == null) { return WSHelper.makeResponse(CardApplicationDisconnectResponse.class, WSHelper.makeResultError(ECardConstants.Minor.App.INCORRECT_PARM, "ConnectionHandle is null")); } StateEntry stateEntry = salStates.getSessionBySlotHandle(slotHandle); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); Disconnect disconnect = new Disconnect(); disconnect.setSlotHandle(slotHandle); if (request.getAction() != null) { disconnect.setAction(request.getAction()); } stateEntry.removeCard(); // remove entries associated with this handle DisconnectResponse disconnectResponse = (DisconnectResponse) env.getDispatcher().safeDeliver(disconnect); response.setResult(disconnectResponse.getResult()); } catch (ECardException e) { LOG.debug("Could not process CardApplicationDisconnectResponse", e); response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * This CardApplicationStartSession function starts a session between the client application and the card application. * See BSI-TR-03112-4, version 1.1.2, section 3.2.3. * * @param request CardApplicationStartSession * @return CardApplicationStartSessionResponse */ @Publish @Override public CardApplicationStartSessionResponse cardApplicationStartSession(CardApplicationStartSession request) { CardApplicationStartSessionResponse response = WSHelper.makeResponse(CardApplicationStartSessionResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(request, connectionHandle); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); Assert.assertIncorrectParameter(cardStateEntry, "The parameter session identifier did not identify a session with a connected card."); byte[] cardApplicationID = connectionHandle.getCardApplication(); String didName = SALUtils.getDIDName(request); Assert.assertIncorrectParameter(didName, "The parameter didName is empty."); DIDAuthenticationDataType didAuthenticationProtocolData = request.getAuthenticationProtocolData(); Assert.assertIncorrectParameter(didAuthenticationProtocolData, "The parameter didAuthenticationProtocolData is empty."); DIDStructureType didStructure = cardStateEntry.getDIDStructure(didName, cardApplicationID); Assert.assertNamedEntityNotFound(didStructure, "The given DIDName cannot be found."); Assert.securityConditionApplication(cardStateEntry.getCif(), cardStateEntry.getAuthenticatedDIDs(), cardApplicationID, ConnectionServiceActionName.CARD_APPLICATION_START_SESSION); String protocolURI = didStructure.getDIDMarker().getProtocol(); SALProtocol protocol = getProtocol(connectionHandle, request.getDIDScope(), protocolURI); if (protocol.hasNextStep(FunctionType.CardApplicationStartSession)) { response = protocol.cardApplicationStartSession(request); removeFinishedProtocol(connectionHandle, protocolURI, protocol); } else { throw new InappropriateProtocolForActionException("CardApplicationStartSession", protocol.toString()); } } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The CardApplicationEndSession function closes the session between the client application and the card application. * See BSI-TR-03112-4, version 1.1.2, section 3.2.4. * * @param request CardApplicationEndSession * @return CardApplicationEndSessionResponse */ @Publish @Override public CardApplicationEndSessionResponse cardApplicationEndSession(CardApplicationEndSession request) { CardApplicationEndSessionResponse response = WSHelper.makeResponse(CardApplicationEndSessionResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); byte[] cardApplicationID = connectionHandle.getCardApplication(); String didName = SALUtils.getDIDName(request); DIDStructureType didStructure = cardStateEntry.getDIDStructure(didName, cardApplicationID); Assert.assertNamedEntityNotFound(didStructure, "The given DIDName cannot be found."); Assert.securityConditionApplication(cardStateEntry.getCif(), cardStateEntry.getAuthenticatedDIDs(), cardApplicationID, ConnectionServiceActionName.CARD_APPLICATION_END_SESSION); String protocolURI = didStructure.getDIDMarker().getProtocol(); SALProtocol protocol = getProtocol(connectionHandle, null, protocolURI); if (protocol.hasNextStep(FunctionType.CardApplicationEndSession)) { response = protocol.cardApplicationEndSession(request); removeFinishedProtocol(connectionHandle, protocolURI, protocol); } else { throw new InappropriateProtocolForActionException("CardApplicationEndSession", protocol.toString()); } } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The CardApplicationList function returns a list of the available card applications on an eCard. * See BSI-TR-03112-4, version 1.1.2, section 3.3.1. * * @param request CardApplicationList * @return CardApplicationListResponse */ @Publish @Override public CardApplicationListResponse cardApplicationList(CardApplicationList request) { CardApplicationListResponse response = WSHelper.makeResponse(CardApplicationListResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle, false); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); /* TR-03112-4 section 3.3.2 states that the alpha application have to be connected with CardApplicationConnect. In case of using CardInfo file descriptions this is not necessary because we just work on a file. */ // byte[] cardApplicationID = connectionHandle.getCardApplication(); // Assert.securityConditionApplication(cardStateEntry, cardApplicationID, // CardApplicationServiceActionName.CARD_APPLICATION_LIST); CardInfoWrapper cardInfoWrapper = cardStateEntry.getCif(); CardApplicationNameList cardApplicationNameList = new CardApplicationNameList(); cardApplicationNameList.getCardApplicationName().addAll(cardInfoWrapper.getCardApplicationNameList()); response.setCardApplicationNameList(cardApplicationNameList); } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } @Override public CardApplicationCreateResponse cardApplicationCreate(CardApplicationCreate request) { return WSHelper.makeResponse(CardApplicationCreateResponse.class, WSHelper.makeResultUnknownError("Not supported yet.")); } /** * The CardApplicationDelete function deletes a card application as well as all corresponding * data sets, DSIs, DIDs and services. * See BSI-TR-03112-4, version 1.1.2, section 3.3.3. * * @param request CardApplicationDelete * @return CardApplicationDeleteResponse */ @Override public CardApplicationDeleteResponse cardApplicationDelete(CardApplicationDelete request) { CardApplicationDeleteResponse response = WSHelper.makeResponse(CardApplicationDeleteResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle, false); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); byte[] cardApplicationName = request.getCardApplicationName(); Assert.assertIncorrectParameter(cardApplicationName, "The parameter CardApplicationName is empty."); Assert.securityConditionApplication(cardStateEntry.getCif(), cardStateEntry.getAuthenticatedDIDs(), connectionHandle.getCardApplication(), CardApplicationServiceActionName.CARD_APPLICATION_DELETE); // TODO: determine how the deletion have to be performed. A card don't have to support the Deletion by // application identifier. Necessary attributes should be available in the ATR or EF.ATR. DeleteFile delFile = new DeleteFile.Application(cardApplicationName); delFile.transmit(env.getDispatcher(), connectionHandle.getSlotHandle()); } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The CardApplicationServiceList function returns a list of all available services of a card application. * See BSI-TR-03112-4, version 1.1.2, section 3.3.4. * * @param request CardApplicationServiceList * @return CardApplicationServiceListResponse */ @Publish @Override public CardApplicationServiceListResponse cardApplicationServiceList(CardApplicationServiceList request) { CardApplicationServiceListResponse response = WSHelper.makeResponse(CardApplicationServiceListResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); byte[] cardApplicationID = connectionHandle.getCardApplication(); Assert.securityConditionApplication(cardStateEntry.getCif(), cardStateEntry.getAuthenticatedDIDs(), cardApplicationID, CardApplicationServiceActionName.CARD_APPLICATION_SERVICE_LIST); CardApplicationServiceNameList cardApplicationServiceNameList = new CardApplicationServiceNameList(); CardInfoWrapper cardInfoWrapper = cardStateEntry.getCif(); Iterator<CardApplicationType> it = cardInfoWrapper.getApplicationCapabilities().getCardApplication().iterator(); while (it.hasNext()) { CardApplicationType next = it.next(); byte[] appName = next.getApplicationIdentifier(); if (Arrays.equals(appName, cardApplicationID)) { Iterator<CardApplicationServiceType> itt = next.getCardApplicationServiceInfo().iterator(); while (itt.hasNext()) { CardApplicationServiceType nextt = itt.next(); cardApplicationServiceNameList.getCardApplicationServiceName().add(nextt.getCardApplicationServiceName()); } } } response.setCardApplicationServiceNameList(cardApplicationServiceNameList); } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The CardApplicationServiceCreate function creates a new service in the card application. * See BSI-TR-03112-4, version 1.1.2, section 3.3.5. * * @param request CardApplicationServiceCreate * @return CardApplicationServiceCreateResponse */ @Override public CardApplicationServiceCreateResponse cardApplicationServiceCreate(CardApplicationServiceCreate request) { return WSHelper.makeResponse(CardApplicationServiceCreateResponse.class, WSHelper.makeResultUnknownError("Not supported yet.")); } /** * Code for a specific card application service was loaded into the card application with the aid * of the CardApplicationServiceLoad function. * See BSI-TR-03112-4, version 1.1.2, section 3.3.6. * * @param request CardApplicationServiceLoad * @return CardApplicationServiceLoadResponse */ @Override public CardApplicationServiceLoadResponse cardApplicationServiceLoad(CardApplicationServiceLoad request) { return WSHelper.makeResponse(CardApplicationServiceLoadResponse.class, WSHelper.makeResultUnknownError("Not supported yet.")); } /** * The CardApplicationServiceDelete function deletes a card application service in a card application. * See BSI-TR-03112-4, version 1.1.2, section 3.3.7. * * @param request CardApplicationServiceDelete * @return CardApplicationServiceDeleteResponse */ @Override public CardApplicationServiceDeleteResponse cardApplicationServiceDelete(CardApplicationServiceDelete request) { return WSHelper.makeResponse(CardApplicationServiceDeleteResponse.class, WSHelper.makeResultUnknownError("Not supported yet.")); } /** * The CardApplicationServiceDescribe function can be used to request an URI, an URL or a detailed description * of the selected card application service. * See BSI-TR-03112-4, version 1.1.2, section 3.3.8. * * @param request CardApplicationServiceDescribe * @return CardApplicationServiceDescribeResponse */ @Publish @Override public CardApplicationServiceDescribeResponse cardApplicationServiceDescribe(CardApplicationServiceDescribe request) { CardApplicationServiceDescribeResponse response = WSHelper.makeResponse(CardApplicationServiceDescribeResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); byte[] cardApplicationID = connectionHandle.getCardApplication(); String cardApplicationServiceName = request.getCardApplicationServiceName(); Assert.assertIncorrectParameter(cardApplicationServiceName, "The parameter CardApplicationServiceName is empty."); Assert.securityConditionApplication(cardStateEntry.getCif(), cardStateEntry.getAuthenticatedDIDs(), cardApplicationID, CardApplicationServiceActionName.CARD_APPLICATION_SERVICE_DESCRIBE); CardInfoWrapper cardInfoWrapper = cardStateEntry.getCif(); Iterator<CardApplicationType> it = cardInfoWrapper.getApplicationCapabilities().getCardApplication().iterator(); while (it.hasNext()) { CardApplicationType next = it.next(); byte[] appName = next.getApplicationIdentifier(); if (Arrays.equals(appName, cardApplicationID)){ Iterator<CardApplicationServiceType> itt = next.getCardApplicationServiceInfo().iterator(); while (itt.hasNext()) { CardApplicationServiceType nextt = itt.next(); if (nextt.getCardApplicationServiceName().equals(cardApplicationServiceName)) { response.setServiceDescription(nextt.getCardApplicationServiceDescription()); return response; } } } } } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The ExecuteAction function permits use of additional card application services by the client application * which are not explicitly specified in [ISO24727-3] but which can be implemented by the eCard with additional code. * See BSI-TR-03112-4, version 1.1.2, section 3.3.9. * * @param request ExecuteAction * @return ExecuteActionResponse */ @Override public ExecuteActionResponse executeAction(ExecuteAction request) { return WSHelper.makeResponse(ExecuteActionResponse.class, WSHelper.makeResultUnknownError("Not supported yet.")); } /** * The DataSetList function returns the list of the data sets in the card application addressed with the * ConnectionHandle. * See BSI-TR-03112-4, version 1.1.2, section 3.4.1. * * @param request DataSetList * @return DataSetListResponse */ @Publish @Override public DataSetListResponse dataSetList(DataSetList request) { DataSetListResponse response = WSHelper.makeResponse(DataSetListResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle, false); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); byte[] cardApplicationID = connectionHandle.getCardApplication(); Assert.securityConditionApplication(cardStateEntry.getCif(), cardStateEntry.getAuthenticatedDIDs(), cardApplicationID, NamedDataServiceActionName.DATA_SET_LIST); CardInfoWrapper cardInfoWrapper = cardStateEntry.getCif(); DataSetNameListType dataSetNameList = cardInfoWrapper.getDataSetNameList(cardApplicationID); response.setDataSetNameList(dataSetNameList); } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The DataSetCreate function creates a new data set in the card application addressed with the * ConnectionHandle (or otherwise in a previously selected data set if this is implemented as a DF). * See BSI-TR-03112-4, version 1.1.2, section 3.4.2. * * @param request DataSetCreate * @return DataSetCreateResponse */ @Override public DataSetCreateResponse dataSetCreate(DataSetCreate request) { return WSHelper.makeResponse(DataSetCreateResponse.class, WSHelper.makeResultUnknownError("Not supported yet.")); } /** * The DataSetSelect function selects a data set in a card application. * See BSI-TR-03112-4, version 1.1.2, section 3.4.3. * * @param request DataSetSelect * @return DataSetSelectResponse */ @Publish @Override public DataSetSelectResponse dataSetSelect(DataSetSelect request) { DataSetSelectResponse response = WSHelper.makeResponse(DataSetSelectResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); byte[] applicationID = connectionHandle.getCardApplication(); String dataSetName = request.getDataSetName(); Assert.assertIncorrectParameter(dataSetName, "The parameter DataSetName is empty."); CardInfoWrapper cardInfoWrapper = cardStateEntry.getCif(); DataSetInfoType dataSetInfo = cardInfoWrapper.getDataSet(dataSetName, applicationID); Assert.assertNamedEntityNotFound(dataSetInfo, "The given DataSet cannot be found."); Assert.securityConditionDataSet(cardStateEntry, applicationID, dataSetName, NamedDataServiceActionName.DATA_SET_SELECT); byte[] fileID = dataSetInfo.getDataSetPath().getEfIdOrPath(); byte[] slotHandle = connectionHandle.getSlotHandle(); CardResponseAPDU result = CardUtils.selectFileWithOptions(env.getDispatcher(), slotHandle, fileID, null, CardUtils.FCP_RESPONSE_DATA); FCP fcp = null; if (result != null && result.getData().length > 0) { try { fcp = new FCP(result.getData()); } catch (TLVException ex) { LOG.warn("Invalid FCP received."); } } if (fcp == null) { LOG.info("Using fake FCP."); fcp = new FCP(createFakeFCP(Arrays.copyOfRange(fileID, fileID.length - 2, fileID.length))); } cardStateEntry.setFCPOfSelectedEF(fcp); } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The DataSetDelete function deletes a data set of a card application on an eCard. * See BSI-TR-03112-4, version 1.1.2, section 3.4.4. * * @param request DataSetDelete * @return DataSetDeleteResponse */ @Override public DataSetDeleteResponse dataSetDelete(DataSetDelete request) { DataSetDeleteResponse response = WSHelper.makeResponse(DataSetDeleteResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); byte[] cardApplicationID = connectionHandle.getCardApplication(); CardInfoWrapper cardInfoWrapper = cardStateEntry.getCif(); String dataSetName = request.getDataSetName(); Assert.assertIncorrectParameter(dataSetName, "The parameter DataSetName is empty."); Assert.securityConditionDataSet(cardStateEntry, cardApplicationID, dataSetName, NamedDataServiceActionName.DATA_SET_DELETE); DataSetInfoType dataSet = cardInfoWrapper.getDataSet(dataSetName, cardApplicationID); if (dataSet == null) { throw new NamedEntityNotFoundException("The data set " + dataSetName + " does not exist."); } byte[] path = dataSet.getDataSetPath().getEfIdOrPath(); int len = path.length; byte[] fid = new byte[] {path[len - 2], path[len - 1]}; DeleteFile delFile = new DeleteFile.ChildFile(fid); delFile.transmit(env.getDispatcher(), connectionHandle.getSlotHandle()); } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The function DSIList supplies the list of the DSI (Data Structure for Interoperability) which exist in the * selected data set. * See BSI-TR-03112-4, version 1.1.2, section 3.4.5. <br> * <br> * Prerequisites: <br> * - a connection to a card application has been established <br> * - a data set has been selected <br> * * @param request DSIList * @return DSIListResponse */ @Publish @Override public DSIListResponse dsiList(DSIList request) { DSIListResponse response = WSHelper.makeResponse(DSIListResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle, false); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); CardInfoWrapper cardInfoWrapper = cardStateEntry.getCif(); byte[] cardApplicationID = connectionHandle.getCardApplication(); if (cardStateEntry.getFCPOfSelectedEF() == null) { throw new PrerequisitesNotSatisfiedException("No EF selected."); } DataSetInfoType dataSet = cardInfoWrapper.getDataSetByFid( cardStateEntry.getFCPOfSelectedEF().getFileIdentifiers().get(0)); Assert.securityConditionDataSet(cardStateEntry, cardApplicationID, dataSet.getDataSetName(), NamedDataServiceActionName.DSI_LIST); DSINameListType dsiNameList = new DSINameListType(); for (DSIType dsi : dataSet.getDSI()) { dsiNameList.getDSIName().add(dsi.getDSIName()); } response.setDSINameList(dsiNameList); } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The DSICreate function creates a DSI (Data Structure for Interoperability) in the currently selected data set. * See BSI-TR-03112-4, version 1.1.2, section 3.4.6. * <br> * <br> * Preconditions: <br> * - Connection to a card application established via CardApplicationConnect <br> * - A data set has been selected with DataSetSelect <br> * - The DSI does not exist in the data set. <br> * * @param request DSICreate * @return DSICreateResponse */ @Override public DSICreateResponse dsiCreate(DSICreate request) { DSICreateResponse response = WSHelper.makeResponse(DSICreateResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); CardInfoWrapper cardInfoWrapper = cardStateEntry.getCif(); byte[] cardApplicationID = connectionHandle.getCardApplication(); byte[] dsiContent = request.getDSIContent(); Assert.assertIncorrectParameter(dsiContent, "The parameter DSIContent is empty."); String dsiName = request.getDSIName(); Assert.assertIncorrectParameter(dsiName, "The parameter DSIName is empty."); DSIType dsi = cardInfoWrapper.getDSIbyName(dsiName); if (dsi != null) { throw new NameExistsException("There is already an DSI with the name " + dsiName + " in the current EF."); } byte[] slotHandle = connectionHandle.getSlotHandle(); if (cardStateEntry.getFCPOfSelectedEF() == null) { throw new PrerequisitesNotSatisfiedException("No data set for writing selected."); } else { DataSetInfoType dataSet = cardInfoWrapper.getDataSetByFid( cardStateEntry.getFCPOfSelectedEF().getFileIdentifiers().get(0)); Assert.securityConditionDataSet(cardStateEntry, cardApplicationID, dataSet.getDataSetName(), NamedDataServiceActionName.DSI_CREATE); DataElements dElements = cardStateEntry.getFCPOfSelectedEF().getDataElements(); if (dElements.isTransparent()) { WriteBinary writeBin = new WriteBinary(WriteBinary.INS_WRITE_BINARY_DATA, (byte) 0x00, (byte) 0x00, dsiContent); writeBin.transmit(env.getDispatcher(), slotHandle); } else if (dElements.isCyclic()) { WriteRecord writeRec = new WriteRecord((byte) 0x00, WriteRecord.WRITE_PREVIOUS, dsiContent); writeRec.transmit(env.getDispatcher(), slotHandle); } else { WriteRecord writeRec = new WriteRecord((byte) 0x00, WriteRecord.WRITE_LAST, dsiContent); writeRec.transmit(env.getDispatcher(), slotHandle); } } } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The DSIDelete function deletes a DSI (Data Structure for Interoperability) in the currently selected data set. * See BSI-TR-03112-4, version 1.1.2, section 3.4.7. * * @param request DSIDelete * @return DSIDeleteResponse */ //TODO: rewiew function and add @Publish annotation @Override public DSIDeleteResponse dsiDelete(DSIDelete request) { DSIDeleteResponse response = WSHelper.makeResponse(DSIDeleteResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); CardInfoWrapper cardInfoWrapper = cardStateEntry.getCif(); String dsiName = request.getDSIName(); Assert.assertIncorrectParameter(dsiName, "The parameter DSIName is empty."); if (cardStateEntry.getFCPOfSelectedEF() == null) { String msg = "No DataSet selected for deleting the DSI " + request.getDSIName(); throw new PrerequisitesNotSatisfiedException(msg); } DataSetInfoType dataSet = cardInfoWrapper.getDataSetByDsiName(request.getDSIName()); byte[] fidOrPath = dataSet.getDataSetPath().getEfIdOrPath(); byte[] dataSetFid = new byte[] {fidOrPath[fidOrPath.length - 2], fidOrPath[fidOrPath.length - 1]}; if (! Arrays.equals(dataSetFid, cardStateEntry.getFCPOfSelectedEF().getFileIdentifiers().get(0))) { String msg = "The wrong DataSet for the deletion of DSI " + request.getDSIName() + " is selected."; throw new PrerequisitesNotSatisfiedException(msg); } DataSetInfoType dSet = cardInfoWrapper.getDataSetByFid(cardStateEntry.getFCPOfSelectedEF().getFileIdentifiers().get(0)); Assert.securityConditionDataSet(cardStateEntry, connectionHandle.getCardApplication(), dSet.getDataSetName(), NamedDataServiceActionName.DSI_DELETE); DSIType dsi = cardInfoWrapper.getDSIbyName(dsiName); // We have to define some allowed answers because if the file has an write operation counter we wont get an // 9000 response. ArrayList<byte[]> responses = new ArrayList<byte[]>() { { add(new byte[] {(byte) 0x90, (byte) 0x00}); add(new byte[] {(byte) 0x63, (byte) 0xC1}); add(new byte[] {(byte) 0x63, (byte) 0xC2}); add(new byte[] {(byte) 0x63, (byte) 0xC3}); add(new byte[] {(byte) 0x63, (byte) 0xC4}); add(new byte[] {(byte) 0x63, (byte) 0xC5}); add(new byte[] {(byte) 0x63, (byte) 0xC6}); add(new byte[] {(byte) 0x63, (byte) 0xC7}); add(new byte[] {(byte) 0x63, (byte) 0xC8}); add(new byte[] {(byte) 0x63, (byte) 0xC9}); add(new byte[] {(byte) 0x63, (byte) 0xCA}); add(new byte[] {(byte) 0x63, (byte) 0xCB}); add(new byte[] {(byte) 0x63, (byte) 0xCC}); add(new byte[] {(byte) 0x63, (byte) 0xCD}); add(new byte[] {(byte) 0x63, (byte) 0xCE}); add(new byte[] {(byte) 0x63, (byte) 0xCF}); } }; if (cardStateEntry.getFCPOfSelectedEF().getDataElements().isLinear()) { EraseRecord rmRecord = new EraseRecord(dsi.getDSIPath().getIndex()[0], EraseRecord.ERASE_JUST_P1); rmRecord.transmit(env.getDispatcher(), connectionHandle.getSlotHandle(), responses); } else { // NOTE: Erase binary allows to erase only everything after the offset or everything in front of the offset. // currently erasing everything after the offset is used. EraseBinary rmBinary = new EraseBinary((byte) 0x00, (byte) 0x00, dsi.getDSIPath().getIndex()); rmBinary.transmit(env.getDispatcher(), connectionHandle.getSlotHandle(), responses); } } catch (ECardException e) { LOG.error(e.getMessage(), e); response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The DSIWrite function changes the content of a DSI (Data Structure for Interoperability). * See BSI-TR-03112-4, version 1.1.2, section 3.4.8. * For clarification this method updates an existing DSI and does not create a new one. * * The precondition for this method is that a connection to a card application was established and a data set was * selected. Furthermore the DSI exists already. * * @param request DSIWrite * @return DSIWriteResponse */ @Publish @Override public DSIWriteResponse dsiWrite(DSIWrite request) { DSIWriteResponse response = WSHelper.makeResponse(DSIWriteResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); byte[] applicationID = connectionHandle.getCardApplication(); String dsiName = request.getDSIName(); byte[] updateData = request.getDSIContent(); Assert.assertIncorrectParameter(dsiName, "The parameter DSIName is empty."); Assert.assertIncorrectParameter(updateData, "The parameter DSIContent is empty."); CardInfoWrapper cardInfoWrapper = cardStateEntry.getCif(); DataSetInfoType dataSetInfo = cardInfoWrapper.getDataSetByDsiName(dsiName); DSIType dsi = cardInfoWrapper.getDSIbyName(dsiName); Assert.assertNamedEntityNotFound(dataSetInfo, "The given DSIName cannot be found."); Assert.securityConditionDataSet(cardStateEntry, applicationID, dsiName, NamedDataServiceActionName.DSI_WRITE); if (cardStateEntry.getFCPOfSelectedEF() == null) { throw new PrerequisitesNotSatisfiedException("No EF with DSI selected."); } if (! Arrays.equals(dataSetInfo.getDataSetPath().getEfIdOrPath(), cardStateEntry.getFCPOfSelectedEF().getFileIdentifiers().get(0))) { String msg = "The currently selected data set does not contain the DSI to be updated."; throw new PrerequisitesNotSatisfiedException(msg); } byte[] slotHandle = connectionHandle.getSlotHandle(); if (cardStateEntry.getFCPOfSelectedEF().getDataElements().isTransparent()) { // currently assuming that the index encodes the offset byte[] index = dsi.getDSIPath().getIndex(); UpdateBinary updateBin = new UpdateBinary(index[0], index[1], updateData); updateBin.transmit(env.getDispatcher(), slotHandle); } else { // currently assuming that the index encodes the record number byte index = dsi.getDSIPath().getIndex()[0]; UpdateRecord updateRec = new UpdateRecord(index, updateData); updateRec.transmit(env.getDispatcher(), slotHandle); } } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The DSIRead function reads out the content of a specific DSI (Data Structure for Interoperability). * See BSI-TR-03112-4, version 1.1.2, section 3.4.9. * * @param request DSIRead * @return DSIReadResponse */ @Publish @Override public DSIReadResponse dsiRead(DSIRead request) { DSIReadResponse response = WSHelper.makeResponse(DSIReadResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); byte[] applicationID = cardStateEntry.getCurrentCardApplication().getApplicationIdentifier(); String dsiName = request.getDSIName(); byte[] slotHandle = connectionHandle.getSlotHandle(); Assert.assertIncorrectParameter(dsiName, "The parameter DSIName is empty."); Assert.securityConditionDataSet(cardStateEntry, applicationID, dsiName, NamedDataServiceActionName.DSI_READ); if (cardStateEntry.getFCPOfSelectedEF() == null) { throw new PrerequisitesNotSatisfiedException("No DataSet to read selected."); } CardInfoWrapper cardInfoWrapper = cardStateEntry.getCif(); DataSetInfoType dataSetInfo = cardInfoWrapper.getDataSetByDsiName(dsiName); if (dataSetInfo == null) { // there is no data set which contains the given dsi name so the name should be an data set name dataSetInfo = cardInfoWrapper.getDataSetByName(dsiName); if (dataSetInfo != null) { if (!cardStateEntry.getFCPOfSelectedEF().getFileIdentifiers().isEmpty()) { byte[] path = dataSetInfo.getDataSetPath().getEfIdOrPath(); byte[] fid = Arrays.copyOfRange(path, path.length - 2, path.length); if (!Arrays.equals(fid, cardStateEntry.getFCPOfSelectedEF().getFileIdentifiers().get(0))) { String msg = "Wrong DataSet for reading the DSI " + dsiName + " is selected."; throw new PrerequisitesNotSatisfiedException(msg); } } byte[] fileContent = CardUtils.readFile(cardStateEntry.getFCPOfSelectedEF(), env.getDispatcher(), slotHandle); response.setDSIContent(fileContent); } else { String msg = "The given DSIName does not related to any know DSI or DataSet."; throw new IncorrectParameterException(msg); } } else { // There exists a data set with the given dsi name // check whether the correct file is selected byte[] dataSetPath = dataSetInfo.getDataSetPath().getEfIdOrPath(); byte[] dataSetFID = new byte[] {dataSetPath[dataSetPath.length - 2], dataSetPath[dataSetPath.length - 1]}; if (Arrays.equals(dataSetFID, cardStateEntry.getFCPOfSelectedEF().getFileIdentifiers().get(0))) { DSIType dsi = cardInfoWrapper.getDSIbyName(dsiName); PathType dsiPath = dsi.getDSIPath(); if (dsiPath.getTagRef() != null) { TagRef tagReference = dsiPath.getTagRef(); byte[] tag = tagReference.getTag(); GetData getDataRequest; if (tag.length == 2) { getDataRequest = new GetData(GetData.INS_DATA, tag[0], tag[1]); CardResponseAPDU cardResponse = getDataRequest.transmit(env.getDispatcher(), slotHandle, Collections.EMPTY_LIST); byte[] responseData = cardResponse.getData(); while (cardResponse.getTrailer()[0] == (byte) 0x61) { GetResponse allData = new GetResponse(); cardResponse = allData.transmit(env.getDispatcher(), slotHandle, Collections.EMPTY_LIST); responseData = ByteUtils.concatenate(responseData, cardResponse.getData()); } response.setDSIContent(responseData); } else if (tag.length == 1) { // how to determine Simple- or BER-TLV in this case correctly? // Now try Simple-TLV first and if it fail try BER-TLV getDataRequest = new GetData(GetData.INS_DATA, GetData.SIMPLE_TLV, tag[0]); CardResponseAPDU cardResponse = getDataRequest.transmit(env.getDispatcher(), slotHandle, Collections.EMPTY_LIST); byte[] responseData = cardResponse.getData(); // just an assumption if (Arrays.equals(cardResponse.getTrailer(), new byte[] {(byte) 0x6A, (byte) 0x88})) { getDataRequest = new GetData(GetData.INS_DATA, GetData.BER_TLV_ONE_BYTE, tag[0]); cardResponse = getDataRequest.transmit(env.getDispatcher(), slotHandle, Collections.EMPTY_LIST); responseData = cardResponse.getData(); } while (cardResponse.getTrailer()[0] == (byte) 0x61) { GetResponse allData = new GetResponse(); cardResponse = allData.transmit(env.getDispatcher(), slotHandle, Collections.EMPTY_LIST); responseData = ByteUtils.concatenate(responseData, cardResponse.getData()); } response.setDSIContent(responseData); } } else if (dsiPath.getIndex() != null) { byte[] index = dsiPath.getIndex(); byte[] length = dsiPath.getLength(); List<byte[]> allowedResponse = new ArrayList<>(); allowedResponse.add(new byte[]{(byte) 0x90, (byte) 0x00}); allowedResponse.add(new byte[]{(byte) 0x62, (byte) 0x82}); if (cardStateEntry.getFCPOfSelectedEF().getDataElements().isLinear()) { // in this case we use the index as record number and the length as length of record ReadRecord readRecord = new ReadRecord(index[0]); // NOTE: For record based files TR-0312-4 states to ignore the length field in case of records CardResponseAPDU cardResponse = readRecord.transmit(env.getDispatcher(), slotHandle, allowedResponse); response.setDSIContent(cardResponse.getData()); } else { // in this case we use index as offset and length as the expected length ReadBinary readBinary = new ReadBinary(ByteUtils.toShort(index), ByteUtils.toShort(length)); CardResponseAPDU cardResponse = readBinary.transmit(env.getDispatcher(), slotHandle, allowedResponse); response.setDSIContent(cardResponse.getData()); } } else { String msg = "The currently selected data set does not contain the DSI with the name " + dsiName; throw new PrerequisitesNotSatisfiedException(msg); } } } } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The Encipher function encrypts a transmitted plain text. The detailed behaviour of this function depends on * the protocol of the DID. * See BSI-TR-03112-4, version 1.1.2, section 3.5.1. * * @param request Encipher * @return EncipherResponse */ @Publish @Override public EncipherResponse encipher(Encipher request) { EncipherResponse response = WSHelper.makeResponse(EncipherResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle, false); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); byte[] applicationID = cardStateEntry.getCurrentCardApplication().getApplicationIdentifier(); String didName = SALUtils.getDIDName(request); byte[] plainText = request.getPlainText(); Assert.assertIncorrectParameter(plainText, "The parameter PlainText is empty."); DIDScopeType didScope = request.getDIDScope(); if (didScope == null) { didScope = DIDScopeType.LOCAL; } if (didScope.equals(DIDScopeType.LOCAL)) { byte[] necessaryCardApp = cardStateEntry.getCif().getApplicationIdByDidName(didName, didScope); if (! Arrays.equals(necessaryCardApp, applicationID)) { throw new SecurityConditionNotSatisfiedException("Wrong application selected."); } } DIDStructureType didStructure = cardStateEntry.getDIDStructure(didName, didScope); Assert.assertNamedEntityNotFound(didStructure, "The given DIDName cannot be found."); String protocolURI = didStructure.getDIDMarker().getProtocol(); SALProtocol protocol = getProtocol(connectionHandle, request.getDIDScope(), protocolURI); if (protocol.hasNextStep(FunctionType.Encipher)) { response = protocol.encipher(request); removeFinishedProtocol(connectionHandle, protocolURI, protocol); } else { throw new InappropriateProtocolForActionException("Encipher", protocol.toString()); } } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The Decipher function decrypts a given cipher text. The detailed behaviour of this function depends on * the protocol of the DID. * See BSI-TR-03112-4, version 1.1.2, section 3.5.2. * * @param request Decipher * @return DecipherResponse */ @Override public DecipherResponse decipher(Decipher request) { DecipherResponse response = WSHelper.makeResponse(DecipherResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle, false); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); byte[] applicationID = cardStateEntry.getCurrentCardApplication().getApplicationIdentifier(); String didName = SALUtils.getDIDName(request); byte[] cipherText = request.getCipherText(); Assert.assertIncorrectParameter(cipherText, "The parameter CipherText is empty."); DIDScopeType didScope = request.getDIDScope(); if (didScope == null) { didScope = DIDScopeType.LOCAL; } if (didScope.equals(DIDScopeType.LOCAL)) { byte[] necessaryCardApp = cardStateEntry.getCif().getApplicationIdByDidName(didName, didScope); if (! Arrays.equals(necessaryCardApp, applicationID)) { throw new SecurityConditionNotSatisfiedException("Wrong application selected."); } } DIDStructureType didStructure = cardStateEntry.getDIDStructure(didName, didScope); Assert.assertNamedEntityNotFound(didStructure, "The given DIDName cannot be found."); String protocolURI = didStructure.getDIDMarker().getProtocol(); SALProtocol protocol = getProtocol(connectionHandle, request.getDIDScope(), protocolURI); if (protocol.hasNextStep(FunctionType.Decipher)) { response = protocol.decipher(request); removeFinishedProtocol(connectionHandle, protocolURI, protocol); } else { throw new InappropriateProtocolForActionException("Decipher", protocol.toString()); } } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The GetRandom function returns a random number which is suitable for authentication with the DID addressed with * DIDName. * See BSI-TR-03112-4, version 1.1.2, section 3.5.3. * * @param request GetRandom * @return GetRandomResponse */ @Publish @Override public GetRandomResponse getRandom(GetRandom request) { GetRandomResponse response = WSHelper.makeResponse(GetRandomResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle, false); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); byte[] applicationID = cardStateEntry.getCurrentCardApplication().getApplicationIdentifier(); String didName = SALUtils.getDIDName(request); DIDScopeType didScope = request.getDIDScope(); if (didScope == null) { didScope = DIDScopeType.LOCAL; } if (didScope.equals(DIDScopeType.LOCAL)) { byte[] necessaryApp = cardStateEntry.getCif().getApplicationIdByDidName(didName, didScope); if (! Arrays.equals(necessaryApp, applicationID)) { throw new SecurityConditionNotSatisfiedException("The wrong application is selected for getRandom()"); } } DIDStructureType didStructure = cardStateEntry.getDIDStructure(didName, didScope); Assert.assertNamedEntityNotFound(didStructure, "The given DIDName cannot be found."); String protocolURI = didStructure.getDIDMarker().getProtocol(); SALProtocol protocol = getProtocol(connectionHandle, request.getDIDScope(), protocolURI); if (protocol.hasNextStep(FunctionType.GetRandom)) { response = protocol.getRandom(request); removeFinishedProtocol(connectionHandle, protocolURI, protocol); } else { throw new InappropriateProtocolForActionException("GetRandom", protocol.toString()); } } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The Hash function calculates the hash value of a transmitted message. * See BSI-TR-03112-4, version 1.1.2, section 3.5.4. * * @param request Hash * @return HashResponse */ @Publish @Override public HashResponse hash(Hash request) { HashResponse response = WSHelper.makeResponse(HashResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle, false); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); byte[] applicationID = cardStateEntry.getCurrentCardApplication().getApplicationIdentifier(); String didName = SALUtils.getDIDName(request); byte[] message = request.getMessage(); Assert.assertIncorrectParameter(message, "The parameter Message is empty."); DIDScopeType didScope = request.getDIDScope(); if (didScope == null) { didScope = DIDScopeType.LOCAL; } if (didScope.equals(DIDScopeType.LOCAL)) { byte[] necesssaryApp = cardStateEntry.getCif().getApplicationIdByDidName(didName, didScope); if (! Arrays.equals(necesssaryApp, applicationID)) { String msg = "Wrong application for executing Hash with the specified DID " + didName + "."; throw new SecurityConditionNotSatisfiedException(msg); } } DIDStructureType didStructure = cardStateEntry.getDIDStructure(didName, didScope); Assert.assertNamedEntityNotFound(didStructure, "The given DIDName cannot be found."); String protocolURI = didStructure.getDIDMarker().getProtocol(); SALProtocol protocol = getProtocol(connectionHandle, request.getDIDScope(), protocolURI); if (protocol.hasNextStep(FunctionType.Hash)) { response = protocol.hash(request); removeFinishedProtocol(connectionHandle, protocolURI, protocol); } else { throw new InappropriateProtocolForActionException("Hash", protocol.toString()); } } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The Sign function signs a transmitted message. * See BSI-TR-03112-4, version 1.1.2, section 3.5.5. * * @param request Sign * @return SignResponse */ @Override public SignResponse sign(Sign request) { SignResponse response = WSHelper.makeResponse(SignResponse.class, WSHelper.makeResultOK()); ConnectedCardEntry cardStateEntry = null; try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle, false); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); cardStateEntry = stateEntry.getCardEntry(); byte[] applicationID = cardStateEntry.getCurrentCardApplication().getApplicationIdentifier(); String didName = SALUtils.getDIDName(request); byte[] message = request.getMessage(); Assert.assertIncorrectParameter(message, "The parameter Message is empty."); DIDScopeType didScope = request.getDIDScope(); if (didScope == null) { didScope = DIDScopeType.LOCAL; } if (didScope.equals(DIDScopeType.LOCAL)) { byte[] necessarySelectedApp = cardStateEntry.getCif().getApplicationIdByDidName(didName, didScope); if (! Arrays.equals(necessarySelectedApp, applicationID)) { String msg = "Wrong application selected for the execution of Sign with the DID " + didName + "."; throw new SecurityConditionNotSatisfiedException(msg); } } DIDStructureType didStructure = cardStateEntry.getDIDStructure(didName, didScope); Assert.assertNamedEntityNotFound(didStructure, "The given DIDName cannot be found."); String protocolURI = didStructure.getDIDMarker().getProtocol(); SALProtocol protocol = getProtocol(connectionHandle, request.getDIDScope(), protocolURI); if (protocol.hasNextStep(FunctionType.Sign)) { response = protocol.sign(request); removeFinishedProtocol(connectionHandle, protocolURI, protocol); } else { throw new InappropriateProtocolForActionException("Sign", protocol.toString()); } } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } // TODO: remove when PIN state tracking is implemented setPinNotAuth(cardStateEntry); return response; } /** * The VerifySignature function verifies a digital signature. * See BSI-TR-03112-4, version 1.1.2, section 3.5.6. * * @param request VerifySignature * @return VerifySignatureResponse */ @Override public VerifySignatureResponse verifySignature(VerifySignature request) { VerifySignatureResponse response = WSHelper.makeResponse(VerifySignatureResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle, false); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); byte[] applicationID = cardStateEntry.getCurrentCardApplication().getApplicationIdentifier(); String didName = SALUtils.getDIDName(request); byte[] signature = request.getSignature(); Assert.assertIncorrectParameter(signature, "The parameter Signature is empty."); DIDScopeType didScope = request.getDIDScope(); if (didScope == null) { didScope = DIDScopeType.LOCAL; } if (didScope.equals(DIDScopeType.LOCAL)) { byte[] necessarySelectedApp = cardStateEntry.getCif().getApplicationIdByDidName(didName, didScope); if (! Arrays.equals(necessarySelectedApp, applicationID)) { String msg = "Wrong application selected for the execution of VerifySignature with the DID " + didName + "."; throw new SecurityConditionNotSatisfiedException(msg); } } DIDStructureType didStructure = cardStateEntry.getDIDStructure(didName, didScope); Assert.assertNamedEntityNotFound(didStructure, "The given DIDName cannot be found."); String protocolURI = didStructure.getDIDMarker().getProtocol(); SALProtocol protocol = getProtocol(connectionHandle, request.getDIDScope(), protocolURI); if (protocol.hasNextStep(FunctionType.VerifySignature)) { response = protocol.verifySignature(request); removeFinishedProtocol(connectionHandle, protocolURI, protocol); } else { throw new InappropriateProtocolForActionException("VerifySignature", protocol.toString()); } } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The VerifyCertificate function validates a given certificate. * See BSI-TR-03112-4, version 1.1.2, section 3.5.7. * * @param request VerifyCertificate * @return VerifyCertificateResponse */ @Override public VerifyCertificateResponse verifyCertificate(VerifyCertificate request) { VerifyCertificateResponse response = WSHelper.makeResponse(VerifyCertificateResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle, false); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); byte[] applicationID = cardStateEntry.getCurrentCardApplication().getApplicationIdentifier(); String didName = SALUtils.getDIDName(request); byte[] certificate = request.getCertificate(); Assert.assertIncorrectParameter(certificate, "The parameter Certificate is empty."); String certificateType = request.getCertificateType(); Assert.assertIncorrectParameter(certificateType, "The parameter CertificateType is empty."); String rootCert = request.getRootCert(); Assert.assertIncorrectParameter(rootCert, "The parameter RootCert is empty."); DIDStructureType didStructure = cardStateEntry.getDIDStructure(didName, applicationID); Assert.assertNamedEntityNotFound(didStructure, "The given DIDName cannot be found."); DIDScopeType didScope = request.getDIDScope(); if (didScope == null) { didScope = DIDScopeType.LOCAL; } if (didScope.equals(DIDScopeType.LOCAL)) { byte[] necessarySelectedApp = cardStateEntry.getCif().getApplicationIdByDidName(didName, didScope); if (! Arrays.equals(necessarySelectedApp, applicationID)) { String msg = "Wrong application selected for the execution of VerifyCertificate with the DID " + didName + "."; throw new SecurityConditionNotSatisfiedException(msg); } } String protocolURI = didStructure.getDIDMarker().getProtocol(); SALProtocol protocol = getProtocol(connectionHandle, request.getDIDScope(), protocolURI); if (protocol.hasNextStep(FunctionType.VerifyCertificate)) { response = protocol.verifyCertificate(request); removeFinishedProtocol(connectionHandle, protocolURI, protocol); } else { throw new InappropriateProtocolForActionException("VerifyCertificate", protocol.toString()); } } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The DIDList function returns a list of the existing DIDs in the card application addressed by the * ConnectionHandle or the ApplicationIdentifier element within the Filter. * See BSI-TR-03112-4, version 1.1.2, section 3.6.1. * * @param request DIDList * @return DIDListResponse */ @Publish @Override public DIDListResponse didList(DIDList request) { DIDListResponse response = WSHelper.makeResponse(DIDListResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); byte[] appId = connectionHandle.getCardApplication(); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); Assert.securityConditionApplication(cardStateEntry.getCif(), cardStateEntry.getAuthenticatedDIDs(), appId, DifferentialIdentityServiceActionName.DID_LIST); byte[] applicationIDFilter = null; String objectIDFilter = null; String applicationFunctionFilter = null; DIDQualifierType didQualifier = request.getFilter(); if (didQualifier != null) { applicationIDFilter = didQualifier.getApplicationIdentifier(); objectIDFilter = didQualifier.getObjectIdentifier(); applicationFunctionFilter = didQualifier.getApplicationFunction(); } /* * Filter by ApplicationIdentifier. * [TR-03112-4] Allows specifying an application identifier. If this element is present all * DIDs within the specified card application are returned no matter which card application * is currently selected. */ CardApplicationWrapper cardApplication; if (applicationIDFilter != null) { cardApplication = cardStateEntry.getCif().getCardApplication(applicationIDFilter); Assert.assertIncorrectParameter(cardApplication, "The given CardApplication cannot be found."); } else { cardApplication = cardStateEntry.getCurrentCardApplication(); } List<DIDInfoType> didInfos = new ArrayList<>(cardApplication.getDIDInfoList()); /* * Filter by ObjectIdentifier. * [TR-03112-4] Allows specifying a protocol OID (cf. [TR-03112-7]) such that only DIDs * which support a given protocol are listed. */ if (objectIDFilter != null) { Iterator<DIDInfoType> it = didInfos.iterator(); while (it.hasNext()) { DIDInfoType next = it.next(); if (!next.getDifferentialIdentity().getDIDProtocol().equals(objectIDFilter)) { it.remove(); } } } /* * Filter by ApplicationFunction. * [TR-03112-4] Allows filtering for DIDs, which support a specific cryptographic operation. * The bit string is coded as the SupportedOperations-element in [ISO7816-15]. */ if (applicationFunctionFilter != null) { Iterator<DIDInfoType> it = didInfos.iterator(); while (it.hasNext()) { DIDInfoType next = it.next(); if (next.getDifferentialIdentity().getDIDMarker().getCryptoMarker() == null) { it.remove(); } else { iso.std.iso_iec._24727.tech.schema.CryptoMarkerType rawMarker; rawMarker = next.getDifferentialIdentity().getDIDMarker().getCryptoMarker(); CryptoMarkerType cryptoMarker = new CryptoMarkerType(rawMarker); AlgorithmInfoType algInfo = cryptoMarker.getAlgorithmInfo(); if (! algInfo.getSupportedOperations().contains(applicationFunctionFilter)) { it.remove(); } } } } DIDNameListType didNameList = new DIDNameListType(); for (DIDInfoType didInfo : didInfos) { didNameList.getDIDName().add(didInfo.getDifferentialIdentity().getDIDName()); } response.setDIDNameList(didNameList); } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The DIDCreate function creates a new differential identity in the card application addressed with ConnectionHandle. * See BSI-TR-03112-4, version 1.1.2, section 3.6.2. * * @param request DIDCreate * @return DIDCreateResponse */ @Override public DIDCreateResponse didCreate(DIDCreate request) { return WSHelper.makeResponse(DIDCreateResponse.class, WSHelper.makeResultUnknownError("Not supported yet.")); } /** * The public information for a DID is read with the DIDGet function. * See BSI-TR-03112-4, version 1.1.2, section 3.6.3. * * @param request DIDGet * @return DIDGetResponse */ @Publish @Override public DIDGetResponse didGet(DIDGet request) { DIDGetResponse response = WSHelper.makeResponse(DIDGetResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // handle must be requested without application, as it is irrelevant for this call // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle, false); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); String didName = SALUtils.getDIDName(request); DIDStructureType didStructure = SALUtils.getDIDStructure(request, didName, cardStateEntry, connectionHandle); response.setDIDStructure(didStructure); } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The DIDUpdate function creates a new key (marker) for the DID addressed with DIDName. * See BSI-TR-03112-4, version 1.1.2, section 3.6.4. * * @param request DIDUpdate * @return DIDUpdateResponse */ // TODO: discuss whether we should publish this @Publish @Override public DIDUpdateResponse didUpdate(DIDUpdate request) { DIDUpdateResponse response = WSHelper.makeResponse(DIDUpdateResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); byte[] cardApplicationID = connectionHandle.getCardApplication(); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle, false); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); String didName = request.getDIDName(); Assert.assertIncorrectParameter(didName, "The parameter DIDName is empty."); DIDUpdateDataType didUpdateData = request.getDIDUpdateData(); Assert.assertIncorrectParameter(didUpdateData, "The parameter DIDUpdateData is empty."); DIDStructureType didStructure = cardStateEntry.getDIDStructure(didName, cardApplicationID); Assert.assertNamedEntityNotFound(didStructure, "The given DIDName cannot be found."); Assert.securityConditionDID(cardStateEntry.getCif(), cardStateEntry.getAuthenticatedDIDs(), cardApplicationID, didName, DifferentialIdentityServiceActionName.DID_UPDATE); String protocolURI = didStructure.getDIDMarker().getProtocol(); SALProtocol protocol = getProtocol(connectionHandle, null, protocolURI); if (protocol.hasNextStep(FunctionType.DIDUpdate)) { response = protocol.didUpdate(request); removeFinishedProtocol(connectionHandle, protocolURI, protocol); } else { throw new InappropriateProtocolForActionException("DIDUpdate", protocol.toString()); } } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The DIDDelete function deletes the DID addressed with DIDName. * See BSI-TR-03112-4, version 1.1.2, section 3.6.5. * * @param request DIDDelete * @return DIDDeleteResponse */ @Override public DIDDeleteResponse didDelete(DIDDelete request) { DIDDeleteResponse response = WSHelper.makeResponse(DIDDeleteResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); byte[] cardApplicationID = connectionHandle.getCardApplication(); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle, false); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); String didName = request.getDIDName(); Assert.assertIncorrectParameter(didName, "The parameter DIDName is empty."); DIDStructureType didStructure = cardStateEntry.getDIDStructure(didName, cardApplicationID); Assert.assertNamedEntityNotFound(didStructure, "The given DIDName cannot be found."); Assert.securityConditionDID(cardStateEntry.getCif(), cardStateEntry.getAuthenticatedDIDs(), cardApplicationID, didName, DifferentialIdentityServiceActionName.DID_DELETE); String protocolURI = didStructure.getDIDMarker().getProtocol(); SALProtocol protocol = getProtocol(connectionHandle, null, protocolURI); if (protocol.hasNextStep(FunctionType.DIDDelete)) { response = protocol.didDelete(request); removeFinishedProtocol(connectionHandle, protocolURI, protocol); } else { throw new InappropriateProtocolForActionException("DIDDelete", protocol.toString()); } } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * The DIDAuthenticate function can be used to execute an authentication protocol using a DID addressed by DIDName. * See BSI-TR-03112-4, version 1.1.2, section 3.6.6. * * @param request DIDAuthenticate * @return DIDAuthenticateResponse */ @Publish @Override public DIDAuthenticateResponse didAuthenticate(DIDAuthenticate request) { DIDAuthenticateResponse response = WSHelper.makeResponse(DIDAuthenticateResponse.class, WSHelper.makeResultOK()); String protocolURI = ""; try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); DIDAuthenticationDataType didAuthenticationData = request.getAuthenticationProtocolData(); Assert.assertIncorrectParameter(didAuthenticationData, "The parameter AuthenticationProtocolData is empty."); protocolURI = didAuthenticationData.getProtocol(); // FIXME: workaround for missing protocol URI from eID-Servers if (protocolURI == null) { LOG.warn("ProtocolURI was null"); protocolURI = ECardConstants.Protocol.EAC_GENERIC; } else if (protocolURI.equals("urn:oid:1.0.24727.3.0.0.7.2")) { LOG.warn("ProtocolURI was urn:oid:1.0.24727.3.0.0.7.2"); protocolURI = ECardConstants.Protocol.EAC_GENERIC; } didAuthenticationData.setProtocol(protocolURI); SALProtocol protocol = getProtocol(connectionHandle, request.getDIDScope(), protocolURI); if (protocol.hasNextStep(FunctionType.DIDAuthenticate)) { response = protocol.didAuthenticate(request); removeFinishedProtocol(connectionHandle, protocolURI, protocol); } else { throw new InappropriateProtocolForActionException("DIDAuthenticate", protocol.toString()); } } catch (ECardException ex) { LOG.debug("ECard error occurred during DIDAuthenticate execution.", ex); response.setResult(ex.getResult()); } catch (Exception ex) { LOG.error("General error occurred during DIDAuthenticate execution.", ex); throwThreadKillException(ex); response.setResult(WSHelper.makeResult(ex)); } // add empty response data if none are present if (response.getAuthenticationProtocolData() == null) { EmptyResponseDataType data = new EmptyResponseDataType(); data.setProtocol(protocolURI); response.setAuthenticationProtocolData(data); } return response; } /** * The ACLList function returns the access control list for the stated target object (card application, data set, DID). * See BSI-TR-03112-4, version 1.1.2, section 3.7.1. * * @param request ACLList * @return ACLListResponse */ @Publish @Override public ACLListResponse aclList(ACLList request) { ACLListResponse response = WSHelper.makeResponse(ACLListResponse.class, WSHelper.makeResultOK()); try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); // CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle, false); StateEntry stateEntry = SALUtils.getStateBySession(request, salStates); ConnectedCardEntry cardStateEntry = stateEntry.getCardEntry(); TargetNameType targetName = request.getTargetName(); Assert.assertIncorrectParameter(targetName, "The parameter TargetName is empty."); // get the target values, according to the schema only one must exist, we pick the first existing ;-) byte[] targetAppId = targetName.getCardApplicationName(); String targetDataSet = targetName.getDataSetName(); String targetDid = targetName.getDIDName(); CardInfoWrapper cardInfoWrapper = cardStateEntry.getCif(); byte[] handleAppId = connectionHandle.getCardApplication(); if (targetDataSet != null) { DataSetInfoType dataSetInfo = cardInfoWrapper.getDataSet(targetDataSet, handleAppId); Assert.assertNamedEntityNotFound(dataSetInfo, "The given DataSet cannot be found."); response.setTargetACL(cardInfoWrapper.getDataSet(targetDataSet, handleAppId).getDataSetACL()); } else if (targetDid != null) { DIDInfoType didInfo = cardInfoWrapper.getDIDInfo(targetDid, handleAppId); Assert.assertNamedEntityNotFound(didInfo, "The given DIDInfo cannot be found."); //TODO Check security condition ? response.setTargetACL(cardInfoWrapper.getDIDInfo(targetDid, handleAppId).getDIDACL()); } else if (targetAppId != null) { CardApplicationWrapper cardApplication = cardInfoWrapper.getCardApplication(targetAppId); Assert.assertNamedEntityNotFound(cardApplication, "The given CardApplication cannot be found."); Assert.securityConditionApplication(cardStateEntry.getCif(), cardStateEntry.getAuthenticatedDIDs(), targetAppId, AuthorizationServiceActionName.ACL_LIST); response.setTargetACL(cardInfoWrapper.getCardApplication(targetAppId).getCardApplicationACL()); } else { throw new IncorrectParameterException("The given TargetName is invalid."); } } catch (ECardException e) { response.setResult(e.getResult()); } catch (Exception e) { LOG.error(e.getMessage(), e); throwThreadKillException(e); response.setResult(WSHelper.makeResult(e)); } return response; } /** * An access rule in the access control list is modified with the ACLModify function. * See BSI-TR-03112-4, version 1.1.2, section 3.7.2. * * @param request ACLModify * @return ACLModifyResponse */ @Override public ACLModifyResponse aclModify(ACLModify request) { return WSHelper.makeResponse(ACLModifyResponse.class, WSHelper.makeResultUnknownError("Not supported yet.")); } /** * Sets the GUI. * * @param uc User consent */ public void setGUI(UserConsent uc) { this.userConsent = uc; } /** * Removes a finished protocol from the SAL instance. * * @param handle Connection Handle * @param protocolURI Protocol URI * @param protocol Protocol * @throws UnknownConnectionHandleException */ private void removeFinishedProtocol(ConnectionHandleType handle, String protocolURI, SALProtocol protocol) throws UnknownConnectionHandleException, IncorrectParameterException, NoSuchSession { if (protocol.isFinished()) { LOG.debug("SAL Protocol is finished, destroying protocol instance."); try { // CardStateEntry entry = SALUtils.getCardStateEntry(states, handle, false); StateEntry stateEntry = SALUtils.getStateBySession(handle, salStates); stateEntry.removeProtocol(protocolURI); } finally { protocolSelector.returnSALProtocol(protocol, false); } } } private SALProtocol getProtocol(@Nonnull ConnectionHandleType handle, @Nullable DIDScopeType scope, @Nonnull String protocolURI) throws UnknownProtocolException, UnknownConnectionHandleException, IncorrectParameterException, NoSuchSession { // CardStateEntry entry = SALUtils.getCardStateEntry(states, handle, scope != DIDScopeType.GLOBAL); StateEntry stateEntry = SALUtils.getStateBySession(handle, salStates); SALProtocol protocol = stateEntry.getProtocol(); if (protocol == null) { try { protocol = protocolSelector.getSALProtocol(protocolURI); stateEntry.setProtocol(protocol, protocolURI); } catch (AddonNotFoundException ex) { throw new UnknownProtocolException("The protocol URI '" + protocolURI + "' is not available."); } } protocol.getInternalData().put("cardState", stateEntry); return protocol; } private byte[] createFakeFCP(byte[] fid) { try { TLV fcp = new TLV(); fcp.setTagNumWithClass((byte) 0x62); TLV fileID = new TLV(); fileID.setTagNumWithClass((byte) 0x83); fileID.setValue(fid); fcp.setChild(fileID); return fcp.toBER(); } catch (TLVException ex) { LOG.error(null, ex); return null; } } // TODO: remove function when state tracking is implemented private void setPinNotAuth(@Nullable ConnectedCardEntry cardStateEntry) { if (cardStateEntry != null) { LOG.info("Unauthenticate Card PIN (state=false)."); // This method only works in a a very limited way. All PIN DIDs get status unauth here. for (DIDInfoType didInfo : Collections.unmodifiableCollection(cardStateEntry.getAuthenticatedDIDs())) { if ("urn:oid:1.3.162.15480.3.0.9".equals(didInfo.getDifferentialIdentity().getDIDProtocol())) { cardStateEntry.removeAuthenticated(didInfo); } } } } private void throwThreadKillException(Exception ex) { Throwable cause; if (ex instanceof InvocationTargetExceptionUnchecked) { cause = ex.getCause(); } else { cause = ex; } if (cause instanceof ThreadTerminateException) { throw (ThreadTerminateException) cause; } else if (cause instanceof InterruptedException) { throw new ThreadTerminateException("Thread running inside SAL interrupted.", cause); } else if (cause instanceof RuntimeException) { throw (RuntimeException) ex; } } }
package com.valkryst.VTerminal.AsciiStringTest; import com.valkryst.VTerminal.AsciiCharacter; import com.valkryst.VTerminal.AsciiString; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import java.awt.Color; public class ConstructorTest { private final String testString = "ABCDEFGHJIKLMNOP"; private AsciiString string; @Before public void initializeString() { string = new AsciiString(testString); string.setBackgroundColor(Color.BLACK); string.setForegroundColor(Color.WHITE); } @Test public void lengthConstructor_withValidInput() { for (int i = 0 ; i < 10 ; i++) { final AsciiString string = new AsciiString(i); // Ensure that the correct number of characters are initialized: Assert.assertEquals(i, string.getCharacters().length); // Ensure all characters are initialized properly: for (final AsciiCharacter character: string.getCharacters()) { Assert.assertEquals(' ', character.getCharacter()); } // Ensure that no two characters are initialized as the same object: for (int a = 0 ; a < i ; a++) { for (int b = a + 1 ; b < i ; b++) { final AsciiCharacter charA = string.getCharacters()[a]; final AsciiCharacter charB = string.getCharacters()[b]; // Using == compares object references: Assert.assertFalse(charA == charB); } } } } @Test(expected=IllegalArgumentException.class) public void lengthConstructor_withNegativeLength() { new AsciiString(-1); } @Test public void stringConstructor_withValidInput() { for (int i = 0 ; i < 10 ; i++) { final AsciiString string = new AsciiString(testString.substring(0, i)); // Ensure that the correct number of characters are initialized: Assert.assertEquals(i, string.getCharacters().length); // Ensure all characters are initialized properly: for (int a = 0 ; a < string.getCharacters().length ; a++) { final char expected = testString.charAt(a); final char actual = string.getCharacters()[a].getCharacter(); Assert.assertEquals(expected, actual); } // Ensure that no two characters are initialized as the same object: for (int a = 0 ; a < i ; a++) { for (int b = a + 1 ; b < i ; b++) { final AsciiCharacter charA = string.getCharacters()[a]; final AsciiCharacter charB = string.getCharacters()[b]; // Using == compares object references: Assert.assertFalse(charA == charB); } } } } @Test public void stringConstructor_withEmptyString() { final AsciiString string = new AsciiString(""); Assert.assertEquals(0, string.getCharacters().length); } @Test(expected=NullPointerException.class) public void stringConstructor_withNullString() { new AsciiString(null); } }
package org.mockito.internal.progress; import static java.util.Arrays.*; import static org.mockito.internal.progress.VerificationModeImpl.*; import org.junit.Test; import org.mockito.exceptions.base.MockitoException; import org.mockitoutil.TestBase; public class VerificationModeImplTest extends TestBase { @Test public void shouldKnowIfNumberOfInvocationsMatters() throws Exception { VerificationModeImpl mode = atLeastOnce(); assertTrue(mode.atLeastMode()); mode = times(50); assertFalse(mode.atLeastMode()); } @Test public void shouldNotAllowNegativeNumberOfInvocations() throws Exception { try { times(-50); fail(); } catch (MockitoException e) { assertEquals("Negative value is not allowed here", e.getMessage()); } } @Test public void shouldNotAllowNegativeNumberOfMinimumInvocations() throws Exception { try { atLeast(-50); fail(); } catch (MockitoException e) { assertEquals("Negative value or zero are not allowed here", e.getMessage()); } } @Test public void shouldKnowIfIsMissingMethodMode() throws Exception { assertTrue(atLeastOnce().missingMethodMode()); assertTrue(times(1).missingMethodMode()); assertTrue(times(10).missingMethodMode()); assertFalse(noMoreInteractions().missingMethodMode()); assertFalse(times(0).missingMethodMode()); } @Test public void shouldKnowIfIsMissingMethodInOrderMode() throws Exception { assertTrue(inOrder(null, asList("mock")).missingMethodInOrderMode()); assertTrue(inOrder(1, asList("mock")).missingMethodInOrderMode()); assertTrue(inOrder(10, asList("mock")).missingMethodInOrderMode()); assertFalse(times(10).missingMethodInOrderMode()); assertFalse(noMoreInteractions().missingMethodInOrderMode()); assertFalse(times(0).missingMethodInOrderMode()); } @Test public void shouldKnowIfIsInOrderMode() throws Exception { assertTrue(inOrder(1, asList(new Object())).inOrderMode()); assertFalse(times(0).inOrderMode()); assertFalse(times(2).inOrderMode()); assertFalse(atLeastOnce().inOrderMode()); assertFalse(noMoreInteractions().inOrderMode()); } @Test public void shouldKnowIfIsAtLeastMode() throws Exception { assertTrue(atLeastOnce().atLeastMode()); assertTrue(atLeast(10).atLeastMode()); assertFalse(times(0).atLeastMode()); assertFalse(times(2).atLeastMode()); assertFalse(noMoreInteractions().atLeastMode()); } @Test public void shouldKnowIfMatchesActualInvocationCount() throws Exception { assertFalse(times(1).matchesActualCount(0)); assertFalse(times(1).matchesActualCount(2)); assertFalse(times(100).matchesActualCount(200)); assertTrue(times(1).matchesActualCount(1)); assertTrue(times(100).matchesActualCount(100)); } @Test public void shouldKnowIfMatchesActualInvocationCountWhenAtLeastOnceMode() throws Exception { assertFalse(atLeastOnce().matchesActualCount(0)); assertTrue(atLeastOnce().matchesActualCount(1)); assertTrue(atLeastOnce().matchesActualCount(100)); } @Test public void shouldKnowIfMatchesActualInvocationCountWhenAtLeastMode() throws Exception { assertFalse(atLeast(10).matchesActualCount(5)); assertFalse(atLeast(2).matchesActualCount(1)); assertTrue(atLeast(10).matchesActualCount(10)); assertTrue(atLeast(10).matchesActualCount(15)); } @Test public void shouldKnowIfTooLittleActualInvocations() throws Exception { assertTrue(times(1).tooLittleActualInvocations(0)); assertTrue(times(100).tooLittleActualInvocations(99)); assertFalse(times(0).tooLittleActualInvocations(0)); assertFalse(times(1).tooLittleActualInvocations(1)); assertFalse(times(1).tooLittleActualInvocations(2)); } @Test public void shouldAtLeastModeIgnoreTooLittleActualInvocations() throws Exception { assertFalse(atLeast(10).tooLittleActualInvocations(5)); assertFalse(atLeast(10).tooLittleActualInvocations(15)); assertFalse(atLeastOnce().tooLittleActualInvocations(10)); } @Test public void shouldKnowIfTooLittleActualInvocationsInAtLeastMode() throws Exception { assertTrue(atLeast(3).tooLittleActualInvocationsInAtLeastMode(2)); assertTrue(atLeast(3).tooLittleActualInvocationsInAtLeastMode(1)); assertTrue(atLeast(3).tooLittleActualInvocationsInAtLeastMode(0)); assertFalse(atLeast(1).tooLittleActualInvocationsInAtLeastMode(1)); assertFalse(atLeast(1).tooLittleActualInvocationsInAtLeastMode(2)); } @Test public void shouldTooLittleActualInvocationsInAtLeastModeIgnoreOtherModes() throws Exception { assertFalse(times(10).tooLittleActualInvocationsInAtLeastMode(5)); assertFalse(times(10).tooLittleActualInvocationsInAtLeastMode(15)); } @Test public void shouldKnowIfTooManyActualInvocations() throws Exception { assertTrue(times(0).tooManyActualInvocations(1)); assertTrue(times(99).tooManyActualInvocations(100)); assertFalse(times(0).tooManyActualInvocations(0)); assertFalse(times(1).tooManyActualInvocations(1)); assertFalse(times(2).tooManyActualInvocations(1)); } @Test public void shouldKnowIfWantedCountIsZero() throws Exception { assertTrue(times(0).neverWanted()); assertFalse(times(1).neverWanted()); assertFalse(times(20).neverWanted()); assertFalse(atLeastOnce().neverWanted()); } @Test public void shouldKnowIfExactNumberOfInvocationsMode() throws Exception { assertTrue(times(0).exactNumberOfInvocationsMode()); assertTrue(times(1).exactNumberOfInvocationsMode()); assertTrue(atLeastOnce().exactNumberOfInvocationsMode()); assertFalse(noMoreInteractions().exactNumberOfInvocationsMode()); assertFalse(inOrder(1, asList(new Object())).exactNumberOfInvocationsMode()); } @Test public void shouldKnowIfNeverWantedButInvoked() throws Exception { assertFalse(times(1).neverWantedButInvoked(0)); assertFalse(times(10).neverWantedButInvoked(20)); assertFalse(times(0).neverWantedButInvoked(0)); assertFalse(atLeastOnce().neverWantedButInvoked(0)); assertFalse(atLeastOnce().neverWantedButInvoked(1)); assertTrue(times(0).neverWantedButInvoked(1)); assertTrue(times(0).neverWantedButInvoked(10)); } }
package eu.project.rapid.utils; import eu.project.rapid.common.Clone; import eu.project.rapid.common.RapidConstants; import eu.project.rapid.common.RapidConstants.REGIME; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManagerFactory; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.security.*; import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.util.Enumeration; import java.util.Properties; import static eu.project.rapid.utils.Constants.*; // import org.bouncycastle.jce.provider.BouncyCastleProvider; /** * FIXME: Delete this class and use only configuration from Rapid-Common project. * * @author sokol */ public final class Configuration { private Logger log; private REGIME regime; private Clone vm; // Common variables private Properties props; private String userHomeFolder; private String rapidFolder; private String rapidLogFile; // DB related variables private String rapidDbName; private String dbDriver; private String dbUrl; private String dbUser; private String dbPass; private int asPort; private int asPortSsl; private String dsIp; private int dsPort; private String slamIp; private int slamPort; private String vmmIp; private int vmmPort; private String gvirtusIp; private int gvirtusPort; // Client only variables private int acRmPort; // The port where the AC_RM will listen for clients (apps) to ask for info. private String sharedPrefsFile; // Contains the full path to the shared prefs file, where the // AC_RM stores common parameters, like userID, etc. // SSL related configuration parameters given by the developer on the configuration file private String sslKeyStoreName; private String sslKeyStorePassword; private String caTrustStoreName; private String sslCertAlias; private String sslCertPassword; private String asymmetricAlg; private String symmetricAlg; private int symmetricKeySize; // SSL related parameters that are created after reading the crypto variables. private PublicKey publicKey; private PrivateKey privateKey; private KeyManagerFactory kmf; private SSLContext sslContext; private SSLSocketFactory sslFactory; private boolean cryptoInitialized = false; // Settings parameters that the user chooses when launching the first app, so that the AC_RM // starts running and registering with the DS. private boolean connectToPrevVm = false; private boolean connectSsl = false; private int clonePortBandwidthTest = 4321; public Configuration(String callerTag, REGIME regime) { this.regime = regime; String TAG = Configuration.class.getSimpleName() + "-" + callerTag + "-" + regime.toString(); log = LogManager.getLogger(TAG); log.info("Reading the configuration file"); userHomeFolder = System.getProperty("user.home"); props = new Properties(); try (InputStream is = getClass().getClassLoader().getResourceAsStream(CONFIG_PROPERTIES)) { if (is != null) { props.load(is); // AS initialization parameters asPort = Integer.parseInt( props.getProperty(AS_PORT_KEY, Integer.toString(RapidConstants.DEFAULT_VM_PORT))); asPortSsl = Integer.parseInt(props.getProperty(AS_PORT_SSL_KEY, Integer.toString(RapidConstants.DEFAULT_VM_PORT_SSL))); log.info(AS_PORT_KEY + ": " + asPort); log.info(AS_PORT_SSL_KEY + ": " + asPortSsl); // DS IP and port dsIp = props.getProperty(DS_IP_KEY); dsPort = Integer.parseInt( props.getProperty(DS_PORT_KEY, Integer.toString(RapidConstants.DEFAULT_DS_PORT))); log.info(DS_IP_KEY + ": " + dsIp); log.info(DS_PORT_KEY + ": " + dsPort); // SLAM IP and port slamIp = props.getProperty(SLAM_IP_KEY, SLAM_IP_DEFAULT); slamPort = Integer.parseInt( props.getProperty(SLAM_PORT_KEY, Integer.toString(RapidConstants.DEFAULT_SLAM_PORT))); log.info(SLAM_IP_KEY + ": " + slamIp); log.info(SLAM_PORT_KEY + ": " + slamPort); // RAPID folder configuration if (regime == REGIME.AC) { rapidFolder = props.getProperty(RAPID_FOLDER_CLIENT_KEY, RAPID_FOLDER_CLIENT_DEFAULT); rapidFolder = userHomeFolder + File.separator + rapidFolder; } else if (regime == REGIME.AS) { rapidFolder = props.getProperty(RAPID_FOLDER_SERVER_KEY, RAPID_FOLDER_SERVER_DEFAULT); rapidFolder = userHomeFolder + File.separator + rapidFolder; } rapidLogFile = props.getProperty(Constants.LOG_FILE_NAME_KEY, Constants.LOG_FILE_NAME_DEFAULT); rapidLogFile = rapidFolder + File.separator + rapidLogFile; // AC_RM configuration listening port acRmPort = Integer.parseInt( props.getProperty(AC_RM_PORT_KEY, Integer.toString(RapidConstants.AC_RM_PORT_DEFAULT))); sharedPrefsFile = props.getProperty(SHARED_PREFS_KEY, SHARED_PREFS_DEFAULT); sharedPrefsFile = rapidFolder + File.separator + sharedPrefsFile; connectToPrevVm = props.getProperty(CONNECT_PREV_VM_KEY, CONNECT_PREV_VM_DEFAULT).equals(Constants.TRUE); // GVirtuS ip and port gvirtusIp = props.getProperty(Constants.GVIRTUS_IP_KEY); gvirtusPort = Integer.parseInt(props.getProperty(Constants.GVIRTUS_PORT_KEY, Integer.toString(RapidConstants.DEFAULT_GVIRTUS_PORT))); // GVirtuS ip and port vmmIp = props.getProperty(Constants.VMM_IP_KEY); vmmPort = Integer.parseInt(props.getProperty(Constants.VMM_PORT_KEY, Integer.toString(RapidConstants.DEFAULT_VMM_PORT))); // SSL parameters connectSsl = props.getProperty(Constants.CONNECT_SSL_KEY, Constants.CONNECT_SSL_DEFAULT) .equals(Constants.TRUE); initializeCrypto(); } else { log.warn("Could not find the configuration file: " + CONFIG_PROPERTIES); } } catch (IOException e) { log.error("Error while opening the configuration file: " + e); } } private void initializeCrypto() { sslKeyStoreName = props.getProperty(SSL_KEYSTORE_KEY, SSL_KEYSTORE_DEFAULT); sslKeyStorePassword = props.getProperty(SSL_KEYSTORE_PASSW_KEY, SSL_KEYSTORE_PASSW_DEFAULT); caTrustStoreName = props.getProperty(SSL_CA_TRUSTSTORE_KEY, SSL_CA_TRUSTSTORE_DEFAULT); sslCertAlias = props.getProperty(SSL_CERT_ALIAS_KEY, SSL_CERT_ALIAS_DEFAULT); sslCertPassword = props.getProperty(SSL_CERT_PASSW_KEY, SSL_CERT_PASSW_DEFAULT); asymmetricAlg = props.getProperty(ASYMMETRIC_ALG_KEY, ASYMMETRIC_ALG_DEFAULT); symmetricAlg = props.getProperty(SYMMETRIC_ALG_KEY, SYMMETRIC_ALG_DEFAULT); symmetricKeySize = Integer .parseInt(props.getProperty(SYMMETRIC_ALG_KEY_SIZE_KEY, SYMMETRIC_ALG_KEY_SIZE_DEFAULT)); try { log.info("KeyStore default type: " + KeyStore.getDefaultType()); log.info("KeyManagerFactory default algorithm: " + KeyManagerFactory.getDefaultAlgorithm()); KeyStore trustStore = KeyStore.getInstance("JKS"); trustStore.load(this.getClass().getClassLoader().getResourceAsStream(caTrustStoreName), "passkeystore".toCharArray()); TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); trustManagerFactory.init(trustStore); // KeyStore keyStore = KeyStore.getInstance("BKS"); KeyStore keyStore = KeyStore.getInstance("JKS"); keyStore.load(this.getClass().getClassLoader().getResourceAsStream(sslKeyStoreName), sslKeyStorePassword.toCharArray()); Enumeration<String> aliases = keyStore.aliases(); while (aliases.hasMoreElements()) { log.info(aliases.nextElement()); } kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); // kmf.init(keyStore, sslKeyStorePassword.toCharArray()); kmf.init(keyStore, sslCertPassword.toCharArray()); // privateKey = (PrivateKey) keyStore.getKey(sslCertAlias, "kot".toCharArray()); log.info("Getting the public key..."); Certificate cert = keyStore.getCertificate(sslCertAlias); publicKey = cert.getPublicKey(); sslContext = SSLContext.getInstance("TLS"); sslContext.init(null, trustManagerFactory.getTrustManagers(), null); sslFactory = sslContext.getSocketFactory(); log.info("SSL Factory created"); cryptoInitialized = true; // log.info("Certificate: " + cert.toString()); log.info("Crypto initialized correctly"); // log.info("PrivateKey algorithm: " + privateKey.getAlgorithm()); log.info("PublicKey algorithm: " + publicKey.getAlgorithm()); } catch (IOException | KeyStoreException | NoSuchAlgorithmException | CertificateException e) { log.error("Crypto not initialized: " + e); e.printStackTrace(); } catch (UnrecoverableKeyException | KeyManagementException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (Exception e) { log.error("Unknown exception while initializing crypto: " + e); } } @Override public String toString() { return AS_PORT_KEY + ": " + asPort + "\n" + AS_PORT_SSL_KEY + ": " + asPortSsl + "\n"; } /** * @return the userHomeFolder */ public String getUserHomeFolder() { return userHomeFolder; } /** * @param userHomeFolder the userHomeFolder to set */ public void setUserHomeFolder(String userHomeFolder) { this.userHomeFolder = userHomeFolder; } /** * @return the rapidFolder */ public String getRapidFolder() { return rapidFolder; } /** * @param rapidFolder the rapidFolder to set */ public void setRapidFolder(String rapidFolder) { this.rapidFolder = rapidFolder; } /** * @return the asPort */ public int getAsPort() { return asPort; } /** * @param asPort the asPort to set */ public void setAsPort(int asPort) { this.asPort = asPort; } /** * @return the asPortSsl */ public int getAsPortSsl() { return asPortSsl; } /** * @param asPortSsl the asPortSsl to set */ public void setAsPortSsl(int asPortSsl) { this.asPortSsl = asPortSsl; } /** * @return the dsIp */ public String getDsIp() { return dsIp; } /** * @param dsIp the dsIp to set */ public void setDsIp(String dsIp) { this.dsIp = dsIp; } /** * @return the dsPort */ public int getDsPort() { return dsPort; } /** * @param dsPort the dsPort to set */ public void setDsPort(int dsPort) { this.dsPort = dsPort; } /** * @return the slamIp */ public String getSlamIp() { return slamIp; } /** * @param slamIp the slamIp to set */ public void setSlamIp(String slamIp) { this.slamIp = slamIp; } /** * @return the slamPort */ public int getSlamPort() { return slamPort; } /** * @param slamPort the slamPort to set */ public void setSlamPort(int slamPort) { this.slamPort = slamPort; } /** * @return the sslKeyStoreName */ public String getSslKeyStoreName() { return sslKeyStoreName; } /** * @param sslKeyStoreName the sslKeyStoreName to set */ public void setSslKeyStoreName(String sslKeyStoreName) { this.sslKeyStoreName = sslKeyStoreName; } /** * @return the caTrustStoreName */ public String getCaTrustStoreName() { return caTrustStoreName; } /** * @param caTrustStoreName the caTrustStoreName to set */ public void setCaTrustStoreName(String caTrustStoreName) { this.caTrustStoreName = caTrustStoreName; } /** * @return the sslCertAlias */ public String getSslCertAlias() { return sslCertAlias; } /** * @param sslCertAlias the sslCertAlias to set */ public void setSslCertAlias(String sslCertAlias) { this.sslCertAlias = sslCertAlias; } /** * @return the sslCertPassword */ public String getSslCertPassword() { return sslCertPassword; } /** * @param sslCertPassword the sslCertPassword to set */ public void setSslCertPassword(String sslCertPassword) { this.sslCertPassword = sslCertPassword; } /** * @return the asymmetricAlg */ public String getAsymmetricAlg() { return asymmetricAlg; } /** * @param asymmetricAlg the asymmetricAlg to set */ public void setAsymmetricAlg(String asymmetricAlg) { this.asymmetricAlg = asymmetricAlg; } /** * @return the symmetricAlg */ public String getSymmetricAlg() { return symmetricAlg; } /** * @param symmetricAlg the symmetricAlg to set */ public void setSymmetricAlg(String symmetricAlg) { this.symmetricAlg = symmetricAlg; } /** * @return the symmetricKeySize */ public int getSymmetricKeySize() { return symmetricKeySize; } /** * @param symmetricKeySize the symmetricKeySize to set */ public void setSymmetricKeySize(int symmetricKeySize) { this.symmetricKeySize = symmetricKeySize; } /** * @return the publicKey */ public PublicKey getPublicKey() { return publicKey; } /** * @param publicKey the publicKey to set */ public void setPublicKey(PublicKey publicKey) { this.publicKey = publicKey; } /** * @return the privateKey */ public PrivateKey getPrivateKey() { return privateKey; } /** * @param privateKey the privateKey to set */ public void setPrivateKey(PrivateKey privateKey) { this.privateKey = privateKey; } /** * @return the kmf */ public KeyManagerFactory getKmf() { return kmf; } /** * @param kmf the kmf to set */ public void setKmf(KeyManagerFactory kmf) { this.kmf = kmf; } /** * @return the sslContext */ public SSLContext getSslContext() { return sslContext; } /** * @param sslContext the sslContext to set */ public void setSslContext(SSLContext sslContext) { this.sslContext = sslContext; } /** * @return the sslFactory */ public SSLSocketFactory getSslFactory() { return sslFactory; } /** * @param sslFactory the sslFactory to set */ public void setSslFactory(SSLSocketFactory sslFactory) { this.sslFactory = sslFactory; } /** * @return the cryptoInitialized */ public boolean isCryptoInitialized() { return cryptoInitialized; } /** * @param cryptoInitialized the cryptoInitialized to set */ public void setCryptoInitialized(boolean cryptoInitialized) { this.cryptoInitialized = cryptoInitialized; } /** * @return the acRmPort */ public int getAcRmPort() { return acRmPort; } /** * @param acRmPort the acRmPort to set */ public void setAcRmPort(int acRmPort) { this.acRmPort = acRmPort; } /** * @return the fulle path to the sharedPrefsFile */ public String getSharedPrefsFile() { return sharedPrefsFile; } /** * @param sharedPrefsFile the sharedPrefsFile to set */ public void setSharedPrefsFile(String sharedPrefsFile) { this.sharedPrefsFile = sharedPrefsFile; } /** * @return the connectToPrevVm */ public boolean isConnectToPrevVm() { return connectToPrevVm; } /** * @param connectToPrevVm the connectToPrevVm to set */ public void setConnectToPrevVm(boolean connectToPrevVm) { this.connectToPrevVm = connectToPrevVm; } /** * @return the connectSsl */ public boolean isConnectSsl() { return connectSsl; } /** * @param connectSsl the connectSsl to set */ public void setConnectSsl(boolean connectSsl) { this.connectSsl = connectSsl; } /** * @return the regime */ public REGIME getRegime() { return regime; } /** * @param regime the regime to set */ public void setRegime(REGIME regime) { this.regime = regime; } /** * @return the rapidLogFile */ public String getRapidLogFile() { return rapidLogFile; } /** * @param rapidLogFile the rapidLogFile to set */ public void setRapidLogFile(String rapidLogFile) { this.rapidLogFile = rapidLogFile; } /** * @return the rapidDbName */ public String getRapidDbName() { return rapidDbName; } /** * @param rapidDbName the rapidDbName to set */ public void setRapidDbName(String rapidDbName) { this.rapidDbName = rapidDbName; } /** * @return the dbDriver */ public String getDbDriver() { return dbDriver; } /** * @param dbDriver the dbDriver to set */ public void setDbDriver(String dbDriver) { this.dbDriver = dbDriver; } /** * @return the dbUrl */ public String getDbUrl() { return dbUrl; } /** * @param dbUrl the dbUrl to set */ public void setDbUrl(String dbUrl) { this.dbUrl = dbUrl; } /** * @return the dbUser */ public String getDbUser() { return dbUser; } /** * @param dbUser the dbUser to set */ public void setDbUser(String dbUser) { this.dbUser = dbUser; } /** * @return the dbPass */ public String getDbPass() { return dbPass; } /** * @param dbPass the dbPass to set */ public void setDbPass(String dbPass) { this.dbPass = dbPass; } /** * @return the vm */ public Clone getVm() { return vm; } /** * @param vm the vm to set */ public void setVm(Clone vm) { this.vm = vm; } /** * @return the clonePortBandwidthTest */ public int getClonePortBandwidthTest() { return clonePortBandwidthTest; } /** * @param clonePortBandwidthTest the clonePortBandwidthTest to set */ public void setClonePortBandwidthTest(int clonePortBandwidthTest) { this.clonePortBandwidthTest = clonePortBandwidthTest; } /** * @return the gvirtusIp */ public String getGvirtusIp() { return gvirtusIp; } /** * @param gvirtusIp the gvirtusIp to set */ public void setGvirtusIp(String gvirtusIp) { this.gvirtusIp = gvirtusIp; } /** * @return the gvirtusPort */ public int getGvirtusPort() { return gvirtusPort; } /** * @param gvirtusPort the gvirtusPort to set */ public void setGvirtusPort(int gvirtusPort) { this.gvirtusPort = gvirtusPort; } /** * @return the vmmIp */ public String getVmmIp() { return vmmIp; } /** * @param vmmIp the vmmIp to set */ public void setVmmIp(String vmmIp) { this.vmmIp = vmmIp; } /** * @return the vmmPort */ public int getVmmPort() { return vmmPort; } /** * @param vmmPort the vmmPort to set */ public void setVmmPort(int vmmPort) { this.vmmPort = vmmPort; } }
package yuku.alkitab.base.ac; import android.app.AlertDialog; import android.content.Intent; import android.content.res.Resources; import android.os.Bundle; import android.os.Handler; import android.preference.CheckBoxPreference; import android.preference.ListPreference; import android.preference.Preference; import android.preference.PreferenceFragment; import android.view.View; import yuku.afw.storage.Preferences; import yuku.alkitab.base.App; import yuku.alkitab.base.ac.base.BasePreferenceActivity; import yuku.alkitab.base.sync.SyncSettingsActivity; import yuku.alkitab.debug.R; import java.util.List; import static yuku.alkitab.base.util.Literals.List; public class SettingsActivity extends BasePreferenceActivity { public List<String> VALID_FRAGMENT_NAMES = List( DisplayFragment.class.getName(), UsageFragment.class.getName() ); Header firstHeaderWithFragment; public static Intent createIntent() { return new Intent(App.context, SettingsActivity.class); } @Override public void onBuildHeaders(final List<Header> target) { super.onBuildHeaders(target); loadHeadersFromResource(R.xml.settings_headers, target); // look for first header with a fragment for (final Header header : target) { if (header.fragment != null) { firstHeaderWithFragment = header; break; } } for (final Header header : target) { if (header.id == R.id.header_id_sync) { header.intent = new Intent(App.context, SyncSettingsActivity.class); } } } @Override public Header onGetInitialHeader() { return firstHeaderWithFragment; } @Override protected boolean isValidFragment(final String fragmentName) { return VALID_FRAGMENT_NAMES.contains(fragmentName); } public static class DisplayFragment extends PreferenceFragment { @Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.settings_display); final ListPreference pref_language = (ListPreference) findPreference(getString(R.string.pref_language_key)); pref_language.setOnPreferenceChangeListener((preference, newValue) -> { final Handler handler = new Handler(); // do this after this method returns true handler.post(App::updateConfigurationWithPreferencesLocale); return true; }); autoDisplayListPreference(pref_language); // show textPadding preference only when there is nonzero side padding on this configuration if (getResources().getDimensionPixelOffset(R.dimen.text_side_padding) == 0) { final Preference preference = findPreference(getString(R.string.pref_textPadding_key)); getPreferenceScreen().removePreference(preference); } } } public static class UsageFragment extends PreferenceFragment { @Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.settings_usage); final ListPreference pref_volumeButtonNavigation = (ListPreference) findPreference(getString(R.string.pref_volumeButtonNavigation_key)); autoDisplayListPreference(pref_volumeButtonNavigation); final CheckBoxPreference pref_showHiddenVersion = (CheckBoxPreference) findPreference(getString(R.string.pref_showHiddenVersion_key)); pref_showHiddenVersion.setOnPreferenceChangeListener((preference, newValue) -> { final boolean value = (boolean) newValue; if (value) { new AlertDialog.Builder(getActivity()) .setMessage(R.string.show_hidden_version_warning) .setNegativeButton(R.string.cancel, null) .setPositiveButton(R.string.ok, (dialog, which) -> pref_showHiddenVersion.setChecked(true)) .show(); return false; } return true; }); } } static void autoDisplayListPreference(final ListPreference pref) { final CharSequence label = pref.getEntry(); if (label != null) { pref.setSummary(label); } final Preference.OnPreferenceChangeListener originalChangeListener = pref.getOnPreferenceChangeListener(); pref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(final Preference preference, final Object newValue) { final boolean changed; if (originalChangeListener != null) { changed = originalChangeListener.onPreferenceChange(preference, newValue); } else { changed = true; } if (changed) { final int index = pref.findIndexOfValue((String) newValue); if (index >= 0) { pref.setSummary(pref.getEntries()[index]); } } return changed; } }); } public static void setPaddingBasedOnPreferences(final View view) { final Resources r = App.context.getResources(); if (Preferences.getBoolean(r.getString(R.string.pref_textPadding_key), r.getBoolean(R.bool.pref_textPadding_default))) { final int tb = r.getDimensionPixelOffset(R.dimen.text_topbottom_padding); final int lr = r.getDimensionPixelOffset(R.dimen.text_side_padding); view.setPadding(lr, tb, lr, tb); } else { final int no = r.getDimensionPixelOffset(R.dimen.text_nopadding); view.setPadding(no, no, no, no); } } }
package rapture.index; import java.util.List; import org.testng.Assert; import org.testng.Reporter; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.DataProvider; import org.testng.annotations.Optional; import org.testng.annotations.Parameters; import org.testng.annotations.Test; import com.google.common.collect.ImmutableMap; import rapture.common.RaptureURI; import rapture.common.Scheme; import rapture.common.TableQueryResult; import rapture.common.client.HttpDocApi; import rapture.common.client.HttpIndexApi; import rapture.common.impl.jackson.JacksonUtil; import rapture.common.model.IndexConfig; import rapture.helper.IntegrationTestHelper; public class IndexTests { HttpDocApi docApi = null; HttpIndexApi index = null; IntegrationTestHelper helper = null; @BeforeClass(groups = { "index", "mongo", "nightly" }) @Parameters({ "RaptureURL", "RaptureUser", "RapturePassword" }) public void setUp(@Optional("http://localhost:8665/rapture") String url, @Optional("rapture") String username, @Optional("rapture") String password) { helper = new IntegrationTestHelper(url, username, password); docApi = helper.getDocApi(); index = helper.getIndexApi(); } @Test(groups = { "index", "mongo", "nightly" }, dataProvider = "implTypes") public void testUpdateIndex(String implType) { String INDEXCFG = "planet($0) string, moon($1) string, fieldOne(one) string, fieldTwo(two) integer, fieldInner(inner.alpha) string"; IndexConfig planetIndex = null; RaptureURI repo = helper.getRandomAuthority(Scheme.DOCUMENT); helper.configureTestRepo(repo, implType); String planetURI = repo.getAuthority(); Reporter.log("Document URI: document://" + planetURI, true); planetIndex = index.createIndex(planetURI, INDEXCFG); Reporter.log("Created index: " + planetIndex.getName(), true); String query = "SELECT planet, moon, fieldOne, fieldTwo WHERE fieldTwo > 2.5"; TableQueryResult res = index.findIndex(planetURI, query); List<List<Object>> resList = res.getRows(); if (resList != null) Assert.assertEquals(resList.size(), 0); createData1(planetURI); createData3(planetURI); Reporter.log("Updated index: " + planetIndex.getName(), true); Reporter.log("Testing query: " + query, true); res = index.findIndex(planetURI, query); resList = res.getRows(); Assert.assertEquals(resList.size(), 3); createData2(planetURI); Reporter.log("Testing query: " + query, true); res = index.findIndex(planetURI, query); resList = res.getRows(); Assert.assertEquals(resList.size(), 7); query = "SELECT planet, moon, fieldOne, fieldTwo WHERE fieldTwo < -1.5"; Reporter.log("Testing query: " + query, true); res = index.findIndex(planetURI, query); resList = res.getRows(); Assert.assertEquals(resList.size(), 2); } @Test(groups = { "index", "mongo", "nightly" }, dataProvider = "implTypes") public void testUpdateIndexAfterDelete(String implType) { String INDEXCFG = "planet($0) string, moon($1) string, fieldOne(one) string, fieldTwo(two) integer, fieldInner(inner.alpha) string"; IndexConfig planetIndex = null; RaptureURI repo = helper.getRandomAuthority(Scheme.DOCUMENT); helper.configureTestRepo(repo, implType); String planetURI = repo.getAuthority(); Reporter.log("Document URI: document://" + planetURI, true); planetIndex = index.createIndex(planetURI, INDEXCFG); Reporter.log("Created index: " + planetIndex.getName(), true); String query = "SELECT planet, moon, fieldOne, fieldTwo WHERE fieldTwo > 2.5"; TableQueryResult res = index.findIndex(planetURI, query); List<List<Object>> resList = res.getRows(); if (resList != null) Assert.assertEquals(resList.size(), 0); createData1(planetURI); createData2(planetURI); Reporter.log("Updated index: " + planetIndex.getName(), true); Reporter.log("Testing query: " + query, true); res = index.findIndex(planetURI, query); resList = res.getRows(); Assert.assertEquals(resList.size(), 7); deleteData2(planetURI); Reporter.log("Testing query: " + query, true); res = index.findIndex(planetURI, query); resList = res.getRows(); Assert.assertEquals(resList.size(), 3); query = "SELECT planet, moon, fieldOne, fieldTwo WHERE fieldTwo < -1.5"; Reporter.log("Testing query: " + query, true); res = index.findIndex(planetURI, query); resList = res.getRows(); if (resList != null) Assert.assertEquals(resList.size(), 0); } @Test(groups = { "index", "mongo", "nightly" }, dataProvider = "implTypes") public void testLimitQuery(String implType) { String INDEXCFG = "planet($0) string, moon($1) string, fieldOne(one) string, fieldTwo(two) integer, fieldInner(inner.alpha) string"; IndexConfig planetIndex = null; RaptureURI repo = helper.getRandomAuthority(Scheme.DOCUMENT); helper.configureTestRepo(repo, implType); String planetURI = repo.getAuthority(); Reporter.log("Document URI: document://" + planetURI, true); planetIndex = index.createIndex(planetURI, INDEXCFG); Reporter.log("Created index: " + planetIndex.getName(), true); createData1(planetURI); createData2(planetURI); createData3(planetURI); String limitQuery = "SELECT planet, moon LIMIT 4"; Reporter.log("Testing query: " + limitQuery, true); TableQueryResult res = index.findIndex(planetURI, limitQuery); List<List<Object>> limitList = res.getRows(); Assert.assertNotNull(limitList); Assert.assertEquals(limitList.size(), 4); limitQuery = "SELECT DISTINCT planet, moon ORDER BY planet, moon ASC LIMIT 2"; Reporter.log("Testing query: " + limitQuery, true); res = index.findIndex(planetURI, limitQuery); limitList = res.getRows(); Assert.assertEquals(limitList.size(), 2); limitQuery = "SELECT DISTINCT distinct planet, moon ORDER BY planet, moon Asc Limit 2 Skip 2"; Reporter.log("Testing query: " + limitQuery, true); res = index.findIndex(planetURI, limitQuery); List<List<Object>> limitList2 = res.getRows(); Assert.assertEquals(limitList.size(), 2); Assert.assertEquals(limitList.get(0).get(0).toString(), "Earth"); Assert.assertEquals(limitList.get(1).get(0).toString(), "Jupiter"); Assert.assertEquals(limitList.get(1).get(1).toString(), "Europa"); Assert.assertEquals(limitList2.get(0).get(0).toString(), "Jupiter"); Assert.assertEquals(limitList2.get(0).get(1).toString(), "Ganymede"); Assert.assertEquals(limitList2.get(1).get(0).toString(), "Jupiter"); Assert.assertEquals(limitList2.get(1).get(1).toString(), "Io"); } @Test(groups = { "index", "mongo", "nightly" }, dataProvider = "implTypes") public void testDistinctQuery(String implType) { String INDEXCFG = "planet($0) string, moon($1) string, fieldOne(one) string, fieldTwo(two) integer, fieldInner(inner.alpha) string"; IndexConfig planetIndex = null; RaptureURI repo = helper.getRandomAuthority(Scheme.DOCUMENT); helper.configureTestRepo(repo, implType); String planetURI = repo.getAuthority(); Reporter.log("Document URI: document://" + planetURI, true); planetIndex = index.createIndex(planetURI, INDEXCFG); Reporter.log("Created index: " + planetIndex.getName(), true); createData1(planetURI); createData2(planetURI); String distinctQuery = "SELECT DISTINCT planet"; TableQueryResult distinctResults = index.findIndex(planetURI, distinctQuery); Reporter.log("Testing query: " + distinctQuery, true); List<List<Object>> distinctList = distinctResults.getRows(); Assert.assertNotNull(distinctList); Assert.assertEquals(distinctList.size(), 5); } @Test(groups = { "index", "mongo", "nightly" }, dataProvider = "implTypes") public void testAscendingOrder(String implType) { String INDEXCFG = "planet($0) string, moon($1) string, fieldOne(one) string, fieldTwo(two) integer, fieldInner(inner.alpha) string"; IndexConfig planetIndex = null; RaptureURI repo = helper.getRandomAuthority(Scheme.DOCUMENT); helper.configureTestRepo(repo, implType); String planetURI = repo.getAuthority(); Reporter.log("Document URI: document://" + planetURI, true); planetIndex = index.createIndex(planetURI, INDEXCFG); Reporter.log("Created index: " + planetIndex.getName(), true); createData1(planetURI); createData2(planetURI); String orderQuery = "SELECT DISTINCT planet"; TableQueryResult orderResult = index.findIndex(planetURI, orderQuery); Reporter.log("Testing query: " + orderQuery, true); List<List<Object>> orderList = orderResult.getRows(); Assert.assertEquals(orderList.size(), 5); orderQuery = "SELECT DISTINCT moon"; orderResult = index.findIndex(planetURI, orderQuery); Reporter.log("Testing query: " + orderQuery, true); orderList = orderResult.getRows(); Assert.assertEquals(orderList.size(), 8); createData3(planetURI); orderQuery = "SELECT DISTINCT planet, moon ORDER BY moon, planet ASC"; orderResult = index.findIndex(planetURI, orderQuery); Reporter.log("Testing query: " + orderQuery, true); orderList = orderResult.getRows(); Assert.assertNotNull(orderList); Assert.assertEquals(orderList.size(), 9); Reporter.log("Verifying order of results", true); String last = "Aaaa"; for (List<Object> next : orderList) { String nextStr = next.get(1).toString(); Assert.assertTrue(nextStr.compareTo(last) >= 0); last = nextStr; } orderQuery = "SELECT planet, moon Order By moon, planet ASC"; orderResult = index.findIndex(planetURI, orderQuery); Reporter.log("Testing query: " + orderQuery, true); orderList = orderResult.getRows(); Assert.assertEquals(orderList.size(), 12); last = "Aaaa"; for (List<Object> next : orderList) { String nextStr = next.get(1).toString(); Assert.assertTrue(nextStr.compareTo(last) >= 0); last = nextStr; } orderQuery = "SELECT planet, moon ORDER BY moon, planet ASC"; orderResult = index.findIndex(planetURI, orderQuery); Reporter.log("Testing query: " + orderQuery, true); orderList = orderResult.getRows(); Assert.assertEquals(orderList.size(), 12); last = "Aaaa"; for (List<Object> next : orderList) { String nextStr = next.get(1).toString(); Assert.assertTrue(nextStr.compareTo(last) >= 0); last = nextStr; } } @Test(groups = { "index", "mongo", "nightly" }, dataProvider = "implTypes") public void testDescendingOrder(String implType) { String INDEXCFG = "planet($0) string, moon($1) string, fieldOne(one) string, fieldTwo(two) integer, fieldInner(inner.alpha) string"; IndexConfig planetIndex = null; RaptureURI repo = helper.getRandomAuthority(Scheme.DOCUMENT); helper.configureTestRepo(repo, implType); String planetURI = repo.getAuthority(); Reporter.log("Document URI: document://" + planetURI, true); planetIndex = index.createIndex(planetURI, INDEXCFG); Reporter.log("Created index: " + planetIndex.getName(), true); createData1(planetURI); createData2(planetURI); String orderQuery = "SELECT DISTINCT planet ORDER BY planet DESC"; TableQueryResult orderResult = index.findIndex(planetURI, orderQuery); Reporter.log("Testing query: " + orderQuery, true); List<List<Object>> orderList = orderResult.getRows(); Assert.assertNotNull(orderList); Assert.assertEquals(orderList.size(), 5); String last = "Zzzz"; Reporter.log("Verifying order of results", true); for (List<Object> next : orderList) { String nextStr = next.get(0).toString(); Assert.assertTrue(nextStr.compareTo(last) < 0); last = nextStr; } } @Test(groups = { "index", "mongo", "nightly" }, dataProvider = "implTypes") public void testOrderLimit(String implType) { String INDEXCFG = "planet($0) string, moon($1) string, fieldOne(one) string, fieldTwo(two) integer, fieldInner(inner.alpha) string"; IndexConfig planetIndex = null; RaptureURI repo = helper.getRandomAuthority(Scheme.DOCUMENT); helper.configureTestRepo(repo, implType); String planetURI = repo.getAuthority(); Reporter.log("Document URI: document://" + planetURI, true); planetIndex = index.createIndex(planetURI, INDEXCFG); Reporter.log("Created index: " + planetIndex.getName(), true); createData1(planetURI); createData2(planetURI); String orderQuery = "SELECT DISTINCT planet ORDER BY planet DESC LIMIT 3"; TableQueryResult orderResults = index.findIndex(planetURI, orderQuery); Reporter.log("Query: " + orderQuery, true); List<List<Object>> orderList = orderResults.getRows(); Assert.assertNotNull(orderList); Reporter.log("Verifying results size", true); Assert.assertEquals(orderList.size(), 3); String last = "Zzzz"; Reporter.log("Verifying order of results", true); for (List<Object> next : orderList) { String nextStr = next.get(0).toString(); Assert.assertTrue(nextStr.compareTo(last) < 0); last = nextStr; } } @AfterClass(groups = { "index", "mongo", "nightly" }) public void AfterTest() { helper.cleanAllAssets(); } @DataProvider public Object[][] implTypes() { return new Object[][] { new Object[] { "MONGODB" }, new Object[] { "MEMORY" }, }; } private void createData1(String planetURI) { docApi.putDoc(planetURI + "/Mercury/None", JacksonUtil.jsonFromObject(ImmutableMap.of("one", "A", "two", new Double(1.5), "three", "constant", "inner", ImmutableMap.of("alpha", "Z")))); docApi.putDoc(planetURI + "/Venus/None", JacksonUtil.jsonFromObject(ImmutableMap.of("one", "B", "two", new Integer(2), "three", "constant", "inner", ImmutableMap.of("alpha", "Y")))); docApi.putDoc(planetURI + "/Earth/Moon", JacksonUtil.jsonFromObject(ImmutableMap.of("one", "C", "two", new Double(3.7), "three", "constant", "inner", ImmutableMap.of("alpha", "X")))); docApi.putDoc(planetURI + "/Mars/Phobos", JacksonUtil.jsonFromObject(ImmutableMap.of("one", "D", "two", new Integer(4), "three", "constant", "inner", ImmutableMap.of("alpha", "W")))); docApi.putDoc(planetURI + "/Mars/Deimos", JacksonUtil.jsonFromObject(ImmutableMap.of("one", "E", "two", new Integer(5), "three", "constant", "inner", ImmutableMap.of("alpha", "V")))); } private void createData2(String planetURI) { docApi.putDoc(planetURI + "/Jupiter/Ganymede", JacksonUtil.jsonFromObject(ImmutableMap.of("one", "F", "two", new Integer(6), "three", "constant", "inner", ImmutableMap.of("alpha", "U")))); docApi.putDoc(planetURI + "/Jupiter/Europa", JacksonUtil.jsonFromObject(ImmutableMap.of("one", "G", "two", new Integer(7), "three", "constant", "inner", ImmutableMap.of("alpha", "T")))); docApi.putDoc(planetURI + "/Jupiter/Titan", JacksonUtil.jsonFromObject(ImmutableMap.of("one", "H", "two", new Integer(8), "three", "constant", "inner", ImmutableMap.of("alpha", "S")))); docApi.putDoc(planetURI + "/Jupiter/Io", JacksonUtil.jsonFromObject(ImmutableMap.of("one", "I", "two", new Integer(9), "three", "constant", "inner", ImmutableMap.of("alpha", "R")))); } private void deleteData2(String planetURI) { docApi.deleteDoc(planetURI + "/Jupiter/Ganymede"); docApi.deleteDoc(planetURI + "/Jupiter/Europa"); docApi.deleteDoc(planetURI + "/Jupiter/Titan"); docApi.deleteDoc(planetURI + "/Jupiter/Io"); } private void createData3(String planetURI) { docApi.putDoc(planetURI + "/Earth/Moon/Foo", JacksonUtil.jsonFromObject(ImmutableMap.of("one", "Q", "two", new Double(-1), "three", "constant", "inner", ImmutableMap.of("alpha", "X")))); docApi.putDoc(planetURI + "/Earth/Moon/Bar", JacksonUtil.jsonFromObject(ImmutableMap.of("one", "W", "two", new Double(-2), "three", "constant", "inner", ImmutableMap.of("alpha", "X")))); docApi.putDoc(planetURI + "/Earth/Moon/Baz", JacksonUtil.jsonFromObject(ImmutableMap.of("one", "E", "two", new Double(-3), "three", "constant", "inner", ImmutableMap.of("alpha", "X")))); } }
package com.cinchapi.concourse.store; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.nio.MappedByteBuffer; import java.nio.channels.FileChannel; import java.util.Iterator; import java.util.List; import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.cinchapi.common.Strings; import com.cinchapi.common.io.ByteBuffers; import com.cinchapi.concourse.exception.ConcourseRuntimeException; import com.cinchapi.concourse.service.ConcourseService; import com.cinchapi.concourse.service.StaggeredWriteService; import com.cinchapi.concourse.service.TransactionService; import com.cinchapi.concourse.store.Transaction.Operation.Type; import com.cinchapi.concourse.structure.Commit; import com.cinchapi.concourse.structure.Key; import com.cinchapi.concourse.structure.Value.Values; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; /** * <p> * A {@link Transaction} is initiated from a {@link TransactionService} for the * purpose of conducting an ACID operation. This object provides a similar * action interface as the the parent. * </p> * <p> * <h2>Transaction ACIDity</h2> * <ul> * <li><strong>Atomicity</strong>: The commits in a transaction are all or * nothing.</li> * <li><strong>Consistency</strong>: Each successful transaction write is at a * minimum <em>instantaneously consistent</em> such that a write is * <em><strong>guaranteed</strong></em> to be consistent at the instant when it * is written and also consistent up until the instant when another write occurs * in the parent service. Once a transaction is committed, the parent service is * locked and all the operations that occurred in the transaction are replayed * in a new transaction against the current state of the parent at the time of * locking to ensure that each operation is consistent with the most recent * data. If the replay succeeds, all the operations are permanently written to * the parent and the lock is released, otherwise the commit fails and the * transaction is discarded.</li> * <li><strong>Isolation</strong>: Each concurrent transaction exists in * isolation. The results of an uncommitted transaction are invisible to other * transactions. At the time of commit, the transaction grabs a lock on the * parent service, so commits also happen in isolation.</li> * <li><strong>Durability</strong>: Once a transaction is committed, it is * permanently written to the parent service. Before attempt to commit a * transaction to the parent service, the transaction is logged to a file on * disk so that, in the event of a power loss, crash, shutdown, etc, the * transaction can be recovered and resume. Once the transaction is fully * committed, the file on disk is deleted.</li> * </ul> * </p> * * * @author jnelson */ public final class Transaction extends StaggeredWriteService { // NOTE: This class does not define hashCode() or equals() because the // defaults are the desired behaviour. /** * Start a {@code transaction} for the {@code parent} service. * * @param parent * @return the transaction */ public static Transaction initFrom(TransactionService parent) { return new Transaction(parent); } /** * Return a closed {@code transaction} that has been deserialized and * recovered from the {@code file}. * * @param file * @param parent * @return the recovered Transaction */ public static Transaction recoverFrom(String file, TransactionService parent) { String content = ""; FileInputStream stream; try { stream = new FileInputStream(new File(file)); FileChannel channel = stream.getChannel(); MappedByteBuffer buffer = channel.map( FileChannel.MapMode.READ_ONLY, 0, channel.size()); content = ByteBuffers.charset().decode(buffer).toString(); } catch (Exception e) { e.printStackTrace(); } Gson gson = new LocalGsonBuilder(parent).build(); return gson.fromJson(content, Transaction.class); } /** * Replay the {@code transaction} against the most current view of the * parent service and see if the commits succeed. * * @param transaction * @return a new {@code transaction} if the replay succeeds, and * {@code null} if the replay fails */ @Nullable private static Transaction replay(Transaction transaction) { Transaction t = Transaction .initFrom((TransactionService) transaction.primary); Preconditions.checkState(transaction.isClosed(), "Cannot replay a transaction that is not closed"); Preconditions.checkState(transaction.primary.equals(t.primary), "Cannot replay a transaction with a different parent service"); synchronized (transaction.primary) { Iterator<Operation> operations = transaction.flusher(); while (operations.hasNext()) { Operation operation = operations.next(); if(Utilities.flush(operation, t)) { continue; } else { // detected a merge conflict that would cause the // transaction to fail t.closed = true; return null; } } } t.closed = true; return t; } /** * Return a {@link Transaction} seeded with the {@code operations}. * * @param operations * @param parent * @return the Transaction */ private static Transaction withOperations(List<Operation> operations, TransactionService parent) { Transaction transaction = new Transaction(parent); transaction.closed = true; transaction.operations = operations; // authorized return transaction; } private static final Logger log = LoggerFactory .getLogger(Transaction.class); private static final int INITIAL_CAPACITY = 10; private List<Operation> operations = Lists .newArrayListWithExpectedSize(INITIAL_CAPACITY); // treat as if // final private boolean closed = false; /** * Construct a new instance for the purpose of replaying. * * @param transaction */ private Transaction(Transaction transaction) { super(transaction.primary, VolatileDatabase .newInstancewithExpectedCapacity(transaction.operations.size())); } /** * Construct a new instance. * * @param parent * - must be an instance of ConcourseService */ private Transaction(TransactionService parent) { super((ConcourseService) parent, VolatileDatabase .newInstancewithExpectedCapacity(INITIAL_CAPACITY)); } /** * Commit this transaction to the parent service. * * @return {@code true} if the transaction is successfully committed. */ public synchronized boolean commit() { closed = true; Transaction current = Transaction.replay(this); if(current != null) { current.doCommit(); return true; } else { log.info("Failed to commit transaction {}", this); return false; } } /** * Return {@code true} if the transaction is closed. * * @return {@code true} if the transaction is closed. */ public boolean isClosed() { return closed; } /** * Rollback and cancel all the changes in the transaction. */ public void rollback() { closed = true; } @Override public synchronized void shutdown() { secondary.shutdown(); // shutdown the volatile db super.shutdown(); } @Override public String toString() { return Strings.toString(operations); } @Override protected boolean addSpi(long row, String column, Object value) { if(super.addSpi(row, column, value) && !isClosed()) { return storeOperation(Type.ADD, row, column, value); } return false; } /** * Flush the transaction to its parent service. This method does not perform * ANY checks, so use with caution. */ protected synchronized void doCommit() { Preconditions.checkState(closed, "The transaction must be closed in order to commit"); final String transactionFile = ((TransactionService) primary)._(); final File file = new File(transactionFile); Runnable cleanup = new Runnable() { // Delete files, release locks, etc @Override public void run() { file.delete(); primary.notifyAll(); shutdown(); } }; synchronized (primary) { while (file.exists()) { try { primary.wait(); } catch (InterruptedException e) { throw new ConcourseRuntimeException(e); } } try { serialize(transactionFile); } catch (IOException e) { cleanup.run(); log.error( "An error occured while trying to serialize transaction {}: {}", this, e); throw new ConcourseRuntimeException(e); } Iterator<Operation> operations = flusher(); while (operations.hasNext()) { Operation operation = operations.next(); if(Utilities.flush(operation, primary)) { log.debug("Successfully saved transaction operation {}:", operation); } else { log.warn( "Failed attempt to save transaction operation {} because it appears " + "that the primary service was previously shutdown while " + "committing this transaction, but managed to successfully " + "commit this particular transaction.", operation); } } } } @Override protected boolean removeSpi(long row, String column, Object value) { if(super.removeSpi(row, column, value) && !isClosed()) { return storeOperation(Type.REMOVE, row, column, value); } return false; } /** * Assert that the number of operations is equal to the number of commits. */ private void assertSize() { assert operations.size() == ((VolatileDatabase) secondary).ordered .size() : "There is a discrepency between the number of operations and the number of commits"; } /** * Return an iterator of mappings from {@link Commit} to * {@link OperationType} for the purpose of flushing this transaction to * its parent service. * * @return the flusher */ private Iterator<Operation> flusher() { Preconditions.checkState(isClosed(), "Cannot flush a transaction that is not closed"); // Ensuring // that the // transaction // is closed // protects // against // concurrent // modification return operations.iterator(); } /** * Serialize the transaction and store it to the {@code file}. * * @param file * @throws IOException */ private void serialize(String file) throws IOException { Gson gson = new LocalGsonBuilder((TransactionService) primary).build(); String json = gson.toJson(this); BufferedWriter out; out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream( file), ByteBuffers.charset().displayName())); out.write(json); out.flush(); out.close(); } /** * Store an operation in the transaction. This method should ONLY be called * from the {@link #addSpi(long, String, Object)} or * {@link #removeSpi(long, String, Object)} method. * * @param type * @param row * @param column * @param value * @return */ private boolean storeOperation(Type type, long row, String column, Object value) { operations.add(new Operation(type, row, column, value)); assertSize(); return true; } /** * Encapsulates serializable information about the type, row, column and * value (raw) that define an operation. Timestamp information is lost, but * that is okay because each operation will receive its true timestamp at * the time of commit. * * @author jnelson */ @Immutable public static class Operation { // NOTE: This class does not define hashCode() or equals() because the // defaults are the desired behaviour. private final Type type; private final long row; private final String column; private final Object value; /** * Construct a new instance. * * @param type * @param row * @param column * @param value */ public Operation(Type type, long row, String column, Object value) { this.type = type; this.row = row; this.column = column; this.value = value; } /** * Return the {@code column}. * * @return the column */ public String getColumn() { return column; } /** * Return the {@code row}. * * @return the row */ public long getRow() { return row; } /** * Return the {@code type}. * * @return the type */ public Type getType() { return type; } /** * Return the {@code value}. * * @return the value */ public Object getValue() { return value; } @Override public String toString() { return Strings.toString(this); } /** * The write operation types that can occur within a transaction. */ public enum Type { ADD, REMOVE } /** * GSON type adapter for {@link Operation}. * * @author jnelson */ private static class GsonTypeAdapter implements JsonSerializer<Operation>, JsonDeserializer<Operation> { static final String TYPE_MEMBER = "type"; static final String ROW_MEMBER = "row"; static final String COLUMN_MEMBER = "column"; static final String VALUE_MEMBER = "value"; static final String VALUE_TYPE_MEMBER = "value_type"; @Override public Operation deserialize(JsonElement json, java.lang.reflect.Type typeOfT, JsonDeserializationContext context) throws JsonParseException { JsonObject obj = json.getAsJsonObject(); Type type = Type.values()[obj.get(TYPE_MEMBER).getAsInt()]; long row = obj.get(ROW_MEMBER).getAsLong(); String column = obj.get(COLUMN_MEMBER).getAsString(); com.cinchapi.concourse.structure.Value.Type valueType = com.cinchapi.concourse.structure.Value.Type .values()[obj.get(VALUE_TYPE_MEMBER).getAsInt()]; Object value = null; if(valueType == com.cinchapi.concourse.structure.Value.Type.BOOLEAN) { value = obj.get(VALUE_MEMBER).getAsBoolean(); } else if(valueType == com.cinchapi.concourse.structure.Value.Type.DOUBLE) { value = obj.get(VALUE_MEMBER).getAsDouble(); } else if(valueType == com.cinchapi.concourse.structure.Value.Type.FLOAT) { value = obj.get(VALUE_MEMBER).getAsFloat(); } else if(valueType == com.cinchapi.concourse.structure.Value.Type.INTEGER) { value = obj.get(VALUE_MEMBER).getAsInt(); } else if(valueType == com.cinchapi.concourse.structure.Value.Type.LONG) { value = obj.get(VALUE_MEMBER).getAsLong(); } else if(valueType == com.cinchapi.concourse.structure.Value.Type.RELATION) { value = Key.fromLong(obj.get(VALUE_MEMBER).getAsLong()); } else { value = obj.get(VALUE_MEMBER).getAsString(); } return new Operation(type, row, column, value); } @Override public JsonElement serialize(Operation src, java.lang.reflect.Type typeOfSrc, JsonSerializationContext context) { JsonObject object = new JsonObject(); object.addProperty(TYPE_MEMBER, src.getType().ordinal()); object.addProperty(ROW_MEMBER, src.getRow()); object.addProperty(COLUMN_MEMBER, src.getColumn()); object.addProperty(VALUE_MEMBER, src.getValue().toString()); object.addProperty(VALUE_TYPE_MEMBER, Values.getObjectType(src.getValue()).ordinal()); return object; } } } /** * GSON type adapter for {@link Transaction}. * * @author jnelson */ private static class GsonTypeAdapter implements JsonSerializer<Transaction>, JsonDeserializer<Transaction> { static final String OPERATIONS_MEMBER = "operations"; final TransactionService parent; public GsonTypeAdapter(TransactionService parent) { this.parent = parent; } @Override public Transaction deserialize(JsonElement json, java.lang.reflect.Type typeOfT, JsonDeserializationContext context) throws JsonParseException { Gson gson = new GsonBuilder().registerTypeAdapter(Operation.class, new Operation.GsonTypeAdapter()).create(); JsonObject object = json.getAsJsonObject(); JsonArray jsonOperations = object.get(OPERATIONS_MEMBER) .getAsJsonArray(); List<Operation> operations = Lists .newArrayListWithCapacity(jsonOperations.size()); Iterator<JsonElement> elements = jsonOperations.iterator(); while (elements.hasNext()) { operations.add(gson.fromJson(elements.next(), Operation.class)); } return Transaction.withOperations(operations, parent); } @Override public JsonElement serialize(Transaction src, java.lang.reflect.Type typeOfSrc, JsonSerializationContext context) { Gson gson = new GsonBuilder().registerTypeAdapter(Operation.class, new Operation.GsonTypeAdapter()).create(); Iterator<Operation> flusher = src.flusher(); JsonArray operations = new JsonArray(); while (flusher.hasNext()) { operations .add(gson.toJsonTree(flusher.next(), Operation.class)); } JsonObject object = new JsonObject(); object.add(OPERATIONS_MEMBER, operations); return object; } } /** * A {@link GsonBuilder} that depends on a specific * {@link TransactionService} for the purpose of initiating a * {@link Transaction.GsonTypeAdapter}. * * @author jnelson */ private static class LocalGsonBuilder { static final GsonBuilder builder = new GsonBuilder() .registerTypeAdapter(Operation.class, new Operation.GsonTypeAdapter()); final TransactionService parent; /** * Construct a new instance. * * @param parent */ public LocalGsonBuilder(TransactionService parent) { this.parent = parent; } public Gson build() { return builder.registerTypeAdapter(Transaction.class, new Transaction.GsonTypeAdapter(parent)).create(); } } /** * Utility methods for {@link Transaction}. * * @author jnelson */ private static class Utilities { /** * Flush a transaction operation to another service. * * @param operation * @param to * @return {@code true} if the operation is successfully flushed. */ public static boolean flush(Operation operation, ConcourseService to) { Preconditions .checkArgument( to instanceof Transaction || to instanceof TransactionService, "A transaction operation can only be flushed to a TransactionService or another Transaction"); if(operation.getType() == Type.ADD && to.add(operation.getRow(), operation.getColumn(), operation.getValue())) { return true; } else if(operation.getType() == Type.REMOVE && to.remove(operation.getRow(), operation.getColumn(), operation.getValue())) { return true; } else { // detected a merge conflict that would cause the // transaction to fail return false; } } } }
package fi.hu.cs.titokone; import java.awt.*; import javax.swing.JFrame; import java.awt.image.BufferedImage; import javax.imageio.*; import javax.imageio.stream.ImageInputStream; import java.io.*; import java.util.*; import fi.hu.cs.ttk91.TTK91Cpu; /** This class takes care of the animation window. It digs the needed information from a RunInfo instance. */ public class Animator extends JFrame { private final static File backgroundImageFile = new File("animator.gif"); private final static Font textFont = new Font ("Arial", Font.BOLD, 16); private final static int R0 = 0; private final static int R1 = 1; private final static int R2 = 2; private final static int R3 = 3; private final static int R4 = 4; private final static int R5 = 5; private final static int R6 = 6; private final static int R7 = 7; private final static int TR = 8; private final static int PC = 9; private final static int IR = 10; private final static int SR = 11; private final static int BASE = 12; private final static int LIMIT = 13; private final static int MAR = 14; private final static int MBR = 15; private final static int ALU_IN1 = 16; private final static int ALU_IN2 = 17; private final static int ALU_OUT = 18; private final static int EXTERNAL_DEVICE = 19; private final static int MEMORY = 20; private final static int[][] routeToBus = { {228,131, 269,131}, {228,151, 269,151}, {228,171, 269,171}, {228,191, 269,191}, {228,211, 269,211}, {228,231, 269,231}, {228,251, 269,251}, {228,271, 269,271}, {292,131, 269,131}, {292,151, 269,151}, {292,171, 269,171}, {292,191, 269,191}, {292,321, 269,321}, // BASE {292,341, 269,341}, // LIMIT {292,361, 269,361}, // MAR {292,381, 269,381}, // MBR {140,345, 140,330, 269,330}, // ALU_IN1 {210,345, 210,330, 269,330}, // ALU_IN2 {180,420, 180,432, 269,432}, // ALU_OUT {540,415, 540,487, 269,487}, // EXTERNAL_DEVICE {680,415, 680,487, 269,487}, // MEMORY }; private final static int[][] whereWriteValueTo = { {165,138}, {165,158}, {165,178}, {165,198}, {165,218}, {165,238}, {165,258}, {165,278}, {305,137}, {305,157}, {305,177}, {305,197}, {305,328}, // BASE {305,348}, // LIMIT {305,368}, // MAR {305,388}, // MBR {114,368}, // ALU_IN1 {182,368}, // ALU_IN2 {154,409}, // ALU_OUT }; /** Contains values of registers, alu, memory and external device. */ private int[] value = new int[routeToBus.length]; /** Current command label */ private String currentCommand = ""; /** Comment label */ private String comment = ""; private BufferedImage backgroundImage, doubleBuffer; private int pointX=-1, pointY=-1; public Animator (int wide, int height, String title) throws IOException { // read the background image BufferedImage bi = ImageIO.read (backgroundImageFile); backgroundImage = new BufferedImage (bi.getWidth(), bi.getHeight(), BufferedImage.TYPE_INT_RGB); doubleBuffer = new BufferedImage (bi.getWidth(), bi.getHeight(), BufferedImage.TYPE_INT_RGB); backgroundImage.createGraphics().drawImage (bi, 0,0, null); setSize (wide, height); setTitle (title); setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); show(); } public void paint (Graphics g) { // copy backround image to dublebuffer backgroundImage.copyData (doubleBuffer.getRaster()); Graphics g2 = doubleBuffer.createGraphics(); g2.setColor (Color.BLACK); // write values (registers, alu, control unit) g2.setFont (textFont); for (int i=0; i < whereWriteValueTo.length; i++) g2.drawString ("" + value[i], whereWriteValueTo[i][0], whereWriteValueTo[i][1]); // write current command and comments g2.drawString (currentCommand, 355, 48); g2.drawString (comment, 106, 559); // draw red animation spot if (pointX != -1) { g2.setColor (Color.RED); g2.fillOval (pointX -5, pointY -5, 10, 10); } // draw double buffer to frame g.drawImage (doubleBuffer, 0,0, getWidth(), getHeight(), null); } /** This method produces an animation of a command based on the information in the RunInfo parameter. @param info A RunInfo to base the animation on. */ public void animate(RunInfo info) { currentCommand = ""; // animate instruction fetch comment = new Message ("Fetch the next instruction from memory slot {0} to IR.", ""+value[PC]).toString(); value[PC]++; animateAnEvent (PC, MAR, value[PC]-1); animateAnEvent (MAR, MEMORY); animateAnEvent (MEMORY, MBR, info.getBinary()); animateAnEvent (MBR, IR); currentCommand = info.getLineContents(); pause(); int opcode = info.getBinary() >>> 24; int Rj = info.getFirstOperand()[0]; int Rj_value = info.getFirstOperand()[1]; int Ri = info.getIndexRegister()[0]; int Ri_value = info.getIndexRegister()[1]; int ADDR = info.getADDR(); int memoryFetches = info.getMemoryfetches(); if (Ri != 0) ADDR += Ri_value; int param = ADDR; int whereIsSecondOperand = IR; if (memoryFetches == 1) { param = info.getValueAtADDR(); whereIsSecondOperand = MBR; comment = new Message ("Fetch second operand from memory slot {0}.", ""+ADDR).toString(); animateAnEvent (IR, MAR, ADDR); animateAnEvent (MAR, MEMORY); animateAnEvent (MEMORY, MBR, param); } else if (memoryFetches == 2) { param = info.getSecondFetchValue(); whereIsSecondOperand = MBR; comment = new Message ("Indirect memory accessing mode. 1: Fetch indexing value from memory slot {0}.", ""+ADDR).toString(); animateAnEvent (IR, MAR, ADDR); animateAnEvent (MAR, MEMORY); animateAnEvent (MEMORY, MBR, info.getValueAtADDR()); comment = new Message ("Indirect memory accessing mode. 2: Fetch second operand from memory slot {0}.", ""+value[MBR]).toString(); pause(); animateAnEvent (MBR, MAR); animateAnEvent (MAR, MEMORY); animateAnEvent (MEMORY, MBR, param); } switch (info.getOperationtype()) { case RunDebugger.NO_OPERATION : comment = new Message ("No-operation command compleated.").toString(); pause(); break; case RunDebugger.DATA_TRANSFER_OPERATION : switch (opcode) { case 1 : // STORE comment = new Message ("Write value {0} from register R{1} to memory slot {2}.", new String[] {""+Rj_value, ""+Rj, ""+param}).toString(); animateAnEvent (whereIsSecondOperand, MAR, param); animateAnEvent (Rj, MBR); animateAnEvent (MBR, MEMORY); pause(); break; case 2 : // LOAD comment = new Message ("Load value {0} to register R{1}.", new String[] {""+param, ""+Rj}).toString(); animateAnEvent (whereIsSecondOperand, Rj, param); pause(); break; case 3 : int inValue = info.whatIN()[1]; comment = new Message ("Read value {0} from device {1} to register R{2}.", new String[] {""+inValue, info.whatDevice(), ""+Rj}).toString(); animateAnEvent (whereIsSecondOperand, EXTERNAL_DEVICE); animateAnEvent (EXTERNAL_DEVICE, Rj, inValue); pause(); case 4 : // OUT int outValue = info.whatOUT()[1]; comment = new Message ("Write value {0} from register R{1} to device {2}.", new String[] {""+value[Rj], ""+Rj, info.whatDevice()}).toString(); animateAnEvent (whereIsSecondOperand, EXTERNAL_DEVICE); animateAnEvent (Rj, EXTERNAL_DEVICE); pause(); } break; case RunDebugger.ALU_OPERATION : comment = new Message ("Copy register R{0} to ALU IN1.", ""+Rj).toString(); animateAnEvent (Rj, ALU_IN1); comment = new Message ("Copy second operand to ALU IN2.").toString(); animateAnEvent (whereIsSecondOperand, ALU_IN2, param); comment = new Message ("ALU computes the result.").toString(); pause(); comment = new Message ("Copy ALU result to register R{0}", ""+Rj).toString(); value[ALU_OUT] = info.getALUResult(); animateAnEvent (ALU_OUT, Rj); pause(); break; case RunDebugger.COMP_OPERATION : break; case RunDebugger.BRANCH_OPERATION : break; case RunDebugger.SUB_OPERATION : break; case RunDebugger.STACK_OPERATION : break; case RunDebugger.SVC_OPERATION : break; } /* currentCommand = "LOAD R0, 2"; value[PC] = 5; repaint(); pause(); comment = "Fetch next instruction from memory to IR"; value[PC] = 6; animateAnEvent (PC, MAR, 5); animateAnEvent (MAR, MEMORY); animateAnEvent (MEMORY, MBR, 34078722); animateAnEvent (MBR, IR); comment = "Fetch second parameter from memory"; repaint(); pause(); animateAnEvent (IR, MAR, 2); animateAnEvent (MAR, MEMORY); animateAnEvent (MEMORY, MBR, 101); comment = "Store result to R0"; repaint(); pause(); animateAnEvent (MBR, R0); currentCommand = "MUL R0, =10"; comment = "Fetch next instruction from memory to IR"; repaint(); pause(); value[PC] = 7; animateAnEvent (PC, MAR, 6); animateAnEvent (MAR, MEMORY); animateAnEvent (MEMORY, MBR, 318767114); animateAnEvent (MBR, IR); comment = "Transfer first parameter to ALU IN1"; repaint(); pause(); animateAnEvent (R0, ALU_IN1); comment = "Transfer second parameter to ALU IN2"; animateAnEvent (IR, ALU_IN2, 10); value[ALU_OUT] = 1010; comment = "Transfer ALU result to R0"; try {Thread.sleep(500);} catch (Exception e) {} repaint(); pause(); animateAnEvent (ALU_OUT, R0); */ } /** This method animates one event like "move 7 from R1 to In2 in ALU using the bus in between" The building block of a more complex operations like "STORE R1, 100" where one needs to fetch an instruction, decipher it etc. Each time something changes wait for user input (space-bar) to continue. @param from From where does the value come from. @param to Where is the value going to be transported. @param value Value to be moved. tos new value. */ private void animateAnEvent(int from, int to, int newValue) { // form the route int routeLength = routeToBus[from].length +routeToBus[to].length; int[] route = new int[routeLength]; for (int i=0; i < routeToBus[from].length; i++) route[i] = routeToBus[from][i]; for (int i=0; i < routeToBus[to].length; i+=2) { route[i +routeToBus[from].length] = routeToBus[to][routeToBus[to].length -i -2]; route[i +1 +routeToBus[from].length] = routeToBus[to][routeToBus[to].length -i -1]; } int x1 = route[0]; int y1 = route[1]; int x2, y2; for (int i=2; i < route.length; i+=2) { x2 = route[i]; y2 = route[i+1]; while (x1 != x2 || y1 != y2) { if (x1 < x2) x1 = Math.min (x2, x1+8); if (x1 > x2) x1 = Math.max (x2, x1-8); if (y1 < y2) y1 = Math.min (y2, y1+8); if (y1 > y2) y1 = Math.max (y2, y1-8); pointX = x1; pointY = y1; repaint(); try { Thread.sleep(40*2); } catch (Exception e) {} } } pointX = pointY = -1; value[to] = newValue; repaint(); } private void animateAnEvent(int from, int to) { animateAnEvent (from, to, value[from]); } private void pause() { repaint(); try {Thread.sleep(3000);} catch (Exception e) {} } public static void main (String[] args) throws IOException { Animator a = new Animator(800, 600, "Animator"); RunDebugger runDebugger = new RunDebugger(); /* runDebugger.cycleStart (0, "NOP", 1, 2,2); runDebugger.setOperationType (RunDebugger.NO_OPERATION); runDebugger.runCommand (0, 0, 0); a.animate (runDebugger.cycleEnd()); runDebugger.cycleStart (1, "STORE R1, @100", 2, 2,2); runDebugger.setOperationType (RunDebugger.DATA_TRANSFER_OPERATION); runDebugger.setValueAtADDR (666); runDebugger.runCommand (27787365, 0,0); a.animate (runDebugger.cycleEnd()); runDebugger.cycleStart (0, "LOAD R2, @10(R1)", 1, 2,2); runDebugger.setOperationType (RunDebugger.DATA_TRANSFER_OPERATION); runDebugger.setValueAtADDR (100); runDebugger.setSecondFetchValue (1000); runDebugger.runCommand (38862858, 0,0); a.animate (runDebugger.cycleEnd()); runDebugger.cycleStart (0, "IN R7, 10(R1)", 1, 2,2); runDebugger.setOperationType (RunDebugger.DATA_TRANSFER_OPERATION); runDebugger.setIN (1, 75); runDebugger.runCommand (65601546, 0,0); a.animate (runDebugger.cycleEnd()); runDebugger.cycleStart (0, "OUT R3, =0", 1, 2,2); runDebugger.setOperationType (RunDebugger.DATA_TRANSFER_OPERATION); runDebugger.setOUT (0, -1); runDebugger.runCommand (73400320, 0,0); a.animate (runDebugger.cycleEnd()); */ runDebugger.cycleStart (0, "ADD R6, =20", 1, 2,2); runDebugger.setOperationType (RunDebugger.ALU_OPERATION); runDebugger.setALUResult (20); runDebugger.runCommand (297795604, 0,0); a.animate (runDebugger.cycleEnd()); } }
package edu.wpi.first.wpilibj.templates; import edu.wpi.first.wpilibj.*; /** * * @author Tyler */ public class RobotActuators { public static Victor leftDrive; public static Victor rightDrive; public static Talon pickupRollerArmMotor; public static Talon pickupSystemMotor; public static Talon shooterWinch; public static Relay compressor; public static Solenoid shifterPiston; public static Solenoid rollerArmUp; public static Solenoid rollerArmDown; public static Solenoid latch; public static void initialize() { //Motors rightDrive = new Victor(1); leftDrive = new Victor(2); pickupSystemMotor = new Talon(3); pickupRollerArmMotor = new Talon(4); shooterWinch = new Talon(5); //Relays compressor = new Relay(1); //Solenoids shifterPiston = new Solenoid(1); rollerArmUp = new Solenoid(2); rollerArmDown = new Solenoid(3); latch = new Solenoid(4); //IS THIS ONE RIGHT? } }
package fi.hu.cs.titokone; import fi.hu.cs.ttk91.TTK91CompileException; import java.util.HashMap; import java.util.Vector; /** This class knows everything about the relation between symbolic code and binary code. It can transform a full source to binary or one symbolic command to binary or vice versa. Empty out all compiler commands and empty lines at the start of round 2.*/ public class Compiler { /** This field contains the source code as a String array. */ private String[] source; /** This field holds the declared variables, labels and other symbols. It acts as a pointer to the symbolTable Vector where the actual data is stored. */ private HashMap symbols; /** This field holds the invalid values to be introduced (i.e. already used labels can't be re-used. */ private HashMap invalidLabels; /** This field tells the next line to be checked. */ private int nextLine; /** This field holds all the valid symbols on a label. */ private final String VALIDLABELCHARS = "0123456789abcdefghijklmnopqrstuvwxyz_"; private final int NOTVALID = -1; private final int EMPTY = -1; /** Maximum value of the address part. */ private final int MAXINT = 32767; /** Minimum value of the address part. */ private final int MININT = -32767; /** This field holds the value of Stdin if it was set with DEF command. */ private String defStdin; /** This field holds the value of Stdout if it was set with DEF command. */ private String defStdout; /** This field keeps track of whether we are in the first round of compilation or the second. It is set by compile() and updated by compileLine(). */ private boolean firstRound; /** This field counts the number of actual command lines found during the first round. */ private int commandLineCount; /** This array contains the code. During the first round this field holds the clean version of the code (stripped of compiler commands like def, ds, dc etc.) */ private Vector code; /** This field acts as a symboltable, it is a String array vector where 1:st position holds the name of the symbol and the second either it's value (label, equ) or the command (ds 10, dc 10) */ private Vector symbolTable; /** This array contains the data. */ private String[] data; // Second Round /** This field holds the Memoryline objects for the code. These are passed to the Application constructor at the end of the compile process, and are gathered during the second round from first round commands in code-array */ private MemoryLine[] codeMemoryLines; /** This field holds the Memoryline objects for the data area. Much like the code part, this is gathered during the second round and passed to the Application when getApplication() method is called. */ private MemoryLine[] dataMemoryLines; /** This value tells if all the lines are processed twice and getApplication can be run. */ private boolean compileFinished; /** This field contains the CompileDebugger instance to inform of any compilation happenings. */ private CompileDebugger compileDebugger; /** This field contains the SymbolicInterpreter instance to use as part of the compilation. */ private SymbolicInterpreter symbolicInterpreter; /** This constructor sets up the class. It also initializes an instance of CompileDebugger. */ public Compiler() { compileDebugger = new CompileDebugger(); symbolicInterpreter = new SymbolicInterpreter(); } /** This function initializes transforms a symbolic source code into an application class. After this, call compileLine() to actually compile the application one line at a time, and finally getApplication() to get the finished application. @param source The symbolic source code to be compiled. */ public void compile(String source) { firstRound = true; compileFinished = false; while (source.indexOf("\r\n") != -1) { source = source.substring(0, source.indexOf("\r\n")) + source.substring(source.indexOf("\r\n") + 1); } source = source.toLowerCase(); this.source = source.split("[\n\r\f\u0085\u2028\u2029]"); // antti: removed + from the split and added the while loop (21.04.2004) nextLine = 0; defStdin = ""; defStdout = ""; code = new Vector(); symbols = new HashMap(); symbolTable = new Vector(); invalidLabels = new HashMap(); invalidLabels.put("crt", new Integer(0)); invalidLabels.put("kbd", new Integer(1)); invalidLabels.put("stdin", new Integer(6)); invalidLabels.put("stdout", new Integer(7)); invalidLabels.put("halt", new Integer(11)); invalidLabels.put("read", new Integer(12)); invalidLabels.put("write", new Integer(13)); invalidLabels.put("time", new Integer(14)); invalidLabels.put("date", new Integer(15)); } /** This function goes through one line of the code. On the first round, it gathers the symbols and their definitions to a symbol table and conducts syntax-checking, on the second round it transforms each command to its binary format. For the transformations, the CompileConstants class is used. It calls the private methods firstRoundProcess() and secondRoundProcess() to do the actual work, if there is any to do. The transfer from first round of compilation to the second is done automatically; during it, initializeSecondRound() is called. @return A CompileInfo debug information object, describing what happened during the compilation of this line and whether this is the first or second round of compilation or null if there are no more lines left to process. @throws TTK91CompileException If a) there is a syntax error during the first round of checking (error code 101) or b) a symbol is still undefined after the first round of compilation is finished. */ public CompileInfo compileLine() throws TTK91CompileException { CompileInfo info; if (firstRound) { if (nextLine == source.length) { compileDebugger.firstPhase(); info = initializeSecondRound(); return info; } else { compileDebugger.firstPhase(nextLine, source[nextLine]); info = firstRoundProcess(source[nextLine]); ++nextLine; return info; } } else { if (nextLine == code.size()) { compileDebugger.finalPhase(); compileFinished = true; return null; } else { compileDebugger.secondPhase(nextLine, source[nextLine]); info = secondRoundProcess((String)code.get(nextLine)); ++nextLine; return info; } } } /** This method returns the readily-compiled application if the compilation is complete, or null otherwise. */ public Application getApplication() throws IllegalStateException { if (compileFinished) { dataMemoryLines = new MemoryLine[data.length]; for (int i = 0; i < data.length; ++i) { dataMemoryLines[i] = new MemoryLine(Integer.parseInt(data[i]), ""); } SymbolTable st = new SymbolTable(); String[] tempSTLine; String symbolName; int symbolValue; for (int i = 0; i < symbolTable.size(); ++i) { tempSTLine = (String[])symbolTable.get(i); symbolName = tempSTLine[0]; symbolValue = Integer.parseInt(tempSTLine[1]); st.addSymbol(symbolName, symbolValue); } if (!defStdin.equals("")) { st.addDefinition("stdin", defStdin); } if (!defStdout.equals("")) { st.addDefinition("stdout", defStdout); } return new Application(codeMemoryLines, dataMemoryLines, st); } else { throw new IllegalStateException(new Message("Compilation is not " + "finished " + "yet.").toString()); } } /** This function transforms a binary command number to a MemoryLine containing both the binary and the symbolic command corresponding to it. @param binary The command to be translated as binary. @return A MemoryLine instance containing both the information about the symbolic command and the binary version of it. */ public MemoryLine getSymbolicAndBinary(int binary) { BinaryInterpreter bi = new BinaryInterpreter(); return new MemoryLine(binary, bi.binaryToString(binary)); } /** This function transforms a MemoryLine containing only the binary command to a MemoryLine containing both the binary and the symbolic command corresponding to it. @param binaryOnly A MemoryLine containing the binary only of the command to be translated as binary. If the MemoryLine contains both, the pre-set symbolic value is ignored. @return A MemoryLine instance containing both the information about the symbolic command and the binary version of it. */ public MemoryLine getSymbolicAndBinary(MemoryLine binaryOnly) { BinaryInterpreter bi = new BinaryInterpreter(); return new MemoryLine(binaryOnly.getBinary(), bi.binaryToString(binaryOnly.getBinary())); } /** This function gathers new symbol information from the given line and checks its syntax. If a data reservation is detected, the dataAreaSize is incremented accordingly. If the line contains an actual command, commandLineCount is incremented. @param line The line of code to process. @return A CompileInfo object describing what was done, or null if the first round has been completed. This will be the sign for the compiler to prepare for the second round and start it. */ private CompileInfo firstRoundProcess(String line) throws TTK91CompileException { String[] lineTemp = parseCompilerCommandLine(line); boolean nothingFound = true; String comment = ""; String[] commentParameters; int intValue = 0; String[] symbolTableEntry = new String[2]; boolean labelFound = false; boolean variableUsed = false; if (lineTemp == null) { lineTemp = parseLine(line); if (lineTemp == null) { // not a valid command comment = new Message("Invalid command.").toString(); throw new TTK91CompileException(comment); } else { if (lineTemp[1].equals("")) { // line empty; } else { code.add(line); if (!lineTemp[0].equals("")) { nothingFound = false; labelFound = true; // label found if (invalidLabels.containsKey(lineTemp[0])) { // not a valid label comment = new Message("Invalid label.").toString(); throw new TTK91CompileException(comment); } else { invalidLabels.put(lineTemp[0], null); if (symbols.containsKey(lineTemp[0])) { symbolTableEntry[0] = lineTemp[0]; symbolTableEntry[1] = "" + (code.size() - 1); /* MUUTETTU 23.04. (OLLI) */ symbolTable.set(((Integer)symbols.get(lineTemp[0])).intValue(), symbolTableEntry.clone()); } else { symbols.put(lineTemp[0], new Integer(code.size() - 1)); symbolTableEntry[0] = lineTemp[0]; symbolTableEntry[1] = "" + (code.size() - 1); symbolTable.add(symbolTableEntry.clone()); } compileDebugger.foundLabel(lineTemp[0], code.size() -1); } } try { if (!lineTemp[4].equals("")) Integer.parseInt(lineTemp[4]); } catch(NumberFormatException e) { // variable used if (symbolicInterpreter.getRegisterId(lineTemp[4]) == -1) { nothingFound = false; variableUsed = true; compileDebugger.foundSymbol(lineTemp[4]); if (!symbols.containsKey(lineTemp[4])) { if (invalidLabels.get(lineTemp[4]) == null) { symbols.put(lineTemp[4], new Integer(symbolTable.size())); symbolTableEntry[0] = lineTemp[4]; symbolTableEntry[1] = ""; symbolTable.add(symbolTableEntry.clone()); } else { // predefined word (halt etc) was used symbols.put(lineTemp[4], new Integer(symbolTable.size())); symbolTableEntry[0] = lineTemp[4]; symbolTableEntry[1] = "" + (Integer) invalidLabels.get(lineTemp[4]); symbolTable.add(symbolTableEntry.clone()); } } } } if (variableUsed && labelFound) { commentParameters = new String[2]; commentParameters[0] = lineTemp[0]; commentParameters[1] = lineTemp[4]; comment = new Message("Found label {0} and variable " + "{1}.", commentParameters).toString(); compileDebugger.setComment(comment); } else { if (variableUsed) { comment = new Message("Variable {0} used.", lineTemp[4]).toString(); compileDebugger.setComment(comment); } else { if (labelFound) { comment = new Message("Label {0} found.", lineTemp[0]).toString(); compileDebugger.setComment(comment); } } } } } } else { // compiler command boolean allCharsValid = true; boolean atLeastOneNonNumber = false; if (invalidLabels.containsKey(lineTemp[0])) { // not a valid label if (!(lineTemp[1].equalsIgnoreCase("def") && (lineTemp[0].equalsIgnoreCase("stdin") || lineTemp[0].equalsIgnoreCase("stdout")) )) { comment = new Message("Invalid label.").toString(); throw new TTK91CompileException(comment); } } if(!validLabelName(lineTemp[0])) { // not a valid label; comment = new Message("Invalid label.").toString(); throw new TTK91CompileException(comment); } else { if (lineTemp[1].equalsIgnoreCase("ds")) { intValue = 0; try { intValue = Integer.parseInt(lineTemp[2]); } catch(NumberFormatException e) { comment = new Message("Invalid size for a " + "DS.").toString(); throw new TTK91CompileException(comment); } if (intValue < 0 || intValue > MAXINT) { comment = new Message("Invalid size for a " + "DS.").toString(); throw new TTK91CompileException(comment); } } if (lineTemp[1].equalsIgnoreCase("dc")) { intValue = 0; if (lineTemp[2].trim().length() > 0) { try { intValue = Integer.parseInt(lineTemp[2]); } catch(NumberFormatException e) { comment = new Message("Invalid value for a " + "DC.").toString(); throw new TTK91CompileException(comment); } if (intValue < MININT || intValue > MAXINT) { comment = new Message("Invalid value for a " + "DC.").toString(); throw new TTK91CompileException(comment); } } } if (lineTemp[1].equalsIgnoreCase("equ")) { if (symbols.containsKey(lineTemp[0])) { symbolTableEntry[0] = lineTemp[0]; symbolTableEntry[1] = lineTemp[2]; symbolTable.set(((Integer)symbols.get(lineTemp[0])).intValue(), symbolTableEntry.clone()); } else { symbols.put(lineTemp[0], new Integer(symbolTable.size())); symbolTableEntry[0] = lineTemp[0]; symbolTableEntry[1] = lineTemp[2]; symbolTable.add(symbolTableEntry.clone()); } compileDebugger.foundEQU(lineTemp[0], intValue); commentParameters = new String[2]; commentParameters[0] = lineTemp[0]; commentParameters[1] = lineTemp[2]; comment = new Message("Variable {0} defined as {1}.", commentParameters).toString(); compileDebugger.setComment(comment); } if (lineTemp[1].equals("ds")) { if (symbols.containsKey(lineTemp[0])) { symbolTableEntry[0] = lineTemp[0]; symbolTableEntry[1] = lineTemp[1] + " " + lineTemp[2]; symbolTable.set(((Integer)symbols.get(lineTemp[0])).intValue(), symbolTableEntry.clone() ); } else { symbols.put(lineTemp[0], new Integer(symbolTable.size())); symbolTableEntry[0] = lineTemp[0]; symbolTableEntry[1] = lineTemp[1] + " " + lineTemp[2]; symbolTable.add(symbolTableEntry.clone()); } compileDebugger.foundDS(lineTemp[0]); comment = new Message("Found variable {0}.", lineTemp[0]).toString(); compileDebugger.setComment(comment); } if (lineTemp[1].equals("dc")) { compileDebugger.foundDC(lineTemp[0]); if (symbols.containsKey(lineTemp[0])) { symbolTableEntry[0] = lineTemp[0]; symbolTableEntry[1] = lineTemp[1] + " " + lineTemp[2]; symbolTable.set(((Integer)symbols.get(lineTemp[0])).intValue(), symbolTableEntry.clone()); } else { symbols.put(lineTemp[0], new Integer(symbolTable.size())); symbolTableEntry[0] = lineTemp[0]; symbolTableEntry[1] = lineTemp[1] + " " + lineTemp[2]; symbolTable.add(symbolTableEntry.clone()); } compileDebugger.foundDC(lineTemp[0]); comment = new Message("Found variable {0}.", lineTemp[0]).toString(); compileDebugger.setComment(comment); } if (lineTemp[1].equalsIgnoreCase("def")) { if (lineTemp[0].equals("stdin") || lineTemp[0].equals("stdout")) { if (lineTemp[0].equals("stdin")) { defStdin = lineTemp[2]; } else { defStdout = lineTemp[2]; } compileDebugger.foundDEF(lineTemp[0], lineTemp[2]); commentParameters = new String[2]; commentParameters[0] = lineTemp[0].toUpperCase(); commentParameters[1] = lineTemp[2]; comment = new Message("{0} defined as {1}.", commentParameters).toString(); compileDebugger.setComment(comment); } else { comment = new Message("Invalid DEF " + "operation.").toString(); throw new TTK91CompileException(comment); } } } } return compileDebugger.lineCompiled(); } /** This method initializes the code and data area arrays for the second round processing according to the dataAreaSize and commandLineCount variables. It also resets the StringTokenizer by calling tokenize(). Before entering the second round we must clear all the empty lines like compiler-codes (pseudo-codes) and lines with nothing but comments. */ private CompileInfo initializeSecondRound() { nextLine = 0; firstRound = false; // copy the code. String[] newCode = new String[code.size()]; for (int i= 0; i < newCode.length; ++i) newCode[i] = (String)code.get(i); String[] lineTemp; int dataAreaSize = 0; // calculate the size of data-area for (int i = 0; i < symbolTable.size(); ++i) { lineTemp = (String[])symbolTable.get(i); if (lineTemp[1].trim().length() >= 2) { if (lineTemp[1].substring(0,2).equalsIgnoreCase("ds")) { dataAreaSize += Integer.parseInt(lineTemp[1].substring(3)); } else { if (lineTemp[1].substring(0,2).equalsIgnoreCase("dc")) ++dataAreaSize; } } } if (!defStdin.equals("")) ++dataAreaSize; if (!defStdout.equals("")) ++dataAreaSize; data = new String[dataAreaSize]; String[] newSymbolTableLine = new String[2]; newSymbolTableLine[0] = ""; newSymbolTableLine[1] = ""; int nextPosition = 0; int nextMemorySlot = newCode.length; int dsValue = 0; // update variable values to symbolTable for (int i = 0; i < symbolTable.size(); ++i) { lineTemp = (String[])symbolTable.get(i); if (lineTemp[1].trim().length() >= 2) { if (lineTemp[1].substring(0,2).equalsIgnoreCase("ds")) { dsValue = Integer.parseInt(lineTemp[1].substring(3)); newSymbolTableLine[0] = lineTemp[0]; newSymbolTableLine[1] = "" + nextMemorySlot; symbolTable.set(i, newSymbolTableLine.clone()); ++nextMemorySlot; for (int j = 0; j < dsValue; ++j) { data[j + nextPosition] = "" + 0; } nextPosition += dsValue; } else { if (lineTemp[1].substring(0,2).equalsIgnoreCase("dc")) { if (lineTemp[1].trim().length() > 2) { data[nextPosition] = lineTemp[1].substring(3); } else { data[nextPosition] = "" + 0; } newSymbolTableLine[0] = lineTemp[0]; newSymbolTableLine[1] = "" + nextMemorySlot; symbolTable.set(i, newSymbolTableLine.clone()); ++nextMemorySlot; ++nextPosition; } } } } if (!defStdin.equals("")) { data[nextPosition] = "STDIN " + defStdin; ++nextPosition; } if (!defStdout.equals("")) { data[nextPosition] = "STDOUT " + defStdout; } // make new SymbolTable String[][] newSymbolTable = new String[symbolTable.size()][2]; for (int i = 0; i < newSymbolTable.length; ++i) { newSymbolTable[i] = (String[])symbolTable.get(i); } // prepare for the second round. codeMemoryLines = new MemoryLine[newCode.length]; compileDebugger.finalFirstPhase(newCode, data, newSymbolTable); return compileDebugger.lineCompiled(); } /** This function transforms any commands to binary and stores both forms in the code array, or sets any initial data values in the data array. It uses CompileConstants as its aid. @param line The line of code to process. @return A CompileInfo object describing what was done, or null if the second round and thus the compilation has been completed. */ private CompileInfo secondRoundProcess(String line) throws TTK91CompileException { /* Antti: 04.03.04 Do a pure binary translation first, then when all sections are complete, convert the binary to an integer. Needs variables for opcode(8bit), first operand(3 bit)(r0 to r7), m-part(memory format, direct, indirect or from code), possible index register (3 bit) and 16 bits for the address. Once STORE is converted to a 00000001 and the rest of the code processed we get 32bit binary that is the opcode from symbolic opcode. Antti 08.03.04 Teemu said that we should support the machine spec instead of Koksi with this one. No need to support opcodes like Muumuu LOAD R1, 100 kissa etc. Only tabs and extra spacing. So we need to support opcodes like LOAD R1, 100 but not codes like LOAD R1, =R2. Basic functionality: (Trim between each phase.) Check if there is a label (8 first are the meaningful ones also must have one non-number)) Convert opcode (8bit) check which register (0 to 7) =, Rj/addr or @ (00, 01 or 10) if addr(Ri) or Rj(Ri)(0 to 7) convert address (16bit) check if the rest is fine (empty or starts with ;) Store both formats to a data array (symbolic and binary). */ // check if variable is set! int addressAsInt = 0; int lineAsBinary; String comment; String[] symbolTableEntry; String[] lineTemp = parseLine(line); if (!lineTemp[4].equals("")) { try { addressAsInt = Integer.parseInt(lineTemp[4]); } catch (NumberFormatException e) { Object tempObject = symbolTable.get((((Integer)symbols.get(lineTemp[4]))).intValue()); symbolTableEntry = (String[])tempObject; if (symbolTableEntry[1].equals("")) { comment = new Message("").toString(); throw new TTK91CompileException(comment); } addressAsInt = Integer.parseInt((String)symbolTableEntry[1]); } } lineAsBinary = symbolicInterpreter.stringToBinary(lineTemp[1], lineTemp[2], lineTemp[3], addressAsInt + "", lineTemp[5]); compileDebugger.setBinary(lineAsBinary); codeMemoryLines[nextLine] = new MemoryLine(lineAsBinary, line); // comment String lineAsZerosAndOnes = symbolicInterpreter.intToBinary(lineAsBinary, 32); String binaryByPositions = symbolicInterpreter.binaryToInt(lineAsZerosAndOnes.substring(0, 8), true) + ":" + symbolicInterpreter.binaryToInt(lineAsZerosAndOnes.substring(8, 11), false) + ":" + symbolicInterpreter.binaryToInt(lineAsZerosAndOnes.substring(11, 13), false) + ":" + symbolicInterpreter.binaryToInt(lineAsZerosAndOnes.substring(13, 16), false) + ":" + symbolicInterpreter.binaryToInt(lineAsZerosAndOnes.substring(16), true); String[] commentParameters = {line, "" + lineAsBinary, binaryByPositions}; comment = new Message("{0} --> {1} ({2}) ", commentParameters).toString(); compileDebugger.setComment(comment); return compileDebugger.lineCompiled(); } /** This method parses a String and tries to find a label, opCode and all the other parts of a Command line. @param symbolicOpCode Symbolic form of an operation code. */ public String[] parseLine(String symbolicOpcode) { String label = ""; String opcode = ""; String firstRegister = ""; String addressingMode = ""; String secondRegister = ""; String address = ""; String[] parsedLine; String wordTemp = ""; int nextToCheck = 0; // for looping out the spacing int fieldEnd = 0; // searches the end of a field (' ', ',') boolean spaceBetweenMemorymodeAndAddress = false; fieldEnd = symbolicOpcode.indexOf(";"); if (fieldEnd != -1) { symbolicOpcode = symbolicOpcode.substring(0, fieldEnd); } symbolicOpcode = symbolicOpcode.replace('\t',' '); symbolicOpcode = symbolicOpcode.replace('', ' '); // Not stupid! symbolicOpcode = symbolicOpcode.toLowerCase(); symbolicOpcode = symbolicOpcode.trim(); if (symbolicOpcode.length() == 0) { parsedLine = new String[6]; for (int i = 0; i < parsedLine.length; ++i) parsedLine[i] = ""; return parsedLine; } String[] lineAsArray = symbolicOpcode.split("[ \t,]+"); int lineAsArrayIndex = 0; /* label */ wordTemp = lineAsArray[lineAsArrayIndex]; if (symbolicInterpreter.getOpcode(wordTemp) == -1) { if(!validLabelName(wordTemp)) return null; label = wordTemp; ++lineAsArrayIndex; } /* opcode */ if (lineAsArrayIndex < lineAsArray.length) { opcode = lineAsArray[lineAsArrayIndex]; ++lineAsArrayIndex; if (symbolicInterpreter.getOpcode(opcode) < 0) { return null; } } else { return null; } /*first register*/ if (lineAsArrayIndex < lineAsArray.length) { // first register might end with a ','. Not when push Sp etc. if (lineAsArray[lineAsArrayIndex].charAt( lineAsArray[lineAsArrayIndex].length() -1) == ',') { if (symbolicInterpreter.getRegisterId( lineAsArray[lineAsArrayIndex].substring(0, lineAsArray[lineAsArrayIndex].length() - 1) ) != -1) { firstRegister = lineAsArray[lineAsArrayIndex].substring(0, lineAsArray[lineAsArrayIndex].length() -1); ++lineAsArrayIndex; } } else { if (symbolicInterpreter.getRegisterId( lineAsArray[lineAsArrayIndex]) != -1) { firstRegister = lineAsArray[lineAsArrayIndex]; ++lineAsArrayIndex; } } } /* addressingMode */ if (lineAsArrayIndex < lineAsArray.length) { if (lineAsArray[lineAsArrayIndex].charAt(0) == '=' || lineAsArray[lineAsArrayIndex].charAt(0) == '@') { addressingMode = "" + lineAsArray[lineAsArrayIndex].charAt(0); if (lineAsArray[lineAsArrayIndex].length() == 1) { spaceBetweenMemorymodeAndAddress = true; ++lineAsArrayIndex; } } else { addressingMode = ""; } } /*address and second register*/ if (lineAsArrayIndex < lineAsArray.length) { if (lineAsArray[lineAsArrayIndex].indexOf("(") != -1) { if (lineAsArray[lineAsArrayIndex].indexOf(")") < lineAsArray[lineAsArrayIndex].indexOf("(")) { return null; } else { if (spaceBetweenMemorymodeAndAddress) { address = lineAsArray[lineAsArrayIndex].substring( 0, lineAsArray[lineAsArrayIndex].indexOf("(") ); } else { address = lineAsArray[lineAsArrayIndex].substring( addressingMode.length(), lineAsArray[lineAsArrayIndex].indexOf("(") ); } secondRegister = lineAsArray[lineAsArrayIndex].substring( lineAsArray[lineAsArrayIndex].indexOf("(") + 1, lineAsArray[lineAsArrayIndex].indexOf(")") ); if (symbolicInterpreter.getRegisterId(secondRegister) == -1) { return null; } } } else { if (spaceBetweenMemorymodeAndAddress) { address = lineAsArray[lineAsArrayIndex]; } else { address = lineAsArray[lineAsArrayIndex].substring(addressingMode.length()); } } ++lineAsArrayIndex; } if (symbolicInterpreter.getRegisterId(address) != -1) { secondRegister = address; address = ""; } if (lineAsArrayIndex < lineAsArray.length) { return null; } if (opcode.length() > 0) { if (opcode.charAt(0) == 'j' || opcode.charAt(0) == 'J') { // Opcode matches jneg/jzer/jpos or the negations // jnneg/jnzer/jnpos. if(opcode.toLowerCase().matches("j" + "n?" + "((neg)|(zer)|(pos))")) { if (firstRegister.equals("")) return null; } if (addressingMode.equals("=") || address.equals("")) return null; } else { if (opcode.equalsIgnoreCase("nop")) { // (do nothing) } else { if (opcode.equalsIgnoreCase("pop")) { if (addressingMode.equals("@") || addressingMode.equals("=") || !address.equals("")) return null; } else { if (opcode.equalsIgnoreCase("pushr") || opcode.equalsIgnoreCase("popr")) { if (firstRegister.equals("")) return null; } else { if (firstRegister.equals("") || (address.equals("") && secondRegister.equals(""))) return null; } } } } } if (addressingMode.equals("=") && address.equals("")) return null; if (opcode.equalsIgnoreCase("store") && address.equals("")) return null; if (opcode.equalsIgnoreCase("store") && addressingMode.equals("=")) return null; if (opcode.equals("") && (!label.equals("") || !firstRegister.equals("") || !addressingMode.equals("") || !address.equals("") || !secondRegister.equals(""))) { return null; } parsedLine = new String[6]; parsedLine[0] = label.trim(); parsedLine[1] = opcode.trim(); parsedLine[2] = firstRegister.trim(); parsedLine[3] = addressingMode.trim(); parsedLine[4] = address.trim(); parsedLine[5] = secondRegister.trim(); return parsedLine; } /** This function tries to find a compiler command from the line. Works much like parseLine but this time valid opcodes are DEF, EQU, DC and DS. @param line String representing one line from source code. @return String array with label in position 0, command in the position 1 and position 2 contains the parameter. */ public String[] parseCompilerCommandLine(String line) { int fieldEnd = 0; int nextToCheck = 0; String label = ""; String opcode = ""; String value = ""; int intValue; String[] parsedLine; /* preprosessing */ line = line.trim(); line = line.toLowerCase(); line = line.replace('\t',' '); fieldEnd = line.indexOf(";"); if (fieldEnd != -1) { line = line.substring(0, fieldEnd); } /* LABEL opcode value */ fieldEnd = line.indexOf(" "); if (fieldEnd == -1) { label = line.substring(nextToCheck); fieldEnd = line.length(); } else { label = line.substring(nextToCheck, fieldEnd); } nextToCheck = fieldEnd + 1; /* label OPCODE value */ if (nextToCheck < line.length()) { while (line.charAt(nextToCheck) == ' ') { ++nextToCheck; } fieldEnd = line.indexOf(' ', nextToCheck); if (fieldEnd == -1) { opcode = line.substring(nextToCheck); fieldEnd = line.length(); } else { opcode = line.substring(nextToCheck, fieldEnd); } if (!opcode.matches("((dc)|(ds)|(equ)|(def))")) { return null; } nextToCheck = fieldEnd; } /* label opcode VALUE */ if (nextToCheck < line.length()) { while (line.charAt(nextToCheck) == ' ') { ++nextToCheck; } value = line.substring(nextToCheck); if (opcode.equals("def")) { if (value.length() < 1) return null; } else { if (value.length() > 0) { try { intValue = Integer.parseInt(value); if (opcode.equalsIgnoreCase("ds") && intValue < 1) { return null; } } catch (NumberFormatException e) { return null; } } } } if (!opcode.equalsIgnoreCase("dc") && value.equals("")) return null; parsedLine = new String[3]; parsedLine[0] = label; parsedLine[1] = opcode; parsedLine[2] = value; return parsedLine; } /** This method tests whether a label name contains at least one non-number and consists of 0-9, A- and _. It does not check whether the label is in use already or if it is a reserved word. @param labelName The label name to test. @return True if the label consists of valid characters, false otherwise. */ private boolean validLabelName(String labelName) { // It must have one non-number. Valid characters are A-, 0-9 and _. // Test 1: the word contains one or more of the following: // a-z, A-Z, _, 0-9, , , in any order. // Test 2: the word also contains one non-number (class \D // means anything but 0-9) surrounded by any number of // any character. All these 'anything buts' and 'anys' are // also valid characters, since we check that in Test 1. if(labelName.matches("[\\w]+") && labelName.matches(".*\\D.*")) { return true; } return false; } }
package com.netcosports.flip; import android.content.Context; import android.content.res.Resources; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.LinearGradient; import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.Shader; import android.support.v4.view.ViewCompat; import android.util.AttributeSet; import android.view.View; import android.view.animation.AnimationUtils; public class FlipCountdownView extends View{ private int roundRectRadius = 4; private int middleLineHeight = 2; public FlipCountdownView(Context context) { super(context); init(null); } public FlipCountdownView(Context context, AttributeSet attrs) { super(context, attrs); init(attrs); } public FlipCountdownView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(attrs); } private Paint mPaint; private Paint mPaintBg; private Paint mPaintGradientTop; private Paint mPaintMiddle; private int numberOffset = 0; private int colorGradientTop; private void init(AttributeSet attrs) { Resources res = getContext().getResources(); int textColor, bgColor; float textSize; if(attrs != null) { TypedArray a = res.obtainAttributes(attrs, R.styleable.FlipCountdownView); textColor = a.getColor(R.styleable.FlipCountdownView_flipTextColor, res.getColor(R.color.flip_countdown_text)); bgColor = a.getColor(R.styleable.FlipCountdownView_flipBackgroundColor, res.getColor(R.color.flip_countdown_background)); textSize = a.getDimension(R.styleable.FlipCountdownView_flipTextSize, res.getDimension(R.dimen.flip_countdown_text_size)); a.recycle(); } else { textColor = res.getColor(R.color.flip_countdown_text); bgColor = res.getColor(R.color.flip_countdown_background); textSize = res.getDimension(R.dimen.flip_countdown_text_size); } roundRectRadius = res.getDimensionPixelSize(R.dimen.flip_countdown_round_rect_radius); middleLineHeight = res.getDimensionPixelSize(R.dimen.flip_countdown_middle_line_height); mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); mPaint.setColor(textColor); mPaint.setTextSize(textSize); mPaintBg = new Paint(Paint.ANTI_ALIAS_FLAG); mPaintBg.setColor(bgColor); mPaintBg.setStyle(Paint.Style.FILL); mPaintMiddle = new Paint(Paint.ANTI_ALIAS_FLAG); mPaintMiddle.setColor(Color.BLACK); mPaintMiddle.setAlpha(30); mPaintMiddle.setStrokeWidth(middleLineHeight); mPaintMiddle.setStyle(Paint.Style.STROKE); mPaintGradientTop = new Paint(Paint.ANTI_ALIAS_FLAG); colorGradientTop = res.getColor(R.color.flip_countdown_gradient); duration = res.getInteger(R.integer.flip_duration); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); mPaintGradientTop.setShader(new LinearGradient(0, 0, 0, getMeasuredHeight() / 2, new int[]{Color.TRANSPARENT, colorGradientTop}, new float[]{0, 1}, Shader.TileMode.REPEAT )); } private int mCurrentValue = -1; private int mValue = -1; public void setValue(int value) { if(value < 10 && value >= 0) { mValue = value; invalidate(); } } private float duration; public void setDuration(int duration) { this.duration = duration; } private long startAnimTimestamp = 0; @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); drawBgRect(canvas); if(mValue >= 0) { if(mCurrentValue == -1 || mCurrentValue == mValue) { mCurrentValue = mValue; drawNumber(canvas, mValue); } else if(mCurrentValue != mValue) { //animation in progress if(startAnimTimestamp == 0) { //start animation startAnimTimestamp = AnimationUtils.currentAnimationTimeMillis(); ViewCompat.postInvalidateOnAnimation(this); } else { float currentPercentage = (AnimationUtils.currentAnimationTimeMillis() - startAnimTimestamp) / duration; if(currentPercentage >= 1) { //animation finished mCurrentValue = mValue; startAnimTimestamp = 0; drawNumber(canvas, mCurrentValue); } else { //draw current state drawHalfUpperNumber(canvas, mValue); drawHalfUpperNumber(canvas, mCurrentValue, 1 - 2 * currentPercentage); drawHalfBottomNumber(canvas, mCurrentValue); drawHalfBottomNumber(canvas, mValue, 2 * (currentPercentage - 0.5f)); ViewCompat.postInvalidateOnAnimation(this); } } } } canvas.drawLine(0, getMeasuredHeight()/2, getMeasuredWidth(), getMeasuredHeight()/2, mPaintMiddle); } private Rect bounds = new Rect(); private void drawNumber(Canvas canvas, int value) { drawHalfBottomNumber(canvas, value); drawHalfUpperNumber(canvas, value); } private RectF rectF = new RectF(); private void drawHalfBottomNumber(Canvas canvas, int value) { drawHalfBottomNumber(canvas, value, 1); } private void drawHalfBottomNumber(Canvas canvas, int value, float percent) { String text = String.valueOf(value); mPaint.getTextBounds(text, 0, text.length(), bounds); canvas.save(); canvas.clipRect(0,getMeasuredHeight() / 2 + numberOffset /2,getMeasuredWidth(), getMeasuredHeight()); percent = getRealPercent(percent); canvas.scale(1, percent, 0, getMeasuredHeight() / 2); setColorFilter(percent); drawBgRect(canvas); float widthText = mPaint.measureText(text); canvas.drawText(text, (int)(getMeasuredWidth() / 2 - widthText / 2), getMeasuredHeight() / 2 + bounds.height() / 2, mPaint); canvas.restore(); } private void setColorFilter(float percent) { if(percent != 1) { PorterDuffColorFilter filter = new PorterDuffColorFilter(addAlphaPercentToColor((int) (80 - 80 * percent), Color.BLACK), PorterDuff.Mode.DARKEN); mPaintBg.setColorFilter(filter); } else { mPaintBg.setColorFilter(null); } } public static int addAlphaPercentToColor(int alphaPercent, int color) { return Color.argb(alphaPercent * 255 / 100, Color.red(color), Color.green(color), Color.blue(color)); } private void drawHalfUpperNumber(Canvas canvas, int value) { drawHalfUpperNumber(canvas, value, 1); } private void drawHalfUpperNumber(Canvas canvas, int value, float percent) { String text = String.valueOf(value); mPaint.getTextBounds(text, 0, text.length(), bounds); canvas.save(); canvas.clipRect(0,0,getMeasuredWidth(), getMeasuredHeight() / 2 - numberOffset / 2); percent = getRealPercent(percent); canvas.scale(1, percent, 0, getMeasuredHeight()/2); setColorFilter(percent); drawBgRect(canvas); float widthText = mPaint.measureText(text); canvas.drawText(text, (int)(getMeasuredWidth() / 2 - widthText / 2), getMeasuredHeight() / 2 + bounds.height() / 2, mPaint); canvas.restore(); } private void drawBgRect(Canvas canvas) { rectF.set(0, 0, getMeasuredWidth(), getMeasuredHeight()); canvas.drawRoundRect(rectF, roundRectRadius, roundRectRadius, mPaintBg); rectF.set(0,0,getMeasuredWidth(), getMeasuredHeight()/2); canvas.drawRoundRect(rectF, roundRectRadius, roundRectRadius, mPaintGradientTop); } private float getRealPercent(float percent) { if(percent > 1) percent = 1; else if(percent < 0) percent = 0; return percent; } }
package com.intellij.localvcs; import org.junit.Before; import org.junit.Test; public class SnapshotDirectoriesTest extends TestCase { // todo test boundary conditions private Snapshot s; @Before public void setUp() { s = new Snapshot(); } @Test public void testCeatingDirectory() { assertFalse(s.hasRevision(fn("dir"))); s.doCreateDirectory(fn("dir")); assertTrue(s.hasRevision(fn("dir"))); assertEquals(DirectoryEntry.class, s.getRevision(fn("dir")).getClass()); assertTrue(s.getRevision(fn("dir")).getChildren().isEmpty()); } @Test public void testFilesUnderDirectory() { s.doCreateDirectory(fn("dir")); s.doCreateFile(fn("dir/file"), ""); assertTrue(s.hasRevision(fn("dir"))); assertTrue(s.hasRevision(fn("dir/file"))); Entry dir = s.getRevision(fn("dir")); Entry file = s.getRevision(fn("dir/file")); assertEquals(1, dir.getChildren().size()); assertSame(file, dir.getChildren().get(0)); assertSame(dir, file.getParent()); } @Test public void testCreatingChildredForNonExistingDirectoryThrowsException() { try { s.doCreateFile(fn("dir/file"), ""); fail(); } catch (LocalVcsException e) { } try { s.doCreateDirectory(fn("dir1/dir2")); fail(); } catch (LocalVcsException e) { } } @Test public void testDeletingDirectory() { s.doCreateDirectory(fn("dir")); assertTrue(s.hasRevision(fn("dir"))); s.doDelete(fn("dir")); assertFalse(s.hasRevision(fn("dir"))); } @Test public void testDeletingSubdirectory() { s.doCreateDirectory(fn("dir1")); s.doCreateDirectory(fn("dir1/dir2")); assertTrue(s.hasRevision(fn("dir1"))); assertTrue(s.hasRevision(fn("dir1/dir2"))); s.doDelete(fn("dir1/dir2")); assertFalse(s.hasRevision(fn("dir1/dir2"))); assertTrue(s.hasRevision(fn("dir1"))); } @Test public void testDeletingDirectoryWithContent() { s.doCreateDirectory(fn("dir1")); s.doCreateDirectory(fn("dir1/dir2")); s.doDelete(fn("dir1")); assertFalse(s.hasRevision(fn("dir1/dir2"))); assertFalse(s.hasRevision(fn("dir1"))); } @Test public void testDeletingFilesUnderDirectory() { s.doCreateDirectory(fn("dir")); s.doCreateFile(fn("dir/file"), ""); assertTrue(s.hasRevision(fn("dir/file"))); s.doDelete(fn("dir/file")); assertFalse(s.hasRevision(fn("dir/file"))); } @Test public void testRenamingFilesUnderDirectory() { s.doCreateDirectory(fn("dir")); s.doCreateFile(fn("dir/file"), "content"); s.doRename(fn("dir/file"), "new file"); assertFalse(s.hasRevision(fn("dir/file"))); assertTrue(s.hasRevision(fn("dir/new file"))); assertEquals("content", s.getRevision(fn("dir/new file")).getContent()); } @Test public void testRenamingSubdirectories() { // todo //s.doCreateDirectory(fn("dir1")); //s.doCreateDirectory(fn("dir1/dir2")); //s.doCreateFile(fn("dir1/dir2/file"), null); //s.doRename(fn("dir1/dir2"), fn("new dir")); //assertFalse(s.hasRevision(fn("dir1/dir2"))); //assertFalse(s.hasRevision(fn("dir1/dir2/file"))); //assertTrue(s.hasRevision(fn("dir1/new dir"))); //assertTrue(s.hasRevision(fn("dir1/new dir/file"))); } @Test public void testApplyingAndRevertingDirectoryCreation() { s = s.apply(cs(new CreateDirectoryChange(fn("dir")))); assertTrue(s.hasRevision(fn("dir"))); s = s.revert(); assertFalse(s.hasRevision(fn("dir"))); } @Test public void testApplyingAndRevertingFileCreationUnderDirectory() { s = s.apply(cs(new CreateDirectoryChange(fn("dir")))); s = s.apply(cs(new CreateFileChange(fn("dir/file"), ""))); assertTrue(s.hasRevision(fn("dir/file"))); s = s.revert(); assertFalse(s.hasRevision(fn("dir/file"))); assertTrue(s.hasRevision(fn("dir"))); } }
package org.ocelotds.web; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.function.Predicate; import javax.enterprise.context.ApplicationScoped; import javax.websocket.Session; import org.ocelotds.web.ws.predicates.IsOpenAndDifferentPredicate; import org.ocelotds.web.ws.predicates.IsOpenPredicate; /** * * @author hhfrancois */ @ApplicationScoped public class SessionManager { Map<String, Collection<Session>> httpid_wss = new HashMap<>(); Map<String, String> wsid_httpid = new HashMap<>(); Predicate<Session> ISOPEN = new IsOpenPredicate(); public void linkWsToHttp(Session ws, String httpid) { if(ws != null && httpid != null) { Collection<Session> wss = getValidSessionsElseRemove(httpid, ISOPEN); wss.add(ws); wsid_httpid.put(ws.getId(), httpid); httpid_wss.put(httpid, wss); } } public void unlinkWs(String wsid) { if(wsid != null && wsid_httpid.containsKey(wsid)) { String httpid = wsid_httpid.remove(wsid); getValidSessionsElseRemove(httpid, new IsOpenAndDifferentPredicate(wsid)); } } /** * Return all sessions for httpid and for the predicate * if some session negate the predicate, its are removed * @param httpid * @param predicat * @return */ Collection<Session> getValidSessionsElseRemove(String httpid, Predicate<Session> predicat) { Collection<Session> wss = new ArrayList(); if(httpid_wss.containsKey(httpid)) { Collection<Session> befores = httpid_wss.get(httpid); for (Session before : befores) { if(predicat.test(before)) { wss.add(before); wsid_httpid.put(before.getId(), httpid); } else { wsid_httpid.remove(before.getId()); } } if(wss.isEmpty()) { httpid_wss.remove(httpid); } else { httpid_wss.put(httpid, wss); } } return wss; } public Collection<Session> getUserSessions(String httpid) { return Collections.unmodifiableCollection(getValidSessionsElseRemove(httpid, ISOPEN)); } }
package org.openlca.io.maps; import java.util.HashMap; import java.util.Map; import org.json.simple.parser.ParseException; import org.openlca.core.database.IDatabase; import org.openlca.core.database.MappingDao; import org.openlca.core.model.Mapping; import org.openlca.io.maps.content.AbstractMapContent; public abstract class AbstractMapper { protected MappingDao dao; protected Map<String, Mapping> importMap = new HashMap<>(); protected Map<String, Mapping> exportMap = new HashMap<>(); public AbstractMapper(IDatabase database) { dao = new MappingDao(database); } public boolean add(AbstractMapContent content) { Mapping mapping = new Mapping(); mapping.setForImport(content.isForImport()); mapping.setExternalContent(content.toJson()); mapping.setOlcaContent(content.getOlcaRefId()); mapping.setMappingType(content.getMapType()); if (addToMap(mapping, content.getMapType())) { dao.insert(mapping); return true; } else { System.err.println("Content already exist: " + content.toJson() + " : " + content.getOlcaRefId()); return false; } } private boolean addToMap(Mapping mapping, String mapType) { String key = null; if (mapping.isForImport()) { key = mapping.getExternalContent() + mapType; if (importMap.containsKey(key)) return false; importMap.put(key, mapping); } else { key = mapping.getOlcaContent() + mapType; if (exportMap.containsKey(key)) return false; exportMap.put(key, mapping); } return true; } protected void fillMap(String mapType) { for (Mapping mapping : dao.getAllForImport(mapType)) importMap.put(mapping.getExternalContent() + mapType, mapping); for (Mapping mapping : dao.getAllForExport(mapType)) exportMap.put(mapping.getOlcaContent() + mapType, mapping); } protected AbstractMapContent getForImport(AbstractMapContent content) { Mapping mapping = importMap .get(content.toJson() + content.getMapType()); if (mapping == null) return null; content.setForImport(true); content.setOlcaRefId(mapping.getOlcaContent()); return content; } protected AbstractMapContent getForExport(AbstractMapContent content, String olcaId) { Mapping mapping = exportMap.get(olcaId + content.getMapType()); if (mapping == null) return null; try { content.fromJson(mapping.getExternalContent()); } catch (ParseException e) { return null; } content.setOlcaRefId(mapping.getOlcaContent()); content.setForImport(false); return content; } }
package com.tapsterrock.mpx; import java.io.File; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.BufferedOutputStream; import java.io.FileOutputStream; import java.io.InputStream; import java.io.BufferedInputStream; import java.io.InputStreamReader; import java.io.FileInputStream; import java.util.Date; import java.util.Iterator; import java.util.LinkedList; import java.util.Collections; /** * This class encapsulates all functionality relating to creating, read * and writing MPX files and their constituent records. * * TODO Ensure that the underlying lists are returned unmodifyable */ public class MPXFile { /** * Default constructor. * * @throws MPXException if construction fails */ public MPXFile() throws MPXException { configure (); } /** * Copy constructor. WARNING: this provides a shallow copy only. * * @param file File to be copied */ public MPXFile (MPXFile file) { m_allResourceAssignments = file.m_allResourceAssignments; m_allResources = file.m_allResources; m_allTasks = file.m_allTasks; m_autoOutlineLevel = file.m_autoOutlineLevel; m_autoOutlineNumber = file.m_autoOutlineNumber; m_autoResourceID = file.m_autoResourceID; m_autoResourceUniqueID = file.m_autoResourceUniqueID; m_autoTaskID = file.m_autoTaskID; m_autoTaskUniqueID = file.m_autoTaskUniqueID; m_autoWBS = file.m_autoWBS; m_baseCalendars = file.m_baseCalendars; m_baseOutlineLevel = file.m_baseOutlineLevel; m_childTasks = file.m_childTasks; m_currencyFormat = file.m_currencyFormat; m_currencySettings = file.m_currencySettings; m_dateFormat = file.m_dateFormat; m_dateTimeSettings = file.m_dateTimeSettings; m_ddeOleClientLinks = file.m_ddeOleClientLinks; m_defaultSettings = file.m_defaultSettings; m_delimiter = file.m_delimiter; m_fileCreationRecord = file.m_fileCreationRecord; m_ignoreCurrencyThousandsSeparator = file.m_ignoreCurrencyThousandsSeparator; m_lastBaseCalendar = file.m_lastBaseCalendar; m_lastResource = file.m_lastResource; m_lastResourceAssignment = file.m_lastResourceAssignment; m_lastResourceCalendar = file.m_lastResourceCalendar; m_lastTask = file.m_lastTask; m_projectHeader = file.m_projectHeader; m_projectNames = file.m_projectNames; m_records = file.m_records; m_resourceID = file.m_resourceID; m_resourceModel = file.m_resourceModel; m_resourceTableDefinition = file.m_resourceTableDefinition; m_resourceUniqueID = file.m_resourceUniqueID; m_taskID = file.m_taskID; m_taskModel = file.m_taskModel; m_taskTableDefinition = file.m_taskTableDefinition; m_taskUniqueID = file.m_taskUniqueID; m_timeFormat = file.m_timeFormat; } /** * This constructor is the primary mechanism for reading an * existing MPX file. * * @param stream input stream * @throws MPXException if construction fails */ public MPXFile (InputStream stream) throws MPXException { configure (); read (stream); } /** * This constructor is provided as a convenience to allow a source * file path to be specified from which the contents of the MPX file * are read. * * @param path path of input file * @throws MPXException if construction fails */ public MPXFile (String path) throws MPXException { configure(); read (new File (path)); } /** * This constructor is provided as a convenience to allow a source * file to be specified from which the contents of the MPX file * are read. * * @param file input file object * @throws MPXException if construction fails */ public MPXFile (File file) throws MPXException { configure (); read (file); } /** * This method configures the basic MPX file. */ private void configure () { m_records.add (m_fileCreationRecord); m_records.add (m_currencySettings); m_records.add (m_defaultSettings); m_records.add (m_dateTimeSettings); m_records.add (m_projectHeader); } /** * Accessor method to retrieve the current file delimiter character. * * @return delimiter character */ public char getDelimiter() { return (m_delimiter); } /** * Modifier method used to set the delimiter character. * * @param delimiter delimiter character */ public void setDelimiter (char delimiter) { m_delimiter = delimiter; } /** * Underlying method used to read an MPX file from an input stream. * * @param is input stream * @throws MPXException if file read fails */ public void read (InputStream is) throws MPXException { try { // Test the header and extract the separator. If this is successful, // we reset the stream back as far as we can. The design of the // BufferedInputStream class means that we can't get back to character // zero, so the first record we will read will get "PX" rather than // "MPX" in the first field position. BufferedInputStream bis = new BufferedInputStream (is); byte[] data = new byte[4]; data[0] = (byte)bis.read(); bis.mark(1024); data[1] = (byte)bis.read(); data[2] = (byte)bis.read(); data[3] = (byte)bis.read(); if (data[0] != 'M' || data[1] != 'P' || data[2] != 'X') { throw new MPXException (MPXException.INVALID_FILE); } setDelimiter ((char)data[3]); bis.reset(); // Now process the file in full InputStreamReader reader = new InputStreamReader (bis); Tokenizer tk = new Tokenizer (reader); tk.setDelimiter(m_delimiter); Record record; String number; // Add the header record using a dummy value for the record number add ("999", new Record (this, tk)); // Read the remainder of the records while (true) { record = new Record (this, tk); number = record.getRecordNumber(); if (number == null) { break; } add (number, record); } // Ensure that the structure is consistent updateStructure(); } catch (IOException ex) { throw new MPXException (MPXException.READ_ERROR, ex); } } /** * This is a convenience method to read an MPX file * given a file name. * * @param file the file to be read. * @throws MPXException thrown if a file read error occurs */ public void read (String file) throws MPXException { try { FileInputStream fis = new FileInputStream (file); read (fis); fis.close(); } catch (IOException ex) { throw new MPXException (MPXException.READ_ERROR, ex); } } /** * This is a convenience method to read an MPX file * from a file object. * * @param file the file to be read. * @throws MPXException thrown if a file read error occurs */ public void read (File file) throws MPXException { try { FileInputStream fis = new FileInputStream (file); read (fis); fis.close(); } catch (IOException ex) { throw new MPXException (MPXException.READ_ERROR, ex); } } /** * This is a convenience method provided to allow an empty record * of a specified type to be added to the file. * * @param recordNumber type of record to be added * @return object representing the new record * @throws MPXException Thrown on parse errors */ private MPXRecord add (int recordNumber) throws MPXException { return (add (String.valueOf(recordNumber), Record.EMPTY_RECORD)); } /** * This method adds a new record of the specified type and populates * it with data read from an MPX file. * * @param recordNumber type of record to add * @param record data from MPX file * @return new object representing record from MPX file * @throws MPXException normally thrown on parsing errors */ private MPXRecord add (String recordNumber, Record record) throws MPXException { MPXRecord current = null; switch (Integer.parseInt (recordNumber)) { case Comments.RECORD_NUMBER: { current = new Comments (this, record); m_records.add (current); break; } case CurrencySettings.RECORD_NUMBER: { m_currencySettings.update (record); current = m_currencySettings; break; } case DefaultSettings.RECORD_NUMBER: { m_defaultSettings.update (record); current = m_defaultSettings; break; } case DateTimeSettings.RECORD_NUMBER: { m_dateTimeSettings.update (record); current = m_dateTimeSettings; break; } case BaseCalendar.RECORD_NUMBER: { if (m_baseCalendars.size() < MAX_BASE_CALENDARS) { m_lastBaseCalendar = new BaseCalendar (this, record); current = m_lastBaseCalendar; m_records.add (current); m_baseCalendars.add (current); } break; } case BaseCalendarHours.RECORD_NUMBER: { if (m_lastBaseCalendar != null) { current = m_lastBaseCalendar.addBaseCalendarHours (record); } break; } case BaseCalendarException.RECORD_NUMBER: { if (m_lastBaseCalendar != null) { current = m_lastBaseCalendar.addBaseCalendarException (record); } break; } case ProjectHeader.RECORD_NUMBER: { m_projectHeader.update (record); current = m_projectHeader; break; } case ResourceModel.RECORD_NUMBER_TEXT: { if (m_resourceTableDefinition == false && m_ignoreTextModel == false) { current = m_resourceModel; m_resourceModel.update (record, true); m_resourceTableDefinition=true; } break; } case ResourceModel.RECORD_NUMBER_NUMERIC: { if (m_resourceTableDefinition == false) { current = m_resourceModel; m_resourceModel.update (record, false); m_resourceTableDefinition=true; } break; } case Resource.RECORD_NUMBER: { if (m_allResources.size() < MAX_RESOURCES) { m_lastResource = new Resource (this, record); current = m_lastResource; m_records.add (current); m_allResources.add (current); } break; } case ResourceNotes.RECORD_NUMBER: { if (m_lastResource != null) { current = m_lastResource.addResourceNotes (record); } break; } case ResourceCalendar.RECORD_NUMBER: { if (m_lastResource != null) { m_lastResourceCalendar = m_lastResource.addResourceCalendar (record); current = m_lastResourceCalendar; } break; } case ResourceCalendarHours.RECORD_NUMBER: { if (m_lastResourceCalendar != null) { current = m_lastResourceCalendar.addResourceCalendarHours (record); } break; } case ResourceCalendarException.RECORD_NUMBER: { if (m_lastResourceCalendar != null) { current = m_lastResourceCalendar.addResourceCalendarException (record); } break; } case TaskModel.RECORD_NUMBER_TEXT: { if (m_taskTableDefinition == false && m_ignoreTextModel == false) { current = m_taskModel; m_taskModel.update (record, true); m_taskTableDefinition=true; } break; } case TaskModel.RECORD_NUMBER_NUMERIC: { if (m_taskTableDefinition == false) { current = m_taskModel; m_taskModel.update (record, false); m_taskTableDefinition=true; } break; } case Task.RECORD_NUMBER: { if (m_allTasks.size() < MAX_TASKS) { m_lastTask = new Task(this, record); current = m_lastTask; m_records.add (current); m_allTasks.add (current); int outlineLevel = m_lastTask.getOutlineLevelValue(); if (m_baseOutlineLevel == -1) { m_baseOutlineLevel = outlineLevel; } if (outlineLevel == m_baseOutlineLevel) { m_childTasks.add (m_lastTask); } else { if (m_childTasks.isEmpty() == true) { throw new MPXException (MPXException.INVALID_OUTLINE); } ((Task)m_childTasks.getLast()).addChildTask (m_lastTask, outlineLevel); } } break; } case TaskNotes.RECORD_NUMBER: { if (m_lastTask != null) { current = m_lastTask.addTaskNotes (record); } break; } case RecurringTask.RECORD_NUMBER: { if (m_lastTask != null) { current = m_lastTask.addRecurringTask (record); } break; } case ResourceAssignment.RECORD_NUMBER: { if (m_lastTask != null) { m_lastResourceAssignment = m_lastTask.addResourceAssignment (record); current = m_lastResourceAssignment; m_allResourceAssignments.add (m_lastResourceAssignment); } break; } case ResourceAssignmentWorkgroupFields.RECORD_NUMBER: { if (m_lastResourceAssignment != null) { current = m_lastResourceAssignment.addWorkgroupAssignment (record); } break; } case ProjectNames.RECORD_NUMBER: { if (m_projectNames < MAX_PROJECT_NAMES) { current = new ProjectNames (this, record); m_records.add (current); ++m_projectNames; } break; } case DdeOleClientLinks.RECORD_NUMBER: { if (m_ddeOleClientLinks < MAX_DDE_OLE) { current = new DdeOleClientLinks (this, record); m_records.add(current); m_ddeOleClientLinks++; } break; } case FileCreationRecord.RECORD_NUMBER: { current = getFileCreationRecord(); ((FileCreationRecord)current).setValues (record); break; } default: { throw new MPXException (MPXException.INVALID_RECORD); } } return (current); } /** * This method is provided to allow child tasks that have been created * programatically to be added as a record to the main file. * * @param task task created as a child of another task * @throws MPXException thrown when too many tasks are defined */ void addTask (Task task) throws MPXException { if (m_allTasks.size() == MAX_TASKS) { throw new MPXException (MPXException.MAXIMUM_RECORDS); } m_records.add (task); m_allTasks.add (task); } /** * This method allows a task to be added to the file programatically. * * @return new task object * @throws MPXException normally thrown on parse errors */ public Task addTask () throws MPXException { return ((Task)add(Task.RECORD_NUMBER)); } /** * This method is used to retrieve a list of all of the top level tasks * that are defined in this MPX file. * * @return list of tasks */ public LinkedList getChildTasks () { return (m_childTasks); } /** * This method is used to retrieve a list of all of the tasks * that are defined in this MPX file. * * @return list of all tasks */ public LinkedList getAllTasks () { return (m_allTasks); } /** * Method for accessing the Task Model * * @return task model */ TaskModel getTaskModel () { return (m_taskModel); } /** * Method for accessing the Resource Model * * @return resource model */ ResourceModel getResourceModel () { return (m_resourceModel); } /** * Used to set whether WBS numbers are automatically created. * * @param flag true if automatic WBS required. */ public void setAutoWBS (boolean flag) { m_autoWBS = flag; } /** * Used to set whether outline level numbers are automatically created. * * @param flag true if automatic outline level required. */ public void setAutoOutlineLevel (boolean flag) { m_autoOutlineLevel = flag; } /** * Used to set whether outline numbers are automatically created. * * @param flag true if automatic outline number required. */ public void setAutoOutlineNumber (boolean flag) { m_autoOutlineNumber = flag; } /** * Used to set whether the task unique ID field is automatically populated. * * @param flag true if automatic unique ID required. */ public void setAutoTaskUniqueID (boolean flag) { m_autoTaskUniqueID = flag; } /** * Used to set whether the task ID field is automatically populated. * * @param flag true if automatic ID required. */ public void setAutoTaskID (boolean flag) { m_autoTaskID = flag; } /** * Retrieve the flag that determines whether WBS is generated * automatically. * * @return boolean, default is false. */ public boolean getAutoWBS () { return (m_autoWBS); } /** * Retrieve the flag that determines whether outline level is generated * automatically. * * @return boolean, default is false. */ public boolean getAutoOutlineLevel () { return (m_autoOutlineLevel); } /** * Retrieve the flag that determines whether outline numbers are generated * automatically. * * @return boolean, default is false. */ public boolean getAutoOutlineNumber () { return (m_autoOutlineNumber); } /** * Retrieve the flag that determines whether the task unique ID * is generated automatically. * * @return boolean, default is false. */ public boolean getAutoTaskUniqueID () { return (m_autoTaskUniqueID); } /** * Retrieve the flag that determines whether the task ID * is generated automatically. * * @return boolean, default is false. */ public boolean getAutoTaskID () { return (m_autoTaskID); } /** * This method is used to retrieve the next unique ID for a task. * * @return next unique ID */ int getTaskUniqueID () { return (++m_taskUniqueID); } /** * This method is used to retrieve the next ID for a task. * * @return next ID */ int getTaskID () { return (++m_taskID); } /** * Used to set whether the resource unique ID field is automatically populated. * * @param flag true if automatic unique ID required. */ public void setAutoResourceUniqueID (boolean flag) { m_autoResourceUniqueID = flag; } /** * Used to set whether the resource ID field is automatically populated. * * @param flag true if automatic ID required. */ public void setAutoResourceID (boolean flag) { m_autoResourceID = flag; } /** * Retrieve the flag that determines whether the resource unique ID * is generated automatically. * * @return boolean, default is false. */ public boolean getAutoResourceUniqueID () { return (m_autoResourceUniqueID); } /** * This method sets the flag indicating that the text version of the * Task and Resource Table Definition records should be ignored. Ignoring * these records gets around the problem where MPX files have been generated * with incorrect taks or resource field names, but correct task or resource * field numbers in the numeric version of the record. * * @param flag Boolean flag */ public void setIgnoreTextModel (boolean flag) { m_ignoreTextModel = flag; } /** * Retrieves the flag indicating that the text version of the Task and * Resource Table Definition records should be ignored. * * @return Boolean flag */ public boolean getIgnoreTextModel () { return (m_ignoreTextModel); } /** * Retrieve the flag that determines whether the resource ID * is generated automatically. * * @return boolean, default is false. */ public boolean getAutoResourceID () { return (m_autoResourceID); } /** * This method is used to retrieve the next unique ID for a resource. * * @return next unique ID */ int getResourceUniqueID () { return (++m_resourceUniqueID); } /** * This method is used to retrieve the next ID for a resource. * * @return next ID */ int getResourceID () { return (++m_resourceID); } /** * Programatically add a new comment to the MPX file. * * @return new comment object * @throws MPXException normally thrown on parse errors */ public Comments addComments() throws MPXException { return ((Comments)add(Comments.RECORD_NUMBER)); } /** * Retrieves the file creation record. * * @return file creation record. */ public FileCreationRecord getFileCreationRecord () { return (m_fileCreationRecord); } /** * Retrieves the currency settings. * * @return currency settings */ public CurrencySettings getCurrencySettings () { return (m_currencySettings); } /** * Retrieves the default settings. * * @return default settings */ public DefaultSettings getDefaultSettings () { return (m_defaultSettings); } /** * Retrieves the date and time settings. * * @return date and time settings */ public DateTimeSettings getDateTimeSettings () { return (m_dateTimeSettings); } /** * This method is used to add a new base calendar to the file. * * @return new base calendar object * @throws MPXException normally thrown on parse errors */ public BaseCalendar addBaseCalendar () throws MPXException { return ((BaseCalendar)add(BaseCalendar.RECORD_NUMBER)); } /** * This is a convenience method used to add a base calendar called * "Standard" to the file, and populate it with a default working week * and default working hours * * @return a new default base calendar * @throws MPXException normally thrown when a parse error occurs */ public BaseCalendar addDefaultBaseCalendar () throws MPXException { BaseCalendar calendar = (BaseCalendar)add(BaseCalendar.RECORD_NUMBER); calendar.setName("Standard"); calendar.setWorkingDay(1, false); calendar.setWorkingDay(2, true); calendar.setWorkingDay(3, true); calendar.setWorkingDay(4, true); calendar.setWorkingDay(5, true); calendar.setWorkingDay(6, true); calendar.setWorkingDay(7, false); calendar.addDefaultBaseCalendarHours (); return (calendar); } /** * This method retrieves the list of base calendars defined in * this file. * * @return List of calendars */ public LinkedList getBaseCalendars () { return (m_baseCalendars); } /** * This method is used to retrieve the project header record. * * @return project header object */ public ProjectHeader getProjectHeader () { return (m_projectHeader); } /** * This method is used to add a new resource to the file. * * @return new resource object * @throws MPXException normally thrown on parse errors */ public Resource addResource () throws MPXException { return ((Resource)add(Resource.RECORD_NUMBER)); } /** * This method is used to retrieve a list of all of the resources * that are defined in this MPX file. * * @return list of all resources */ public LinkedList getAllResources () { return (m_allResources); } /** * This method is used to retrieve a list of all of the resource assignments * that are defined in this MPX file. * * @return list of all resources */ public LinkedList getAllResourceAssignments () { return (m_allResourceAssignments); } /** * This method is provided to allow resource assignments that have been created * programatically to be added as a record to the main file. * * @param assignment Resource assignment created as part of a task */ void addResourceAssignment (ResourceAssignment assignment) { m_allResourceAssignments.add (assignment); } /** * This method is used to add project names to the file. * * @return new project names object * @throws MPXException normally thrown on parse errors */ public ProjectNames addProjectNames() throws MPXException { return ((ProjectNames)add(ProjectNames.RECORD_NUMBER)); } /** * This method is used to add new dde/ole links to the file. * * @return new dde/ole links object * @throws MPXException normally thrown on parse errors */ public DdeOleClientLinks addDdeOleClientLinks() throws MPXException { return ((DdeOleClientLinks)add(DdeOleClientLinks.RECORD_NUMBER)); } /** * Retrieves the named base calendar. This method will return * null if the named base calendar is not located. * * @param calendarName name of the required base calendar * @return base calendar object */ public BaseCalendar getBaseCalendar (String calendarName) { BaseCalendar calendar = null; String name; Iterator iter = m_baseCalendars.iterator(); while (iter.hasNext() == true) { calendar = (BaseCalendar)iter.next(); name = calendar.getName(); if (name != null && name.equalsIgnoreCase(calendarName) == true) { break; } calendar = null; } return (calendar); } /** * This method writes each record in an MPX file to an output stream, via * the specified OutputStreamWriter. By providing the OutputStreamWriter * as an argument, the caller can control the character encoding used * when writing the file. * * @param w OutputStreamWriterinstance * @throws IOException thrown on failure to write to the output stream */ public void write (OutputStreamWriter w) throws IOException { Iterator iter = m_records.iterator(); while(iter.hasNext()) { w.write((iter.next()).toString()); } w.flush(); // Reset the model written flags to allow them to be written again m_taskModel.setWritten (false); m_resourceModel.setWritten (false); } /** * This method writes each record in the MPX file to an output stream. * Note that the default OutputStreamWriter is used, which may not * provide you with the character set encoding appropriate for the * data represented in the file. * * @param out destination output stream * @throws IOException thrown on failure to write to the output stream */ public void write (OutputStream out) throws IOException { write (new OutputStreamWriter (new BufferedOutputStream (out))); } /** * This is a convenience method provided to allow the contents of the MPX * file to be written to a file specified by the File object passed as * a parameter. * * @param out destination output file * @throws IOException thrown on failure to write to the file */ public void write (File out) throws IOException { FileOutputStream fos = new FileOutputStream (out); write (fos); fos.flush(); fos.close(); } /** * This is a convenience method provided to allow the contents of the MPX * file to be written to a file specified by the file name passed as * a parameter. * * @param file destination output file * @throws IOException thrown on failure to write to the file */ public void write (String file) throws IOException { FileOutputStream fos = new FileOutputStream (file); write (fos); fos.flush(); fos.close(); } /** * This method retrieves the time formatter. * * @return time formatter */ MPXTimeFormat getTimeFormat () { return (m_timeFormat); } /** * This method retrieves the date formatter. * * @return date formatter */ MPXDateFormat getDateFormat () { return (m_dateFormat); } /** * This method retrieves the currency formatter. * * @return currency formatter */ MPXNumberFormat getCurrencyFormat () { return (m_currencyFormat); } /** * Sets the flag that tells the library whether or not to * ignore the thousands separator specified in the currency format. * * @param ignore boolean flag */ public void setIgnoreCurrencyThousandsSeparator (boolean ignore) { m_ignoreCurrencyThousandsSeparator = ignore; } /** * Retrieves the flag that tells the library whether or not to * ignore the thousands separator specified in the currency format. * * @return boolean flag */ public boolean getIgnoreCurrencyThousandsSeparator () { return (m_ignoreCurrencyThousandsSeparator); } /** * This method is used to retrieve the number of child tasks associated * with this parent task. This method is used as part of the process * of automatically generating the WBS. * * @return Number of child tasks */ int getChildTaskCount () { return (m_childTasks.size()); } /** * This method is used to calculate the duration of work between two fixed * dates according to the work schedule defined in the named calendar. The * calendar used is the "Standard" calendar. If this calendar does not exist, * and exception will be thrown. * * @param startDate start of the period * @param endDate end of the period * @return new MPXDuration object * @throws MPXException normally when no Standard calendar is available */ public MPXDuration getDuration (Date startDate, Date endDate) throws MPXException { return (getDuration ("Standard", startDate, endDate)); } /** * This method is used to calculate the duration of work between two fixed * dates according to the work schedule defined in the named calendar. * The name of the calendar to be used is passed as an argument. * * @param calendarName name of the calendar to use * @param startDate start of the period * @param endDate end of the period * @return new MPXDuration object * @throws MPXException normally when no Standard calendar is available */ public MPXDuration getDuration (String calendarName, Date startDate, Date endDate) throws MPXException { BaseCalendar calendar = getBaseCalendar(calendarName); if (calendar == null) { throw new MPXException (MPXException.CALENDAR_ERROR + ": " + calendarName); } return (calendar.getDuration (startDate, endDate)); } /** * This method allows an arbitrary task to be retrieved based * on its ID field. * * @param id task identified * @return the requested task, or null if not found */ public Task getTaskByID (int id) { Task result = null; Iterator iter = m_allTasks.iterator(); Task task; int taskID; while (iter.hasNext() == true) { task = (Task)iter.next(); taskID = task.getIDValue(); if (taskID == id) { result = task; break; } } return (result); } /** * This method allows an arbitrary task to be retrieved based * on its UniqueID field. * * @param id task identified * @return the requested task, or null if not found */ public Task getTaskByUniqueID (int id) { Task result = null; Iterator iter = m_allTasks.iterator(); Task task; int taskID; while (iter.hasNext() == true) { task = (Task)iter.next(); taskID = task.getUniqueIDValue(); if (taskID == id) { result = task; break; } } return (result); } /** * This method allows an arbitrary resource to be retrieved based * on its ID field. * * @param id resource identified * @return the requested resource, or null if not found */ public Resource getResourceByID (int id) { Resource result = null; Iterator iter = m_allResources.iterator(); Resource resource; int resourceID; while (iter.hasNext() == true) { resource = (Resource)iter.next(); resourceID = resource.getIDValue(); if (resourceID == id) { result = resource; break; } } return (result); } /** * This method allows an arbitrary resource to be retrieved based * on its UniqueID field. * * @param id resource identified * @return the requested resource, or null if not found */ public Resource getResourceByUniqueID (int id) { Resource result = null; Iterator iter = m_allResources.iterator(); Resource resource; int resourceID; while (iter.hasNext() == true) { resource = (Resource)iter.next(); resourceID = resource.getUniqueIDValue(); if (resourceID == id) { result = resource; break; } } return (result); } /** * This method is used to recreate the hierarchical structure of the * MPX file from scratch. The method sorts the list of all tasks, * then iterates through it creating the parent-child structure defined * by the outline level field. */ protected void updateStructure () { if (m_allTasks.size() > 1) { Collections.sort (m_allTasks); m_childTasks.clear (); Task task; Task lastTask = null; Task parent; int level; int lastLevel = -1; Iterator iter = m_allTasks.iterator(); while (iter.hasNext() == true) { task = (Task)iter.next(); task.clearChildTasks (); level = task.getOutlineLevelValue(); parent = null; if (lastTask != null) { if (level == lastLevel) { parent = lastTask.getParentTask(); } else { if (level > lastLevel) { parent = lastTask; } else { while (level <= lastLevel) { parent = lastTask.getParentTask(); if (parent == null) { break; } lastLevel = parent.getOutlineLevelValue(); lastTask = parent; } } } } lastTask = task; lastLevel = level; if (getAutoWBS() == true) { task.generateWBS (parent); } if (getAutoOutlineNumber() == true) { task.generateOutlineNumber(parent); } if (parent == null) { m_childTasks.add (task); } else { parent.addChildTask (task); } } } } /** * Constant containing the end of line characters used in MPX files. * Note that this constant has package level access only. */ static final String EOL = "\r\n"; /** * Counter used to populate the unique ID field of a task */ private int m_taskUniqueID = 0; /** * Counter used to populate the ID field of a task */ private int m_taskID = 0; /** * Counter used to populate the unique ID field of a resource */ private int m_resourceUniqueID = 0; /** * Counter used to populate the ID field of a resource */ private int m_resourceID = 0; /** * List to maintain records in the order that they are added. */ private LinkedList m_records = new LinkedList(); /** * This list holds a reference to all resources defined in the * MPX file. */ private LinkedList m_allResources = new LinkedList (); /** * This list holds a reference to all tasks defined in the * MPX file. */ private LinkedList m_allTasks = new LinkedList (); /** * List holding references to the top level tasks * as defined by the outline level. */ private LinkedList m_childTasks = new LinkedList (); /** * This list holds a reference to all resource assignments defined in the * MPX file. */ private LinkedList m_allResourceAssignments = new LinkedList (); /** * List holding references to all base calendars. */ private LinkedList m_baseCalendars = new LinkedList (); /** * Date formatter. */ private MPXDateFormat m_dateFormat = new MPXDateFormat(); /** * Time formatter. */ private MPXTimeFormat m_timeFormat = new MPXTimeFormat (); /** * Currency formatter. */ private MPXNumberFormat m_currencyFormat = new MPXNumberFormat (); /** * File creation record. */ private FileCreationRecord m_fileCreationRecord = new FileCreationRecord (this); /** * Currency settings record. */ private CurrencySettings m_currencySettings = new CurrencySettings (this); /** * Default settings record. */ private DefaultSettings m_defaultSettings = new DefaultSettings (this); /** * Date and time settings record. */ private DateTimeSettings m_dateTimeSettings = new DateTimeSettings (this); /** * Project header record. */ private ProjectHeader m_projectHeader = new ProjectHeader (this); /** * Task model. */ private TaskModel m_taskModel = new TaskModel(this); /** * Resource model. */ private ResourceModel m_resourceModel = new ResourceModel(this); /** * Reference to the last task added to the file. */ private Task m_lastTask = null; /** * Reference to the last resource added to the file. */ private Resource m_lastResource = null; /** * Reference to the last resource calendar added to the file. */ private ResourceCalendar m_lastResourceCalendar = null; /** * Reference to the last resource assignment added to the file. */ private ResourceAssignment m_lastResourceAssignment = null; /** * Reference to the last base calendar added to the file. */ private BaseCalendar m_lastBaseCalendar = null; /** * Flag indicating the existence of a resource model record. */ private boolean m_resourceTableDefinition = false; /** * Flag indicating the existence of a task model record. */ private boolean m_taskTableDefinition = false; /** * Count of the number of project names. */ private int m_projectNames = 0; /** * Count of the number of dde/ole links. */ private int m_ddeOleClientLinks = 0; /** * Character to be used as delimiter throughout this file. */ private char m_delimiter = ','; /** * Indicating whether WBS value should be calculated on creation, or will * be manually set. */ private boolean m_autoWBS = false; /** * Indicating whether the Outline Level value should be calculated on * creation, or will be manually set. */ private boolean m_autoOutlineLevel = false; /** * Indicating whether the Outline Number value should be calculated on * creation, or will be manually set. */ private boolean m_autoOutlineNumber = false; /** * Indicating whether the unique ID of a task should be * calculated on creation, or will be manually set. */ private boolean m_autoTaskUniqueID = false; /** * Indicating whether the ID of a task should be * calculated on creation, or will be manually set. */ private boolean m_autoTaskID = false; /** * Indicating whether the unique ID of a resource should be * calculated on creation, or will be manually set. */ private boolean m_autoResourceUniqueID = false; /** * Indicating whether the ID of a resource should be * calculated on creation, or will be manually set. */ private boolean m_autoResourceID = false; /** * Flag indicating that the text form of the task model should be ignored. */ private boolean m_ignoreTextModel = false; /** * This member data is used to hold the outline level number of the * first outline level used in the MPX file. When data from * Microsoft Project is saved in MPX format, MSP creates an invisible * task with an outline level as zero, which acts as an umbrella * task for all of the other tasks defined in the file. This is not * a strict requirement, and an MPX file could be generated from another * source that only contains "visible" tasks that have outline levels * >= 1. */ private int m_baseOutlineLevel = -1; /** * Flag used to tell the library whether to use thousands separators when * reading and writing MPX files, or whether to ignore them. Microsoft * Project appears to ignore them when reading and writing files, so the * default value is true. * * @todo move this into the currency settings class? */ private boolean m_ignoreCurrencyThousandsSeparator = true; /** * Constant representing maximum number of BaseCalendars per MPX file. */ private static final int MAX_BASE_CALENDARS = 250; /** * Constant representing maximum number of Tasks per MPX file. */ private static final int MAX_TASKS = 9999; /** * Constant representing maximum number of ProjectNames per MPX file. */ private static final int MAX_PROJECT_NAMES = 500; /** * Constant representing maximum number of DdeOleClientLinks per MPX file. */ private static final int MAX_DDE_OLE = 500; /** * Constant representing maximum number of Resources per MPX file. */ private static final int MAX_RESOURCES = 9999; }
package org.bridgedb.tools.qc; import java.io.File; import java.io.OutputStream; import java.io.PrintStream; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.bridgedb.DataSource; import org.bridgedb.IDMapperException; import org.bridgedb.Xref; import org.bridgedb.bio.DataSourceTxt; import org.bridgedb.bio.Organism; import org.bridgedb.rdb.SimpleGdb; import org.bridgedb.rdb.SimpleGdbFactory; /** * Utility to do simple quality control on a BridgeDerby database. * Run with two parameters: [old database] and [new database] * Some basic comparisons will be done, which serves as a sanity check * that not suddenly a whole identifier system has gone missing. * <p> * The script produces a report on STDOUT (configurable), lines starting with "INFO" * are strictly informative, whereas lines starting with "WARNING" are * problems worth investigating further. Ideally there are no "WARNING" lines * in the report. */ public class BridgeQC { private final File oldDb; private final File newDb; private SimpleGdb oldGdb; private SimpleGdb newGdb; private PrintStream out; /** * Compares two Derby databases and reports the output * to STDOUT. * * @param f1 the original Derby database * @param f2 the new Derby database */ public BridgeQC(File f1, File f2) throws IDMapperException { this(f1, f2, System.out); } /** * Compares two Derby databases and reports the output * to the given {@link java.io.OutputStream}. * * @param f1 the original Derby database * @param f2 the new Derby database */ public BridgeQC(File f1, File f2, OutputStream out) throws IDMapperException { oldDb = f1; newDb = f2; this.out = new PrintStream(out); } Map<DataSource, Integer> oldSet = new HashMap<DataSource, Integer>(); Map<DataSource, Integer> newSet = new HashMap<DataSource, Integer>(); public void initDatabases() throws IDMapperException { String url1 = "jdbc:derby:jar:(" + oldDb + ")database"; oldGdb = SimpleGdbFactory.createInstance("old", url1); String url2 = "jdbc:derby:jar:(" + newDb + ")database"; newGdb = SimpleGdbFactory.createInstance("new", url2); } public void compareDataSources() throws IDMapperException { for (DataSource ds : oldGdb.getCapabilities().getSupportedSrcDataSources()) { int oldGenes = oldGdb.getGeneCount(ds); oldSet.put (ds, oldGenes); } for (DataSource ds : newGdb.getCapabilities().getSupportedSrcDataSources()) { int newGenes = newGdb.getGeneCount(ds); newSet.put (ds, newGenes); } // not in new for (DataSource ds : oldSet.keySet()) { if (!newSet.containsKey(ds)) { this.out.println ("WARNING: " + ds.getSystemCode() + " is only in old database"); } } // not in old for (DataSource ds : newSet.keySet()) { int newGenes = newSet.get(ds); if (newGenes == 0) { this.out.println ("WARNING: " + ds.getSystemCode() + " has 0 ids"); } if (!oldSet.containsKey(ds)) { this.out.println ("INFO: " + ds.getSystemCode() + " is only in new database"); this.out.printf ("INFO: Number of ids in %s: %d\n", ds.getSystemCode(), newGenes); } else { Set<String> oldIDs = new HashSet<String>(); for (Xref oldXref : oldGdb.getIterator(ds)) oldIDs.add(oldXref.getId()); Set<String> newIDs = new HashSet<String>(); for (Xref newXref : newGdb.getIterator(ds)) newIDs.add(newXref.getId()); // determine all new IDs Set<String> newGenesAdded = new HashSet<String>(); newGenesAdded.addAll(newIDs); newGenesAdded.removeAll(oldIDs); // determine all no longer existing (removed) IDs Set<String> genesRemoved = new HashSet<String>(); genesRemoved.addAll(oldIDs); genesRemoved.removeAll(newIDs); int oldGenes = oldSet.get(ds); double delta = (double)(newGenes - oldGenes) / (double)oldGenes; if (newGenesAdded.size() + genesRemoved.size() == 0) this.out.printf( "INFO: Number of ids in %s%s: %d (unchanged)\n", ds.getSystemCode(), (ds.getFullName() != null && ds.getFullName().length() > 0) ? " (" + ds.getFullName() + ")" : "", newGenes ); else this.out.printf( "INFO: Number of ids in %s%s: %d (%d added, %d removed -> overall changed %+3.1f%%)\n", ds.getSystemCode(), (ds.getFullName() != null && ds.getFullName().length() > 0) ? " (" + ds.getFullName() + ")" : "", newGenes, newGenesAdded.size(), genesRemoved.size(), (delta * 100) ); if (genesRemoved.size() > 0 && "true".equals(System.getProperty("showRemovedIDs", "false"))) this.out.printf( "INFO: The ids removed from %s%s: %s\n", ds.getSystemCode(), (ds.getFullName() != null && ds.getFullName().length() > 0) ? " (" + ds.getFullName() + ")" : "", "" + genesRemoved ); if (delta < -0.1) this.out.println ("WARNING: Number of ids in " + ds.getSystemCode() + " has shrunk by more than 10%"); } } } public void compareLinks() throws SQLException { Connection con = oldGdb.getConnection(); //TODO ... do something to compare cross-link consistency ... } public void checkDatabaseSanity() throws SQLException { Connection con = newGdb.getConnection(); Statement st = con.createStatement(); /** check for ids that occur in the link table but not in datanode table. We expect zero results */ String sql = "select coderight, idright from link left outer join datanode on link.idright = datanode.id and link.coderight = datanode.code where datanode.code IS NULL"; ResultSet rs = st.executeQuery(sql); if (rs.next()) { this.out.println ("ERROR: 'link' table contains ids that do not occur in 'datanode' table."); this.out.print ("ERROR: A few examples: "); String sep = ""; int i = 0; do { this.out.print (sep + rs.getString(1) + ":" + rs.getString(2)); sep = ", "; } while (rs.next() && ++i < 8); this.out.println(); this.out.println ("ERROR: These ids will not map properly."); } } public void compareFileSizes() throws SQLException { long oldSize = oldDb.length(); long newSize = newDb.length(); this.out.printf ("INFO: new size is %d Mb (changed %+3.1f%%)\n", newSize / 1000000, (double)(newSize - oldSize) / (double)oldSize * 100); } public void compareAttributes() throws IDMapperException { Set<String> oldAttrSet = oldGdb.getAttributeSet(); Set<String> newAttrSet = newGdb.getAttributeSet(); for (String oldAttr : oldAttrSet) { if (!newAttrSet.contains(oldAttr)) { this.out.println ("WARNING: Attribute " + oldAttr + " only in old database"); } } for (String newAttr : newAttrSet) { this.out.println ("INFO: Attribute provided: " + newAttr); if (!oldAttrSet.contains(newAttr)) { this.out.println ("INFO: Attribute " + newAttr + " only in new database"); } } } public static boolean safeEquals (Object a, Object b) { return a == null ? b == null : a.equals(b); } public interface PropertyChecker { abstract void check(String oldVal, String newVal, PrintStream out); } enum Props implements PropertyChecker { ORGANISM (true, false) { public void check(String oldVal, String newVal, PrintStream out) { if (newVal != null) { Organism o = Organism.fromLatinName(newVal); if (o == null) this.out.println ("WARNING: species '" + newVal + "' is not a recognized latin name"); } } }, DATASOURCENAME (true, true) { public void check(String oldVal, String newVal, PrintStream out) {} }, SERIES (true, true) { public void check(String oldVal, String newVal, PrintStream out) {} }, DATATYPE (true, true) { public void check(String oldVal, String newVal, PrintStream out) {} }, DATASOURCEVERSION (false, true) { public void check(String oldVal, String newVal, PrintStream out) {} }, BUILDDATE (false, true) { public void check(String oldVal, String newVal, PrintStream out) { SimpleDateFormat sft = new SimpleDateFormat("yyyyMMdd"); Date oldDate = null; Date newDate = null; try { if (oldVal != null) oldDate = sft.parse(oldVal); } catch (ParseException e) { this.out.println ("ERROR: " + oldVal + " does not match pattern yyyymmdd"); } try { if (newVal != null) newDate = sft.parse(newVal); } catch (ParseException e) { this.out.println ("ERROR: " + oldVal + " does not match pattern yyyymmdd"); } if (oldDate != null && newDate != null && oldDate.after(newDate)) { this.out.println ("ERROR: new date " + newVal + " is older than old date " + oldVal); } } }, SCHEMAVERSION (false, true) { public void check(String oldVal, String newVal, PrintStream out) {} }, ; private boolean mustBeSame; private boolean mustBeDefined; PrintStream out; Props(boolean mustBeSame, boolean mustBeDefined) { this.mustBeSame = mustBeSame; this.mustBeDefined = mustBeDefined; } public void checkWrap(String oldVal, String newVal) { if (mustBeSame && !safeEquals (oldVal, newVal)) this.out.println ("WARNING: old " + name() + " '" + oldVal + "' doesn\'t match new " + name() + " '" + newVal + "'"); if (mustBeDefined && (newVal == null || newVal.equals(""))) this.out.println ("WARNING: property " + name() + " is undefined"); check(oldVal, newVal, this.out); } } public void compareInfo() { for (Props p : Props.values()) { p.checkWrap(oldGdb.getCapabilities().getProperty(p.name()), newGdb.getCapabilities().getProperty(p.name())); } } public int countPrimary(DataSource ds)throws IDMapperException{ int countOfPrimary = 0; for (Xref xref : oldGdb.getIterator(ds)){ if (xref.isPrimary()){ countOfPrimary++; } } return countOfPrimary; } public int totalIds(DataSource ds)throws IDMapperException{ int countOfID = 0; for(Xref xref : oldGdb.getIterator(ds)){ countOfID++; } return countOfID; } public void run() throws IDMapperException, SQLException { initDatabases(); checkDatabaseSanity(); compareInfo(); compareDataSources(); compareLinks(); compareAttributes(); compareFileSizes(); summarizeOverallStats(); } private void summarizeOverallStats() throws IDMapperException { this.out.println("INFO: total number of identifiers is " + newGdb.getGeneCount()); this.out.println("INFO: total number of mappings is " + newGdb.getLinkCount()); for (DataSource ds : newGdb.getCapabilities().getSupportedSrcDataSources()) this.out.println("INFO: total number of primary ids in datasource" + ds + " are "+countPrimary(ds)); for (DataSource ds : newGdb.getCapabilities().getSupportedSrcDataSources()) this.out.println("INFO: total number of secondary ids in datasource" + ds + " are "+(countOfID(ds)-countPrimary(ds))); } public static void printUsage() { System.out.println ("Expected 2 arguments: <old database> <new database>"); } /** * @param args * @throws IDMapperException * @throws SQLException */ public static void main(String[] args) throws IDMapperException, SQLException { if (args.length != 2) { printUsage(); return; } BridgeQC main = new BridgeQC (new File(args[0]), new File(args[1])); DataSourceTxt.init(); main.run(); PatternChecker checker = new PatternChecker(); checker.run(new File(args[0])); } }
// Revision 1.1 1999-01-31 13:33:08+00 sm11td // Initial revision package Debrief.Wrappers; import java.awt.Color; import java.awt.Font; import java.awt.Point; import java.beans.IntrospectionException; import java.beans.MethodDescriptor; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.beans.PropertyDescriptor; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Enumeration; import java.util.Iterator; import java.util.List; import java.util.SortedSet; import java.util.TreeSet; import java.util.Vector; import Debrief.ReaderWriter.Replay.FormatTracks; import Debrief.Tools.Properties.TrackColorModePropertyEditor; import Debrief.Wrappers.DynamicTrackShapes.DynamicTrackShapeSetWrapper; import Debrief.Wrappers.DynamicTrackShapes.DynamicTrackShapeWrapper; import Debrief.Wrappers.Track.AbsoluteTMASegment; import Debrief.Wrappers.Track.CoreTMASegment; import Debrief.Wrappers.Track.DynamicInfillSegment; import Debrief.Wrappers.Track.LightweightTrackWrapper; import Debrief.Wrappers.Track.PlanningSegment; import Debrief.Wrappers.Track.RelativeTMASegment; import Debrief.Wrappers.Track.SplittableLayer; import Debrief.Wrappers.Track.TrackColorModeHelper; import Debrief.Wrappers.Track.TrackColorModeHelper.DeferredDatasetColorMode; import Debrief.Wrappers.Track.TrackColorModeHelper.TrackColorMode; import Debrief.Wrappers.Track.TrackSegment; import Debrief.Wrappers.Track.TrackWrapper_Support; import Debrief.Wrappers.Track.TrackWrapper_Support.SegmentList; import Debrief.Wrappers.Track.TrackWrapper_Test; import Debrief.Wrappers.Track.WormInHoleOffset; import MWC.GUI.BaseLayer; import MWC.GUI.CanvasType; import MWC.GUI.Defaults; import MWC.GUI.DynamicPlottable; import MWC.GUI.Editable; import MWC.GUI.FireExtended; import MWC.GUI.FireReformatted; import MWC.GUI.HasEditables.ProvidesContiguousElements; import MWC.GUI.Layer; import MWC.GUI.Layers; import MWC.GUI.MessageProvider; import MWC.GUI.PlainWrapper; import MWC.GUI.Plottable; import MWC.GUI.Plottables; import MWC.GUI.Plottables.IteratorWrapper; import MWC.GUI.Canvas.CanvasTypeUtilities; import MWC.GUI.Properties.FractionPropertyEditor; import MWC.GUI.Properties.LabelLocationPropertyEditor; import MWC.GUI.Properties.LineStylePropertyEditor; import MWC.GUI.Properties.LineWidthPropertyEditor; import MWC.GUI.Properties.NullableLocationPropertyEditor; import MWC.GUI.Shapes.DraggableItem; import MWC.GUI.Shapes.HasDraggableComponents; import MWC.GUI.Shapes.TextLabel; import MWC.GUI.Shapes.Symbols.SymbolFactoryPropertyEditor; import MWC.GUI.Shapes.Symbols.SymbolScalePropertyEditor; import MWC.GUI.Shapes.Symbols.Vessels.WorldScaledSym; import MWC.GenericData.Duration; import MWC.GenericData.HiResDate; import MWC.GenericData.TimePeriod; import MWC.GenericData.Watchable; import MWC.GenericData.WatchableList; import MWC.GenericData.WorldArea; import MWC.GenericData.WorldDistance; import MWC.GenericData.WorldDistance.ArrayLength; import MWC.GenericData.WorldLocation; import MWC.GenericData.WorldSpeed; import MWC.GenericData.WorldVector; import MWC.TacticalData.Fix; import MWC.Utilities.Errors.Trace; import MWC.Utilities.TextFormatting.FormatRNDateTime; /** * the TrackWrapper maintains the GUI and data attributes of the whole track iteself, but the * responsibility for the fixes within the track are demoted to the FixWrapper */ public class TrackWrapper extends LightweightTrackWrapper implements WatchableList, DraggableItem, HasDraggableComponents, ProvidesContiguousElements, ISecondaryTrack, DynamicPlottable { // member variables /** * class containing editable details of a track */ public final class trackInfo extends Editable.EditorType implements Editable.DynamicDescriptors { /** * constructor for this editor, takes the actual track as a parameter * * @param data * track being edited */ public trackInfo(final TrackWrapper data) { super(data, data.getName(), ""); } @Override public final MethodDescriptor[] getMethodDescriptors() { // just add the reset color field first final Class<TrackWrapper> c = TrackWrapper.class; final MethodDescriptor[] _methodDescriptors = new MethodDescriptor[] {method(c, "exportThis", null, "Export Shape"), method(c, "resetLabels", null, "Reset DTG Labels"), method(c, "calcCourseSpeed", null, "Generate calculated Course and Speed")}; return _methodDescriptors; } @Override public final String getName() { return super.getName(); } @Override public final PropertyDescriptor[] getPropertyDescriptors() { try { final PropertyDescriptor[] _coreDescriptors = new PropertyDescriptor[] {displayExpertLongProp("SymbolType", "Snail symbol type", "the type of symbol plotted for this label", FORMAT, SymbolFactoryPropertyEditor.class), displayExpertLongProp( "LineThickness", "Line thickness", "the width to draw this track", FORMAT, LineWidthPropertyEditor.class), expertProp("Name", "the track name"), displayExpertProp("InterpolatePoints", "Interpolate points", "whether to interpolate points between known data points", SPATIAL), expertProp("Color", "the track color", FORMAT), displayExpertProp("EndTimeLabels", "Start/End time labels", "Whether to label track start/end with 6-figure DTG", VISIBILITY), displayExpertProp( "PlotArrayCentre", "Plot array centre", "highlight the sensor array centre when non-zero array length provided", VISIBILITY), displayExpertProp("TrackFont", "Track font", "the track label font", FORMAT), displayExpertProp( "NameVisible", "Name visible", "show the track label", VISIBILITY), displayExpertProp("PositionsVisible", "Positions visible", "show individual Positions", VISIBILITY), displayExpertProp( "NameAtStart", "Name at start", "whether to show the track name at the start (or end)", VISIBILITY), displayExpertProp("LinkPositions", "Link positions", "whether to join the track points", VISIBILITY), expertProp("Visible", "whether the track is visible", VISIBILITY), displayExpertLongProp("NameLocation", "Name location", "relative location of track label", FORMAT, MWC.GUI.Properties.NullableLocationPropertyEditor.class), displayExpertLongProp("LabelFrequency", "Label frequency", "the label frequency", TEMPORAL, MWC.GUI.Properties.TimeFrequencyPropertyEditor.class), displayExpertLongProp("ResampleDataAt", "Resample data at", "the data sample rate", TEMPORAL, MWC.GUI.Properties.TimeFrequencyPropertyEditor.class), displayExpertLongProp("ArrowFrequency", "Arrow frequency", "the direction marker frequency", TEMPORAL, MWC.GUI.Properties.TimeFrequencyPropertyEditor.class), displayExpertLongProp("SymbolFrequency", "Symbol frequency", "the symbol frequency", TEMPORAL, MWC.GUI.Properties.TimeFrequencyPropertyEditor.class), displayProp("CustomTrailLength", "Custom Snail Trail", "to specify a custom snail trail length", Editable.EditorType.TEMPORAL), displayExpertLongProp( "CustomVectorStretch", "Custom Vector Stretch", "to specify a custom snail vector stretch", Editable.EditorType.TEMPORAL, FractionPropertyEditor.class), displayExpertLongProp("LineStyle", "Line style", "the line style used to join track points", FORMAT, MWC.GUI.Properties.LineStylePropertyEditor.class)}; PropertyDescriptor[] res; // SPECIAL CASE: if we have a world scaled symbol, provide // editors for // the symbol size final TrackWrapper item = (TrackWrapper) this.getData(); if (item._theSnailShape instanceof WorldScaledSym) { // yes = better create height/width editors final PropertyDescriptor[] _coreDescriptorsWithSymbols = new PropertyDescriptor[_coreDescriptors.length + 2]; System.arraycopy(_coreDescriptors, 0, _coreDescriptorsWithSymbols, 2, _coreDescriptors.length); _coreDescriptorsWithSymbols[0] = displayExpertProp("SymbolLength", "Snail symbol length", "Length of snail symbol", FORMAT); _coreDescriptorsWithSymbols[1] = displayExpertProp("SymbolWidth", "Snail symbol width", "Width of snail symbol", FORMAT); // and now use the new value res = _coreDescriptorsWithSymbols; } else { // yes = better create height/width editors final PropertyDescriptor[] _coreDescriptorsWithSymbols = new PropertyDescriptor[_coreDescriptors.length + 1]; System.arraycopy(_coreDescriptors, 0, _coreDescriptorsWithSymbols, 1, _coreDescriptors.length); _coreDescriptorsWithSymbols[0] = displayExpertLongProp("SnailSymbolSize", "Snail symbol size", "Size of symbol", FORMAT, SymbolScalePropertyEditor.class); // and now use the new value res = _coreDescriptorsWithSymbols; } // TRACK COLORING HANDLING final List<TrackColorMode> datasets = getTrackColorModes(); if (datasets.size() > 0) { // store the datasets TrackColorModePropertyEditor.setCustomModes(datasets); final List<PropertyDescriptor> tmpList = new ArrayList<PropertyDescriptor>(); tmpList.addAll(Arrays.asList(res)); // insert the editor tmpList.add(displayExpertLongProp("TrackColorMode", "Track Coloring Mode", "the mode in which to color the track", FORMAT, TrackColorModePropertyEditor.class)); // ok. if we're in a measuremd mode, it may have a mode selector res = tmpList.toArray(res); // NOTE: this info class to implement Editable.DynamicDescriptors // to avoid these descriptors being cached } return res; } catch (final IntrospectionException e) { return super.getPropertyDescriptors(); } } } /** * utility class to let us iterate through all positions without having to copy/paste them into a * new object * * @author Ian * */ public static class WrappedIterators implements Enumeration<Editable> { /** * special class, used when we don't contain any data * * @author Ian * */ private static class EmptyIterator implements Enumeration<Editable> { @Override public boolean hasMoreElements() { return false; } @Override public Editable nextElement() { return null; } } private final List<Enumeration<Editable>> lists = new ArrayList<>(); private int currentList = 0; private Enumeration<Editable> currentIter; private Editable current; private Editable previous; public WrappedIterators() { currentIter = null; } public WrappedIterators(final SegmentList segments) { final Enumeration<Editable> ele = segments.elements(); while (ele.hasMoreElements()) { final TrackSegment seg = (TrackSegment) ele.nextElement(); lists.add(seg.elements()); } // if we have some data, return the first. Else, return an // empty iterator currentIter = lists.isEmpty() ? new EmptyIterator() : this.lists.get(0); } public void add(final Enumeration<MWC.GUI.Editable> item) { lists.add(item); if (currentIter == null) { currentIter = lists.get(0); } } public Editable currentElement() { return current; } @Override public boolean hasMoreElements() { while (currentList < lists.size() - 1 && !currentIter.hasMoreElements()) { currentList++; currentIter = lists.get(currentList); } return currentIter.hasMoreElements(); } @Override public Editable nextElement() { while (currentList < lists.size() - 1 && !currentIter.hasMoreElements()) { currentList++; currentIter = lists.get(currentList); } // cache the previous value previous = current; // cache the current value current = currentIter.nextElement(); return current; } public Editable previousElement() { return previous; } } private static final String SOLUTIONS_LAYER_NAME = "Solutions"; public static final String SENSORS_LAYER_NAME = "Sensors"; public static final String DYNAMIC_SHAPES_LAYER_NAME = "Dynamic Shapes"; /** * keep track of versions - version id */ static final long serialVersionUID = 1; private static String checkTheyAreNotOverlapping(final Editable[] subjects) { // first, check they don't overlap. // start off by collecting the periods final TimePeriod[] _periods = new TimePeriod.BaseTimePeriod[subjects.length]; for (int i = 0; i < subjects.length; i++) { final Editable editable = subjects[i]; TimePeriod thisPeriod = null; if (editable instanceof TrackWrapper) { final TrackWrapper tw = (TrackWrapper) editable; thisPeriod = new TimePeriod.BaseTimePeriod(tw.getStartDTG(), tw .getEndDTG()); } else if (editable instanceof TrackSegment) { final TrackSegment ts = (TrackSegment) editable; thisPeriod = new TimePeriod.BaseTimePeriod(ts.startDTG(), ts.endDTG()); } _periods[i] = thisPeriod; } // now test them. String failedMsg = null; for (int i = 0; i < _periods.length; i++) { final TimePeriod timePeriod = _periods[i]; for (int j = 0; j < _periods.length; j++) { final TimePeriod timePeriod2 = _periods[j]; // check it's not us if (timePeriod2 != timePeriod) { if (timePeriod.overlaps(timePeriod2)) { failedMsg = "'" + subjects[i].getName() + "' and '" + subjects[j] .getName() + "'"; break; } } } } return failedMsg; } /** * * @param newTrack * @param reference * Note: these parameters are tested here * @see TrackWrapper_Test#testTrackMerge1() */ private static void copyStyling(final TrackWrapper newTrack, final TrackWrapper reference) { // Note: see link in javadoc for where these are tested newTrack.setSymbolType(reference.getSymbolType()); newTrack.setSymbolWidth(reference.getSymbolWidth()); newTrack.setSymbolLength(reference.getSymbolLength()); newTrack.setSymbolColor(reference.getSymbolColor()); } private static void duplicateFixes(final SegmentList newSeg2, final TrackSegment target, final Color infillShade) { final Enumeration<Editable> segs = newSeg2.elements(); while (segs.hasMoreElements()) { final TrackSegment segment = (TrackSegment) segs.nextElement(); if (segment instanceof CoreTMASegment) { final CoreTMASegment ct = (CoreTMASegment) segment; final TrackSegment newSeg = new TrackSegment(ct); duplicateFixes(newSeg, target, infillShade); } else { duplicateFixes(segment, target, infillShade); } } } private static void duplicateFixes(final TrackSegment source, final TrackSegment target, final Color infillShade) { // are we an infill? final boolean isInfill = source instanceof DynamicInfillSegment; // ok, retrieve the points in the track segment final Enumeration<Editable> tsPts = source.elements(); while (tsPts.hasMoreElements()) { final FixWrapper existingFW = (FixWrapper) tsPts.nextElement(); final Fix existingFix = existingFW.getFix(); final Fix newFix = existingFix.makeCopy(); final FixWrapper newF = new FixWrapper(newFix); if (infillShade != null && isInfill) { newF.setColor(infillShade); } // also duplicate the label newF.setLabel(existingFW.getLabel()); target.addFix(newF); } } /** * put the other objects into this one as children * * @param wrapper * whose going to receive it * @param theLayers * the top level layers object * @param parents * the track wrapppers containing the children * @param subjects * the items to insert. */ public static void groupTracks(final TrackWrapper target, final Layers theLayers, final Layer[] parents, final Editable[] subjects) { // ok, loop through the subjects, adding them onto the target for (int i = 0; i < subjects.length; i++) { final Layer thisL = (Layer) subjects[i]; final TrackWrapper thisP = (TrackWrapper) parents[i]; if (thisL != target) { // is it a plain segment? if (thisL instanceof TrackWrapper) { // pass down through the positions/segments final Enumeration<Editable> pts = thisL.elements(); while (pts.hasMoreElements()) { final Editable obj = pts.nextElement(); if (obj instanceof SegmentList) { final SegmentList sl = (SegmentList) obj; final Enumeration<Editable> segs = sl.elements(); while (segs.hasMoreElements()) { final TrackSegment ts = (TrackSegment) segs.nextElement(); // reset the name if we need to if (ts.getName().startsWith("Posi")) { ts.setName(FormatRNDateTime.toString(ts.startDTG().getDate() .getTime())); } target.add(ts); } } else { if (obj instanceof TrackSegment) { final TrackSegment ts = (TrackSegment) obj; // reset the name if we need to if (ts.getName().startsWith("Posi")) { ts.setName(FormatRNDateTime.toString(ts.startDTG().getDate() .getTime())); } // and remember it target.add(ts); } } } } else { // get it's data, and add it to the target target.add(thisL); } // and remove the layer from it's parent if (thisL instanceof TrackSegment) { thisP.removeElement(thisL); // does this just leave an empty husk? if (thisP.numFixes() == 0) { // may as well ditch it anyway theLayers.removeThisLayer(thisP); } } else { // we'll just remove it from the top level layer theLayers.removeThisLayer(thisL); } } } } /** * perform a merge of the supplied tracks. * * @param recipient * the final recipient of the other items * @param theLayers * @param parents * the parent tracks for the supplied items * @param subjects * the actual selected items * @param _newName * name to give to the merged object * @return sufficient information to undo the merge */ public static int mergeTracks(final TrackWrapper newTrack, final Layers theLayers, final Editable[] subjects, final Color infillShade) { // check that the legs don't overlap final String failedMsg = checkTheyAreNotOverlapping(subjects); // how did we get on? if (failedMsg != null) { MessageProvider.Base.Provider.show("Merge tracks", "Sorry, " + failedMsg + " overlap in time. Please correct this and retry", MessageProvider.ERROR); return MessageProvider.ERROR; } // ok, loop through the subjects, adding them onto the target for (int i = 0; i < subjects.length; i++) { final Layer thisL = (Layer) subjects[i]; // is it a plain segment? if (thisL instanceof TrackWrapper) { // is this the first one? If so, we'll copy the symbol setup if (i == 0) { final TrackWrapper track = (TrackWrapper) thisL; copyStyling(newTrack, track); } // pass down through the positions/segments final Enumeration<Editable> pts = thisL.elements(); while (pts.hasMoreElements()) { final Editable obj = pts.nextElement(); if (obj instanceof SegmentList) { final SegmentList sl = (SegmentList) obj; final TrackSegment newT = new TrackSegment(TrackSegment.ABSOLUTE); duplicateFixes(sl, newT, infillShade); newTrack.add(newT); } else if (obj instanceof TrackSegment) { final TrackSegment ts = (TrackSegment) obj; // ok, duplicate the fixes in this segment final TrackSegment newT = new TrackSegment(TrackSegment.ABSOLUTE); duplicateFixes(ts, newT, infillShade); // and add it to the new track newTrack.append(newT); } } } else if (thisL instanceof TrackSegment) { final TrackSegment ts = (TrackSegment) thisL; // ok, duplicate the fixes in this segment final TrackSegment newT = new TrackSegment(ts.getPlotRelative()); duplicateFixes(ts, newT, infillShade); // and add it to the new track newTrack.append(newT); // is this the first one? If so, we'll copy the symbol setup if (i == 0) { final TrackWrapper track = ts.getWrapper(); copyStyling(newTrack, track); } } else if (thisL instanceof SegmentList) { final SegmentList sl = (SegmentList) thisL; // is this the first one? If so, we'll copy the symbol setup if (i == 0) { final TrackWrapper track = sl.getWrapper(); copyStyling(newTrack, track); } // it's absolute, since merged tracks are always // absolute final TrackSegment newT = new TrackSegment(TrackSegment.ABSOLUTE); // ok, duplicate the fixes in this segment duplicateFixes(sl, newT, infillShade); // and add it to the new track newTrack.append(newT); } } // and store the new track theLayers.addThisLayer(newTrack); return MessageProvider.OK; } /** * perform a merge of the supplied tracks. * * @param target * the final recipient of the other items * @param theLayers * @param parents * the parent tracks for the supplied items * @param subjects * the actual selected items * @return sufficient information to undo the merge */ public static int mergeTracksInPlace(final Editable target, final Layers theLayers, final Layer[] parents, final Editable[] subjects) { // where we dump the new data points Layer receiver = (Layer) target; // check that the legs don't overlap final String failedMsg = checkTheyAreNotOverlapping(subjects); // how did we get on? if (failedMsg != null) { MessageProvider.Base.Provider.show("Merge tracks", "Sorry, " + failedMsg + " overlap in time. Please correct this and retry", MessageProvider.ERROR); return MessageProvider.ERROR; } // right, if the target is a TMA track, we have to change it into a // proper // track, since // the merged tracks probably contain manoeuvres if (target instanceof CoreTMASegment) { final CoreTMASegment tma = (CoreTMASegment) target; final TrackSegment newSegment = new TrackSegment(tma); // now do some fancy footwork to remove the target from the wrapper, // and // replace it with our new segment newSegment.getWrapper().removeElement(target); newSegment.getWrapper().add(newSegment); // store the new segment into the receiver receiver = newSegment; } // ok, loop through the subjects, adding them onto the target for (int i = 0; i < subjects.length; i++) { final Layer thisL = (Layer) subjects[i]; final TrackWrapper thisP = (TrackWrapper) parents[i]; // is this the target item (note we're comparing against the item // passed // in, not our // temporary receiver, since the receiver may now be a tracksegment, // not a // TMA segment if (thisL != target) { // is it a plain segment? if (thisL instanceof TrackWrapper) { // pass down through the positions/segments final Enumeration<Editable> pts = thisL.elements(); while (pts.hasMoreElements()) { final Editable obj = pts.nextElement(); if (obj instanceof SegmentList) { final SegmentList sl = (SegmentList) obj; final Enumeration<Editable> segs = sl.elements(); while (segs.hasMoreElements()) { final TrackSegment ts = (TrackSegment) segs.nextElement(); receiver.add(ts); } } else { final Layer ts = (Layer) obj; receiver.append(ts); } } } else { // get it's data, and add it to the target receiver.append(thisL); } // and remove the layer from it's parent if (thisL instanceof TrackSegment) { thisP.removeElement(thisL); // does this just leave an empty husk? if (thisP.numFixes() == 0) { // may as well ditch it anyway theLayers.removeThisLayer(thisP); } } else { // we'll just remove it from the top level layer theLayers.removeThisLayer(thisL); } } } return MessageProvider.OK; } /** * whether to interpolate points in this track */ private boolean _interpolatePoints = false; /** * the end of the track to plot the label */ private boolean _LabelAtStart = true; /** * whether to show a time label at the start/end of the track * */ private boolean _endTimeLabels = true; /** * the style of this line * */ private int _lineStyle = CanvasType.SOLID; /** * whether or not to link the Positions */ private boolean _linkPositions; /** * whether to show a highlight for the array centre * */ private boolean _plotArrayCentre; /** * our editable details */ protected transient Editable.EditorType _myEditor = null; /** * keep a list of points waiting to be plotted * */ transient private int[] _myPts; /** * the sensor tracks for this vessel */ final private BaseLayer _mySensors; /** * the dynamic shapes for this vessel */ final private BaseLayer _myDynamicShapes; /** * the TMA solutions for this vessel */ final private BaseLayer _mySolutions; /** * keep track of how far we are through our array of points * */ transient private int _ptCtr = 0; /** * the list of wrappers we hold */ protected SegmentList _theSegments; /** * flag for if there is a pending update to track - particularly if it's a relative one */ private boolean _relativeUpdatePending = false; // member functions transient private FixWrapper _lastFix; /** * working parameters */ transient private WorldArea _myWorldArea; transient private final PropertyChangeListener _locationListener; transient private PropertyChangeListener _childTrackMovedListener; private Duration _customTrailLength = null; private Double _customVectorStretch = null; /** * how to shade the track * */ private TrackColorModeHelper.TrackColorMode _trackColorMode = TrackColorModeHelper.LegacyTrackColorModes.PER_FIX; /** * cache the position iterator we last used. this prevents us from having to restart at the * beginning when getNearestTo() is being called repetitively */ private transient WrappedIterators _lastPosIterator; // constructors /** * Wrapper for a Track (a series of position fixes). It combines the data with the formatting * details */ public TrackWrapper() { _mySensors = new SplittableLayer(true); _mySensors.setName(SENSORS_LAYER_NAME); _myDynamicShapes = new SplittableLayer(true); _myDynamicShapes.setName(DYNAMIC_SHAPES_LAYER_NAME); _mySolutions = new BaseLayer(true); _mySolutions.setName(SOLUTIONS_LAYER_NAME); // create a property listener for when fixes are moved _locationListener = new PropertyChangeListener() { @Override public void propertyChange(final PropertyChangeEvent arg0) { fixMoved(); } }; _childTrackMovedListener = new PropertyChangeListener() { @Override public void propertyChange(final PropertyChangeEvent evt) { // child track move. remember that we need to recalculate & redraw setRelativePending(); // also share the good news firePropertyChange(PlainWrapper.LOCATION_CHANGED, null, System .currentTimeMillis()); } }; _linkPositions = true; // start off with positions showing (although the default setting for a // fix // is to not show a symbol anyway). We need to make this "true" so that // when a fix position is set to visible it is not over-ridden by this // setting _showPositions = true; // initialise the symbol to use for plotting this track in snail mode _theSnailShape = MWC.GUI.Shapes.Symbols.SymbolFactory.createSymbol( "Submarine"); // declare our arrays _theSegments = new TrackWrapper_Support.SegmentList(); _theSegments.setWrapper(this); // tracks are plotted bolder than lightweight tracks, give them some depth setLineThickness(3); } /** * add the indicated point to the track * * @param point * the point to add */ @Override public void add(final MWC.GUI.Editable point) { // see what type of object this is if (point instanceof FixWrapper) { final FixWrapper fw = (FixWrapper) point; fw.setTrackWrapper(this); addFix(fw); } // is this a sensor? else if (point instanceof SensorWrapper) { final SensorWrapper swr = (SensorWrapper) point; // see if we already have a sensor with this name SensorWrapper existing = null; final Enumeration<Editable> enumer = _mySensors.elements(); while (enumer.hasMoreElements()) { final SensorWrapper oldS = (SensorWrapper) enumer.nextElement(); // does this have the same name? if (oldS.getName().equals(swr.getName())) { // yes - ok, remember it existing = oldS; // and append the data points existing.append(swr); } } // did we find it already? if (existing == null) { // nope, so store it _mySensors.add(swr); } // tell the sensor about us swr.setHost(this); // and the track name (if we're loading from REP it will already // know // the name, but if this data is being pasted in, it may start with // a different // parent track name - so override it here) swr.setTrackName(this.getName()); } // is this a dynamic shape? else if (point instanceof DynamicTrackShapeSetWrapper) { final DynamicTrackShapeSetWrapper swr = (DynamicTrackShapeSetWrapper) point; // just check we don't alraedy have it if (_myDynamicShapes.contains(swr)) { MWC.Utilities.Errors.Trace.trace("Not adding shape-set, it's already present" + swr.getName(), false); } else { // add to our list _myDynamicShapes.add(swr); // tell the sensor about us swr.setHost(this); } } else if (point instanceof DynamicTrackShapeWrapper) { DynamicTrackShapeWrapper shape = (DynamicTrackShapeWrapper) point; DynamicTrackShapeSetWrapper target = null; final Enumeration<Editable> iter = getDynamicShapes().elements(); if (iter != null) { while (iter.hasMoreElements()) { final DynamicTrackShapeSetWrapper set = (DynamicTrackShapeSetWrapper) iter.nextElement(); // is this our sensor? if (set.getName().equals(shape.getSensorName())) { // cool, drop out target = set; break; } } // looping through the sensors } // whether there are any sensors if (target == null) { // then create it target = new DynamicTrackShapeSetWrapper(shape.getSensorName()); add(target); } target.add(shape); } // is this a TMA solution track? else if (point instanceof TMAWrapper) { final TMAWrapper twr = (TMAWrapper) point; // add to our list _mySolutions.add(twr); // tell the sensor about us twr.setHost(this); // and the track name (if we're loading from REP it will already // know // the name, but if this data is being pasted in, it may start with // a different // parent track name - so override it here) twr.setTrackName(this.getName()); } else if (point instanceof TrackSegment) { final TrackSegment seg = (TrackSegment) point; seg.setWrapper(this); _theSegments.addSegment((TrackSegment) point); // hey, sort out the positions sortOutRelativePositions(); // special case - see if it's a relative TMA segment, // we many need some more sorting if (point instanceof RelativeTMASegment) { final RelativeTMASegment newRelativeSegment = (RelativeTMASegment) point; // ok, try to update the layers. get the layers for an // existing segment final SegmentList sl = this.getSegments(); final Enumeration<Editable> sEnum = sl.elements(); while (sEnum.hasMoreElements()) { final TrackSegment mySegment = (TrackSegment) sEnum.nextElement(); if (mySegment != newRelativeSegment) { // ok, it's not this one. try the layers if (mySegment instanceof RelativeTMASegment) { final RelativeTMASegment myRelativeSegnent = (RelativeTMASegment) mySegment; final Layers myExistingLayers = myRelativeSegnent.getLayers(); if (myExistingLayers != newRelativeSegment.getLayers()) { newRelativeSegment.setLayers(myExistingLayers); break; } } } } } // we also need to listen for a child moving seg.addPropertyChangeListener(CoreTMASegment.ADJUSTED, _childTrackMovedListener); } else if (point instanceof Layer) { // just check if it's a track - since we don't want to allow pasting // TMA track into it's parent final Layer layer = (Layer) point; if (layer instanceof TrackWrapper) { final TrackWrapper newTrack = (TrackWrapper) layer; final Enumeration<Editable> segs = newTrack.getSegments().elements(); while (segs.hasMoreElements()) { final Editable seg = segs.nextElement(); if (seg instanceof RelativeTMASegment) { final RelativeTMASegment rel = (RelativeTMASegment) seg; // hey, just check that we're not actually the reference // for this segment if (rel.getHostName().equals(this.getName())) { MessageProvider.Base.Provider.show("Paste track", "Can't paste TMA track into it's reference track:" + this .getName(), MessageProvider.ERROR); return; } } } } final Enumeration<Editable> items = layer.elements(); while (items.hasMoreElements()) { final Editable thisE = items.nextElement(); add(thisE); } } else { Trace.trace("Can't paste " + point + " into track", true); } } public void addFix(final FixWrapper theFix) { // do we have any track segments if (_theSegments.isEmpty()) { // nope, add one final TrackSegment firstSegment = new TrackSegment(TrackSegment.ABSOLUTE); firstSegment.setName("Positions"); _theSegments.addSegment(firstSegment); } // add fix to last track segment final TrackSegment last = (TrackSegment) _theSegments.last(); last.addFix(theFix); // tell the fix about it's daddy theFix.setTrackWrapper(this); if (_myWorldArea == null) { _myWorldArea = new WorldArea(theFix.getLocation(), theFix.getLocation()); } else { _myWorldArea.extend(theFix.getLocation()); } // flush any cached values for time period & lists of positions flushPeriodCache(); flushPositionCache(); } /** * append this other layer to ourselves (although we don't really bother with it) * * @param other * the layer to add to ourselves */ @Override public void append(final Layer other) { boolean modified = false; // is it a track? if ((other instanceof TrackWrapper) || (other instanceof TrackSegment)) { // yes, break it down. final java.util.Enumeration<Editable> iter = other.elements(); while (iter.hasMoreElements()) { final Editable nextItem = iter.nextElement(); if (nextItem instanceof Layer) { append((Layer) nextItem); modified = true; } else { add(nextItem); modified = true; } } } else { // nope, just add it to us. add(other); modified = true; } if (modified) { setRelativePending(); } } /** * Calculates Course & Speed for the track. */ public void calcCourseSpeed() { // step through our fixes final Enumeration<Editable> iter = getPositionIterator(); FixWrapper prevFw = null; while (iter.hasMoreElements()) { final FixWrapper currFw = (FixWrapper) iter.nextElement(); if (prevFw == null) { prevFw = currFw; } else { // calculate the course final WorldVector wv = currFw.getLocation().subtract(prevFw .getLocation()); prevFw.getFix().setCourse(wv.getBearing()); // also, set the correct label alignment currFw.resetLabelLocation(); // calculate the speed // get distance in meters final WorldDistance wd = new WorldDistance(wv); final double distance = wd.getValueIn(WorldDistance.METRES); // get time difference in seconds final long timeDifference = (currFw.getTime().getMicros() - prevFw .getTime().getMicros()) / 1000000; // get speed in meters per second and convert it to knots final WorldSpeed speed = new WorldSpeed(distance / timeDifference, WorldSpeed.M_sec); final double knots = WorldSpeed.convert(WorldSpeed.M_sec, WorldSpeed.Kts, speed.getValue()); prevFw.setSpeed(knots); prevFw = currFw; } } // if it's a DR track this will probably change things setRelativePending(); } private void checkPointsArray() { // is our points store long enough? if ((_myPts == null) || (_myPts.length < numFixes() * 2)) { _myPts = new int[numFixes() * 2]; } // reset the points counter _ptCtr = 0; } public void clearPositions() { boolean modified = false; final Enumeration<Editable> segments = _theSegments.elements(); while (segments.hasMoreElements()) { final TrackSegment seg = (TrackSegment) segments.nextElement(); seg.removeAllElements(); // remember that we've made a change modified = true; // we've also got to clear the cache flushPeriodCache(); flushPositionCache(); } if (modified) { setRelativePending(); } } /** * instruct this object to clear itself out, ready for ditching */ @Override public final void closeMe() { // and my objects // first ask them to close themselves final Enumeration<Editable> it = getPositionIterator(); while (it.hasMoreElements()) { final Editable val = it.nextElement(); if (val instanceof PlainWrapper) { final PlainWrapper pw = (PlainWrapper) val; pw.closeMe(); } else if (val instanceof TrackSegment) { final TrackSegment ts = (TrackSegment) val; // and clear the parent item ts.setWrapper(null); // we also need to stop listen for a child moving ts.removePropertyChangeListener(CoreTMASegment.ADJUSTED, _childTrackMovedListener); } } // now ditch them _theSegments.removeAllElements(); _theSegments = null; // and my objects // first ask the sensors to close themselves if (_mySensors != null) { final Enumeration<Editable> it2 = _mySensors.elements(); while (it2.hasMoreElements()) { final Object val = it2.nextElement(); if (val instanceof PlainWrapper) { final PlainWrapper pw = (PlainWrapper) val; pw.closeMe(); } } // now ditch them _mySensors.removeAllElements(); } // and my objects // first ask the sensors to close themselves if (_myDynamicShapes != null) { final Enumeration<Editable> it2 = _myDynamicShapes.elements(); while (it2.hasMoreElements()) { final Object val = it2.nextElement(); if (val instanceof PlainWrapper) { final PlainWrapper pw = (PlainWrapper) val; pw.closeMe(); } } // now ditch them _myDynamicShapes.removeAllElements(); } // now ask the solutions to close themselves if (_mySolutions != null) { final Enumeration<Editable> it2 = _mySolutions.elements(); while (it2.hasMoreElements()) { final Object val = it2.nextElement(); if (val instanceof PlainWrapper) { final PlainWrapper pw = (PlainWrapper) val; pw.closeMe(); } } // now ditch them _mySolutions.removeAllElements(); } // and our utility objects _lastFix = null; // and our editor _myEditor = null; // now get the parent to close itself super.closeMe(); } /** * switch the two track sections into one track section * * @param res * the previously split track sections */ public void combineSections(final Vector<TrackSegment> res) { // ok, remember the first final TrackSegment keeper = res.firstElement(); // now remove them all, adding them to the first final Iterator<TrackSegment> iter = res.iterator(); while (iter.hasNext()) { final TrackSegment pl = iter.next(); if (pl != keeper) { keeper.append((Layer) pl); } removeElement(pl); } // and put the keepers back in add(keeper); // and remember we need an update setRelativePending(); } @Override public int compareTo(final Plottable arg0) { Integer answer = null; // SPECIAL PROCESSING: we wish to push TMA tracks to the top of any // tracks shown in the outline view. // is he a track? if (arg0 instanceof TrackWrapper) { final TrackWrapper other = (TrackWrapper) arg0; // yes, he's a track. See if we're a relative track final boolean iAmTMA = isTMATrack(); // is he relative? final boolean heIsTMA = other.isTMATrack(); if (heIsTMA) { // ok, he's a TMA segment. now we need to sort out if we are. if (iAmTMA) { // we're both relative, compare names answer = getName().compareTo(other.getName()); } else { // only he is relative, he comes first answer = 1; } } else { // he's not relative. am I? if (iAmTMA) { // I am , so go first answer = -1; } } } else { // we're a track, they're not - put us at the end! answer = 1; } // if we haven't worked anything out yet, just use the parent implementation if (answer == null) { answer = super.compareTo(arg0); } return answer; } /** * return our tiered data as a single series of elements * * @return */ @Override public Enumeration<Editable> contiguousElements() { final WrappedIterators we = new WrappedIterators(); if (_mySensors != null && _mySensors.getVisible()) { final Enumeration<Editable> iter = _mySensors.elements(); while (iter.hasMoreElements()) { final SensorWrapper sw = (SensorWrapper) iter.nextElement(); // is it visible? if (sw.getVisible()) { we.add(sw.elements()); } } } if (_myDynamicShapes != null && _myDynamicShapes.getVisible()) { final Enumeration<Editable> iter = _myDynamicShapes.elements(); while (iter.hasMoreElements()) { final DynamicTrackShapeSetWrapper sw = (DynamicTrackShapeSetWrapper) iter.nextElement(); // is it visible? if (sw.getVisible()) { we.add(sw.elements()); } } } if (_mySolutions != null && _mySolutions.getVisible()) { final Enumeration<Editable> iter = _mySolutions.elements(); while (iter.hasMoreElements()) { final TMAWrapper sw = (TMAWrapper) iter.nextElement(); if (sw.getVisible()) { we.add(sw.elements()); } } } if (_theSegments != null && _theSegments.getVisible()) { we.add(getPositionIterator()); } return we; } /** * this accessor is present for debug/testing purposes only. Do not use outside testing! * * @return the length of the list of screen points waiting to be plotted */ public int debug_GetPointCtr() { return _ptCtr; } /** * this accessor is present for debug/testing purposes only. Do not use outside testing! * * @return the list of screen locations about to be plotted */ public int[] debug_GetPoints() { return _myPts; } /** * get an enumeration of the points in this track * * @return the points in this track */ @Override public Enumeration<Editable> elements() { final TreeSet<Editable> res = new TreeSet<Editable>(); if (!_mySensors.isEmpty()) { res.add(_mySensors); } if (!_myDynamicShapes.isEmpty()) { res.add(_myDynamicShapes); } if (!_mySolutions.isEmpty()) { res.add(_mySolutions); } // ok, we want to wrap our fast-data as a set of plottables // see how many track segments we have if (_theSegments.size() == 1) { // just the one, insert it res.add(_theSegments.first()); } else { // more than one, insert them as a tree res.add(_theSegments); } return new TrackWrapper_Support.IteratorWrapper(res.iterator()); } // editing parameters /** * filter the list to the specified time period, then inform any listeners (such as the time * stepper) * * @param start * the start dtg of the period * @param end * the end dtg of the period */ @Override public final void filterListTo(final HiResDate start, final HiResDate end) { final Enumeration<Editable> fixWrappers = getPositionIterator(); while (fixWrappers.hasMoreElements()) { final FixWrapper fw = (FixWrapper) fixWrappers.nextElement(); final HiResDate dtg = fw.getTime(); if ((dtg.greaterThanOrEqualTo(start)) && (dtg.lessThanOrEqualTo(end))) { fw.setVisible(true); } else { fw.setVisible(false); } } // now do the same for our sensor data if (_mySensors != null) { final Enumeration<Editable> iter = _mySensors.elements(); while (iter.hasMoreElements()) { final WatchableList sw = (WatchableList) iter.nextElement(); sw.filterListTo(start, end); } // through the sensors } // whether we have any sensors // now do the same for our sensor arc data if (_myDynamicShapes != null) { final Enumeration<Editable> iter = _myDynamicShapes.elements(); while (iter.hasMoreElements()) { final WatchableList sw = (WatchableList) iter.nextElement(); sw.filterListTo(start, end); } // through the sensor arcs } // whether we have any sensor arcs if (_mySolutions != null) { final Enumeration<Editable> iter = _mySolutions.elements(); while (iter.hasMoreElements()) { final WatchableList sw = (WatchableList) iter.nextElement(); sw.filterListTo(start, end); } // through the sensors } // whether we have any sensors // do we have any property listeners? if (getSupport() != null) { final Debrief.GUI.Tote.StepControl.somePeriod newPeriod = new Debrief.GUI.Tote.StepControl.somePeriod(start, end); getSupport().firePropertyChange(WatchableList.FILTERED_PROPERTY, null, newPeriod); } } @Override public void findNearestHotSpotIn(final Point cursorPos, final WorldLocation cursorLoc, final ComponentConstruct currentNearest, final Layer parentLayer) { // initialise thisDist, since we're going to be over-writing it WorldDistance thisDist = new WorldDistance(0, WorldDistance.DEGS); // cycle through the fixes final Enumeration<Editable> fixes = getPositionIterator(); while (fixes.hasMoreElements()) { final FixWrapper thisF = (FixWrapper) fixes.nextElement(); // only check it if it's visible if (thisF.getVisible()) { // how far away is it? thisDist = thisF.getLocation().rangeFrom(cursorLoc, thisDist); final WorldLocation fixLocation = new WorldLocation(thisF.getLocation()) { private static final long serialVersionUID = 1L; @Override public void addToMe(final WorldVector delta) { super.addToMe(delta); thisF.setFixLocation(this); } }; // try range currentNearest.checkMe(this, thisDist, null, parentLayer, fixLocation); } } } @Override public void findNearestHotSpotIn(final Point cursorPos, final WorldLocation cursorLoc, final LocationConstruct currentNearest, final Layer parentLayer, final Layers theData) { // initialise thisDist, since we're going to be over-writing it WorldDistance thisDist = new WorldDistance(0, WorldDistance.DEGS); // cycle through the fixes final Enumeration<Editable> fixes = getPositionIterator(); while (fixes.hasMoreElements()) { final FixWrapper thisF = (FixWrapper) fixes.nextElement(); if (thisF.getVisible()) { // how far away is it? thisDist = thisF.getLocation().rangeFrom(cursorLoc, thisDist); // is it closer? currentNearest.checkMe(this, thisDist, null, parentLayer); } } } public void findNearestSegmentHotspotFor(final WorldLocation cursorLoc, final Point cursorPt, final LocationConstruct currentNearest) { // initialise thisDist, since we're going to be over-writing it WorldDistance thisDist; // cycle through the track segments final Collection<Editable> segments = _theSegments.getData(); for (final Iterator<Editable> iterator = segments.iterator(); iterator .hasNext();) { final TrackSegment thisSeg = (TrackSegment) iterator.next(); if (thisSeg.getVisible()) { // how far away is it? thisDist = new WorldDistance(thisSeg.rangeFrom(cursorLoc), WorldDistance.DEGS); // is it closer? currentNearest.checkMe(thisSeg, thisDist, null, this); } } } private void fixLabelColor() { if (getColor() == null) { // check we have a colour Color labelColor = getColor(); // did we ourselves have a colour? if (labelColor == null) { // nope - do we have any legs? final Enumeration<Editable> numer = this.getPositionIterator(); if (numer.hasMoreElements()) { // ok, use the colour of the first point final FixWrapper pos = (FixWrapper) numer.nextElement(); labelColor = pos.getColor(); } } setColor(labelColor); } } /** * one of our fixes has moved. better tell any bits that rely on the locations of our bits * * @param theFix * the fix that moved */ public void fixMoved() { if (_mySensors != null) { final Enumeration<Editable> iter = _mySensors.elements(); while (iter.hasMoreElements()) { final SensorWrapper nextS = (SensorWrapper) iter.nextElement(); nextS.setHost(this); } } if (_myDynamicShapes != null) { final Enumeration<Editable> iter = _myDynamicShapes.elements(); while (iter.hasMoreElements()) { final DynamicTrackShapeSetWrapper nextS = (DynamicTrackShapeSetWrapper) iter.nextElement(); nextS.setHost(this); } } } /** * ensure the cached set of raw positions gets cleared * */ public void flushPositionCache() { } /** * calculate a position the specified distance back along the ownship track (note, we always * interpolate the parent track position) * * @param searchTime * the time we're looking at * @param sensorOffset * how far back the sensor should be * @param wormInHole * whether to plot a straight line back, or make sensor follow ownship * @return the location */ public FixWrapper getBacktraceTo(final HiResDate searchTime, final ArrayLength sensorOffset, final boolean wormInHole) { FixWrapper res = null; // special case - for single point tracks if (isSinglePointTrack()) { final TrackSegment seg = (TrackSegment) _theSegments.elements() .nextElement(); return (FixWrapper) seg.first(); } if (wormInHole && sensorOffset != null) { res = WormInHoleOffset.getWormOffsetFor(this, searchTime, sensorOffset); } else { final boolean parentInterpolated = getInterpolatePoints(); setInterpolatePoints(true); final MWC.GenericData.Watchable[] list = getNearestTo(searchTime); // and restore the interpolated value setInterpolatePoints(parentInterpolated); FixWrapper wa = null; if (list.length > 0) { wa = (FixWrapper) list[0]; } // did we find it? if (wa != null) { // yes, store it res = new FixWrapper(wa.getFix().makeCopy()); // ok, are we dealing with an offset? if (sensorOffset != null) { // get the current heading final double hdg = wa.getCourse(); // and calculate where it leaves us final WorldVector vector = new WorldVector(hdg, sensorOffset, null); // now apply this vector to the origin res.setLocation(new WorldLocation(res.getLocation().add(vector))); } } } return res; } /** * what geographic area is covered by this track? * * @return get the outer bounds of the area */ @Override public final WorldArea getBounds() { // we no longer just return the bounds of the track, because a portion // of the track may have been made invisible. // instead, we will pass through the full dataset and find the outer // bounds // of the visible area WorldArea res = null; if (!getVisible()) { // hey, we're invisible, return null } else { final Enumeration<Editable> it = getPositionIterator(); while (it.hasMoreElements()) { final FixWrapper fw = (FixWrapper) it.nextElement(); // is this point visible? if (fw.getVisible()) { // has our data been initialised? if (res == null) { // no, initialise it res = new WorldArea(fw.getLocation(), fw.getLocation()); } else { // yes, extend to include the new area res.extend(fw.getLocation()); } } } // also extend to include our sensor data if (_mySensors != null) { final Enumeration<Editable> iter = _mySensors.elements(); while (iter.hasMoreElements()) { final PlainWrapper sw = (PlainWrapper) iter.nextElement(); final WorldArea theseBounds = sw.getBounds(); if (theseBounds != null) { if (res == null) { res = new WorldArea(theseBounds); } else { res.extend(sw.getBounds()); } } } // step through the sensors } // whether we have any sensors // also extend to include our sensor data if (_myDynamicShapes != null) { final Enumeration<Editable> iter = _myDynamicShapes.elements(); while (iter.hasMoreElements()) { final Plottable sw = (Plottable) iter.nextElement(); final WorldArea theseBounds = sw.getBounds(); if (theseBounds != null) { if (res == null) { res = new WorldArea(theseBounds); } else { res.extend(sw.getBounds()); } } } // step through the sensors } // and our solution data if (_mySolutions != null) { final Enumeration<Editable> iter = _mySolutions.elements(); while (iter.hasMoreElements()) { final PlainWrapper sw = (PlainWrapper) iter.nextElement(); final WorldArea theseBounds = sw.getBounds(); if (theseBounds != null) { if (res == null) { res = new WorldArea(theseBounds); } else { res.extend(sw.getBounds()); } } } // step through the sensors } // whether we have any sensors } // whether we're visible // SPECIAL CASE: if we're a DR track, the positions all // have the same value if (res != null) { // have we ended up with an empty area? if (res.getHeight() == 0) { // ok - force a bounds update sortOutRelativePositions(); // and retrieve the bounds of hte first segment res = this.getSegments().first().getBounds(); } } return res; } /** * this accessor is only present to support testing. It should not be used externally * * @return the iterator we last used in getNearestTo() */ public WrappedIterators getCachedIterator() { return _lastPosIterator; } /** * length of trail to plot */ public final Duration getCustomTrailLength() { return _customTrailLength; } /** * length of trail to plot */ public final double getCustomVectorStretch() { final double res; // do we have a value? if (_customVectorStretch != null) { res = _customVectorStretch; } else { res = 0; } return res; } /** * get the list of sensor arcs for this track */ public final BaseLayer getDynamicShapes() { return _myDynamicShapes; } /** * the time of the last fix * * @return the DTG */ @Override public final HiResDate getEndDTG() { HiResDate dtg = null; final TimePeriod res = getTimePeriod(); if (res != null) { dtg = res.getEndDTG(); } return dtg; } /** * whether to show time labels at the start/end of the track * * @return yes/no */ public boolean getEndTimeLabels() { return _endTimeLabels; } /** * the editable details for this track * * @return the details */ @Override public Editable.EditorType getInfo() { if (_myEditor == null) { _myEditor = new trackInfo(this); } return _myEditor; } /** * create a new, interpolated point between the two supplied * * @param previous * the previous point * @param next * the next point * @return and interpolated point */ private final FixWrapper getInterpolatedFix(final FixWrapper previous, final FixWrapper next, final HiResDate requestedDTG) { FixWrapper res = null; // do we have a start point if (previous == null) { res = next; } // hmm, or do we have an end point? if (next == null) { res = previous; } // did we find it? if (res == null) { res = FixWrapper.interpolateFix(previous, next, requestedDTG); } return res; } @Override public final boolean getInterpolatePoints() { return _interpolatePoints; } /** * get the set of fixes contained within this time period (inclusive of both end values) * * @param start * start DTG * @param end * end DTG * @return series of fixes */ @Override public final Collection<Editable> getItemsBetween(final HiResDate start, final HiResDate end) { SortedSet<Editable> set = null; // does our track contain any data at all if (!_theSegments.isEmpty()) { // see if we have _any_ points in range if ((getStartDTG().greaterThan(end)) || (getEndDTG().lessThan(start))) { // don't bother with it. } else { // SPECIAL CASE! If we've been asked to show interpolated data // points, // then // we should produce a series of items between the indicated // times. How // about 1 minute resolution? if (getInterpolatePoints()) { final long ourInterval = 1000 * 60; // one minute set = new TreeSet<Editable>(); for (long newTime = start.getDate().getTime(); newTime < end.getDate() .getTime(); newTime += ourInterval) { final HiResDate newD = new HiResDate(newTime); final Watchable[] nearestOnes = getNearestTo(newD); if (nearestOnes.length > 0) { final FixWrapper nearest = (FixWrapper) nearestOnes[0]; set.add(nearest); } } } else { // bugger that - get the real data final Enumeration<Editable> iter = getPositionIterator(); set = new TreeSet<Editable>(); final TimePeriod period = new TimePeriod.BaseTimePeriod(start, end); while (iter.hasMoreElements()) { final FixWrapper nextF = (FixWrapper) iter.nextElement(); final HiResDate dtg = nextF.getDateTimeGroup(); if (period.contains(dtg)) { set.add(nextF); } else if (dtg.greaterThan(end)) { // ok, we've passed the end break; } } // // have a go.. // if (starter == null) // starter = new FixWrapper(new Fix((start), _zeroLocation, 0.0, 0.0)); // else // starter.getFix().setTime(new HiResDate(0, start.getMicros() - 1)); // if (finisher == null) // finisher = // new FixWrapper(new Fix(new HiResDate(0, end.getMicros() + 1), // _zeroLocation, 0.0, 0.0)); // else // finisher.getFix().setTime(new HiResDate(0, end.getMicros() + 1)); // // ok, ready, go for it. // set = getPositionsBetween(starter, finisher); } } } return set; } /** * what is the style used for plotting this track? * * @return */ @Override public int getLineStyle() { return _lineStyle; } /** * whether to link points * * @return */ public boolean getLinkPositions() { return _linkPositions; } /** * just have the one property listener - rather than an anonymous class * * @return */ public PropertyChangeListener getLocationListener() { return _locationListener; } /** * whether to show the track label at the start or end of the track * * @return yes/no to indicate <I>At Start</I> */ public final boolean getNameAtStart() { return _LabelAtStart; } /** * find the fix nearest to this time (or the first fix for an invalid time) * * @param DTG * the time of interest * @return the nearest fix */ @Override public final Watchable[] getNearestTo(final HiResDate srchDTG) { return getNearestTo(srchDTG, true); } /** * find the fix nearest to this time (or the first fix for an invalid time) * * @param DTG * the time of interest * @param onlyVisible * only consider visible fixes * @return the nearest fix */ public final Watchable[] getNearestTo(final HiResDate srchDTG, final boolean onlyVisible) { /** * we need to end up with a watchable, not a fix, so we need to work our way through the fixes */ FixWrapper res = null; // check that we do actually contain some data if (_theSegments.isEmpty()) { return new Watchable[] {}; } else if (isSinglePointTrack()) { final TrackSegment seg = (TrackSegment) _theSegments.elements() .nextElement(); final FixWrapper fix = (FixWrapper) seg.first(); return new Watchable[] {fix}; } // special case - if we've been asked for an invalid time value if (srchDTG == TimePeriod.INVALID_DATE) { final TrackSegment seg = (TrackSegment) _theSegments.first(); final FixWrapper fix = (FixWrapper) seg.first(); // just return our first location return new MWC.GenericData.Watchable[] {fix}; } else if (_lastFix != null && _lastFix.getDTG().equals(srchDTG)) { // see if this is the DTG we have just requested res = _lastFix; } else { final TrackSegment firstSeg = (TrackSegment) _theSegments.first(); final TrackSegment lastSeg = (TrackSegment) _theSegments.last(); if ((firstSeg != null) && (!firstSeg.isEmpty())) { // see if this DTG is inside our data range // in which case we will just return null final FixWrapper theFirst = (FixWrapper) firstSeg.first(); final FixWrapper theLast = (FixWrapper) lastSeg.last(); if ((srchDTG.greaterThan(theFirst.getTime())) && (srchDTG .lessThanOrEqualTo(theLast.getTime()))) { FixWrapper previous = null; // do we already have a position iterator? final Enumeration<Editable> pIter; if (_lastPosIterator != null) { final FixWrapper thisPos = (FixWrapper) _lastPosIterator .currentElement(); final FixWrapper prevPos = (FixWrapper) _lastPosIterator .previousElement(); if (thisPos.getDTG().equals(srchDTG)) { // ok, we know this answer, use it res = thisPos; pIter = null; } else if (thisPos.getDTG().lessThan(srchDTG)) { // the current iterator is still valid, stick with it pIter = _lastPosIterator; previous = thisPos; } else if (prevPos != null && thisPos.getDTG().greaterThan(srchDTG) && prevPos.getDTG().lessThan(srchDTG)) { // we're currently either side of the required value // we don't need to restart the iterator res = thisPos; previous = prevPos; pIter = _lastPosIterator; } else { // we've gone past the required value, and // the previous value isn't of any use pIter = getPositionIterator(); } } else { // we don't have a cached iterator, better create one then pIter = getPositionIterator(); } // yes it's inside our data range, find the first fix // after the indicated point if (res == null) { while (pIter.hasMoreElements()) { final FixWrapper fw = (FixWrapper) pIter.nextElement(); if (!onlyVisible || fw.getVisible()) { if (fw.getDTG().greaterThanOrEqualTo(srchDTG)) { res = fw; break; } // and remember the previous one previous = fw; } } } // can we cache our iterator? if (pIter != null && pIter.hasMoreElements()) { // ok, it's still of value _lastPosIterator = (WrappedIterators) pIter; } else { // nope, drop it. _lastPosIterator = null; } // right, that's the first points on or before the indicated // DTG. Are we // meant // to be interpolating? if (res != null) { if (getInterpolatePoints()) { if (!res.getTime().equals(srchDTG)) { // do we know the previous time? if (previous != null) { // cool, sort out the interpolated point USING // THE ORIGINAL // SEARCH TIME res = getInterpolatedFix(previous, res, srchDTG); // and reset the label res.resetName(); } } } } } else if (srchDTG.equals(theFirst.getDTG())) { // aaah, special case. just see if we're after a data point // that's the // same // as our start time res = theFirst; } } // and remember this fix _lastFix = res; } if (res != null) { return new MWC.GenericData.Watchable[] {res}; } else { return new MWC.GenericData.Watchable[] {}; } } public boolean getPlotArrayCentre() { return _plotArrayCentre; } /** * provide iterator for all positions that doesn't require a new list to be generated * * @return iterator through all positions */ @Override public Enumeration<Editable> getPositionIterator() { return new WrappedIterators(_theSegments); } /** * whether positions are being shown * * @return */ public final boolean getPositionsVisible() { return _showPositions; } /** * get our child segments * * @return */ public SegmentList getSegments() { return _theSegments; } /** * get the list of sensors for this track */ public final BaseLayer getSensors() { return _mySensors; } /** * get the list of sensors for this track */ public final BaseLayer getSolutions() { return _mySolutions; } // watchable (tote related) parameters /** * the earliest fix in the track * * @return the DTG */ @Override public final HiResDate getStartDTG() { HiResDate res = null; final TimePeriod period = getTimePeriod(); if (period != null) { res = period.getStartDTG(); } return res; } private TimePeriod getTimePeriod() { TimePeriod res = null; final Enumeration<Editable> segs = _theSegments.elements(); while (segs.hasMoreElements()) { final TrackSegment seg = (TrackSegment) segs.nextElement(); // do we have a dtg? if ((seg.startDTG() != null) && (seg.endDTG() != null)) { // yes, get calculating if (res == null) { res = new TimePeriod.BaseTimePeriod(seg.startDTG(), seg.endDTG()); } else { res.extend(seg.startDTG()); res.extend(seg.endDTG()); } } } return res; } /** * the colour of the points on the track * * @return the colour */ public final Color getTrackColor() { return getColor(); } /** * get the mode used to color the track * * @return */ public TrackColorMode getTrackColorMode() { // ok, see if we're using a deferred mode. If we are, we should correct it if (_trackColorMode instanceof DeferredDatasetColorMode) { _trackColorMode = TrackColorModeHelper.sortOutDeferredMode( (DeferredDatasetColorMode) _trackColorMode, this); } return _trackColorMode; } public List<TrackColorMode> getTrackColorModes() { return TrackColorModeHelper.getAdditionalTrackColorModes(this); } /** * whether this object has editor details * * @return yes/no */ @Override public final boolean hasEditor() { return true; } /** * whether this is single point track. Single point tracks get special processing. * * @return */ @Override public boolean isSinglePointTrack() { final boolean res; if (_theSegments.size() == 1) { final TrackSegment first = (TrackSegment) _theSegments.elements() .nextElement(); // we want to avoid getting the size() of the list. // So, do fancy trick to check the first element is non-null, // and the second is null final Enumeration<Editable> elems = first.elements(); if (elems != null && elems.hasMoreElements() && elems .nextElement() != null && !elems.hasMoreElements()) { res = true; } else { res = false; } } else { res = false; } return res; } /** * accessor to determine if this is a relative track * * @return */ public boolean isTMATrack() { boolean res = false; if (_theSegments != null && !_theSegments.isEmpty() && _theSegments .first() instanceof CoreTMASegment) { res = true; } return res; } /** * quick accessor for how many fixes we have * * @return */ public int numFixes() { int res = 0; // loop through segments final Enumeration<Editable> segs = _theSegments.elements(); while (segs.hasMoreElements()) { // get this segment final TrackSegment seg = (TrackSegment) segs.nextElement(); res += seg.size(); } return res; } /** * draw this track (we can leave the Positions to draw themselves) * * @param dest * the destination */ @Override public final void paint(final CanvasType dest) { // check we are visible and have some track data, else we won't work if (!getVisible() || this.getStartDTG() == null) { return; } // set the thickness for this track dest.setLineWidth(getLineThickness()); // and set the initial colour for this track if (getColor() != null) { dest.setColor(getColor()); } // firstly plot the solutions if (_mySolutions.getVisible()) { final Enumeration<Editable> iter = _mySolutions.elements(); while (iter.hasMoreElements()) { final TMAWrapper sw = (TMAWrapper) iter.nextElement(); // just check that the sensor knows we're it's parent if (sw.getHost() == null) { sw.setHost(this); } // and do the paint sw.paint(dest); } // through the solutions } // whether the solutions are visible // now plot the sensors if (_mySensors.getVisible()) { final Enumeration<Editable> iter = _mySensors.elements(); while (iter.hasMoreElements()) { final SensorWrapper sw = (SensorWrapper) iter.nextElement(); // just check that the sensor knows we're it's parent if (sw.getHost() == null) { sw.setHost(this); } // and do the paint sw.paint(dest); } // through the sensors } // whether the sensor layer is visible // and now the track itself // just check if we are drawing anything at all if ((!getLinkPositions() || getLineStyle() == LineStylePropertyEditor.UNCONNECTED) && (!_showPositions)) { return; } // let the fixes draw themselves in final List<FixWrapper> endPoints = paintFixes(dest); final boolean plotted_anything = !endPoints.isEmpty(); // and draw the track label // still, we only plot the track label if we have plotted any // points if (getNameVisible() && plotted_anything) { // just see if we have multiple segments. if we do, // name them individually if (this._theSegments.size() <= 1) { paintSingleTrackLabel(dest, endPoints); } else { // we've got multiple segments, name them paintMultipleSegmentLabel(dest); } } // if the label is visible // lastly - paint any TMA or planning segment labels paintVectorLabels(dest); } @Override public void paint(final CanvasType dest, final long time) { if (!getVisible()) { return; } // set the thickness for this track dest.setLineWidth(getLineThickness()); // and set the initial colour for this track if (getColor() != null) { dest.setColor(getColor()); } // we plot only the dynamic arcs because they are MovingPlottable if (_myDynamicShapes.getVisible()) { final Enumeration<Editable> iter = _myDynamicShapes.elements(); while (iter.hasMoreElements()) { final DynamicTrackShapeSetWrapper sw = (DynamicTrackShapeSetWrapper) iter.nextElement(); // and do the paint sw.paint(dest, time); } } } /** * paint the fixes for this track * * @param dest * @return a collection containing the first & last visible fix */ private List<FixWrapper> paintFixes(final CanvasType dest) { // collate a list of the start & end points final List<FixWrapper> endPoints = new ArrayList<FixWrapper>(); // use the track color mode final TrackColorMode tMode = getTrackColorMode(); // we need an array to store the polyline of points in. Check it's big // enough checkPointsArray(); // we draw tracks as polylines. But we can't do that // if the color/style changes. So, we have to track their values Color lastCol = null; final int defaultlineStyle = getLineStyle(); FixWrapper lastFix = null; // update DR positions (if necessary) if (_relativeUpdatePending) { // ok, generate the points on the relative track sortOutRelativePositions(); // and clear the flag _relativeUpdatePending = false; } // cycle through the segments final Enumeration<Editable> segments = _theSegments.elements(); while (segments.hasMoreElements()) { final TrackSegment seg = (TrackSegment) segments.nextElement(); // is it a single point segment? final boolean singlePointSegment = seg.size() == 1; // how shall we plot this segment? final int thisLineStyle; // is the parent using the default style? if (defaultlineStyle == CanvasType.SOLID) { // yes, let's override it, if the segment wants to thisLineStyle = seg.getLineStyle(); } else { // no, we're using a custom style - don't override it. thisLineStyle = defaultlineStyle; } // is this segment visible? if (!seg.getVisible()) { // nope, jump to the next continue; } final Enumeration<Editable> fixWrappers = seg.elements(); while (fixWrappers.hasMoreElements()) { final FixWrapper fw = (FixWrapper) fixWrappers.nextElement(); // have a look at the last fix. we defer painting the fix label, // because we want to know the id of the last visible fix, since // we may need to paint it's label in 6 DTG if ((getPositionsVisible() && lastFix != null && lastFix.getVisible()) || singlePointSegment) { // is this the first visible fix? final boolean isFirstVisibleFix = endPoints.size() == 1; // special handling. if we only have one point in the segment, // we treat it as the last fix final FixWrapper newLastFix; if (lastFix == null) { newLastFix = fw; } else { newLastFix = lastFix; } // more special processing - for single-point segments final boolean symWasVisible = newLastFix.getSymbolShowing(); if (singlePointSegment) { newLastFix.setSymbolShowing(true); } paintIt(dest, newLastFix, getEndTimeLabels() && isFirstVisibleFix, false); if (singlePointSegment) { newLastFix.setSymbolShowing(symWasVisible); } } // now there's a chance that our fix has forgotten it's // parent, // particularly if it's the victim of a // copy/paste operation. Tell it about it's children fw.setTrackWrapper(this); final Color thisFixColor = tMode.colorFor(fw); // do our job of identifying the first & last date value if (fw.getVisible()) { // ok, see if this is the first one if (endPoints.size() == 0) { endPoints.add(fw); } else { // have we already got an end value? if (endPoints.size() == 2) { // yes, drop it endPoints.remove(1); } // store a new end value endPoints.add(fw); } } else { // nope. Don't join it to the last position. // ok, if we've built up a polygon, we need to write it // now paintSetOfPositions(dest, lastCol, thisLineStyle); } // remember this fix, used for relative tracks lastFix = fw; // ok, we only do this writing to screen if the actual // position is visible if (!fw.getVisible()) { continue; } final java.awt.Point thisP = dest.toScreen(fw.getLocation()); // just check that there's enough GUI to create the plot // (i.e. has a point been returned) if (thisP == null) { return endPoints; } // are we if (getLinkPositions() && (getLineStyle() != LineStylePropertyEditor.UNCONNECTED)) { // right, just check if we're a different colour to // the previous one final Color thisCol = thisFixColor; // do we know the previous colour if (lastCol == null) { lastCol = thisCol; } // is this to be joined to the previous one? if (fw.getLineShowing()) { // so, grow the the polyline, unless we've got a // colour change... if (thisCol != lastCol) { // double check we haven't been modified if (_ptCtr > _myPts.length) { continue; } // add our position to the list - we'll output // the polyline at the end if (_ptCtr < _myPts.length - 1) { _myPts[_ptCtr++] = thisP.x; _myPts[_ptCtr++] = thisP.y; } // yup, better get rid of the previous // polygon paintSetOfPositions(dest, lastCol, thisLineStyle); } // add our position to the list - we'll output // the polyline at the end if (_ptCtr > _myPts.length - 1) { continue; } _myPts[_ptCtr++] = thisP.x; _myPts[_ptCtr++] = thisP.y; } else { // nope, output however much line we've got so // far - since this // line won't be joined to future points paintSetOfPositions(dest, thisCol, thisLineStyle); // start off the next line _myPts[_ptCtr++] = thisP.x; _myPts[_ptCtr++] = thisP.y; } /* * set the colour of the track from now on to this colour, so that the "link" to the next * fix is set to this colour if left unchanged */ dest.setColor(thisFixColor); // and remember the last colour lastCol = thisCol; } } // while fixWrappers has more elements // ok - paint the label for the last visible point if (getPositionsVisible()) { if (endPoints.size() > 1) { // special handling. If it's a planning segment, we hide the // last fix, unless it's the very last segment // do we have more legs? final boolean hasMoreLegs = segments.hasMoreElements(); // is this a planning track? final boolean isPlanningTrack = this instanceof CompositeTrackWrapper; // ok, we hide the last point for planning legs, if there are // more legs to come final boolean forceHideLabel = isPlanningTrack && hasMoreLegs; // ok, get painting paintIt(dest, endPoints.get(1), getEndTimeLabels(), forceHideLabel); } } // ok, just see if we have any pending polylines to paint paintSetOfPositions(dest, lastCol, thisLineStyle); } return endPoints; } // LAYER support methods /** * paint this fix, overriding the label if necessary (since the user may wish to have 6-figure * DTGs at the start & end of the track * * @param dest * where we paint to * @param thisF * the fix we're painting * @param isEndPoint * whether point is one of the ends * @param forceHideLabel * whether we wish to hide the label */ private void paintIt(final CanvasType dest, final FixWrapper thisF, final boolean isEndPoint, final boolean forceHideLabel) { // have a look at the last fix. we defer painting the fix label, // because we want to know the id of the last visible fix, since // we may need to paint it's label in 6 DTG final boolean isVis = thisF.getLabelShowing(); final String fmt = thisF.getLabelFormat(); final String lblVal = thisF.getLabel(); // are we plotting DTG at ends? if (isEndPoint) { // set the custom format for our end labels (6-fig DTG) thisF.setLabelFormat("ddHHmm"); thisF.setLabelShowing(true); } if (forceHideLabel) { thisF.setLabelShowing(false); } // this next method just paints the fix. we've put the // call into paintThisFix so we can override the painting // in the CompositeTrackWrapper class paintThisFix(dest, thisF.getLocation(), thisF); // do we need to restore it? if (isEndPoint) { thisF.setLabelFormat(fmt); thisF.setLabelShowing(isVis); thisF.setLabel(lblVal); } if (forceHideLabel) { thisF.setLabelShowing(isVis); } } private void paintMultipleSegmentLabel(final CanvasType dest) { final Enumeration<Editable> posis = _theSegments.elements(); while (posis.hasMoreElements()) { final TrackSegment thisE = (TrackSegment) posis.nextElement(); // is this segment visible? if (!thisE.getVisible()) { continue; } // does it have visible data points? if (thisE.isEmpty()) { continue; } // if this is a TMA segment, we plot the name 1/2 way along. If it isn't // we plot it at the start if (thisE instanceof CoreTMASegment) { // just move along - we plot the name // a the mid-point } else { final WorldLocation theLoc = thisE.getTrackStart(); // hey, don't abuse the track label - create a fresh one each time final TextLabel label = new TextLabel(theLoc, thisE.getName()); // copy the font from the parent label.setFont(getTrackFont()); // is the first track a DR track? if (thisE.getPlotRelative()) { label.setFont(label.getFont().deriveFont(Font.ITALIC)); } else if (getTrackFont().isItalic()) { label.setFont(label.getFont().deriveFont(Font.PLAIN)); } // just see if this is a planning segment, with its own colors final Color color; if (thisE instanceof PlanningSegment) { final PlanningSegment ps = (PlanningSegment) thisE; color = ps.getColor(); } else { color = getColor(); } label.setColor(color); label.setLocation(theLoc); label.paint(dest); } } } /** * paint any polyline that we've built up * * @param dest * - where we're painting to * @param thisCol * @param lineStyle */ private void paintSetOfPositions(final CanvasType dest, final Color thisCol, final int lineStyle) { if (_ptCtr > 0) { dest.setColor(thisCol); dest.setLineStyle(lineStyle); final int[] poly = new int[_ptCtr]; System.arraycopy(_myPts, 0, poly, 0, _ptCtr); dest.drawPolyline(poly); dest.setLineStyle(CanvasType.SOLID); // and reset the counter _ptCtr = 0; } } private void paintSingleTrackLabel(final CanvasType dest, final List<FixWrapper> endPoints) { // check that we have found a location for the label if (getLabelLocation() == null) { return; } // check that we have set the name for the label if (getName() == null) { System.err.println("TRACK NAME MISSING"); } // does the first label have a colour? fixLabelColor(); // ok, sort out the correct location final FixWrapper hostFix; if (getNameAtStart() || endPoints.size() == 1) { // ok, we're choosing to use the start for the location. Or, // we've only got one fix - in which case the end "is" the start hostFix = endPoints.get(0); } else { hostFix = endPoints.get(1); } // sort out the location setLabelLocation(hostFix.getLocation()); // and the relative location // hmm, if we're plotting date labels at the ends, // shift the track name so that it's opposite Integer oldLoc = null; if (this.getEndTimeLabels()) { oldLoc = getNameLocation(); // is it auto-locate? if (oldLoc == NullableLocationPropertyEditor.AUTO) { // ok, automatically locate it final int theLoc = LabelLocationPropertyEditor.oppositeFor(hostFix .getLabelLocation()); setNameLocation(theLoc); } } // and paint it paintLabel(dest); // ok, restore the user-favourite location if (oldLoc != null) { setNameLocation(oldLoc); } } /** * get the fix to paint itself * * @param dest * @param lastLocation * @param fw */ protected void paintThisFix(final CanvasType dest, final WorldLocation lastLocation, final FixWrapper fw) { fw.paintMe(dest, lastLocation, getTrackColorMode().colorFor(fw)); } /** * draw vector labels for any TMA tracks * * @param dest */ private void paintVectorLabels(final CanvasType dest) { // cycle through the segments final Enumeration<Editable> segments = _theSegments.elements(); while (segments.hasMoreElements()) { final TrackSegment seg = (TrackSegment) segments.nextElement(); // is this segment visible? if (!seg.getVisible()) { // nope, jump to the next continue; } // paint only visible planning segments if (seg instanceof PlanningSegment) { final PlanningSegment ps = (PlanningSegment) seg; ps.paintLabel(dest); } else if (seg instanceof CoreTMASegment) { final CoreTMASegment tma = (CoreTMASegment) seg; // check the segment has some data if (!seg.isEmpty()) { final WorldLocation firstLoc = seg.first().getBounds().getCentre(); final WorldLocation lastLoc = seg.last().getBounds().getCentre(); final Font f = Defaults.getFont(); final Color c = getColor(); // tell the segment it's being stretched final String spdTxt = MWC.Utilities.TextFormatting.GeneralFormat .formatOneDecimalPlace(tma.getSpeed().getValueIn(WorldSpeed.Kts)); // copied this text from RelativeTMASegment double courseVal = tma.getCourse(); if (courseVal < 0) { courseVal += 360; } String textLabel = "[" + spdTxt + " kts " + (int) courseVal + "\u00B0]"; // ok, now plot it CanvasTypeUtilities.drawLabelOnLine(dest, textLabel, f, c, firstLoc, lastLoc, 1.2, true); textLabel = tma.getName().replace(TextLabel.NEWLINE_MARKER, " "); CanvasTypeUtilities.drawLabelOnLine(dest, textLabel, f, c, firstLoc, lastLoc, 1.2, false); } } } } /** * return the range from the nearest corner of the track * * @param other * the other location * @return the range */ @Override public final double rangeFrom(final WorldLocation other) { double nearest = -1; // do we have a track? if (_myWorldArea != null) { // find the nearest point on the track nearest = _myWorldArea.rangeFrom(other); } return nearest; } // track-shifting operation // support for dragging the track around /** * if a track segment is going to be split (and then deleted), re-attach any infills to one of the * new segments * * @param toBeDeleted * the segment that will be split * @param newBefore * the new first-half of the segment * @param newAfter * the new second-half of the segment */ private void reconnectInfills(final TrackSegment toBeDeleted, final TrackSegment newBefore, final TrackSegment newAfter) { // ok, loop through our legs final Enumeration<Editable> lIter = getSegments().elements(); while (lIter.hasMoreElements()) { final TrackSegment thisLeg = (TrackSegment) lIter.nextElement(); if (thisLeg instanceof DynamicInfillSegment) { final DynamicInfillSegment infill = (DynamicInfillSegment) thisLeg; if (toBeDeleted.equals(infill.getBeforeSegment())) { // connect to new after infill.configure(newAfter, infill.getAfterSegment()); } else if (toBeDeleted.equals(infill.getAfterSegment())) { // connect to new before infill.configure(infill.getBeforeSegment(), newBefore); } } } } /** * remove the requested item from the track * * @param point * the point to remove */ @Override public void removeElement(final Editable point) { boolean modified = false; // just see if it's a sensor which is trying to be removed if (point instanceof SensorWrapper) { _mySensors.removeElement(point); // tell the sensor wrapper to forget about us final TacticalDataWrapper sw = (TacticalDataWrapper) point; sw.setHost(null); // remember that we've made a change modified = true; } else if (point instanceof TMAWrapper) { _mySolutions.removeElement(point); // tell the sensor wrapper to forget about us final TacticalDataWrapper sw = (TacticalDataWrapper) point; sw.setHost(null); // remember that we've made a change modified = true; } else if (point instanceof SensorContactWrapper) { // ok, cycle through our sensors, try to remove this contact... final Enumeration<Editable> iter = _mySensors.elements(); while (iter.hasMoreElements()) { final SensorWrapper sw = (SensorWrapper) iter.nextElement(); // try to remove it from this one... sw.removeElement(point); // remember that we've made a change modified = true; } } else if (point instanceof DynamicTrackShapeWrapper) { // ok, cycle through our sensors, try to remove this contact... final Enumeration<Editable> iter = _myDynamicShapes.elements(); while (iter.hasMoreElements()) { final DynamicTrackShapeSetWrapper sw = (DynamicTrackShapeSetWrapper) iter.nextElement(); // try to remove it from this one... sw.removeElement(point); // remember that we've made a change modified = true; } } else if (point instanceof TrackSegment) { _theSegments.removeElement(point); // and clear the parent item final TrackSegment ts = (TrackSegment) point; ts.setWrapper(null); // we also need to stop listen for a child moving ts.removePropertyChangeListener(CoreTMASegment.ADJUSTED, _childTrackMovedListener); // remember that we've made a change modified = true; } else if (point.equals(_mySensors)) { // ahh, the user is trying to delete all the solution, cycle through // them final Enumeration<Editable> iter = _mySensors.elements(); while (iter.hasMoreElements()) { final Editable editable = iter.nextElement(); // tell the sensor wrapper to forget about us final TacticalDataWrapper sw = (TacticalDataWrapper) editable; sw.setHost(null); } // and empty them out _mySensors.removeAllElements(); // remember that we've made a change modified = true; } else if (point.equals(_myDynamicShapes)) { // ahh, the user is trying to delete all the solution, cycle through // them final Enumeration<Editable> iter = _myDynamicShapes.elements(); while (iter.hasMoreElements()) { final Editable editable = iter.nextElement(); // tell the sensor wrapper to forget about us final DynamicTrackShapeSetWrapper sw = (DynamicTrackShapeSetWrapper) editable; sw.setHost(null); } // and empty them out _myDynamicShapes.removeAllElements(); // remember that we've made a change modified = true; } else if (point.equals(_mySolutions)) { // ahh, the user is trying to delete all the solution, cycle through // them final Enumeration<Editable> iter = _mySolutions.elements(); while (iter.hasMoreElements()) { final Editable editable = iter.nextElement(); // tell the sensor wrapper to forget about us final TacticalDataWrapper sw = (TacticalDataWrapper) editable; sw.setHost(null); } // and empty them out _mySolutions.removeAllElements(); // remember that we've made a change modified = true; } else if (point instanceof FixWrapper) { final FixWrapper fw = (FixWrapper) point; // loop through the segments final Enumeration<Editable> segments = _theSegments.elements(); while (segments.hasMoreElements()) { final TrackSegment seg = (TrackSegment) segments.nextElement(); seg.removeElement(point); // and stop listening to it (if it's a fix) fw.removePropertyChangeListener(PlainWrapper.LOCATION_CHANGED, _locationListener); // remember that we've made a change modified = true; // we've also got to clear the cache flushPeriodCache(); flushPositionCache(); } } if (modified) { setRelativePending(); } } /** * pass through the track, resetting the labels back to their original DTG */ @FireReformatted public void resetLabels() { FormatTracks.formatTrack(this); } @Override public Enumeration<Editable> segments() { final TreeSet<Editable> res = new TreeSet<Editable>(); // ok, we want to wrap our fast-data as a set of plottables // see how many track segments we have if (_theSegments.size() == 1) { // just the one, insert it res.add(_theSegments.first()); } else { // more than one, insert them as a tree res.add(_theSegments); } return new TrackWrapper_Support.IteratorWrapper(res.iterator()); } /** * length of trail to draw */ public final void setCustomTrailLength(final Duration len) { // just check that it's a non-null length if (len != null) { if (len.getMillis() != 0) { _customTrailLength = len; } else { _customTrailLength = null; } } } /** * length of trail to draw */ public final void setCustomVectorStretch(final double stretch) { _customVectorStretch = stretch; } /** * whether to show time labels at the start/end of the track * * @param endTimeLabels * yes/no */ @FireReformatted public void setEndTimeLabels(final boolean endTimeLabels) { this._endTimeLabels = endTimeLabels; } @Override public final void setInterpolatePoints(final boolean val) { _interpolatePoints = val; // note: when we switch interpolation on or off, it can change // the fix that is to be returned from getNearestTo(). // So, we should clear the lastDTG cached value _lastFix = null; } /** * set the style used for plotting the lines for this track * * @param val */ @Override public void setLineStyle(final int val) { _lineStyle = val; } /** * whether to link points * * @param linkPositions */ public void setLinkPositions(final boolean linkPositions) { _linkPositions = linkPositions; } /** * whether to show the track name at the start or end of the track * * @param val * yes no for <I>show label at start</I> */ public final void setNameAtStart(final boolean val) { _LabelAtStart = val; } public void setPlotArrayCentre(final boolean plotArrayCentre) { _plotArrayCentre = plotArrayCentre; } private void setRelativePending() { _relativeUpdatePending = true; } /** * set the data frequency (in seconds) for the track & sensor data * * @param theVal * frequency to use */ @FireExtended @Override public final void setResampleDataAt(final HiResDate theVal) { this._lastDataFrequency = theVal; // have a go at trimming the start time to a whole number of intervals final long interval = theVal.getMicros(); // do we have a start time (we may just be being tested...) if (this.getStartDTG() == null) { return; } final long currentStart = this.getStartDTG().getMicros(); long startTime = (currentStart / interval) * interval; // just check we're in the range if (startTime < currentStart) { startTime += interval; } // move back to millis startTime /= 1000L; // just check it's not a barking frequency if (theVal.getDate().getTime() <= 0) { // ignore, we don't need to do anything for a zero or a -1 } else { final SegmentList segments = _theSegments; final Enumeration<Editable> theEnum = segments.elements(); while (theEnum.hasMoreElements()) { final TrackSegment seg = (TrackSegment) theEnum.nextElement(); seg.decimate(theVal, this, startTime); } // start off with the sensor data if (_mySensors != null) { for (final Enumeration<Editable> iterator = _mySensors .elements(); iterator.hasMoreElements();) { final SensorWrapper thisS = (SensorWrapper) iterator.nextElement(); thisS.decimate(theVal, startTime); } } // now the solutions if (_mySolutions != null) { for (final Enumeration<Editable> iterator = _mySolutions .elements(); iterator.hasMoreElements();) { final TMAWrapper thisT = (TMAWrapper) iterator.nextElement(); thisT.decimate(theVal, startTime); } } // ok, also set the arrow, symbol, label frequencies setLabelFrequency(getLabelFrequency()); setSymbolFrequency(getSymbolFrequency()); setArrowFrequency(getArrowFrequency()); } // remember we may need to regenerate positions, if we're a TMA solution final Editable firstLeg = getSegments().elements().nextElement(); if (firstLeg instanceof CoreTMASegment) { // setRelativePending(); sortOutRelativePositions(); } } // note we are putting a track-labelled wrapper around the colour // parameter, to make the properties window less confusing /** * the colour of the points on the track * * @param theCol * the colour to use */ @FireReformatted public final void setTrackColor(final Color theCol) { setColor(theCol); } /** * set the mode used to color the track * * @param trackColorMode */ public void setTrackColorMode(final TrackColorMode trackColorMode) { this._trackColorMode = trackColorMode; } @Override public void shift(final WorldLocation feature, final WorldVector vector) { feature.addToMe(vector); // right, one of our fixes has moved. get the sensors to update // themselves fixMoved(); } @Override public void shift(final WorldVector vector) { boolean handled = false; boolean updateAlreadyFired = false; // check it contains a range if (vector.getRange() > 0d) { // ok, move any tracks final Enumeration<Editable> enumA = elements(); while (enumA.hasMoreElements()) { final Object thisO = enumA.nextElement(); if (thisO instanceof TrackSegment) { final TrackSegment seg = (TrackSegment) thisO; seg.shift(vector); } else if (thisO instanceof SegmentList) { final SegmentList list = (SegmentList) thisO; final Collection<Editable> items = list.getData(); for (final Iterator<Editable> iterator = items.iterator(); iterator .hasNext();) { final TrackSegment segment = (TrackSegment) iterator.next(); segment.shift(vector); } } } handled = true; // ok, get the legs to re-generate themselves updateAlreadyFired = sortOutRelativePositions(); } // now update the other children - some // are sensitive to ownship track this.updateDependents(elements(), vector); // did we move any dependents if (handled && !updateAlreadyFired) { firePropertyChange(PlainWrapper.LOCATION_CHANGED, null, getNameLocation()); } } /** * if we've got a relative track segment, it only learns where its individual fixes are once * they've been initialised. This is where we do it. */ public boolean sortOutRelativePositions() { boolean moved = false; boolean updateFired = false; FixWrapper lastFix = null; final Enumeration<Editable> segments = _theSegments.elements(); while (segments.hasMoreElements()) { final TrackSegment seg = (TrackSegment) segments.nextElement(); // SPECIAL HANDLING, SEE IF IT'S A TMA SEGMENT TO BE PLOTTED IN // RELATIVE MODE final boolean isRelative = seg.getPlotRelative(); WorldLocation tmaLastLoc = null; long tmaLastDTG = 0; final Enumeration<Editable> fixWrappers = seg.elements(); while (fixWrappers.hasMoreElements()) { final FixWrapper fw = (FixWrapper) fixWrappers.nextElement(); // now there's a chance that our fix has forgotten it's parent, // particularly if it's the victim of a // copy/paste operation. Tell it about it's children fw.setTrackWrapper(this); // ok, are we in relative? if (isRelative) { final long thisTime = fw.getDateTimeGroup().getDate().getTime(); // ok, is this our first location? if (tmaLastLoc == null) { final WorldLocation trackStart = seg.getTrackStart(); if (trackStart != null) { tmaLastLoc = new WorldLocation(trackStart); } } else { // calculate a new vector final long timeDelta = thisTime - tmaLastDTG; if (lastFix != null) { final double courseRads; final double speedKts; if (seg instanceof CoreTMASegment) { final CoreTMASegment tmaSeg = (CoreTMASegment) seg; courseRads = Math.toRadians(tmaSeg.getCourse()); speedKts = tmaSeg.getSpeed().getValueIn(WorldSpeed.Kts); } else { courseRads = lastFix.getCourse(); speedKts = lastFix.getSpeed(); } // check it has a location. final double depthM; if (fw.getLocation() != null) { depthM = fw.getDepth(); } else { // no location - we may be extending a TMA segment depthM = tmaLastLoc.getDepth(); } // use the value of depth as read in from the file tmaLastLoc.setDepth(depthM); final WorldVector thisVec = seg.vectorFor(timeDelta, speedKts, courseRads); tmaLastLoc.addToMe(thisVec); } } lastFix = fw; tmaLastDTG = thisTime; if (tmaLastLoc != null) { // have we found any movement yet? if (!moved && fw.getLocation() != null && !fw.getLocation().equals( tmaLastLoc)) { moved = true; } // dump the location into the fix fw.setFixLocationSilent(new WorldLocation(tmaLastLoc)); } } } } // did we do anything? if (moved) { // get the child components to update, // - including sending out a "moved" message updateDependents(elements(), new WorldVector(0, 0, 0)); // also share the good news firePropertyChange(PlainWrapper.LOCATION_CHANGED, null, System .currentTimeMillis()); updateFired = true; } return updateFired; } /** * split this whole track into two sub-tracks * * @param splitPoint * the point at which we perform the split * @param splitBeforePoint * whether to put split before or after specified point * @return a list of the new track segments (used for subsequent undo operations) */ public Vector<TrackSegment> splitTrack(final FixWrapper splitPoint, final boolean splitBeforePoint) { FixWrapper splitPnt = splitPoint; Vector<TrackSegment> res = null; TrackSegment relevantSegment = null; // are we still in one section? if (_theSegments.size() == 1) { relevantSegment = (TrackSegment) _theSegments.first(); // yup, looks like we're going to be splitting it. // better give it a proper name relevantSegment.setName(relevantSegment.startDTG().getDate().toString()); } else { // ok, find which segment contains our data final Enumeration<Editable> segments = _theSegments.elements(); while (segments.hasMoreElements()) { final TrackSegment seg = (TrackSegment) segments.nextElement(); if (seg.getData().contains(splitPnt)) { relevantSegment = seg; break; } } } if (relevantSegment == null) { throw new RuntimeException( "failed to provide relevant segment, alg will break"); } // hmm, if we're splitting after the point, we need to move along the // bus by // one if (!splitBeforePoint) { final Collection<Editable> items = relevantSegment.getData(); final Iterator<Editable> theI = items.iterator(); Editable previous = null; while (theI.hasNext()) { final Editable thisE = theI.next(); // have we chosen to remember the previous item? if (previous != null) { // yes, this must be the one we're after splitPnt = (FixWrapper) thisE; break; } // is this the one we're looking for? if (thisE.equals(splitPnt)) { // yup, remember it - we want to use the next value previous = thisE; } } } // yup, do our first split final SortedSet<Editable> p1 = relevantSegment.headSet(splitPnt); final SortedSet<Editable> p2 = relevantSegment.tailSet(splitPnt); // get our results ready final TrackSegment ts1; final TrackSegment ts2; // aaah, just sort out if we are splitting a TMA segment, in which case // want to create two // tma segments, not track segments if (relevantSegment instanceof RelativeTMASegment) { final RelativeTMASegment theTMA = (RelativeTMASegment) relevantSegment; // find the ownship location at the relevant time WorldLocation secondLegOrigin = null; // get the time of the split final HiResDate splitTime = splitPnt.getDateTimeGroup(); // aah, sort out if we are splitting before or after. final SensorWrapper sensor = theTMA.getReferenceSensor(); if (sensor != null) { final Watchable[] nearestF = sensor.getNearestTo(splitTime); if ((nearestF != null) && (nearestF.length > 0)) { final SensorContactWrapper scw = (SensorContactWrapper) nearestF[0]; secondLegOrigin = scw.getCalculatedOrigin(null); } } // if we couldn't get a sensor origin, try for the track origin if (secondLegOrigin == null) { final Watchable firstMatch = theTMA.getReferenceTrack().getNearestTo( splitTime)[0]; secondLegOrigin = firstMatch.getLocation(); } final WorldVector secondOffset = splitPnt.getLocation().subtract( secondLegOrigin); // put the lists back into plottable layers final RelativeTMASegment tr1 = new RelativeTMASegment(theTMA, p1, theTMA .getOffset()); final RelativeTMASegment tr2 = new RelativeTMASegment(theTMA, p2, secondOffset); // and store them ts1 = tr1; ts2 = tr2; } else if (relevantSegment instanceof AbsoluteTMASegment) { final AbsoluteTMASegment theTMA = (AbsoluteTMASegment) relevantSegment; // aah, sort out if we are splitting before or after. // find out the offset at the split point, so we can initiate it for // the // second part of the track final Watchable[] matches = this.getNearestTo(splitPnt .getDateTimeGroup()); final WorldLocation origin = matches[0].getLocation(); final FixWrapper t1Start = (FixWrapper) p1.first(); // put the lists back into plottable layers final AbsoluteTMASegment tr1 = new AbsoluteTMASegment(theTMA, p1, t1Start .getLocation(), null, null); final AbsoluteTMASegment tr2 = new AbsoluteTMASegment(theTMA, p2, origin, null, null); // and store them ts1 = tr1; ts2 = tr2; } else { // put the lists back into plottable layers ts1 = new TrackSegment(p1); ts2 = new TrackSegment(p2); } // ok. removing the host segment will delete any infills. So, be sure to re-attach them reconnectInfills(relevantSegment, ts1, ts2); // now clear the positions removeElement(relevantSegment); // and put back our new layers add(ts1); add(ts2); // remember them res = new Vector<TrackSegment>(); res.add(ts1); res.add(ts2); return res; } /** * extra parameter, so that jvm can produce a sensible name for this * * @return the track name, as a string */ @Override public final String toString() { return "Track:" + getName(); } public void trimTo(final TimePeriod period) { if (_mySensors != null) { final Enumeration<Editable> iter = _mySensors.elements(); while (iter.hasMoreElements()) { final SensorWrapper sw = (SensorWrapper) iter.nextElement(); sw.trimTo(period); } } if (_myDynamicShapes != null) { final Enumeration<Editable> iter = _myDynamicShapes.elements(); while (iter.hasMoreElements()) { final DynamicTrackShapeSetWrapper sw = (DynamicTrackShapeSetWrapper) iter.nextElement(); sw.trimTo(period); } } if (_mySolutions != null) { final Enumeration<Editable> iter = _mySolutions.elements(); while (iter.hasMoreElements()) { final TMAWrapper sw = (TMAWrapper) iter.nextElement(); sw.trimTo(period); } } if (_theSegments != null) { final Enumeration<Editable> segments = _theSegments.elements(); while (segments.hasMoreElements()) { final TrackSegment seg = (TrackSegment) segments.nextElement(); seg.trimTo(period); } } } /** * move the whole of the track be the provided offset */ private final boolean updateDependents(final Enumeration<Editable> theEnum, final WorldVector offset) { // keep track of if the track contains something that doesn't get // dragged boolean handledData = false; // work through the elements while (theEnum.hasMoreElements()) { final Object thisO = theEnum.nextElement(); if (thisO instanceof DynamicInfillSegment) { final DynamicInfillSegment dd = (DynamicInfillSegment) thisO; dd.reconstruct(); // ok - job well done handledData = true; } else if (thisO instanceof TrackSegment) { // special case = we handle this higher // up the call chain, since tracks // have to move before any dependent children // ok - job well done handledData = true; } else if (thisO instanceof SegmentList) { final SegmentList list = (SegmentList) thisO; final Collection<Editable> items = list.getData(); final IteratorWrapper enumer = new Plottables.IteratorWrapper(items .iterator()); handledData = updateDependents(enumer, offset); } else if (thisO instanceof SensorWrapper) { final SensorWrapper sw = (SensorWrapper) thisO; final Enumeration<Editable> enumS = sw.elements(); while (enumS.hasMoreElements()) { final SensorContactWrapper scw = (SensorContactWrapper) enumS .nextElement(); // does this fix have it's own origin? final WorldLocation sensorOrigin = scw.getOrigin(); if (sensorOrigin == null) { // ok - get it to recalculate it scw.clearCalculatedOrigin(); @SuppressWarnings("unused") final WorldLocation newO = scw.getCalculatedOrigin(this); // we don't use the newO - we're just // triggering an update } else { // create new object to contain the updated location final WorldLocation newSensorLocation = new WorldLocation( sensorOrigin); newSensorLocation.addToMe(offset); // so the contact did have an origin, change it scw.setOrigin(newSensorLocation); } } // looping through the contacts // ok - job well done handledData = true; } // whether this is a sensor wrapper else if (thisO instanceof TMAWrapper) { final TMAWrapper sw = (TMAWrapper) thisO; final Enumeration<Editable> enumS = sw.elements(); while (enumS.hasMoreElements()) { final TMAContactWrapper scw = (TMAContactWrapper) enumS.nextElement(); // does this fix have it's own origin? final WorldLocation sensorOrigin = scw.getOrigin(); if (sensorOrigin != null) { // create new object to contain the updated location final WorldLocation newSensorLocation = new WorldLocation( sensorOrigin); newSensorLocation.addToMe(offset); // so the contact did have an origin, change it scw.setOrigin(newSensorLocation); } } // looping through the contacts // ok - job well done handledData = true; } // whether this is a TMA wrapper else if (thisO instanceof BaseLayer) { // ok, loop through it final BaseLayer bl = (BaseLayer) thisO; handledData = updateDependents(bl.elements(), offset); } } // looping through this track // ok, did we handle the data? if (!handledData) { System.err.println("TrackWrapper problem; not able to shift:" + theEnum); } return handledData; } /** * is this track visible between these time periods? * * @param start * start DTG * @param end * end DTG * @return yes/no */ public final boolean visibleBetween(final HiResDate start, final HiResDate end) { boolean visible = false; if (getStartDTG().lessThan(end) && (getEndDTG().greaterThan(start))) { visible = true; } return visible; } public PropertyChangeListener[] getPropertyChangeListeners( final String propertyName) { return getSupport().getPropertyChangeListeners(propertyName); } }
package mb.p_raffrayi.impl; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.concurrent.TimeUnit; import javax.annotation.Nullable; import org.metaborg.util.Ref; import org.metaborg.util.collection.CapsuleUtil; import org.metaborg.util.collection.HashTrieRelation3; import org.metaborg.util.collection.IRelation3; import org.metaborg.util.collection.MultiSet; import org.metaborg.util.collection.MultiSetMap; import org.metaborg.util.functions.Function2; import org.metaborg.util.future.CompletableFuture; import org.metaborg.util.future.ICompletable; import org.metaborg.util.future.ICompletableFuture; import org.metaborg.util.future.IFuture; import org.metaborg.util.log.ILogger; import org.metaborg.util.log.LoggerUtils; import org.metaborg.util.task.ICancel; import org.metaborg.util.tuple.Tuple2; import org.metaborg.util.unit.Unit; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import io.usethesource.capsule.Set; import mb.p_raffrayi.DeadlockException; import mb.p_raffrayi.IScopeGraphLibrary; import mb.p_raffrayi.ITypeChecker; import mb.p_raffrayi.ITypeCheckerContext; import mb.p_raffrayi.IUnitResult; import mb.p_raffrayi.IUnitStats; import mb.p_raffrayi.TypeCheckingFailedException; import mb.p_raffrayi.actors.IActor; import mb.p_raffrayi.actors.IActorMonitor; import mb.p_raffrayi.actors.IActorRef; import mb.p_raffrayi.actors.IActorStats; import mb.p_raffrayi.actors.TypeTag; import mb.p_raffrayi.actors.deadlock.ChandyMisraHaas; import mb.p_raffrayi.actors.deadlock.ChandyMisraHaas.Host; import mb.p_raffrayi.impl.tokens.CloseLabel; import mb.p_raffrayi.impl.tokens.CloseScope; import mb.p_raffrayi.impl.tokens.IWaitFor; import mb.p_raffrayi.impl.tokens.InitScope; import mb.p_raffrayi.impl.tokens.Query; import mb.p_raffrayi.impl.tokens.TypeCheckerResult; import mb.p_raffrayi.impl.tokens.TypeCheckerState; import mb.p_raffrayi.nameresolution.DataLeq; import mb.p_raffrayi.nameresolution.DataWf; import mb.scopegraph.ecoop21.LabelOrder; import mb.scopegraph.ecoop21.LabelWf; import mb.scopegraph.ecoop21.NameResolution; import mb.scopegraph.oopsla20.IScopeGraph; import mb.scopegraph.oopsla20.path.IResolutionPath; import mb.scopegraph.oopsla20.reference.EdgeOrData; import mb.scopegraph.oopsla20.reference.Env; import mb.scopegraph.oopsla20.reference.ScopeGraph; import mb.scopegraph.oopsla20.terms.newPath.ScopePath; public abstract class AbstractUnit<S, L, D, R> implements IUnit<S, L, D, R>, IActorMonitor, Host<IActorRef<? extends IUnit<S, L, D, ?>>> { private static final ILogger logger = LoggerUtils.logger(AbstractUnit.class); protected final TypeTag<IUnit<S, L, D, ?>> TYPE = TypeTag.of(IUnit.class); protected final IActor<? extends IUnit<S, L, D, R>> self; @Nullable protected final IActorRef<? extends IUnit<S, L, D, ?>> parent; protected final IUnitContext<S, L, D> context; private final ChandyMisraHaas<IActorRef<? extends IUnit<S, L, D, ?>>> cmh; private volatile boolean innerResult; private final Ref<R> analysis; private final List<Throwable> failures; private final Map<String, IUnitResult<S, L, D, ?>> subUnitResults; private final ICompletableFuture<IUnitResult<S, L, D, R>> unitResult; protected final Ref<IScopeGraph.Immutable<S, L, D>> scopeGraph; protected final Set.Immutable<L> edgeLabels; protected final Set.Transient<S> scopes; private final IRelation3.Transient<S, EdgeOrData<L>, Delay> delays; private final MultiSet.Transient<String> scopeNameCounters; protected final Stats stats; public AbstractUnit(IActor<? extends IUnit<S, L, D, R>> self, @Nullable IActorRef<? extends IUnit<S, L, D, ?>> parent, IUnitContext<S, L, D> context, Iterable<L> edgeLabels) { this.self = self; this.parent = parent; this.context = context; this.cmh = new ChandyMisraHaas<>(this, this::handleDeadlock); this.innerResult = false; this.analysis = new Ref<>(); this.failures = new ArrayList<>(); this.subUnitResults = new HashMap<>(); this.unitResult = new CompletableFuture<>(); this.scopeGraph = new Ref<>(ScopeGraph.Immutable.of()); this.edgeLabels = CapsuleUtil.toSet(edgeLabels); this.scopes = CapsuleUtil.transientSet(); this.delays = HashTrieRelation3.Transient.of(); this.scopeNameCounters = MultiSet.Transient.of(); this.stats = new Stats(self.stats()); } // Interface protected abstract IFuture<D> getExternalDatum(D datum); // IUnit2UnitProtocol interface, called by IUnit implementations @Override public void _initShare(S scope, Iterable<EdgeOrData<L>> edges, boolean sharing) { resume(); doInitShare(self.sender(TYPE), scope, edges, sharing); } @Override public void _addShare(S scope) { doAddShare(self.sender(TYPE), scope); } @Override public void _doneSharing(S scope) { resume(); doCloseScope(self.sender(TYPE), scope); } @Override public void _addEdge(S source, L label, S target) { doAddEdge(self.sender(TYPE), source, label, target); } @Override public void _closeEdge(S scope, EdgeOrData<L> edge) { resume(); doCloseLabel(self.sender(TYPE), scope, edge); } @Override public IFuture<Env<S, L, D>> _query(ScopePath<S, L> path, LabelWf<L> labelWF, DataWf<S, L, D> dataWF, LabelOrder<L> labelOrder, DataLeq<S, L, D> dataEquiv) { // resume(); // FIXME necessary? stats.incomingQueries += 1; return doQuery(self.sender(TYPE), path, labelWF, labelOrder, dataWF, dataEquiv, null, null); } // Implementations -- independent of message handling context protected final S makeScope(String baseName) { final String name = baseName.replace('-', '_'); final int n = scopeNameCounters.add(name); final S scope = context.makeScope(name + "-" + n); return scope; } protected final void doStart(List<S> rootScopes) { for(S rootScope : CapsuleUtil.toSet(rootScopes)) { scopes.__insert(rootScope); doAddLocalShare(self, rootScope); } } protected final IFuture<IUnitResult<S, L, D, R>> doFinish(IFuture<R> result) { final ICompletableFuture<R> internalResult = new CompletableFuture<>(); final TypeCheckerResult<S, L, D> token = TypeCheckerResult.of(self, internalResult); waitFor(token, self); result.whenComplete(internalResult::complete); // FIXME self.schedule(result)? internalResult.whenComplete((r, ex) -> { logger.debug("{} type checker finished", this); resume(); // FIXME necessary? if(ex != null) { failures.add(ex); } else { analysis.set(r); } granted(token, self); final MultiSet.Immutable<IWaitFor<S, L, D>> selfTokens = getTokens(self); if(!selfTokens.isEmpty()) { logger.debug("{} returned while waiting on {}", self, selfTokens); } innerResult = true; }); return unitResult; } protected <Q> Tuple2<IActorRef<? extends IUnit<S, L, D, Q>>, IFuture<IUnitResult<S, L, D, Q>>> doAddSubUnit( String id, Function2<IActor<IUnit<S, L, D, Q>>, IUnitContext<S, L, D>, IUnit<S, L, D, Q>> unitProvider, List<S> rootScopes) { for(S rootScope : rootScopes) { assertOwnOrSharedScope(rootScope); } final Tuple2<IFuture<IUnitResult<S, L, D, Q>>, IActorRef<? extends IUnit<S, L, D, Q>>> result_subunit = context.add(id, unitProvider, rootScopes); final IActorRef<? extends IUnit<S, L, D, Q>> subunit = result_subunit._2(); final ICompletableFuture<IUnitResult<S, L, D, Q>> internalResult = new CompletableFuture<>(); final TypeCheckerResult<S, L, D> token = TypeCheckerResult.of(self, internalResult); waitFor(token, subunit); result_subunit._1().whenComplete(internalResult::complete); // must come after waitFor for(S rootScope : CapsuleUtil.toSet(rootScopes)) { doAddShare(subunit, rootScope); } final IFuture<IUnitResult<S, L, D, Q>> ret = internalResult.whenComplete((r, ex) -> { logger.debug("{} subunit {} finished", this, subunit); resume(); granted(token, subunit); if(ex != null) { failures.add(new Exception("No result for sub unit " + id)); } else { subUnitResults.put(id, r); } }); return Tuple2.of(subunit, ret); } protected final S doFreshScope(String baseName, Iterable<L> edgeLabels, boolean data, boolean sharing) { final S scope = makeScope(baseName); final List<EdgeOrData<L>> labels = Lists.newArrayList(); for(L l : edgeLabels) { labels.add(EdgeOrData.edge(l)); } if(data) { labels.add(EdgeOrData.data()); } scopes.__insert(scope); doAddLocalShare(self, scope); doInitShare(self, scope, labels, sharing); return scope; } protected final void doAddLocalShare(IActorRef<? extends IUnit<S, L, D, ?>> sender, S scope) { assertOwnOrSharedScope(scope); waitFor(InitScope.of(self, scope), sender); } protected final void doAddShare(IActorRef<? extends IUnit<S, L, D, ?>> sender, S scope) { doAddLocalShare(sender, scope); if(!isOwner(scope)) { self.async(parent)._addShare(scope); } } protected final void doInitShare(IActorRef<? extends IUnit<S, L, D, ?>> sender, S scope, Iterable<EdgeOrData<L>> edges, boolean sharing) { assertOwnOrSharedScope(scope); granted(InitScope.of(self, scope), sender); for(EdgeOrData<L> edge : edges) { waitFor(CloseLabel.of(self, scope, edge), sender); } if(sharing) { waitFor(CloseScope.of(self, scope), sender); } if(isOwner(scope)) { if(isScopeInitialized(scope)) { releaseDelays(scope); } } else { self.async(parent)._initShare(scope, edges, sharing); } } protected final void doSetDatum(S scope, D datum) { final EdgeOrData<L> edge = EdgeOrData.data(); assertLabelOpen(scope, edge); scopeGraph.set(scopeGraph.get().setDatum(scope, datum)); doCloseLabel(self, scope, edge); } protected final void doCloseScope(IActorRef<? extends IUnit<S, L, D, ?>> sender, S scope) { assertOwnOrSharedScope(scope); granted(CloseScope.of(self, scope), sender); if(isOwner(scope)) { if(isScopeInitialized(scope)) { releaseDelays(scope); } } else { self.async(parent)._doneSharing(scope); } } protected final void doCloseLabel(IActorRef<? extends IUnit<S, L, D, ?>> sender, S scope, EdgeOrData<L> edge) { assertOwnOrSharedScope(scope); granted(CloseLabel.of(self, scope, edge), sender); if(isOwner(scope)) { if(isEdgeClosed(scope, edge)) { releaseDelays(scope, edge); } } else { self.async(parent)._closeEdge(scope, edge); } } protected final void doAddEdge(@SuppressWarnings("unused") IActorRef<? extends IUnit<S, L, D, ?>> sender, S source, L label, S target) { assertOwnOrSharedScope(source); assertLabelOpen(source, EdgeOrData.edge(label)); scopeGraph.set(scopeGraph.get().addEdge(source, label, target)); if(!isOwner(source)) { self.async(parent)._addEdge(source, label, target); } } protected final IFuture<Env<S, L, D>> doQuery(IActorRef<? extends IUnit<S, L, D, ?>> sender, ScopePath<S, L> path, LabelWf<L> labelWF, LabelOrder<L> labelOrder, DataWf<S, L, D> dataWF, DataLeq<S, L, D> dataEquiv, DataWf<S, L, D> dataWfInternal, DataLeq<S, L, D> dataEquivInternal) { logger.debug("got _query from {}", sender); final boolean external = !sender.equals(self); final NameResolution<S, L, D> nr = new NameResolution<S, L, D>(edgeLabels, labelOrder) { @Override public Optional<IFuture<Env<S, L, D>>> externalEnv(ScopePath<S, L> path, LabelWf<L> re, LabelOrder<L> labelOrder) { final S scope = path.getTarget(); if(canAnswer(scope)) { logger.debug("local env {}", scope); return Optional.empty(); } else { final IActorRef<? extends IUnit<S, L, D, ?>> owner = context.owner(scope); logger.debug("remote env {} at {}", scope, owner); // this code mirrors query(...) final IFuture<Env<S, L, D>> result = self.async(owner)._query(path, re, dataWF, labelOrder, dataEquiv); final Query<S, L, D> wf = Query.of(sender, path, re, dataWF, labelOrder, dataEquiv, result); waitFor(wf, owner); if(external) { stats.forwardedQueries += 1; } else { stats.outgoingQueries += 1; } return Optional.of(result.whenComplete((r, ex) -> { logger.debug("got answer from {}", sender); resume(); granted(wf, owner); })); } } @Override protected IFuture<Optional<D>> getDatum(S scope) { return isComplete(scope, EdgeOrData.data(), sender).thenCompose(__ -> { final Optional<D> datum; if(!(datum = scopeGraph.get().getData(scope)).isPresent()) { return CompletableFuture.completedFuture(Optional.empty()); } if(external || dataWfInternal == null) { logger.debug("require external rep for {}", datum.get()); final IFuture<D> result = getExternalDatum(datum.get()); final IFuture<D> ret; if(result.isDone()) { ret = result; } else { final ICompletableFuture<D> internalResult = new CompletableFuture<>(); final IWaitFor<S, L, D> token = TypeCheckerState.of(sender, ImmutableList.of(datum.get()), internalResult); waitFor(token, self); result.whenComplete(internalResult::complete); // must come after waitFor ret = internalResult.whenComplete((rep, ex) -> { self.assertOnActorThread(); granted(token, self); }); } return ret.thenApply(rep -> { logger.debug("got external rep {} for {}", rep, datum.get()); return Optional.of(rep); }); } else { return CompletableFuture.completedFuture(datum); } }); } @Override protected IFuture<Iterable<S>> getEdges(S scope, L label) { return isComplete(scope, EdgeOrData.edge(label), sender).thenApply(__ -> { return scopeGraph.get().getEdges(scope, label); }); } @Override protected IFuture<Boolean> dataWf(D d, ICancel cancel) throws InterruptedException { stats.dataWfChecks += 1; final IFuture<Boolean> result; if(external || dataWfInternal == null) { result = dataWF.wf(d, queryContext, cancel); } else { result = dataWfInternal.wf(d, queryContext, cancel); } if(result.isDone()) { return result; } else { final ICompletableFuture<Boolean> internalResult = new CompletableFuture<>(); final TypeCheckerState<S, L, D> token = TypeCheckerState.of(sender, ImmutableList.of(d), internalResult); waitFor(token, self); result.whenComplete(internalResult::complete); // must come after waitFor return internalResult.whenComplete((r, ex) -> { self.assertOnActorThread(); granted(token, self); }); } } @Override protected IFuture<Boolean> dataLeq(D d1, D d2, ICancel cancel) throws InterruptedException { stats.dataLeqChecks += 1; final IFuture<Boolean> result; if(external || dataEquivInternal == null) { result = dataEquiv.leq(d1, d2, queryContext, cancel); } else { result = dataEquivInternal.leq(d1, d2, queryContext, cancel); } if(result.isDone()) { return result; } else { final ICompletableFuture<Boolean> internalResult = new CompletableFuture<>(); final TypeCheckerState<S, L, D> token = TypeCheckerState.of(sender, ImmutableList.of(d1, d2), internalResult); waitFor(token, self); result.whenComplete(internalResult::complete); // must come after waitFor return internalResult.whenComplete((r, ex) -> { self.assertOnActorThread(); granted(token, self); }); } } @Override public IFuture<Boolean> dataLeqAlwaysTrue(ICancel cancel) { return dataEquiv.alwaysTrue(queryContext, cancel); } }; final IFuture<Env<S, L, D>> result = nr.env(path, labelWF, context.cancel()); result.whenComplete((env, ex) -> { logger.debug("have answer for {}", sender); }); return result; } private final ITypeCheckerContext<S, L, D> queryContext = new ITypeCheckerContext<S, L, D>() { @Override public String id() { return self.id() + "#query"; } @SuppressWarnings("unused") @Override public <Q> IFuture<IUnitResult<S, L, D, Q>> add(String id, ITypeChecker<S, L, D, Q> unitChecker, List<S> rootScopes) { throw new UnsupportedOperationException("Unsupported in query context."); } @SuppressWarnings("unused") @Override public IFuture<IUnitResult<S, L, D, Unit>> add(String id, IScopeGraphLibrary<S, L, D> library, List<S> rootScopes) { throw new UnsupportedOperationException("Unsupported in query context."); } @SuppressWarnings("unused") @Override public void initScope(S root, Iterable<L> labels, boolean sharing) { throw new UnsupportedOperationException("Unsupported in query context."); } @SuppressWarnings("unused") @Override public S freshScope(String baseName, Iterable<L> edgeLabels, boolean data, boolean sharing) { throw new UnsupportedOperationException("Unsupported in query context."); } @SuppressWarnings("unused") @Override public void shareLocal(S scope) { throw new UnsupportedOperationException("Unsupported in query context."); } @SuppressWarnings("unused") @Override public void setDatum(S scope, D datum) { throw new UnsupportedOperationException("Unsupported in query context."); } @SuppressWarnings("unused") @Override public void addEdge(S source, L label, S target) { throw new UnsupportedOperationException("Unsupported in query context."); } @SuppressWarnings("unused") @Override public void closeEdge(S source, L label) { throw new UnsupportedOperationException("Unsupported in query context."); } @SuppressWarnings("unused") @Override public void closeScope(S scope) { throw new UnsupportedOperationException("Unsupported in query context."); } @Override public IFuture<Set<IResolutionPath<S, L, D>>> query(S scope, LabelWf<L> labelWF, LabelOrder<L> labelOrder, DataWf<S, L, D> dataWF, DataLeq<S, L, D> dataEquiv, @Nullable DataWf<S, L, D> dataWfInternal, @Nullable DataLeq<S, L, D> dataEquivInternal) { // does not require the Unit to be ACTIVE final ScopePath<S, L> path = new ScopePath<>(scope); final IFuture<Env<S, L, D>> result = doQuery(self, path, labelWF, labelOrder, dataWF, dataEquiv, dataWfInternal, dataEquivInternal); final Query<S, L, D> wf = Query.of(self, path, labelWF, dataWF, labelOrder, dataEquiv, result); waitFor(wf, self); stats.localQueries += 1; return self.schedule(result).whenComplete((env, ex) -> { granted(wf, self); }).thenApply(CapsuleUtil::toSet); } }; protected final boolean isOwner(S scope) { final IActorRef<? extends IUnit<S, L, D, ?>> owner = context.owner(scope); return owner.equals(self); } protected boolean canAnswer(S scope) { return isOwner(scope); } // Wait fors & finalization private MultiSet.Immutable<IWaitFor<S, L, D>> waitFors = MultiSet.Immutable.of(); private MultiSetMap.Immutable<IActorRef<? extends IUnit<S, L, D, ?>>, IWaitFor<S, L, D>> waitForsByActor = MultiSetMap.Immutable.of(); protected boolean isWaiting() { return !waitFors.isEmpty(); } protected boolean isWaitingFor(IWaitFor<S, L, D> token) { return waitFors.contains(token); } private MultiSet.Immutable<IWaitFor<S, L, D>> getTokens(IActorRef<? extends IUnit<S, L, D, ?>> unit) { return waitForsByActor.get(unit); } protected void waitFor(IWaitFor<S, L, D> token, IActorRef<? extends IUnit<S, L, D, ?>> actor) { logger.debug("{} wait for {}/{}", self, actor, token); waitFors = waitFors.add(token); waitForsByActor = waitForsByActor.put(actor, token); } protected void granted(IWaitFor<S, L, D> token, IActorRef<? extends IUnit<S, L, D, ?>> actor) { if(!waitForsByActor.contains(actor, token)) { logger.error("{} not waiting for granted {}/{}", self, actor, token); throw new IllegalStateException(self + " not waiting for granted " + actor + "/" + token); } waitFors = waitFors.remove(token); waitForsByActor = waitForsByActor.remove(actor, token); } /** * Checks if the unit is finished, or still waiting on something. Must be called after all grants. Note that if a * wait-for is granted, and others are introduced, this method must be called after all have been processed, or it * may conclude prematurely that the unit is done. */ protected void tryFinish() { logger.debug("{} tryFinish", this); if(innerResult && !unitResult.isDone() && !isWaiting()) { logger.debug("{} finish", this); unitResult.complete( UnitResult.of(self.id(), scopeGraph.get(), analysis.get(), failures, subUnitResults, stats)); } } // Resolution & delays private void releaseDelays(S scope) { for(Map.Entry<EdgeOrData<L>, Delay> entry : delays.get(scope)) { final EdgeOrData<L> edge = entry.getKey(); if(!isWaitingFor(CloseLabel.of(self, scope, edge))) { final Delay delay = entry.getValue(); logger.debug("released {} on {}(/{})", delay, scope, edge); delays.remove(scope, edge, delay); self.complete(delay.future, org.metaborg.util.unit.Unit.unit, null); } } } private void releaseDelays(S scope, EdgeOrData<L> edge) { for(Delay delay : delays.get(scope, edge)) { logger.debug("released {} on {}/{}", delay, scope, edge); delays.remove(scope, edge, delay); self.complete(delay.future, org.metaborg.util.unit.Unit.unit, null); } } private boolean isScopeInitialized(S scope) { return !isWaitingFor(InitScope.of(self, scope)) && !isWaitingFor(CloseScope.of(self, scope)); } private boolean isEdgeClosed(S scope, EdgeOrData<L> edge) { return isScopeInitialized(scope) && !isWaitingFor(CloseLabel.of(self, scope, edge)); } private IFuture<org.metaborg.util.unit.Unit> isComplete(S scope, EdgeOrData<L> edge, IActorRef<? extends IUnit<S, L, D, ?>> sender) { if(isEdgeClosed(scope, edge)) { return CompletableFuture.completedFuture(org.metaborg.util.unit.Unit.unit); } else { final CompletableFuture<org.metaborg.util.unit.Unit> result = new CompletableFuture<>(); delays.put(scope, edge, new Delay(result, sender)); return result; } } private class Delay { public final ICompletableFuture<org.metaborg.util.unit.Unit> future; public final IActorRef<? extends IUnit<S, L, D, ?>> sender; Delay(ICompletableFuture<org.metaborg.util.unit.Unit> future, IActorRef<? extends IUnit<S, L, D, ?>> sender) { this.future = future; this.sender = sender; } @Override public String toString() { return "Delay{future=" + future + ",sender=" + sender + "}"; } } // Deadlock handling protected void suspend() { if(cmh.idle()) { } } protected void resume() { if(cmh.exec()) { } } @Override public void _deadlockQuery(IActorRef<? extends IUnit<S, L, D, ?>> i, int m) { final IActorRef<? extends IUnit<S, L, D, ?>> j = self.sender(TYPE); cmh.query(i, m, j); } @Override public void _deadlockReply(IActorRef<? extends IUnit<S, L, D, ?>> i, int m, java.util.Set<IActorRef<? extends IUnit<S, L, D, ?>>> R) { cmh.reply(i, m, R); } @Override public void _deadlocked(java.util.Set<IActorRef<? extends IUnit<S, L, D, ?>>> nodes) { if(failDelays(nodes)) { resume(); // resume to ensure further deadlock detection after these are handled } } private void handleDeadlock(java.util.Set<IActorRef<? extends IUnit<S, L, D, ?>>> nodes) { logger.debug("{} deadlocked with {}", this, nodes); if(!nodes.contains(self)) { throw new IllegalStateException("Deadlock unrelated to this unit."); } if(nodes.size() == 1) { logger.debug("{} self-deadlocked with {}", this, getTokens(self)); if(failDelays(nodes)) { resume(); // resume to ensure further deadlock detection after these are handled } else { failAll(); } } else { // nodes will include self for(IActorRef<? extends IUnit<S, L, D, ?>> node : nodes) { self.async(node)._deadlocked(nodes); } } } /** * Fail delays that are part of the deadlock. If any delays can be failed, computations should be able to continue * (or fail following the exception). * * The set of open scopes and labels is unchanged, and it is safe for the type checker to continue. */ private boolean failDelays(java.util.Set<IActorRef<? extends IUnit<S, L, D, ?>>> nodes) { final Set.Transient<ICompletable<?>> deadlocked = CapsuleUtil.transientSet(); for(Delay delay : delays.inverse().keySet()) { if(nodes.contains(delay.sender)) { logger.debug("{} fail {}", self, delay); delays.inverse().remove(delay); deadlocked.__insert(delay.future); } } for(IActorRef<? extends IUnit<S, L, D, ?>> node : nodes) { for(IWaitFor<S, L, D> wf : getTokens(node)) { // @formatter:off wf.visit(IWaitFor.cases( initScope -> {}, closeScope -> {}, closeLabel -> {}, query -> {}, result -> {}, typeCheckerState -> { if(nodes.contains(typeCheckerState.origin())) { logger.debug("{} fail {}", self, typeCheckerState); deadlocked.__insert(typeCheckerState.future()); } } )); // @formatter:on } } for(ICompletable<?> future : deadlocked) { self.complete(future, null, new DeadlockException("Type checker deadlocked.")); } return !deadlocked.isEmpty(); } /** * If there are no delays to fail, the type checker has no way to make progress. In this case, everything is failed, * and the state cleaned such that all scopes and labels are closed and these closures properly reported to the * parent. * * After this, it is not safe if the type checker is ever called again, as it may then try to close scopes and * labels that were cleaned up. Therefore, local delays are not failed, as this would trigger their completion and * trigger the type checker. Delays resulting from remote queries must still be cancelled, or the remote unit waits * indefinitely for the result from this now defunct unit. */ private void failAll() { // Grants are processed immediately, while the result failure is scheduled. // This ensures that all labels are closed by the time the result failure is processed. for(IWaitFor<S, L, D> wf : waitFors) { // @formatter:off wf.visit(IWaitFor.cases( initScope -> { failures.add(new DeadlockException(initScope.toString())); granted(initScope, self); if(!isOwner(initScope.scope())) { self.async(parent)._initShare(initScope.scope(), CapsuleUtil.immutableSet(), false); } releaseDelays(initScope.scope()); }, closeScope -> { failures.add(new DeadlockException(closeScope.toString())); granted(closeScope, self); if(!isOwner(closeScope.scope())) { self.async(parent)._doneSharing(closeScope.scope()); } releaseDelays(closeScope.scope()); }, closeLabel -> { failures.add(new DeadlockException(closeLabel.toString())); granted(closeLabel, self); if(!isOwner(closeLabel.scope())) { self.async(parent)._closeEdge(closeLabel.scope(), closeLabel.label()); } releaseDelays(closeLabel.scope(), closeLabel.label()); }, query -> { logger.error("Unexpected remaining query: " + query); throw new IllegalStateException("Unexpected remaining query: " + query); }, result -> { self.complete(result.future(), null, new DeadlockException("Type checker did not return a result.")); }, typeCheckerState -> { if(typeCheckerState.origin().equals(self)) { logger.error("Unexpected remaining internal state: " + typeCheckerState); throw new IllegalStateException("Unexpected remaining internal state: " + typeCheckerState); } self.complete(typeCheckerState.future(), null, new DeadlockException("Type checker deadlocked.")); } )); // @formatter:on } } // ChandryMisraHaas.Host @Override public IActorRef<? extends IUnit<S, L, D, ?>> process() { return self; } @Override public java.util.Set<IActorRef<? extends IUnit<S, L, D, ?>>> dependentSet() { return waitForsByActor.keySet(); } @Override public void query(IActorRef<? extends IUnit<S, L, D, ?>> k, IActorRef<? extends IUnit<S, L, D, ?>> i, int m) { self.async(k)._deadlockQuery(i, m); } @Override public void reply(IActorRef<? extends IUnit<S, L, D, ?>> k, IActorRef<? extends IUnit<S, L, D, ?>> i, int m, java.util.Set<IActorRef<? extends IUnit<S, L, D, ?>>> R) { self.async(k)._deadlockReply(i, m, R); } // IActorMonitor private long wakeTimeNanos; @Override public void started() { logger.debug("{} started", this); wakeTimeNanos = System.nanoTime(); } @Override public void resumed() { logger.debug("{} resumed", this); wakeTimeNanos = System.nanoTime(); } @Override public void suspended() { logger.debug("{} suspended", this); final long suspendTimeNanos = System.nanoTime(); final long activeTimeNanos = suspendTimeNanos - wakeTimeNanos; stats.runtimeNanos += activeTimeNanos; suspend(); tryFinish(); } @Override public void stopped(Throwable ex) { if(!unitResult.isDone()) { if(ex != null && ex instanceof InterruptedException) { unitResult.completeExceptionally(ex); } else { unitResult.completeExceptionally(new TypeCheckingFailedException(this + " stopped.", ex)); } } } // Stats protected static class Stats implements IUnitStats { protected int localQueries; protected int incomingQueries; protected int outgoingQueries; protected int forwardedQueries; protected long runtimeNanos; protected int dataWfChecks; protected int dataLeqChecks; private IActorStats actorStats; private Stats(IActorStats actorStats) { this.actorStats = actorStats; } @Override public Iterable<String> csvHeaders() { // @formatter:off return Iterables.concat(ImmutableList.of( "runtimeMillis", "localQueries", "incomingQueries", "outgoingQueries", "forwardedQueries", "dataWfChecks", "dataLeqChecks" ), actorStats.csvHeaders()); // @formatter:on } @Override public Iterable<String> csvRow() { // @formatter:off return Iterables.concat(ImmutableList.of( Long.toString(TimeUnit.MILLISECONDS.convert(runtimeNanos, TimeUnit.NANOSECONDS)), Integer.toString(localQueries), Integer.toString(incomingQueries), Integer.toString(outgoingQueries), Integer.toString(forwardedQueries), Integer.toString(dataWfChecks), Integer.toString(dataLeqChecks) ), actorStats.csvRow()); // @formatter:on } @Override public String toString() { return "UnitStats{ownQueries=" + localQueries + ",foreignQueries=" + incomingQueries + ",forwardedQueries=" + outgoingQueries + "," + actorStats + "}"; } } // Assertions protected void assertOwnOrSharedScope(S scope) { if(!scopes.contains(scope)) { logger.error("Scope {} is not owned or shared by {}", scope, this); throw new IllegalArgumentException("Scope " + scope + " is not owned or shared by " + this); } } protected void assertLabelOpen(S scope, EdgeOrData<L> edge) { assertOwnOrSharedScope(scope); if(isEdgeClosed(scope, edge)) { logger.error("Label {}/{} is not open on {}.", scope, edge, self); throw new IllegalArgumentException("Label " + scope + "/" + edge + " is not open on " + self + "."); } } }
package edu.ucsd.library.floadr; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.StringWriter; import java.util.Iterator; import java.util.List; import javax.activation.MimetypesFileTypeMap; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMResult; import javax.xml.transform.stream.StreamSource; import javax.xml.transform.stream.StreamResult; import org.dom4j.Attribute; import org.dom4j.Document; import org.dom4j.Element; import org.dom4j.Node; import org.dom4j.io.DocumentResult; import org.dom4j.io.XMLWriter; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpHead; import org.apache.http.client.methods.HttpPatch; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPut; import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.entity.ByteArrayEntity;; import org.apache.http.entity.FileEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.impl.conn.PoolingClientConnectionManager; import org.apache.http.util.EntityUtils; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.RDFNode; import com.hp.hpl.jena.rdf.model.StmtIterator; /** * Simple fedora loading utility * @author escowles * @since 2014-11-17 **/ public class Simploadr { private static boolean debug = false; private static MimetypesFileTypeMap mimeTypes = new MimetypesFileTypeMap(); private static int errors = 0; private static int recordsUpdated = 0; private static int filesCreated = 0; private static int filesSkipped = 0; private static String repositoryURL; private static HttpClient client; private static Transformer xslt; /** * Command-line operation. * @param args Command-line arguments: 0: Repository baseURL, * 1: File listing object IDs (one per line), * 2: Base directory to find source files. **/ public static void main( String[] args ) throws Exception { repositoryURL = args[0]; File objectIds = new File(args[1]); File sourceDir = new File(args[2]); String mode = "meta"; if ( args.length > 3 ) { mode = args[3]; } boolean files = (mode != null && mode.indexOf("files") != -1); boolean meta = (mode != null && mode.indexOf("meta") != -1); boolean merge = (mode != null && mode.indexOf("merge") != -1); PoolingClientConnectionManager pool = new PoolingClientConnectionManager(); pool.setMaxTotal(Integer.MAX_VALUE); pool.setDefaultMaxPerRoute(Integer.MAX_VALUE); client = new DefaultHttpClient(pool); // load dams4.2.xsl final StreamSource xsl = new StreamSource(Simploadr.class.getClassLoader() .getResourceAsStream("dams4.2.xsl")); xslt = TransformerFactory.newInstance().newTransformer(xsl); xslt.setParameter("repositoryURL", repositoryURL); // for each id, find/create a fedora object and then load each file BufferedReader objectIdReader = new BufferedReader( new FileReader(objectIds) ); int records = 0; for ( String id = null; (id = objectIdReader.readLine()) != null; ) { records++; final String pairPath = pairPath(id); final File objDir = new File( sourceDir, pairPath ); final File[] objFiles = objDir.listFiles(); if ( objFiles.length > 0 ) { // create object createObject( objPath(id) ); // load files if ( files ) { for ( File f : objFiles ) { createFile( id, f ); } } // load metadata if ( meta ) { File metaFile = new File( sourceDir + "/" + pairPath(id) + "20775-" + id + "-0-rdf.xml" ); loadMetadata( id, metaFile, merge ); } } System.out.println(records + ": " + id + ", metadata: " + recordsUpdated + ", files: " + filesCreated + ", skipped: " + filesSkipped + ", errors: " + errors); } } private static void createObject( String path ) { String objectURI = repositoryURL + path; if ( !debug && !exists(path) ) { HttpPut put = new HttpPut( objectURI ); int status = execute(put, true); if ( status != 201 ) { System.out.println("Node: " + path + ": " + status); errors++; } } } private static void createFile( String objid, File dsFile ) { String objectURI = repositoryURL + "/" + objPath(objid); try { final String fn = dsFile.getName(); if ( fn.matches("^20775-" + objid + "-\\d-.*") && !fn.endsWith("rdf.xml") ) { final String fileId = fileId( objid, fn ); final String dsPath = objPath(objid) + fileId; String fileURI = repositoryURL + dsPath; if ( !debug && exists(dsPath) ) { System.out.println(" Skipped: " + fn); filesSkipped++; } else { HttpPut put = new HttpPut( fileURI ); put.addHeader( "Content-Disposition", "attachment; filename=\"" + fn + "\"" ); put.addHeader( "Content-Type", mimeTypes.getContentType(dsFile) ); put.setEntity( new FileEntity(dsFile) ); int status = execute(put, true); if ( status == 201 || debug ) { System.out.println("File: " + dsPath); filesCreated++; } else { System.out.println("File: " + dsPath + ": " + status); errors++; } } } } catch ( Exception ex ) { errors++; System.out.println("Error: " + ex.toString()); } } private static void loadMetadata( String objid, File metaFile, boolean merge ) { try { // xslt metadata final DocumentResult result = new DocumentResult(); xslt.transform( new StreamSource(metaFile), result ); Document doc = result.getDocument(); // create linked records /** * Convert a filename to a file id. **/ private static String fileId( final String objid, final String filename ) { String[] parts = filename.split("-",4); if ( parts[2].equals("0") ) { return parts[3]; } else { return parts[2] + "/" + parts[3]; } } public static String objPath( String s ) { return "/" + pairPath(s); } /** * Convert a string into a pairpath directory tree. **/ public static String pairPath( String s ) { if ( s == null ) { return null; } String result = ""; int i = 0; while( i < (s.length() - 1) ) { result += s.substring(i,i+2); result += "/"; i += 2; } if ( s.length() > i ) { result += s.substring(i) + "/"; } return result; } }
package org.eddy.pipeline; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.eddy.http.HttpRequest; import org.eddy.pipeline.command.CommandNotify; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.Objects; @Getter @Setter @NoArgsConstructor public class NotifyRunnable implements Runnable { private static final Logger logger = LoggerFactory.getLogger(NotifyRunnable.class); private static final int DEFAULT_TIME = 10; private String pipelineGroup; @Override public void run() { try { execute(); } catch (Exception e) { logger.error("execute error, end ", e); } }
package ca.nrc.cadc.caom2.types; import java.awt.geom.Area; import java.awt.geom.GeneralPath; import java.awt.geom.PathIterator; import java.io.Serializable; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.ListIterator; import java.util.function.Predicate; import java.util.function.UnaryOperator; import org.apache.log4j.Logger; /** * * @author pdowler */ public final class PolygonUtil { private static Logger log = Logger.getLogger(PolygonUtil.class); private static final double DEFAULT_SCALE = 0.02; private static final double MAX_SCALE = 0.12; public static Polygon toPolygon(Shape s) { if (s == null) return null; if (s instanceof Polygon) return (Polygon) s; throw new UnsupportedOperationException(s.getClass().getSimpleName() + " -> Polygon"); } /** * Compute a simple concave outer hull of the specified polygon.This method * is simple a wrapper that calls getConcaveHull and if that fails, it then * tries getConvexHull. * * @param poly * @return a simple bounding polygon */ public static Polygon getOuterHull(final Polygon poly) { log.debug("[getOuterHull] " + poly); Polygon ret = getConcaveHull(poly); if (ret == null) ret = getConvexHull(poly); return ret; } /** * Compute a simple concave outer hull of the specified polygon. This method * removes holes and finds a single concave polygon that includes all the area * of the original (but usually more). * * @param poly * @return concave hull or null of not possible */ public static Polygon getConcaveHull(final Polygon poly) { log.debug("[getConcaveHull] " + poly); if (poly == null) return null; // deep copy Polygon outer = new Polygon(); for (Vertex v : poly.getVertices()) { outer.getVertices().add(new Vertex(v.cval1, v.cval2, v.getType())); } double scale = DEFAULT_SCALE; List<Polygon> parts = removeHoles(outer); while ( parts.size() > 1 && scale <= MAX_SCALE) { log.debug("[getConcaveHull] trying union at scale=" + scale + " with " + parts.size() + " simple polygons"); outer = union(parts, scale); log.debug("[getConcaveHull] union = " + outer); scale += DEFAULT_SCALE; // 2x, 3x, etc parts = removeHoles(outer); log.debug(""); } if (parts.size() == 1) { outer = parts.get(0); log.debug("[getConcaveHull] SUCCESS: " + outer); return outer; } log.debug("[getConcaveHull] FAILED"); return null; } /** * Compute a simple convex hull that contains the specified polygon. * * @param poly * @return */ public static Polygon getConvexHull(final Polygon poly) { log.debug("[getConvexHull] " + poly); if (poly == null) return null; // deep copy //Polygon outer = new Polygon(); //for (Vertex v : poly.getVertices()) // outer.getVertices().add(new Vertex(v.cval1, v.cval2, v.getType())); // TODO: triangulate and find union of all triangles // technically just need to add triangles that have one vertex in one part and two in // the other part (eg that join two parts) throw new UnsupportedOperationException("getConvexHull: not implemented"); } public static Polygon union(List<Polygon> polys) { return union(polys, DEFAULT_SCALE); } public static Polygon union(List<Polygon> polys, double scale) { if (polys.size() == 1) return polys.get(0); // transform the input polygons to some other 2D coordinates where cartesian CAG is good enough double[] cube = null; for (Polygon p : polys) { cube = CartesianTransform.getBoundingCube(p, cube); } CartesianTransform trans = CartesianTransform.getTransform(cube, false); log.debug("working transform: " + trans); // transform all the polygons List<Polygon> work = new ArrayList<Polygon>(polys.size()); for (Polygon p : polys) { work.add(trans.transform(p)); } // compute union without scaling Polygon union = computeUnion(work, scale); // inverse transform back to longitude,latitude union = trans.inverseTransform(union); return union; } public static Polygon intersection(Polygon p1, Polygon p2) { double[] cube = CartesianTransform.getBoundingCube(p1, null); cube = CartesianTransform.getBoundingCube(p2, cube); CartesianTransform trans = CartesianTransform.getTransform(cube, false); Polygon pt1 = trans.transform(p1); Polygon pt2 = trans.transform(p2); Polygon inter = doIntersectCAG(pt1, pt2); if (inter != null) inter = trans.inverseTransform(inter); return inter; } // assumes cartesian approx is safe private static Polygon computeUnion(List<Polygon> work, double scale) { log.debug("[computeUnion] work=" + work.size() + ", scale="+scale); // scale all the polygons up to cause nearby polygons to intersect List<Polygon> scaled = work; if (scale > 0.0) { scaled = new ArrayList<Polygon>(work.size()); for (Polygon p : work) { scaled.add(scalePolygon(p, scale)); } } Polygon poly = null; for (Polygon p : scaled) { if (poly == null) poly = p; else poly = doUnionCAG(poly, p); } removeHoles(poly, 1.0); if (scale > 0.0) poly = unscalePolygon(poly, scaled); smooth(poly); //smooth(poly, 1.0e-4); return poly; } private static class ScaledVertex extends Vertex { private static final long serialVersionUID = 201207271500L; Vertex orig; ScaledVertex(double c1, double c2, SegmentType t, Vertex orig) { super(c1, c2, t); this.orig = orig; } } private static Polygon scalePolygon(Polygon poly, double factor) { log.debug("[scalePolygon] start: " + poly + " BY " + factor); Polygon ret = new Polygon(); PolygonProperties pp = computePolygonProperties(poly); Point c = pp.center; for (Vertex v : poly.getVertices()) { if (SegmentType.CLOSE.equals(v.getType())) { Vertex sv = new ScaledVertex(0.0, 0.0, v.getType(), v); ret.getVertices().add(sv); } else { double dx = (v.cval1 - c.cval1) * factor; double dy = (v.cval2 - c.cval2) * factor; Vertex sv = new ScaledVertex(v.cval1 + dx, v.cval2 + dy, v.getType(), v); ret.getVertices().add(sv); } } log.debug("[scalePolygon] done: " + ret); return ret; } private static Polygon unscalePolygon(Polygon poly, List<Polygon> scaled) { log.debug("[unscalePolygon] start: " + poly); Polygon ret = new Polygon(); boolean validSeg = false; double tol = 0.5* poly.getSize() * DEFAULT_SCALE; log.debug("[unscalePolygon] tol = " + tol); // or each vertex in poly, look for the scaled vertex in the list of input polygons // that is nearest and use the original unscaled vertex if it is close enough for (Vertex pv : poly.getVertices()) { ret.getVertices().add(pv); // shallow copy } List<Vertex> verts = poly.getVertices(); for (int i=0; i<verts.size(); i++) { Vertex pv = verts.get(i); if ( !SegmentType.CLOSE.equals(pv.getType()) ) { ScaledVertex sv = (ScaledVertex) findNearest(pv, scaled); log.debug("[unscalePolygon] nearest: " + pv+ " " + sv); double d = Math.sqrt(distanceSquared(pv, sv)); if (d < tol) { // use orig coords but keep current segtype Vertex v = new Vertex(sv.orig.cval1, sv.orig.cval2, pv.getType()); log.debug("[unscalePolygon] replace: " + pv + " -> " + v + " (d=" + d + ")"); ret.getVertices().set(i, v); if (validSeg) { try { validateSegments(ret); } catch(IllegalPolygonException oops) { log.debug("[unscalePolygon] REVERT: " + v + " -> " + pv); ret.getVertices().set(i, pv); // undo } } } else { log.debug("[unscalePolygon] keep: " + pv + " (d=" + d + ")"); // Vertex v = new Vertex(pv.cval1, pv.cval2, pv.getType()); // ret.getVertices().add(v); } } } // TODO: could track which vertices were replaced and undo it if validateSegments proves // we created an invalid polygon log.debug("[unscalePolygon] done: " + ret); return ret; } private static Vertex findNearest(Vertex v, List<Polygon> polys) { double d = Double.MAX_VALUE; Vertex ret = null; for (Polygon p : polys) { for (Vertex pv : p.getVertices()) { if ( !SegmentType.CLOSE.equals(pv.getType()) ) { double dd = distanceSquared(v, pv); if (dd < d) { d = dd; ret = pv; } } } } return ret; } static List<Polygon> removeHoles(Polygon poly) { log.debug("[removeHoles] start: " + poly); List<Polygon> samples = decompose(poly); // find samples and holes via sign of the area boolean cw = computePolygonProperties(poly).winding; ListIterator<Polygon> iter = samples.listIterator(); int num = 0; while ( iter.hasNext() ) { Polygon part = iter.next(); boolean pcw = computePolygonProperties(part).winding; if (cw != pcw) // opposite sign { iter.remove(); num++; } } if (num > 0) log.debug("[removeHoles] discarded " + num + " holes"); poly.getVertices().clear(); for (Polygon p : samples) { poly.getVertices().addAll(p.getVertices()); } log.debug("[removeHoles] done: " + poly); return samples; } // removes all holes with fractional area less than rat static boolean removeHoles(Polygon poly, double rat) { if (poly.getVertices().size() <= 8) return false; // cannot have holes with fewer than 8 vertices (two triangles and 2 CLOSE) boolean hasHoles = false; log.debug("[removeHoles] start: " + poly); PolygonProperties pProp = computePolygonProperties(poly); Polygon tmp = new Polygon(); boolean go = true; while(go) { go = false; tmp.getVertices().clear(); boolean restart = false; Iterator<Vertex> vi = poly.getVertices().iterator(); while ( !restart && vi.hasNext() ) { Vertex v = vi.next(); tmp.getVertices().add(v); if (SegmentType.CLOSE.equals(v.getType())) { if (tmp.getVertices().size() <= 3) // 2+close is a line == 0 area { // this could be a line segment that is in or out: remove both kinds //log.debug("[removeHoles] removing vertex " + start + " " + tmp.getVertices().size() + " times"); //for (int j=0; j<tmp.getVertices().size(); j++) // pVerts.remove(start); log.debug("[removeHoles] remove scrap segment " + tmp + " from " + poly); for (Vertex rv : tmp.getVertices()) { boolean ok = poly.getVertices().remove(rv); if (!ok) log.warn("[removeHoles] found hole " + tmp + " but failed to remove " + v + " from " + poly); } go = true; restart = true; } else { // closed loop PolygonProperties tProp = computePolygonProperties(tmp); double da = tProp.area/pProp.area; boolean isHole = (tProp.winding != pProp.winding); // opposite winding hasHoles = isHole; if (isHole && da < rat) // hole && small { // remove all these verts from list //log.debug("[removeHoles] removing hole: " + tmp + " with da = " + da); //log.debug("removing vertex " + start + " " + tmp.getVertices().size() + " times"); //for (int j=0; j<tmp.getVertices().size(); j++) // pVerts.remove(start); log.debug("[removeHoles] remove hole " + tmp + " from " + poly); for (Vertex rv : tmp.getVertices()) { boolean ok = poly.getVertices().remove(rv); if (!ok) log.warn("[removeHoles] found hole " + tmp + " but failed to remove " + v + " from " + poly); } go = true; restart = true; } } // we kept this loop, so clear and proceed tmp.getVertices().clear(); } } } log.debug("[removeHoles] done: " + poly); return hasHoles; } private static void smooth(Polygon poly) { List<Polygon> parts = decompose(poly); poly.getVertices().clear(); for (Polygon p : parts) { smoothSimpleAdjacentVertices(p); smoothSimpleColinearSegments(p); for (Vertex v : p.getVertices()) { poly.getVertices().add(v); } } } // currently unused by computeUnion private static void smooth(Polygon poly, double rat) { List<Polygon> parts = decompose(poly); poly.getVertices().clear(); for (Polygon p : parts) { for (Vertex v : p.getVertices()) { poly.getVertices().add(v); } } } private static void smoothSimpleAdjacentVertices(Polygon poly) { log.debug("[smooth.adjacent] " + poly); if (poly.getVertices().size() <= 4) // 3+close == triangle return; PolygonProperties pp = computePolygonProperties(poly); double tol = pp.maxVertexSeparation*1.0e-6; Iterator<Vertex> vi = poly.getVertices().iterator(); List<Segment> segs = new ArrayList<Segment>(); Vertex start = vi.next(); Vertex v1 = start; while ( vi.hasNext() ) { Vertex v2 = vi.next(); if (SegmentType.CLOSE.equals(v2.getType())) v2 = start; Segment s = new Segment(v1, v2); segs.add(s); v1 = v2; } // use length of segments to identify vertices we can remove for (int i=0; i<segs.size(); i++) { Segment ab = segs.get(i); double dx = Math.abs(ab.v1.cval1 - ab.v2.cval1); double dy = Math.abs(ab.v1.cval2 - ab.v2.cval2); log.debug("[smooth.adjacent] " + ab + " " + dx + " " + dy); if ( dx < tol && dy < tol) { final Vertex v = ab.v1; log.debug("[smooth.adjacent] removing " + v); // remove v from poly poly.getVertices().remove(v); // Vertex uses Object.equals aka == if (SegmentType.MOVE.equals(v.getType())) { // change v+1 to MOVE final Vertex nv = new Vertex(ab.v2.cval1, ab.v2.cval2, SegmentType.MOVE); // ugly List.replace(old, new): find index and set int curi = 0; while (ab.v2 != poly.getVertices().get(curi)) curi++; poly.getVertices().set(curi, nv); /* poly.getVertices().replaceAll(new UnaryOperator<Vertex>() { public Vertex apply(Vertex t) { Vertex ret = t; if (vp1 == t) // yes: really == return nv; return ret; } }); */ } } } } private static void smoothSimpleColinearSegments(Polygon poly) { log.debug("[smooth.colinear] " + poly); if (poly.getVertices().size() <= 4) // 3+close == triangle return; PolygonProperties pp = computePolygonProperties(poly); Iterator<Vertex> vi = poly.getVertices().iterator(); List<Segment> segs = new ArrayList<Segment>(); Vertex start = vi.next(); Vertex v1 = start; while ( vi.hasNext() ) { Vertex v2 = vi.next(); if (SegmentType.CLOSE.equals(v2.getType())) v2 = start; Segment s = new Segment(v1, v2); segs.add(s); v1 = v2; } // remove colinear segments for (int i=0; i<segs.size() - 1; i++) { Segment ab = segs.get(i); Segment cd = segs.get(i+1); if ( colinear(ab, cd) ) { // vertex b aka c is on a line between a and d: remove it final Vertex v = ab.v2; // == cd.v1 log.debug("[smooth.colinear] " + ab + " + " + cd + ": removing " + v); // remove v from poly poly.getVertices().remove(v); if (SegmentType.MOVE.equals(v.getType())) { // change v+1 to MOVE final Vertex nv = new Vertex(cd.v2.cval1, cd.v2.cval2, SegmentType.MOVE); // ugly List.replace(old, new): find index and set int curi = 0; while (cd.v2 != poly.getVertices().get(curi)) curi++; poly.getVertices().set(curi, nv); /* poly.getVertices().replaceAll(new UnaryOperator<Vertex>() { public Vertex apply(Vertex t) { Vertex ret = t; if (vp1 == t) // yes: really == return nv; return ret; } }); */ } } else log.debug("[smooth.colinear] non-colinear: " + ab + " + " + cd); } } private static void smoothSimpleSmallAreaChange(Polygon poly, double rat) { log.debug("[smooth] " + poly + " rat="+rat); if (poly.getVertices().size() <= 4) // 3+close == triangle return; PolygonProperties pp = computePolygonProperties(poly); Polygon tmp = new Polygon(); List<Vertex> verts = tmp.getVertices(); boolean changed = true; while (changed) { int posI = -1; int negI = -1; double posDA = Double.MAX_VALUE; double negDA = Double.MAX_VALUE; Vertex posV = null; Vertex negV = null; log.debug("starting loop over vertices..."); for (int i=0; i<poly.getVertices().size(); i++) { verts.clear(); verts.addAll(poly.getVertices()); Vertex v = tmp.getVertices().get(i); log.debug("[smooth] (try) " + v); boolean move = SegmentType.MOVE.equals(v.getType()); boolean line = SegmentType.LINE.equals(v.getType()); if (line || move) { verts.remove(i); if (move) { // change the next from LINE to MOVE Vertex vl = verts.get(i); if (SegmentType.LINE.equals(vl.getType())) { Vertex vm = new Vertex(vl.cval1, vl.cval2, SegmentType.MOVE); log.debug("[smooth] (try) change " + vl + " -> " + vm); verts.set(i, vm); } else throw new IllegalStateException("found " + vl + " after " + v); } PolygonProperties tp = computePolygonProperties(tmp); double da = (tp.area - pp.area)/pp.area; log.debug("[smooth] (try) remove " + v + ", dA = " + da + ", " + pp.area + " -> " + tp.area); if (da >= 0.0) { if (da < posDA) { posDA = da; posV = v; posI = i; } } else // da < 0.0 { da *= -1.0; // abs if (da < negDA) { negDA = da; negV = v; negI = i; } } } } changed = false; if (posV != null && posDA <= negDA && posDA < rat) { log.debug("[smooth] dA = " + posDA + " remove " + posV); poly.getVertices().remove(posV); if ( SegmentType.MOVE.equals(posV.getType()) ) { // change the next from LINE to MOVE Vertex vl = poly.getVertices().get(posI); Vertex vm = new Vertex(vl.cval1, vl.cval2, SegmentType.MOVE); log.debug("[smooth] change " + vl + " -> " + vm); poly.getVertices().set(posI, vm); } changed = true; } else if (negV != null && negDA < rat) { log.debug("[smooth] dA = -" + negDA + " remove " + negV); poly.getVertices().remove(negV); if ( SegmentType.MOVE.equals(negV.getType()) ) { // change the next from LINE to MOVE Vertex vl = poly.getVertices().get(negI); Vertex vm = new Vertex(vl.cval1, vl.cval2, SegmentType.MOVE); log.debug("[smooth] change " + vl + " -> " + vm); poly.getVertices().set(negI, vm); } changed = true; } else { if (negV != null) log.debug("[smooth] negDA = -" + negDA + " keep " + negV); if (posV != null) log.debug("[smooth] posDA = " + posDA + " keep " + posV); } } } /** * Decompose a polygon into one or more simple polygons. Note that disjoint * sections and holes are both included in the output list. * * @param p * @return */ public static List<Polygon> decompose(Polygon p) { List<Polygon> polys = new ArrayList<Polygon>(); Polygon prev = null; // needs to be a stack? Polygon cur = null; for (Vertex v : p.getVertices()) { if (cur == null) // start new poly { log.debug("new Polygon"); cur = new Polygon(); log.debug("vertex: " + v); cur.getVertices().add(v); } else if (SegmentType.MOVE.equals(v.getType())) { //log.debug("vertex: " + v); //cur.getVertices().add(new Vertex(0.0, 0.0,SegmentType.CLOSE)); //polys.add(cur); //log.debug("close Polygon"); if (cur != null) prev = cur; // embedded loop log.debug("new Polygon"); cur = new Polygon(); log.debug("vertex: " + v); cur.getVertices().add(v); } else if (SegmentType.CLOSE.equals(v.getType())) { log.debug("vertex: " + v); cur.getVertices().add(v); polys.add(cur); cur = prev; log.debug("close Polygon"); } else { log.debug("vertex: " + v); cur.getVertices().add(v); } } return polys; } static class PolygonProperties implements Serializable { private static final long serialVersionUID = 201207300900L; boolean winding; Double area; Double maxVertexSeparation; Point center; } // lazy computation of center, area, and size // returns the signed area static PolygonProperties computePolygonProperties(Polygon poly) { // the transform needed for computing things in long/lat using cartesian approximation CartesianTransform trans = CartesianTransform.getTransform(poly); Polygon tpoly = trans.transform(poly); // algorithm from double a = 0.0; double cx = 0.0; double cy = 0.0; int lastMoveTo = 0; for (int i = 0; i < tpoly.getVertices().size(); i++) { Vertex v2 = (Vertex) tpoly.getVertices().get(i); if (SegmentType.MOVE.equals(v2.getType())) lastMoveTo = i; else { Vertex v1 = (Vertex) tpoly.getVertices().get(i-1); if (SegmentType.CLOSE.equals(v2.getType())) // pretend it is a LINE_TO the lastMoveTo vertex v2 = (Vertex) tpoly.getVertices().get(lastMoveTo); double tmp = v1.cval1 * v2.cval2 - v2.cval1 * v1.cval2; a += tmp; cx += (v1.cval1 + v2.cval1) * tmp; cy += (v1.cval2 + v2.cval2) * tmp; //log.debug("[computePolygonProperties] " + v1 + "," + v2 + "," + tmp + " " + cx + "," + cy); } } a *= 0.5; cx = cx / (6.0 * a); cy = cy / (6.0 * a); //log.debug("[computePolygonProperties] " + a + "," + cx + "," + cy); PolygonProperties ret = new PolygonProperties(); ret.winding = (a < 0.0); // arbitrary if (a < 0.0) a *= -1.0; ret.area = new Double(a); ret.center = trans.inverseTransform(new Point(cx, cy)); // size: max distance between any two vertices double d = 0.0; for (int i = 0; i < tpoly.getVertices().size(); i++) { Vertex vi = (Vertex) tpoly.getVertices().get(i); if (!SegmentType.CLOSE.equals(vi.getType())) { for (int j = i+1; j < tpoly.getVertices().size(); j++) { Vertex vj = (Vertex) tpoly.getVertices().get(j); if (!SegmentType.CLOSE.equals(vj.getType())) { double d1 = vi.cval1 - vj.cval1; double d2 = vi.cval2 - vj.cval2; double dd = Math.sqrt(d1*d1 + d2*d2); if (dd > d) d = dd; } } } } ret.maxVertexSeparation = new Double(d); return ret; } static CartesianTransform getTransform(Polygon p1, Polygon p2) { CartesianTransform trans1 = CartesianTransform.getTransform(p1); CartesianTransform trans = CartesianTransform.getTransform(p2); if (trans.isNull()) trans = trans1; else if (!trans1.isNull() && !trans.isNull()) { if (trans1.axis.equals(trans.axis)) trans.a = (trans1.a + trans.a) / 2.0; // mean rotation else if (trans1.axis.equals(CartesianTransform.Y)) // prefer Y over Z trans = trans1; } return trans; } private static class Segment implements Serializable { private static final long serialVersionUID = 201207300900L; Vertex v1; Vertex v2; Segment(Vertex v1, Vertex v2) { this.v1 = v1; this.v2 = v2; } @Override public String toString() { return "("+v1+":"+v2+")"; } } // validate a simple polygon (single loop) for intersecting segments static void validateSegments(Polygon poly) throws IllegalPolygonException { CartesianTransform trans = CartesianTransform.getTransform(poly); Polygon tpoly = trans.transform(poly); Iterator<Vertex> vi = tpoly.getVertices().iterator(); List<Segment> tsegs = new ArrayList<Segment>(); List<Segment> psegs = tsegs; Vertex start = vi.next(); Vertex v1 = start; while ( vi.hasNext() ) { Vertex v2 = vi.next(); if (SegmentType.CLOSE.equals(v2.getType())) v2 = start; Segment s = new Segment(v1, v2); log.debug("validateSegments: " + s); tsegs.add(s); v1 = v2; } if (poly != tpoly) { // make segments with orig coords for reporting vi = poly.getVertices().iterator(); psegs = new ArrayList<Segment>(); start = (Vertex) vi.next(); v1 = start; while ( vi.hasNext() ) { Vertex v2 = vi.next(); if (SegmentType.CLOSE.equals(v2.getType())) v2 = start; Segment s = new Segment(v1, v2); log.debug("validateSegments: " + s); psegs.add(s); v1 = v2; } } for (int i=0; i<tsegs.size(); i++) { Segment s1 = tsegs.get(i); for (int j=0; j<tsegs.size(); j++) { if (i != j) { Segment s2 = tsegs.get(j); if ( intersects(s1, s2, true) ) { Segment r1 = psegs.get(i); Segment r2 = psegs.get(j); throw new IllegalPolygonException("invalid polygon: " + r1 + " intersects " + r2); } } } } } private static boolean colinear(Segment ab, Segment cd) { // determine dot-product double v1x = (ab.v2.cval1 - ab.v1.cval1); double v1y = (ab.v2.cval2 - ab.v1.cval2); double v2x = (cd.v2.cval1 - cd.v1.cval1); double v2y = (cd.v2.cval2 - cd.v1.cval2); double dp = v1x*v2x + v1y*v2y; double magAB = Math.sqrt(v1x*v1x + v1y*v1y); double magCD = Math.sqrt(v2x*v2x + v2y*v2y); double ang = Math.acos(dp/(magAB*magCD)); log.debug("colinear: dot.product = " + ang); if ( Math.abs(ang) < 0.05 || Math.abs(Math.PI - ang) < 0.05 ) return true; return false; } private static boolean intersects(Segment ab, Segment cd, boolean isNext) { log.debug("intersects: " + ab + " vs " + cd); // rden = (Bx-Ax)(Dy-Cy)-(By-Ay)(Dx-Cx) double den = (ab.v2.cval1 - ab.v1.cval1)*(cd.v2.cval2 - cd.v1.cval2) - (ab.v2.cval2 - ab.v1.cval2)*(cd.v2.cval1 - cd.v1.cval1); //log.debug("den = " + den); //rnum = (Ay-Cy)(Dx-Cx)-(Ax-Cx)(Dy-Cy) double rnum = (ab.v1.cval2 - cd.v1.cval2)*(cd.v2.cval1 - cd.v1.cval1) - (ab.v1.cval1 - cd.v1.cval1)*(cd.v2.cval2 - cd.v1.cval2); //log.debug("rnum = " + rnum); if (Math.abs(den) < 1.0e-12) //(den == 0.0) { if (Math.abs(rnum) < 1.0e-12) //(rnum == 0.0) { // colinear: check overlap on one axis if (ab.v2 == cd.v1 || ab.v1 == cd.v2) return false; // end-to-end double len1 = lengthSquared(ab); double len2 = lengthSquared(cd); Segment s = ab; if (len2 > len1) s = cd; // the longer one double dx = Math.abs(s.v1.cval1 - s.v2.cval1); double dy = Math.abs(s.v1.cval2 - s.v2.cval2); if (dx > dy) // more horizontal = project to x { if (ab.v2.cval1 < cd.v1.cval1) return false; // ab left of cd if (ab.v1.cval1 > cd.v2.cval1) return false; // ab right of cd } else // more vertical = project to y { if (ab.v2.cval2 < cd.v1.cval2) return false; // ab below cd if (ab.v1.cval2 > cd.v2.cval2) return false; // ab above cd } return true; // overlapping } return false; // just parallel } double r = rnum / den; //log.debug("r = " + r); // no intersect, =0 or 1 means the ends touch, which is normal but pg_sphere doesn't like it if (r <= 0.0 || r >= 1.0) //if (r < 0.0 || r > 1.0) return false; //snum = (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay) double snum = (ab.v1.cval2 - cd.v1.cval2)*(ab.v2.cval1 - ab.v1.cval1) - (ab.v1.cval1 - cd.v1.cval1)*(ab.v2.cval2 - ab.v1.cval2); //log.debug("snum = " + snum); double s = snum / den; //log.debug("s = " + s); if (s <= 0.0 || s >= 1.0) //if (s < 0.0 || s > 1.0) return false; // no intersect, =0 or 1 means the ends touch, which is normal // r in [0,1] and s in [0,1] = intersects return true; } private static double distanceSquared(Vertex v1, Vertex v2) { return (v1.cval1 - v2.cval1)*(v1.cval1 - v2.cval1) + (v1.cval2 - v2.cval2)*(v1.cval2 - v2.cval2); } private static double lengthSquared(Segment s) { return distanceSquared(s.v1, s.v2); } // use java.awt CAG implementation for 2D cartesian geometry static Polygon doUnionCAG(Polygon p1, Polygon p2) { Area a1 = toArea(p1); Area a2 = toArea(p2); a1.add(a2); Polygon ret = toPolygon(a1); return ret; } // use java.awt CAG implementation for 2D cartesian geometry static Polygon doIntersectCAG(Polygon p1, Polygon p2) { Area a1 = toArea(p1); Area a2 = toArea(p2); a1.intersect(a2); Polygon ret = toPolygon(a1); if (ret.getVertices().isEmpty()) return null; return ret; } static Polygon toPolygon(Area area) { Polygon ret = new Polygon(); List<Vertex> verts = ret.getVertices(); PathIterator pi = area.getPathIterator(null); double[] prev = null; int type; while (!pi.isDone()) { double[] coords = new double[2]; type = pi.currentSegment(coords); if (type == PathIterator.SEG_MOVETO) { verts.add(new Vertex(coords[0], coords[1], SegmentType.MOVE)); } else if (type == PathIterator.SEG_LINETO) { verts.add(new Vertex(coords[0], coords[1], SegmentType.LINE)); } else if (type == PathIterator.SEG_CLOSE) { verts.add(new Vertex(0.0, 0.0, SegmentType.CLOSE)); } else { throw new IllegalStateException("unexpected PathIterator segment type: " + type); } prev = coords; pi.next(); } return ret; } static GeneralPath toGeneralPath(Polygon poly) { GeneralPath gp = new GeneralPath(); for (Vertex v : poly.getVertices()) { if (SegmentType.MOVE.equals(v.getType())) gp.moveTo((float) v.cval1, (float) v.cval2); else if (SegmentType.LINE.equals(v.getType())) gp.lineTo((float) v.cval1, (float) v.cval2); else if (SegmentType.CLOSE.equals(v.getType())) gp.closePath(); else throw new IllegalStateException("BUG: unexpected segment type: " + v.getType()); } return gp; } static Area toArea(Polygon poly) { return new Area(toGeneralPath(poly)); } }
import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.Graphics; import java.awt.Image; import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Clip; import javax.sound.sampled.Line; import javax.swing.JFrame; import javax.swing.Timer; public abstract class GameFrame extends JFrame { static final String TITLE_STRING = "Pong!"; static final Dimension FRAME_SIZE = new Dimension(400, 566); static final Rectangle CEILING = new Rectangle(-FRAME_SIZE.width, -FRAME_SIZE.height, 3 * FRAME_SIZE.width, FRAME_SIZE.height); static final Rectangle FLOOR = new Rectangle(-FRAME_SIZE.width, FRAME_SIZE.height, 3 * FRAME_SIZE.width, FRAME_SIZE.height); static final Rectangle LEFT = new Rectangle(-FRAME_SIZE.width, -FRAME_SIZE.height, FRAME_SIZE.width, 3 * FRAME_SIZE.height); static final Rectangle RIGHT = new Rectangle(FRAME_SIZE.width, -FRAME_SIZE.height, FRAME_SIZE.width, 3 * FRAME_SIZE.height); static final int BAR_V = 2; // barV: static final int BALL_MAX_V = 8; // BALL_MAX_V: Max speed of ball static final int nKEY_LEFT = KeyEvent.VK_LEFT; static final int nKEY_RIGHT = KeyEvent.VK_RIGHT; static final int BALL_N = 10; // BALL_N: static final int MAX_POINT = 100; // Goal Point public static final Font font = new Font("Sans-Serif", Font.PLAIN, 20); public static final Font font_bold = new Font("Sans-Serif", Font.BOLD, 22); public static final Font font2 = new Font("Sans-Serif", Font.BOLD, 80); protected PongController pongController; protected Graphics g; protected Ball[] ball; // Subclass of Rectangle protected Bar bar; // Subclass of Rectangle protected boolean left, right; protected int[] point; // your point: point[id - 1] protected int id; // server: 1, client: 2 ~ number protected int winorlose = 0; // 0: yet, 1; win, 2: lose // count: bar protected int count = 0; // bColor[]: background color protected Color[] bColor = { new Color(255, 255, 255, 100), Color.red, Color.blue }; // bcolori: index of bColor[] protected int bcolori = 0; // 0: white, 1: red, 2: blue protected Clip hit; protected Clip bgm; protected Clip miss; public GameFrame(int n, PongController npc) { this.hit = getClip("hit.wav"); this.bgm = getClip("BGM.wav"); this.pongController = npc; this.setTitle(TITLE_STRING); this.setSize(FRAME_SIZE); this.setResizable(false); this.setLocationRelativeTo(null); try { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } catch (Exception e) { e.printStackTrace(); } this.setBackground(Color.WHITE); ball = new Ball[BALL_N]; // Balls bar = new Bar(150, 461, 100, 10); // Bar point = new int[n]; // Points for (int i = 0; i < point.length; i++) point[i] = 0; try { g = getGraphics(); } catch (Exception e) { e.printStackTrace(); } addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent e) { switch (e.getKeyCode()) { case nKEY_LEFT: left = true; break; case nKEY_RIGHT: right = true; break; } } public void keyReleased(KeyEvent e) { switch (e.getKeyCode()) { case nKEY_LEFT: left = false; break; case nKEY_RIGHT: right = false; break; } } }); } public Clip getClip(String filename) { Clip clip = null; try { // AudioInputStream ais = AudioSystem.getAudioInputStream(new // File(filename)); ClassLoader cl = this.getClass().getClassLoader(); AudioInputStream ais = AudioSystem.getAudioInputStream(cl.getResource(filename)); clip = (Clip) AudioSystem.getLine(new Line.Info(Clip.class)); clip.open(ais); } catch (Exception e) { System.out.println(e); System.exit(0); } return clip; } public void init() { this.miss = getClip("miss.wav"); count = 0; bgm.setFramePosition(0); bgm.loop(Clip.LOOP_CONTINUOUSLY); new Timer(10, new ActionListener() { public void actionPerformed(ActionEvent e) { if (winorlose == 0) { // bar bar.setVX(0); if (left && !right && bar.getX() >= 0) bar.setVX(-BAR_V); else if (right && !left && bar.getX() <= 300) bar.setVX(BAR_V); // ball for (int i = 0; i < ball.length; i++) { if (ball[i] != null) { if (isCeiling(ball[i])) { pongController.sendBall(0, ball[i]); ball[i].setVisible(false); ball[i] = null; } else if (isFloor(ball[i])) { ball[i].boundY(); point[id - 1] -= 5; miss.stop(); miss.setFramePosition(0); // miss miss.start(); sendPoint(id, point[id - 1]); bcolori = 2; } else { if (isReboundLeft(ball[i])) { ball[i].boundX(); ball[i].setVX(Math.abs(ball[i].getVX())); } else if (isReboundRight(ball[i])) { ball[i].boundX(); ball[i].setVX(-Math.abs(ball[i].getVX())); } if (isReboundy(ball[i]) && ball[i].getVY() > 0) { ball[i].setVX(ball[i].getVX() + bar.getVX()); ball[i].boundY(); point[id - 1] += 10; sendPoint(id, point[id - 1]); bcolori = 1; hit.stop(); hit.setFramePosition(0); hit.start(); count++; // 40%1 if (Math.random() < 0.4 && Math.abs(ball[i].getVY()) < BALL_MAX_V) ball[i].setVY( (int) Math.signum(ball[i].getVY()) * (Math.abs(ball[i].getVY()) + 1)); } else if (isReboundx(ball[i])) { ball[i].setVX(-ball[i].getVX() + 2 * bar.getVX()); point[id - 1] += 5; sendPoint(id, point[id - 1]); bcolori = 1; hit.stop(); hit.setFramePosition(0); hit.start(); count++; } for (int j = i + 1; j < ball.length; j++) { if (ball[j] != null) if (isCollide(ball[i], ball[j])) collide(ball[i], ball[j]); } if (ball[i].getVX() > BALL_MAX_V) ball[i].setVX(BALL_MAX_V); else if (ball[i].getVX() < -BALL_MAX_V) ball[i].setVX(-BALL_MAX_V); if (ball[i].getVY() > BALL_MAX_V) ball[i].setVY(BALL_MAX_V); else if (ball[i].getVY() < -BALL_MAX_V) ball[i].setVY(-BALL_MAX_V); if (ball[i].getVY() == 0) ball[i].setVY(1); ball[i].translate(); } } } bar.translate(); if (isMax() && winorlose == 0) terminateGame(); } repaint(2); } }).start(); } public synchronized void paint(Graphics g) { Image image = createImage(FRAME_SIZE.width, FRAME_SIZE.height); Graphics dg = image.getGraphics(); dg.setColor(bColor[bcolori]); dg.fillRect(0, 0, FRAME_SIZE.width, FRAME_SIZE.height); bcolori = 0; // g.clearRect(0, 0, FRAME_SIZE.width, FRAME_SIZE.height); for (int i = 0; i < ball.length; i++) { if (ball[i] != null) { dg.setColor(new Color(ball[i].getR(), ball[i].getG(), ball[i].getB())); dg.fillOval(ball[i].x, ball[i].y, ball[i].width, ball[i].height); } } dg.setColor(Color.BLACK); dg.fillRect(bar.x, bar.y, bar.width, bar.height); dg.setFont(font); for (int i = 0; i < point.length; i++) { if (i + 1 == id) dg.setFont(font_bold); dg.drawString("Player " + (i + 1) + ": " + point[i], 30 + 210 * (i % 2), 50 + 30 * (i / 2)); dg.setFont(font); } if (winorlose == 1) { dg.setFont(font2); dg.setColor(Color.red); dg.drawString("WIN!", 110, 250); } else if (winorlose == 2) { dg.setFont(font2); dg.setColor(Color.blue); dg.drawString("LOSE...", 80, 250); } g.drawImage(image, 0, 0, this); } protected boolean isCeiling(Ball bl) { return bl.next().intersects(CEILING); } protected boolean isFloor(Ball bl) { return bl.next().intersects(FLOOR); } protected boolean isReboundLeft(Ball bl) { return bl.next().intersects(LEFT); } protected boolean isReboundRight(Ball bl) { return bl.next().intersects(RIGHT); } protected boolean isReboundx(Ball bl) { return (bl.next().intersects(bar.next()) && (bl.x + bl.width <= bar.x || bl.x >= bar.x + bar.width)); } protected boolean isReboundy(Ball bl) { return (bl.next().intersects(bar.next()) && (bl.y + bl.height <= bar.y || bl.y >= bar.y + bar.height)); } protected boolean isCollide(Ball bl1, Ball bl2) { return bl1.next().intersects(bl2.next()); } // ball[](null)ball protected void receiveBall(String s) { int i = 0; while (this.ball[i] != null) { i++; } this.ball[i] = new Ball(s); this.ball[i].setLocation(this.FRAME_SIZE.width - this.ball[i].width - this.ball[i].x, 1); this.ball[i].setV(-this.ball[i].getVX(), (int) Math.abs(this.ball[i].getVY())); this.ball[i].setVisible(true); } abstract void receivePoint(String s); abstract void sendPoint(int id, int point); protected void collide(Ball bl1, Ball bl2) { Dimension v1, v2, nv1, nv2; final double e = 1; v1 = bl1.getV(); v2 = bl2.getV(); nv1 = new Dimension((int) Math.floor(((1 - e) * v1.width + (1 + e) * v2.width) / 2), (int) Math.floor(((1 - e) * v1.height + (1 + e) * v2.height) / 2)); nv2 = new Dimension((int) Math.floor(((1 + e) * v1.width + (1 - e) * v2.width) / 2), (int) Math.floor(((1 + e) * v1.height + (1 - e) * v2.height) / 2)); bl1.setV(nv1); bl2.setV(nv2); hit.stop(); hit.setFramePosition(0); hit.start(); while (isCollide(bl1, bl2)) { bl1.translate(); bl2.translate(); } } protected boolean isMax() { for (int i = 0; i < point.length; i++) { if (point[i] >= MAX_POINT) return true; } return false; } protected void terminateGame() { } public void win() { winorlose = 1; } public void lose() { winorlose = 2; } }
package org.bimserver.plugins.services; import org.bimserver.interfaces.objects.SInternalServicePluginConfiguration; import org.bimserver.interfaces.objects.SPluginType; import org.bimserver.models.log.AccessMethod; import org.bimserver.models.store.ServiceDescriptor; import org.bimserver.plugins.Plugin; import org.bimserver.plugins.PluginConfiguration; import org.bimserver.plugins.PluginManagerInterface; import org.bimserver.shared.AuthenticationInfo; import org.bimserver.shared.ChannelConnectionException; import org.bimserver.shared.exceptions.PluginException; import org.bimserver.shared.exceptions.ServiceException; import org.bimserver.shared.exceptions.UserException; import org.bimserver.shared.interfaces.ServiceInterface; public abstract class ServicePlugin implements Plugin { public abstract String getTitle(); private PluginManagerInterface pluginManager; public ServiceInterface getServiceInterface(String token) throws UserException { return pluginManager.getServiceFactory().get(token, AccessMethod.INTERNAL).get(ServiceInterface.class); } protected void registerNewRevisionHandler(long uoid, ServiceDescriptor serviceDescriptor, final NewRevisionHandler newRevisionHandler) { pluginManager.registerNewRevisionHandler(uoid, serviceDescriptor, newRevisionHandler); } protected void unregisterNewRevisionHandler(ServiceDescriptor serviceDescriptor) { pluginManager.unregisterNewRevisionHandler(serviceDescriptor); } protected BimServerClientInterface getLocalBimServerClientInterface(AuthenticationInfo tokenAuthentication) throws ServiceException, ChannelConnectionException { return pluginManager.getLocalBimServerClientInterface(tokenAuthentication); } @Override public void init(PluginManagerInterface pluginManager) throws PluginException { this.pluginManager = pluginManager; } public PluginManagerInterface getPluginManager() { return pluginManager; } public void registerNewExtendedDataOnProjectHandler(long uoid, ServiceDescriptor serviceDescriptor, NewExtendedDataOnProjectHandler newExtendedDataHandler) { pluginManager.registerNewExtendedDataOnProjectHandler(uoid, serviceDescriptor, newExtendedDataHandler); } public void registerNewExtendedDataOnRevisionHandler(long uoid, ServiceDescriptor serviceDescriptor, NewExtendedDataOnRevisionHandler newExtendedDataHandler) { pluginManager.registerNewExtendedDataOnRevisionHandler(uoid, serviceDescriptor, newExtendedDataHandler); } /** * This will start an instance of the ServicePlugin with the settings for a specific user * * @param pluginConfiguration */ public abstract void register(long uoid, SInternalServicePluginConfiguration internalService, PluginConfiguration pluginConfiguration); public abstract void unregister(SInternalServicePluginConfiguration internalService); @Override public SPluginType getPluginType() { return SPluginType.SERVICE; } }
package com.facebook.react; import javax.annotation.Nullable; import android.content.Context; import android.graphics.Rect; import android.os.Build; import android.os.Bundle; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.Surface; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; import android.view.WindowManager; import com.facebook.common.logging.FLog; import com.facebook.infer.annotation.Assertions; import com.facebook.react.bridge.Arguments; import com.facebook.react.bridge.CatalystInstance; import com.facebook.react.bridge.ReactContext; import com.facebook.react.bridge.UiThreadUtil; import com.facebook.react.bridge.WritableMap; import com.facebook.react.bridge.WritableNativeMap; import com.facebook.react.common.ReactConstants; import com.facebook.react.common.annotations.VisibleForTesting; import com.facebook.react.modules.appregistry.AppRegistry; import com.facebook.react.modules.core.DeviceEventManagerModule; import com.facebook.react.modules.deviceinfo.DeviceInfoModule; import com.facebook.react.uimanager.DisplayMetricsHolder; import com.facebook.react.uimanager.JSTouchDispatcher; import com.facebook.react.uimanager.PixelUtil; import com.facebook.react.uimanager.RootView; import com.facebook.react.uimanager.SizeMonitoringFrameLayout; import com.facebook.react.uimanager.UIManagerModule; import com.facebook.react.uimanager.events.EventDispatcher; import com.facebook.systrace.Systrace; import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE; /** * Default root view for catalyst apps. Provides the ability to listen for size changes so that a UI * manager can re-layout its elements. * It delegates handling touch events for itself and child views and sending those events to JS by * using JSTouchDispatcher. * This view is overriding {@link ViewGroup#onInterceptTouchEvent} method in order to be notified * about the events for all of its children and it's also overriding * {@link ViewGroup#requestDisallowInterceptTouchEvent} to make sure that * {@link ViewGroup#onInterceptTouchEvent} will get events even when some child view start * intercepting it. In case when no child view is interested in handling some particular * touch event this view's {@link View#onTouchEvent} will still return true in order to be notified * about all subsequent touch events related to that gesture (in case when JS code want to handle * that gesture). */ public class ReactRootView extends SizeMonitoringFrameLayout implements RootView { /** * Listener interface for react root view events */ public interface ReactRootViewEventListener { /** * Called when the react context is attached to a ReactRootView. */ void onAttachedToReactInstance(ReactRootView rootView); } private @Nullable ReactInstanceManager mReactInstanceManager; private @Nullable String mJSModuleName; private @Nullable Bundle mAppProperties; private @Nullable CustomGlobalLayoutListener mCustomGlobalLayoutListener; private @Nullable ReactRootViewEventListener mRootViewEventListener; private int mRootViewTag; private boolean mIsAttachedToInstance; private final JSTouchDispatcher mJSTouchDispatcher = new JSTouchDispatcher(this); public ReactRootView(Context context) { super(context); } public ReactRootView(Context context, AttributeSet attrs) { super(context, attrs); } public ReactRootView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "ReactRootView.onMeasure"); try { setMeasuredDimension( MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.getSize(heightMeasureSpec)); // Check if we were waiting for onMeasure to attach the root view. if (mReactInstanceManager != null && !mIsAttachedToInstance) { attachToReactInstanceManager(); } } finally { Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); } } @Override public void onChildStartedNativeGesture(MotionEvent androidEvent) { if (mReactInstanceManager == null || !mIsAttachedToInstance || mReactInstanceManager.getCurrentReactContext() == null) { FLog.w( ReactConstants.TAG, "Unable to dispatch touch to JS as the catalyst instance has not been attached"); return; } ReactContext reactContext = mReactInstanceManager.getCurrentReactContext(); EventDispatcher eventDispatcher = reactContext.getNativeModule(UIManagerModule.class) .getEventDispatcher(); mJSTouchDispatcher.onChildStartedNativeGesture(androidEvent, eventDispatcher); } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { dispatchJSTouchEvent(ev); return super.onInterceptTouchEvent(ev); } @Override public boolean onTouchEvent(MotionEvent ev) { dispatchJSTouchEvent(ev); super.onTouchEvent(ev); // In case when there is no children interested in handling touch event, we return true from // the root view in order to receive subsequent events related to that gesture return true; } private void dispatchJSTouchEvent(MotionEvent event) { if (mReactInstanceManager == null || !mIsAttachedToInstance || mReactInstanceManager.getCurrentReactContext() == null) { FLog.w( ReactConstants.TAG, "Unable to dispatch touch to JS as the catalyst instance has not been attached"); return; } ReactContext reactContext = mReactInstanceManager.getCurrentReactContext(); EventDispatcher eventDispatcher = reactContext.getNativeModule(UIManagerModule.class) .getEventDispatcher(); mJSTouchDispatcher.handleTouchEvent(event, eventDispatcher); } @Override public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) { // Override in order to still receive events to onInterceptTouchEvent even when some other // views disallow that, but propagate it up the tree if possible. if (getParent() != null) { getParent().requestDisallowInterceptTouchEvent(disallowIntercept); } } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { // No-op since UIManagerModule handles actually laying out children. } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); if (mIsAttachedToInstance) { getViewTreeObserver().addOnGlobalLayoutListener(getCustomGlobalLayoutListener()); } } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); if (mIsAttachedToInstance) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { getViewTreeObserver().removeOnGlobalLayoutListener(getCustomGlobalLayoutListener()); } else { getViewTreeObserver().removeGlobalOnLayoutListener(getCustomGlobalLayoutListener()); } } } /** * {@see #startReactApplication(ReactInstanceManager, String, android.os.Bundle)} */ public void startReactApplication(ReactInstanceManager reactInstanceManager, String moduleName) { startReactApplication(reactInstanceManager, moduleName, null); } /** * Schedule rendering of the react component rendered by the JS application from the given JS * module (@{param moduleName}) using provided {@param reactInstanceManager} to attach to the * JS context of that manager. Extra parameter {@param launchOptions} can be used to pass initial * properties for the react component. */ public void startReactApplication( ReactInstanceManager reactInstanceManager, String moduleName, @Nullable Bundle initialProperties) { Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "startReactApplication"); try { UiThreadUtil.assertOnUiThread(); // TODO(6788889): Use POJO instead of bundle here, apparently we can't just use WritableMap // here as it may be deallocated in native after passing via JNI bridge, but we want to reuse // it in the case of re-creating the catalyst instance Assertions.assertCondition( mReactInstanceManager == null, "This root view has already been attached to a catalyst instance manager"); mReactInstanceManager = reactInstanceManager; mJSModuleName = moduleName; mAppProperties = initialProperties; if (!mReactInstanceManager.hasStartedCreatingInitialContext()) { mReactInstanceManager.createReactContextInBackground(); } attachToReactInstanceManager(); } finally { Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); } } /** * Unmount the react application at this root view, reclaiming any JS memory associated with that * application. If {@link #startReactApplication} is called, this method must be called before the * ReactRootView is garbage collected (typically in your Activity's onDestroy, or in your * Fragment's onDestroyView). */ public void unmountReactApplication() { if (mReactInstanceManager != null && mIsAttachedToInstance) { mReactInstanceManager.detachRootView(this); mIsAttachedToInstance = false; } } public void onAttachedToReactInstance() { if (mRootViewEventListener != null) { mRootViewEventListener.onAttachedToReactInstance(this); } } public void setEventListener(ReactRootViewEventListener eventListener) { mRootViewEventListener = eventListener; } /* package */ String getJSModuleName() { return Assertions.assertNotNull(mJSModuleName); } public @Nullable Bundle getAppProperties() { return mAppProperties; } public void setAppProperties(@Nullable Bundle appProperties) { UiThreadUtil.assertOnUiThread(); mAppProperties = appProperties; runApplication(); } /** * Calls into JS to start the React application. Can be called multiple times with the * same rootTag, which will re-render the application from the root. */ /* package */ void runApplication() { Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "ReactRootView.runApplication"); try { if (mReactInstanceManager == null || !mIsAttachedToInstance) { return; } ReactContext reactContext = mReactInstanceManager.getCurrentReactContext(); if (reactContext == null) { return; } CatalystInstance catalystInstance = reactContext.getCatalystInstance(); WritableNativeMap appParams = new WritableNativeMap(); appParams.putDouble("rootTag", getRootViewTag()); @Nullable Bundle appProperties = getAppProperties(); if (appProperties != null) { appParams.putMap("initialProps", Arguments.fromBundle(appProperties)); } String jsAppModuleName = getJSModuleName(); catalystInstance.getJSModule(AppRegistry.class).runApplication(jsAppModuleName, appParams); } finally { Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); } } /** * Is used by unit test to setup mIsAttachedToWindow flags, that will let this * view to be properly attached to catalyst instance by startReactApplication call */ @VisibleForTesting /* package */ void simulateAttachForTesting() { mIsAttachedToInstance = true; } private CustomGlobalLayoutListener getCustomGlobalLayoutListener() { if (mCustomGlobalLayoutListener == null) { mCustomGlobalLayoutListener = new CustomGlobalLayoutListener(); } return mCustomGlobalLayoutListener; } private void attachToReactInstanceManager() { Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "attachToReactInstanceManager"); try { if (mIsAttachedToInstance) { return; } mIsAttachedToInstance = true; Assertions.assertNotNull(mReactInstanceManager).attachRootView(this); getViewTreeObserver().addOnGlobalLayoutListener(getCustomGlobalLayoutListener()); } finally { Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); } } @Override protected void finalize() throws Throwable { super.finalize(); Assertions.assertCondition( !mIsAttachedToInstance, "The application this ReactRootView was rendering was not unmounted before the " + "ReactRootView was garbage collected. This usually means that your application is " + "leaking large amounts of memory. To solve this, make sure to call " + "ReactRootView#unmountReactApplication in the onDestroy() of your hosting Activity or in " + "the onDestroyView() of your hosting Fragment."); } public int getRootViewTag() { return mRootViewTag; } public void setRootViewTag(int rootViewTag) { mRootViewTag = rootViewTag; } private class CustomGlobalLayoutListener implements ViewTreeObserver.OnGlobalLayoutListener { private final Rect mVisibleViewArea; private final int mMinKeyboardHeightDetected; private int mKeyboardHeight = 0; private int mDeviceRotation = 0; /* package */ CustomGlobalLayoutListener() { DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(getContext().getApplicationContext()); mVisibleViewArea = new Rect(); mMinKeyboardHeightDetected = (int) PixelUtil.toPixelFromDIP(60); } @Override public void onGlobalLayout() { if (mReactInstanceManager == null || !mIsAttachedToInstance || mReactInstanceManager.getCurrentReactContext() == null) { return; } checkForKeyboardEvents(); checkForDeviceOrientationChanges(); } private void checkForKeyboardEvents() { getRootView().getWindowVisibleDisplayFrame(mVisibleViewArea); final int heightDiff = DisplayMetricsHolder.getWindowDisplayMetrics().heightPixels - mVisibleViewArea.bottom; if (mKeyboardHeight != heightDiff && heightDiff > mMinKeyboardHeightDetected) { // keyboard is now showing, or the keyboard height has changed mKeyboardHeight = heightDiff; WritableMap params = Arguments.createMap(); WritableMap coordinates = Arguments.createMap(); coordinates.putDouble("screenY", PixelUtil.toDIPFromPixel(mVisibleViewArea.bottom)); coordinates.putDouble("screenX", PixelUtil.toDIPFromPixel(mVisibleViewArea.left)); coordinates.putDouble("width", PixelUtil.toDIPFromPixel(mVisibleViewArea.width())); coordinates.putDouble("height", PixelUtil.toDIPFromPixel(mKeyboardHeight)); params.putMap("endCoordinates", coordinates); sendEvent("keyboardDidShow", params); } else if (mKeyboardHeight != 0 && heightDiff <= mMinKeyboardHeightDetected) { // keyboard is now hidden mKeyboardHeight = 0; sendEvent("keyboardDidHide", null); } } private void checkForDeviceOrientationChanges() { final int rotation = ((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE)) .getDefaultDisplay().getRotation(); if (mDeviceRotation == rotation) { return; } mDeviceRotation = rotation; // It's important to repopulate DisplayMetrics and export them before emitting the // orientation change event, so that the Dimensions object returns the correct new values. DisplayMetricsHolder.initDisplayMetrics(getContext()); emitUpdateDimensionsEvent(); emitOrientationChanged(rotation); } private void emitOrientationChanged(final int newRotation) { String name; double rotationDegrees; boolean isLandscape = false; switch (newRotation) { case Surface.ROTATION_0: name = "portrait-primary"; rotationDegrees = 0.0; break; case Surface.ROTATION_90: name = "landscape-primary"; rotationDegrees = -90.0; isLandscape = true; break; case Surface.ROTATION_180: name = "portrait-secondary"; rotationDegrees = 180.0; break; case Surface.ROTATION_270: name = "landscape-secondary"; rotationDegrees = 90.0; isLandscape = true; break; default: return; } WritableMap map = Arguments.createMap(); map.putString("name", name); map.putDouble("rotationDegrees", rotationDegrees); map.putBoolean("isLandscape", isLandscape); sendEvent("namedOrientationDidChange", map); } private void emitUpdateDimensionsEvent() { mReactInstanceManager .getCurrentReactContext() .getNativeModule(DeviceInfoModule.class) .emitUpdateDimensionsEvent(); } private void sendEvent(String eventName, @Nullable WritableMap params) { if (mReactInstanceManager != null) { mReactInstanceManager.getCurrentReactContext() .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class) .emit(eventName, params); } } } }
package com.facebook.react; import javax.annotation.Nullable; import android.content.Context; import android.graphics.Rect; import android.os.Bundle; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.Surface; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; import android.view.WindowManager; import com.facebook.common.logging.FLog; import com.facebook.infer.annotation.Assertions; import com.facebook.react.bridge.Arguments; import com.facebook.react.bridge.CatalystInstance; import com.facebook.react.bridge.ReactContext; import com.facebook.react.bridge.UiThreadUtil; import com.facebook.react.bridge.WritableMap; import com.facebook.react.bridge.WritableNativeMap; import com.facebook.react.common.ReactConstants; import com.facebook.react.common.annotations.VisibleForTesting; import com.facebook.react.modules.appregistry.AppRegistry; import com.facebook.react.modules.core.DeviceEventManagerModule; import com.facebook.react.modules.deviceinfo.DeviceInfoModule; import com.facebook.react.uimanager.DisplayMetricsHolder; import com.facebook.react.uimanager.JSTouchDispatcher; import com.facebook.react.uimanager.PixelUtil; import com.facebook.react.uimanager.RootView; import com.facebook.react.uimanager.SizeMonitoringFrameLayout; import com.facebook.react.uimanager.UIManagerModule; import com.facebook.react.uimanager.events.EventDispatcher; import com.facebook.systrace.Systrace; import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE; /** * Default root view for catalyst apps. Provides the ability to listen for size changes so that a UI * manager can re-layout its elements. * It delegates handling touch events for itself and child views and sending those events to JS by * using JSTouchDispatcher. * This view is overriding {@link ViewGroup#onInterceptTouchEvent} method in order to be notified * about the events for all of it's children and it's also overriding * {@link ViewGroup#requestDisallowInterceptTouchEvent} to make sure that * {@link ViewGroup#onInterceptTouchEvent} will get events even when some child view start * intercepting it. In case when no child view is interested in handling some particular * touch event this view's {@link View#onTouchEvent} will still return true in order to be notified * about all subsequent touch events related to that gesture (in case when JS code want to handle * that gesture). */ public class ReactRootView extends SizeMonitoringFrameLayout implements RootView { /** * Listener interface for react root view events */ public interface ReactRootViewEventListener { /** * Called when the react context is attached to a ReactRootView. */ void onAttachedToReactInstance(ReactRootView rootView); } private @Nullable ReactInstanceManager mReactInstanceManager; private @Nullable String mJSModuleName; private @Nullable Bundle mAppProperties; private @Nullable CustomGlobalLayoutListener mCustomGlobalLayoutListener; private @Nullable ReactRootViewEventListener mRootViewEventListener; private int mRootViewTag; private boolean mWasMeasured = false; private boolean mIsAttachedToInstance = false; private final JSTouchDispatcher mJSTouchDispatcher = new JSTouchDispatcher(this); public ReactRootView(Context context) { super(context); } public ReactRootView(Context context, AttributeSet attrs) { super(context, attrs); } public ReactRootView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "ReactRootView.onMeasure"); try { setMeasuredDimension( MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.getSize(heightMeasureSpec)); mWasMeasured = true; // Check if we were waiting for onMeasure to attach the root view. if (mReactInstanceManager != null && !mIsAttachedToInstance) { attachToReactInstanceManager(); } } finally { Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); } } @Override public void onChildStartedNativeGesture(MotionEvent androidEvent) { if (mReactInstanceManager == null || !mIsAttachedToInstance || mReactInstanceManager.getCurrentReactContext() == null) { FLog.w( ReactConstants.TAG, "Unable to dispatch touch to JS as the catalyst instance has not been attached"); return; } ReactContext reactContext = mReactInstanceManager.getCurrentReactContext(); EventDispatcher eventDispatcher = reactContext.getNativeModule(UIManagerModule.class) .getEventDispatcher(); mJSTouchDispatcher.onChildStartedNativeGesture(androidEvent, eventDispatcher); } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { dispatchJSTouchEvent(ev); return super.onInterceptTouchEvent(ev); } @Override public boolean onTouchEvent(MotionEvent ev) { dispatchJSTouchEvent(ev); super.onTouchEvent(ev); // In case when there is no children interested in handling touch event, we return true from // the root view in order to receive subsequent events related to that gesture return true; } private void dispatchJSTouchEvent(MotionEvent event) { if (mReactInstanceManager == null || !mIsAttachedToInstance || mReactInstanceManager.getCurrentReactContext() == null) { FLog.w( ReactConstants.TAG, "Unable to dispatch touch to JS as the catalyst instance has not been attached"); return; } ReactContext reactContext = mReactInstanceManager.getCurrentReactContext(); EventDispatcher eventDispatcher = reactContext.getNativeModule(UIManagerModule.class) .getEventDispatcher(); mJSTouchDispatcher.handleTouchEvent(event, eventDispatcher); } @Override public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) { // Override in order to still receive events to onInterceptTouchEvent even when some other // views disallow that, but propagate it up the tree if possible. if (getParent() != null) { getParent().requestDisallowInterceptTouchEvent(disallowIntercept); } } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { // No-op since UIManagerModule handles actually laying out children. } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); if (mIsAttachedToInstance) { getViewTreeObserver().addOnGlobalLayoutListener(getCustomGlobalLayoutListener()); } } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); if (mIsAttachedToInstance) { getViewTreeObserver().removeOnGlobalLayoutListener(getCustomGlobalLayoutListener()); } } /** * {@see #startReactApplication(ReactInstanceManager, String, android.os.Bundle)} */ public void startReactApplication(ReactInstanceManager reactInstanceManager, String moduleName) { startReactApplication(reactInstanceManager, moduleName, null); } /** * Schedule rendering of the react component rendered by the JS application from the given JS * module (@{param moduleName}) using provided {@param reactInstanceManager} to attach to the * JS context of that manager. Extra parameter {@param launchOptions} can be used to pass initial * properties for the react component. */ public void startReactApplication( ReactInstanceManager reactInstanceManager, String moduleName, @Nullable Bundle initialProperties) { Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "startReactApplication"); try { UiThreadUtil.assertOnUiThread(); // TODO(6788889): Use POJO instead of bundle here, apparently we can't just use WritableMap // here as it may be deallocated in native after passing via JNI bridge, but we want to reuse // it in the case of re-creating the catalyst instance Assertions.assertCondition( mReactInstanceManager == null, "This root view has already been attached to a catalyst instance manager"); mReactInstanceManager = reactInstanceManager; mJSModuleName = moduleName; mAppProperties = initialProperties; if (!mReactInstanceManager.hasStartedCreatingInitialContext()) { mReactInstanceManager.createReactContextInBackground(); } // We need to wait for the initial onMeasure, if this view has not yet been measured, we set // which will make this view startReactApplication itself to instance manager once onMeasure // is called. if (mWasMeasured) { attachToReactInstanceManager(); } } finally { Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); } } /** * Unmount the react application at this root view, reclaiming any JS memory associated with that * application. If {@link #startReactApplication} is called, this method must be called before the * ReactRootView is garbage collected (typically in your Activity's onDestroy, or in your * Fragment's onDestroyView). */ public void unmountReactApplication() { if (mReactInstanceManager != null && mIsAttachedToInstance) { mReactInstanceManager.detachRootView(this); mIsAttachedToInstance = false; } } public void onAttachedToReactInstance() { if (mRootViewEventListener != null) { mRootViewEventListener.onAttachedToReactInstance(this); } } public void setEventListener(ReactRootViewEventListener eventListener) { mRootViewEventListener = eventListener; } /* package */ String getJSModuleName() { return Assertions.assertNotNull(mJSModuleName); } public @Nullable Bundle getAppProperties() { return mAppProperties; } public void setAppProperties(@Nullable Bundle appProperties) { UiThreadUtil.assertOnUiThread(); mAppProperties = appProperties; runApplication(); } /** * Calls into JS to start the React application. Can be called multiple times with the * same rootTag, which will re-render the application from the root. */ /* package */ void runApplication() { Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "ReactRootView.runApplication"); try { if (mReactInstanceManager == null || !mIsAttachedToInstance) { return; } ReactContext reactContext = mReactInstanceManager.getCurrentReactContext(); if (reactContext == null) { return; } CatalystInstance catalystInstance = reactContext.getCatalystInstance(); WritableNativeMap appParams = new WritableNativeMap(); appParams.putDouble("rootTag", getRootViewTag()); @Nullable Bundle appProperties = getAppProperties(); if (appProperties != null) { appParams.putMap("initialProps", Arguments.fromBundle(appProperties)); } String jsAppModuleName = getJSModuleName(); catalystInstance.getJSModule(AppRegistry.class).runApplication(jsAppModuleName, appParams); } finally { Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); } } /** * Is used by unit test to setup mWasMeasured and mIsAttachedToWindow flags, that will let this * view to be properly attached to catalyst instance by startReactApplication call */ @VisibleForTesting /* package */ void simulateAttachForTesting() { mIsAttachedToInstance = true; mWasMeasured = true; } private CustomGlobalLayoutListener getCustomGlobalLayoutListener() { if (mCustomGlobalLayoutListener == null) { mCustomGlobalLayoutListener = new CustomGlobalLayoutListener(); } return mCustomGlobalLayoutListener; } private void attachToReactInstanceManager() { Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "attachToReactInstanceManager"); try { if (mIsAttachedToInstance) { return; } mIsAttachedToInstance = true; Assertions.assertNotNull(mReactInstanceManager).attachMeasuredRootView(this); getViewTreeObserver().addOnGlobalLayoutListener(getCustomGlobalLayoutListener()); } finally { Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); } } @Override protected void finalize() throws Throwable { super.finalize(); Assertions.assertCondition( !mIsAttachedToInstance, "The application this ReactRootView was rendering was not unmounted before the " + "ReactRootView was garbage collected. This usually means that your application is " + "leaking large amounts of memory. To solve this, make sure to call " + "ReactRootView#unmountReactApplication in the onDestroy() of your hosting Activity or in " + "the onDestroyView() of your hosting Fragment."); } public int getRootViewTag() { return mRootViewTag; } public void setRootViewTag(int rootViewTag) { mRootViewTag = rootViewTag; } private class CustomGlobalLayoutListener implements ViewTreeObserver.OnGlobalLayoutListener { private final Rect mVisibleViewArea; private final int mMinKeyboardHeightDetected; private int mKeyboardHeight = 0; private int mDeviceRotation = 0; /* package */ CustomGlobalLayoutListener() { mVisibleViewArea = new Rect(); mMinKeyboardHeightDetected = (int) PixelUtil.toPixelFromDIP(60); } @Override public void onGlobalLayout() { if (mReactInstanceManager == null || !mIsAttachedToInstance || mReactInstanceManager.getCurrentReactContext() == null) { return; } checkForKeyboardEvents(); checkForDeviceOrientationChanges(); } private void checkForKeyboardEvents() { getRootView().getWindowVisibleDisplayFrame(mVisibleViewArea); final int heightDiff = DisplayMetricsHolder.getWindowDisplayMetrics().heightPixels - mVisibleViewArea.bottom; if (mKeyboardHeight != heightDiff && heightDiff > mMinKeyboardHeightDetected) { // keyboard is now showing, or the keyboard height has changed mKeyboardHeight = heightDiff; WritableMap params = Arguments.createMap(); WritableMap coordinates = Arguments.createMap(); coordinates.putDouble("screenY", PixelUtil.toDIPFromPixel(mVisibleViewArea.bottom)); coordinates.putDouble("screenX", PixelUtil.toDIPFromPixel(mVisibleViewArea.left)); coordinates.putDouble("width", PixelUtil.toDIPFromPixel(mVisibleViewArea.width())); coordinates.putDouble("height", PixelUtil.toDIPFromPixel(mKeyboardHeight)); params.putMap("endCoordinates", coordinates); sendEvent("keyboardDidShow", params); } else if (mKeyboardHeight != 0 && heightDiff <= mMinKeyboardHeightDetected) { // keyboard is now hidden mKeyboardHeight = 0; sendEvent("keyboardDidHide", null); } } private void checkForDeviceOrientationChanges() { final int rotation = ((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE)) .getDefaultDisplay().getRotation(); if (mDeviceRotation == rotation) { return; } mDeviceRotation = rotation; // It's important to repopulate DisplayMetrics and export them before emitting the // orientation change event, so that the Dimensions object returns the correct new values. DisplayMetricsHolder.initDisplayMetrics(getContext()); emitUpdateDimensionsEvent(); emitOrientationChanged(rotation); } private void emitOrientationChanged(final int newRotation) { String name; double rotationDegrees; boolean isLandscape = false; switch (newRotation) { case Surface.ROTATION_0: name = "portrait-primary"; rotationDegrees = 0.0; break; case Surface.ROTATION_90: name = "landscape-primary"; rotationDegrees = -90.0; isLandscape = true; break; case Surface.ROTATION_180: name = "portrait-secondary"; rotationDegrees = 180.0; break; case Surface.ROTATION_270: name = "landscape-secondary"; rotationDegrees = 90.0; isLandscape = true; break; default: return; } WritableMap map = Arguments.createMap(); map.putString("name", name); map.putDouble("rotationDegrees", rotationDegrees); map.putBoolean("isLandscape", isLandscape); sendEvent("namedOrientationDidChange", map); } private void emitUpdateDimensionsEvent() { mReactInstanceManager .getCurrentReactContext() .getNativeModule(DeviceInfoModule.class) .emitUpdateDimensionsEvent(); } private void sendEvent(String eventName, @Nullable WritableMap params) { if (mReactInstanceManager != null) { mReactInstanceManager.getCurrentReactContext() .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class) .emit(eventName, params); } } } }
package com.growthbeat.message.view; import android.os.Bundle; import android.os.Parcelable; import android.support.v4.app.FragmentActivity; import android.view.Window; import com.growthbeat.message.model.Message; public class AlertActivity extends FragmentActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setTheme(android.R.style.Theme_Translucent); Message message = (Message) getIntent().getExtras().get("message"); Bundle bundle = new Bundle(); bundle.putParcelable("message", (Parcelable) message); switch (message.getType()) { case plain: AlertFragment alertFragment = new AlertFragment(); alertFragment.setCancelable(false); alertFragment.setArguments(bundle); alertFragment.show(getSupportFragmentManager(), getClass().getName()); break; case image: ImageFragment imageFragment = new ImageFragment(); imageFragment.setArguments(bundle); getSupportFragmentManager().beginTransaction().replace(android.R.id.content, imageFragment).commitAllowingStateLoss(); break; default: break; } } @Override public void onDestroy() { super.onDestroy(); } }
package com.hubspot.rosetta; import com.fasterxml.jackson.databind.ObjectMapper; import com.hubspot.rosetta.internal.TableNameExtractor; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Types; import java.util.HashMap; import java.util.Map; /** * Core mapping functionality. * * The {@code map} methods here take iterable result sets (field names * to String values) and use Jackson to bind * those values to a * <code>type</code> instance. * * @author tdavis */ public class RosettaMapper<T> { private static TableNameExtractor TABLE_NAME_EXTRACTOR = chooseTableNameExtractor(); private final Class<T> type; private final ObjectMapper objectMapper; private final String tableName; public RosettaMapper(Class<T> type) { this(type, Rosetta.getMapper()); } public RosettaMapper(Class<T> type, ObjectMapper objectMapper) { this(type, objectMapper, null); } public RosettaMapper(Class<T> type, String tableName) { this(type, Rosetta.getMapper(), tableName); } public RosettaMapper(Class<T> type, ObjectMapper objectMapper, String tableName) { this.type = type; this.objectMapper = objectMapper; this.tableName = tableName; } /** * Map a single ResultSet row to a T instance. * * @throws SQLException */ public T mapRow(ResultSet rs) throws SQLException { Map<String, Object> map = new HashMap<String, Object>(); ResultSetMetaData metadata = rs.getMetaData(); for (int i = 1; i <= metadata.getColumnCount(); ++i) { String label = metadata.getColumnLabel(i); final Object value; // calling getObject on a BLOB/CLOB produces weird results switch (metadata.getColumnType(i)) { case Types.BLOB: value = rs.getBytes(i); break; case Types.CLOB: value = rs.getString(i); break; default: value = rs.getObject(i); } // don't use table name extractor because we don't want aliased table name boolean overwrite = metadata.getTableName(i).equals(this.tableName); String tableName = TABLE_NAME_EXTRACTOR.getTableName(metadata, i); if (tableName != null && !tableName.isEmpty()) { String qualifiedName = tableName + "." + metadata.getColumnName(i); add(map, qualifiedName, value, overwrite); } add(map, label, value, overwrite); } return objectMapper.convertValue(map, type); } private void add(Map<String, Object> map, String label, Object value, boolean overwrite) { if (label.contains(".")) { int periodIndex = label.indexOf('.'); String prefix = label.substring(0, periodIndex); String suffix = label.substring(periodIndex + 1); @SuppressWarnings("unchecked") Map<String, Object> submap = (Map<String, Object>) map.get(prefix); if (submap == null) { submap = new HashMap<>(); map.put(prefix, submap); } add(submap, suffix, value, overwrite); } else { if (overwrite || !map.containsKey(label)) { map.put(label, value); } } } private static TableNameExtractor chooseTableNameExtractor() { try { Class.forName("com.mysql.jdbc.ResultSetMetaData"); return (TableNameExtractor) Class.forName("com.mysql.jdbc.MysqlTableNameExtractor").newInstance(); } catch (Exception e) { return new TableNameExtractor.Default(); } } }
package etomica.integrator; import etomica.api.IAtom; import etomica.api.IAtomKinetic; import etomica.api.IAtomList; import etomica.api.IBox; import etomica.api.IPotentialMaster; import etomica.api.IRandom; import etomica.api.ISimulation; import etomica.api.IVectorMutable; import etomica.atom.AtomLeafAgentManager; import etomica.atom.AtomLeafAgentManager.AgentSource; import etomica.atom.AtomSetSinglet; import etomica.atom.iterator.IteratorDirective; import etomica.potential.PotentialCalculationForcePressureSum; import etomica.potential.PotentialCalculationForceSum; import etomica.space.ISpace; import etomica.space.Tensor; import etomica.util.Debug; public class IntegratorVelocityVerlet extends IntegratorMD implements AgentSource<IntegratorVelocityVerlet.MyAgent> { protected PotentialCalculationForceSum forceSum;; protected final IteratorDirective allAtoms; protected final Tensor pressureTensor; protected final Tensor workTensor; protected AtomLeafAgentManager<MyAgent> agentManager; public IntegratorVelocityVerlet(ISimulation sim, IPotentialMaster potentialMaster, ISpace _space) { this(potentialMaster, sim.getRandom(), 0.05, 1.0, _space); } public IntegratorVelocityVerlet(IPotentialMaster potentialMaster, IRandom random, double timeStep, double temperature, ISpace _space) { super(potentialMaster,random,timeStep,temperature, _space); // if you're motivated to throw away information earlier, you can use // PotentialCalculationForceSum instead. forceSum = new PotentialCalculationForcePressureSum(space); allAtoms = new IteratorDirective(); // allAtoms is used only for the force calculation, which has no LRC // but we're also calculating the pressure tensor, which does have LRC. // things deal with this OK. allAtoms.setIncludeLrc(true); pressureTensor = space.makeTensor(); workTensor = space.makeTensor(); } public PotentialCalculationForceSum getForceSum() { return forceSum; } public AtomLeafAgentManager<MyAgent> getAgentManager() { return agentManager; } public void setForceSum(PotentialCalculationForceSum pc){ forceSum = pc; if(box != null){ forceSum.setAgentManager(agentManager); } } public void setBox(IBox p) { if (box != null) { // allow agentManager to de-register itself as a BoxListener agentManager.dispose(); } super.setBox(p); agentManager = new AtomLeafAgentManager<MyAgent>(this,p,MyAgent.class); forceSum.setAgentManager(agentManager); } // steps all particles across time interval tStep // assumes one box public void doStepInternal() { super.doStepInternal(); if (Debug.ON && Debug.DEBUG_NOW) { IAtomList pair = Debug.getAtoms(box); if (pair != null) { IVectorMutable dr = space.makeVector(); dr.Ev1Mv2(pair.getAtom(1).getPosition(), pair.getAtom(0).getPosition()); System.out.println(pair+" dr "+dr); } } IAtomList leafList = box.getLeafList(); int nLeaf = leafList.getAtomCount(); for (int iLeaf=0; iLeaf<nLeaf; iLeaf++) { IAtomKinetic a = (IAtomKinetic)leafList.getAtom(iLeaf); MyAgent agent = agentManager.getAgent(a); IVectorMutable r = a.getPosition(); IVectorMutable v = a.getVelocity(); if (Debug.ON && Debug.DEBUG_NOW && Debug.anyAtom(new AtomSetSinglet(a))) { System.out.println("first "+a+" r="+r+", v="+v+", f="+agent.force); } v.PEa1Tv1(0.5*timeStep*((IAtom)a).getType().rm(),agent.force); // p += f(old)*dt/2 r.PEa1Tv1(timeStep,v); // r += p*dt/m } forceSum.reset(); //Compute forces on each atom potentialMaster.calculate(box, allAtoms, forceSum); if(forceSum instanceof PotentialCalculationForcePressureSum){ pressureTensor.E(((PotentialCalculationForcePressureSum)forceSum).getPressureTensor()); } //Finish integration step for (int iLeaf=0; iLeaf<nLeaf; iLeaf++) { IAtomKinetic a = (IAtomKinetic)leafList.getAtom(iLeaf); // System.out.println("force: "+((MyAgent)a.ia).force.toString()); IVectorMutable velocity = a.getVelocity(); workTensor.Ev1v2(velocity,velocity); workTensor.TE(((IAtom)a).getType().getMass()); pressureTensor.PE(workTensor); if (Debug.ON && Debug.DEBUG_NOW && Debug.anyAtom(new AtomSetSinglet(a))) { System.out.println("second "+a+" v="+velocity+", f="+((MyAgent)agentManager.getAgent(a)).force); } velocity.PEa1Tv1(0.5*timeStep*((IAtom)a).getType().rm(),((MyAgent)agentManager.getAgent(a)).force); //p += f(new)*dt/2 } pressureTensor.TE(1/box.getBoundary().volume()); if(isothermal) { doThermostatInternal(); } } /** * Returns the pressure tensor based on the forces calculated during the * last time step. */ public Tensor getPressureTensor() { return pressureTensor; } public void reset() { super.reset(); if (Debug.ON && Debug.DEBUG_NOW) { IAtomList pair = Debug.getAtoms(box); if (pair != null) { IVectorMutable dr = space.makeVector(); dr.Ev1Mv2(pair.getAtom(1).getPosition(), pair.getAtom(0).getPosition()); System.out.println(pair+" dr "+dr); } } forceSum.reset(); potentialMaster.calculate(box, allAtoms, forceSum); } public MyAgent makeAgent(IAtom a) { return new MyAgent(space); } public void releaseAgent(MyAgent agent, IAtom atom) {} public final static class MyAgent implements IntegratorBox.Forcible {//need public so to use with instanceof public IVectorMutable force; public MyAgent(ISpace space) { force = space.makeVector(); } public IVectorMutable force() {return force;} } }
package com.ibm.bi.dml.parser; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import com.ibm.bi.dml.api.DMLScript; import com.ibm.bi.dml.parser.Expression.BinaryOp; import com.ibm.bi.dml.parser.Expression.DataType; import com.ibm.bi.dml.runtime.controlprogram.ParForProgramBlock.PDataPartitionFormat; import com.ibm.bi.dml.runtime.controlprogram.ParForProgramBlock.PDataPartitioner; import com.ibm.bi.dml.runtime.controlprogram.ParForProgramBlock.PExecMode; import com.ibm.bi.dml.runtime.controlprogram.ParForProgramBlock.POptMode; import com.ibm.bi.dml.runtime.controlprogram.ParForProgramBlock.PResultMerge; import com.ibm.bi.dml.runtime.controlprogram.ParForProgramBlock.PTaskPartitioner; import com.ibm.bi.dml.runtime.controlprogram.parfor.stat.InfrastructureAnalyzer; import com.ibm.bi.dml.runtime.controlprogram.parfor.stat.Timing; import com.ibm.bi.dml.runtime.controlprogram.parfor.util.IDSequence; import com.ibm.bi.dml.utils.LanguageException; /** * This ParForStatementBlock is essentially identical to a ForStatementBlock, except an extended validate * for checking/setting optional parfor parameters and running the loop dependency analysis. * * */ public class ParForStatementBlock extends ForStatementBlock { private static final boolean LDEBUG = DMLScript.DEBUG || false; //local debug flag //external parameter names private static HashSet<String> _paramNames; public static final String CHECK = "check"; //run loop dependency analysis public static final String PAR = "par"; //number of parallel workers public static final String TASK_PARTITIONER = "taskpartitioner"; //task partitioner public static final String TASK_SIZE = "tasksize"; //number of tasks public static final String DATA_PARTITIONER = "datapartitioner"; //task partitioner public static final String RESULT_MERGE = "resultmerge"; //task partitioner public static final String EXEC_MODE = "mode"; //runtime execution mode public static final String OPT_MODE = "opt"; //runtime execution mode //default external parameter values private static HashMap<String, String> _paramDefaults; //internal parameter values private static final boolean NORMALIZE = false; //normalize FOR from to incr private static final boolean USE_FN_CACHE = true; //useful for larger scripts (due to O(n^2)) private static final boolean ABORT_ON_FIRST_DEPENDENCY = true; private static final boolean CONSERVATIVE_CHECK = false; //include FOR into dep analysis, reject unknown vars (otherwise use internal vars for whole row or column) public static final String INTERAL_FN_INDEX_ROW = "__ixr"; //pseudo index for range indexing row public static final String INTERAL_FN_INDEX_COL = "__ixc"; //pseudo index for range indexing col //class members private static IDSequence _idSeq = null; private static IDSequence _idSeqfn = null; private static HashMap<String, LinearFunction> _fncache; //slower for most (small cases) cases //instance members private long _ID = -1; private VariableSet _vsParent = null; private ArrayList<String> _resultVars = null; private Bounds _bounds = null; static { // populate parameter name lookup-table _paramNames = new HashSet<String>(); _paramNames.add( CHECK ); _paramNames.add( PAR ); _paramNames.add( TASK_PARTITIONER ); _paramNames.add( TASK_SIZE ); _paramNames.add( DATA_PARTITIONER ); _paramNames.add( RESULT_MERGE ); _paramNames.add( EXEC_MODE ); _paramNames.add( OPT_MODE ); // populate defaults lookup-table _paramDefaults = new HashMap<String, String>(); _paramDefaults.put( CHECK, "1" ); _paramDefaults.put( PAR, String.valueOf(InfrastructureAnalyzer.getLocalParallelism()) ); _paramDefaults.put( TASK_PARTITIONER, String.valueOf(PTaskPartitioner.FIXED) ); _paramDefaults.put( TASK_SIZE, "1" ); _paramDefaults.put( DATA_PARTITIONER, String.valueOf(PDataPartitioner.NONE) ); _paramDefaults.put( RESULT_MERGE, String.valueOf(PResultMerge.LOCAL_AUTOMATIC) ); _paramDefaults.put( EXEC_MODE, String.valueOf(PExecMode.LOCAL) ); _paramDefaults.put( OPT_MODE, String.valueOf(POptMode.RULEBASED) ); _idSeq = new IDSequence(); _idSeqfn = new IDSequence(); } public ParForStatementBlock() { _ID = _idSeq.getNextID(); _resultVars = new ArrayList<String>(); if( USE_FN_CACHE ) _fncache = new HashMap<String, LinearFunction>(); if( LDEBUG ) System.out.println("PARFOR("+_ID+"): ParForStatementBlock instance created"); } public long getID() { return _ID; } public ArrayList<String> getResultVariables() { return _resultVars; } private void addToResultVariablesNoDup( String var ) { if( !_resultVars.contains( var ) ) _resultVars.add( var ); } @Override @SuppressWarnings("unchecked") public VariableSet validate(DMLProgram dmlProg, VariableSet ids, HashMap<String,ConstIdentifier> constVars) throws LanguageException, ParseException, IOException { if( LDEBUG ) System.out.println("PARFOR("+_ID+"): validating ParForStatementBlock."); //create parent variable set via cloning _vsParent = new VariableSet(); _vsParent._variables = (HashMap<String, DataIdentifier>) ids.getVariables().clone(); if(LDEBUG) //note: A is matrix, and A[i,1] is scalar for( DataIdentifier di : _vsParent._variables.values() ) System.out.println("PARFOR: non-local "+di._name+": "+di.getDataType().toString()+" with rowDim = "+di.getDim1()); //normal validate via ForStatement (sequential) //NOTE: validate/dependency checking of nested parfor-loops happens at this point //NOTE: validate includes also constant propagation for from, to, incr expressions VariableSet vs = super.validate(dmlProg, ids, constVars); //check of correctness of specified parfor parameter names and //set default parameter values for all not specified parameters ParForStatement pfs = (ParForStatement) _statements.get(0); IterablePredicate predicate = pfs.getIterablePredicate(); HashMap<String, String> params = predicate.getParForParams(); if( params != null ) //if parameter specified { for( String key : params.keySet() ) if( !_paramNames.contains(key) ) throw new LanguageException("PARFOR: The specified parameter '"+key+"' is no valid parfor parameter."); //set defaults for all non-specified values for( String key : _paramNames ) if( !params.containsKey(key) ) { //special treatment for degree of parallelism if( key.equals(PAR) && params.containsKey(EXEC_MODE) && params.get(EXEC_MODE).equals(PExecMode.REMOTE_MR.toString())) { params.put(key, String.valueOf(InfrastructureAnalyzer.getRemoteParallelMapTasks())); } else //default case params.put(key, _paramDefaults.get(key)); } } else { //set all defaults params = new HashMap<String, String>(); params.putAll( _paramDefaults ); predicate.setParForParams(params); } //start time measurement for normalization and dependency analysis Timing time = new Timing(); time.start(); // LOOP DEPENDENCY ANALYSIS (test for dependency existence) // no false negative guaranteed, but possibly false positives /* Basic intuition: WRITES to NON-local variables are only permitted iff * - no data dep (no read other than own iteration w i < r j) * - no anti dep (no read other than own iteration w i > r j) * - no output dep (no write other than own iteration) * * ALGORITHM: * 1) Determine candidates C (writes to non-local variables) * 2) Prune all c from C where no dependencies --> C' * 3) Raise an exception/warning if C' not the empty set * * RESTRICTIONS: * - array subscripts of non-local variables must be linear functions of the form * a0+ a1*i + ... + a2*j, where i and j are for or parfor indexes. * - for and parfor increments must be integer values * - only static (integer lower, upper bounds) range indexing * - only input variables considered as potential candidates for checking * * (TODO: in order to remove the last restriction, dependencies must be checked again after * live variable analysis against LIVEOUT) * * NOTE: validity is only checked during compilation, i.e., for dynamic from, to, incr MIN MAX values assumed. */ if( LDEBUG ) System.out.println("PARFOR: running loop dependency analysis ..."); // HashSet<Candidate> C = new HashSet<Candidate>(); HashSet<Candidate> C2 = new HashSet<Candidate>(); Integer sCount = 0; //object for call by ref rDetermineCandidates(pfs.getBody(), C, sCount); boolean check = (Integer.parseInt(params.get(CHECK))==1); if( check ) { // _bounds = new Bounds(); rDetermineBounds( dmlProg.getBlocks(), false ); //writes to _bounds for( Candidate c : C ) { DataType cdt = _vsParent.getVariables().get(c._var).getDataType(); //might be different in DataIdentifier //assume no dependency sCount = 0; boolean[] dep = new boolean[]{false,false,false}; //output, data, anti rCheckCandidates(c, cdt, pfs.getBody(), sCount, dep); if( LDEBUG ) { if( dep[0] ) System.out.println("PARFOR: output dependency detected for var '"+c._var+"'."); if( dep[1] ) System.out.println("PARFOR: data dependency detected for var '"+c._var+"'."); if( dep[2] ) System.out.println("PARFOR: anti dependency detected for var '"+c._var+"'."); } if( dep[0] || dep[1] || dep[2] ) { C2.add(c); if( ABORT_ON_FIRST_DEPENDENCY ) break; } } // if( C2.size() > 0 ) { if( LDEBUG ) System.out.println("PARFOR: loop dependencies detected."); StringBuilder depVars = new StringBuilder(); for( Candidate c : C2 ) { if( depVars.length()>0 ) depVars.append(", "); depVars.append(c._var); } throw new LanguageException( "PARFOR loop dependency analysis: " + "inter-iteration (loop-carried) dependencies detected for variable(s): " + depVars.toString() +".\n " + // "in lines"+this.+"\n" + "Please, ensure independence of iterations." + ((LDEBUG)? "\nDEBUG Context: \n"+this.toString():"") ); } else { if( LDEBUG ) System.out.println("PARFOR: no loop dependencies detected."); } } else { System.out.println("INFO: PARFOR("+_ID+"): loop dependency analysis skipped."); } //if successful, prepare result variables (all distinct vars in all candidates) //a) add own candidates for( Candidate var : C ) addToResultVariablesNoDup( var._var ); //b) get and add child result vars (if required) ArrayList<String> tmp = new ArrayList<String>(); rConsolidateResultVars(pfs.getBody(), tmp); for( String var : tmp ) if(_vsParent.containsVariable(var)) addToResultVariablesNoDup( var ); //cleanup function cache in order to prevent side effects between parfor statements if( USE_FN_CACHE ) _fncache.clear(); System.out.println("INFO: PARFOR("+_ID+"): validate successful (no dependencies) in "+time.stop()+"ms."); return vs; } /** * * @param sb * @return */ public ArrayList<String> getReadOnlyParentVars() { ArrayList<String> ret = new ArrayList<String>(); VariableSet read = variablesRead(); VariableSet updated = variablesUpdated(); VariableSet livein = liveIn(); for( String var : livein.getVariableNames() ) //for all parent variables if( read.containsVariable(var) && !updated.containsVariable(var) ) //read-only ret.add( var ); return ret; } /** * Determines the PDataPartitioningFormat for read-only parent variables according * to the access pattern of that variable within the parfor statement block. * Row-wise or column wise partitioning is only suggested if we see pure row-wise or * column-wise access patterns. * * @param var * @return */ public PDataPartitionFormat determineDataPartitionFormat(String var) { PDataPartitionFormat dpf = null; Collection<PDataPartitionFormat> dpfc = new LinkedList<PDataPartitionFormat>(); try { //determine partitioning candidates ParForStatement pfs = (ParForStatement) _statements.get(0); rDeterminePartitioningCandidates(var, pfs.getBody(), dpfc); //determine final solution for( PDataPartitionFormat tmp : dpfc ) { //System.out.println(var+": "+tmp); if( dpf != null && dpf!=tmp ) //if no consensus dpf = PDataPartitionFormat.NONE; else dpf = tmp; } if( dpf == null ) dpf = PDataPartitionFormat.NONE; } catch (LanguageException e) { if( LDEBUG ) e.printStackTrace(); dpf = PDataPartitionFormat.NONE; } return dpf; } /** * This method recursively determines candidates for output,data,anti dependencies. * Candidates are defined as writes to non-local variables. * * @param asb * @param C * @param sCount * @throws LanguageException */ private void rDetermineCandidates(ArrayList<StatementBlock> asb, HashSet<Candidate> C, Integer sCount) throws LanguageException { for(StatementBlock sb : asb ) // foreach statementblock in parforbody for( Statement s : sb._statements ) // foreach statement in statement block { sCount++; if( s instanceof ForStatement && !(s instanceof ParForStatement) ) { rDetermineCandidates(((ForStatement)s).getBody(), C, sCount); } else if( s instanceof ParForStatement ) { //do nothing, investigated in separate dependency analysis } else if( s instanceof WhileStatement ) { rDetermineCandidates(((WhileStatement)s).getBody(), C, sCount); } else if( s instanceof IfStatement ) { rDetermineCandidates(((IfStatement)s).getIfBody(), C, sCount); rDetermineCandidates(((IfStatement)s).getElseBody(), C, sCount); } else if( s instanceof FunctionStatement ) { rDetermineCandidates(((FunctionStatement)s).getBody(), C, sCount); } else { VariableSet vsUpdated = s.variablesUpdated(); if( vsUpdated != null ) for(String write : vsUpdated.getVariableNames()) { //add writes to non-local variables to candidate set if( _vsParent.containsVariable(write) ) { Collection<DataIdentifier> dats = getDataIdentifiers( s, true ); for( DataIdentifier dat : dats ) { Candidate c = new Candidate(); c._var = write; c._dat = dat; C.add( c ); } if( LDEBUG ) System.out.println("PARFOR: dependency candidate: var '"+write+"'"); } } } } } /** * This method recursively determines partitioning candidates for input variables. * Candidates are defined as index reads of non-local variables. * * @param asb * @param C * @throws LanguageException */ private void rDeterminePartitioningCandidates(String var, ArrayList<StatementBlock> asb, Collection<PDataPartitionFormat> C) throws LanguageException { for(StatementBlock sb : asb ) // foreach statementblock in parforbody for( Statement s : sb._statements ) // foreach statement in statement block { if( s instanceof ForStatement ) //includes for and parfor { rDeterminePartitioningCandidates(var,((ForStatement)s).getBody(), C); } else if( s instanceof WhileStatement ) { rDeterminePartitioningCandidates(var,((WhileStatement)s).getBody(), C); } else if( s instanceof IfStatement ) { rDeterminePartitioningCandidates(var,((IfStatement)s).getIfBody(), C); rDeterminePartitioningCandidates(var,((IfStatement)s).getElseBody(), C); } else if( s instanceof FunctionStatement ) { rDeterminePartitioningCandidates(var,((FunctionStatement)s).getBody(), C); } else { Collection<DataIdentifier> datsRead = getDataIdentifiers(s, false); if( datsRead != null ) for(DataIdentifier read : datsRead) { String readStr = read.getName(); if( var.equals( readStr ) && read instanceof IndexedIdentifier ) { IndexedIdentifier idat = (IndexedIdentifier) read; C.add( determineAccessPattern(idat) ); } } } } } private PDataPartitionFormat determineAccessPattern( IndexedIdentifier dat ) { PDataPartitionFormat dpf = null; Expression rowL = dat.getRowLowerBound(); Expression rowU = dat.getRowUpperBound(); Expression colL = dat.getColLowerBound(); Expression colU = dat.getColUpperBound(); boolean flag1=false, flag2=false; //flag1: true if row expr is colon if( rowL == null && rowU == null ) flag1 = true; //flag2: true if col expr is colon if( colL == null && colU == null ) flag2 = true; if( flag1 && !flag2 ) dpf = PDataPartitionFormat.COLUMN_WISE; else if( !flag1 && flag2 ) dpf = PDataPartitionFormat.ROW_WISE; else dpf = PDataPartitionFormat.NONE; return dpf; } private void rConsolidateResultVars(ArrayList<StatementBlock> asb, ArrayList<String> vars) throws LanguageException { for(StatementBlock sb : asb ) // foreach statementblock in parforbody { if( sb instanceof ParForStatementBlock ) { vars.addAll(((ParForStatementBlock)sb).getResultVariables()); } for( Statement s : sb._statements ) // foreach statement in statement block { if( s instanceof ForStatement || s instanceof ParForStatement ) { rConsolidateResultVars(((ForStatement)s).getBody(), vars); } else if( s instanceof WhileStatement ) { rConsolidateResultVars(((WhileStatement)s).getBody(), vars); } else if( s instanceof IfStatement ) { rConsolidateResultVars(((IfStatement)s).getIfBody(), vars); rConsolidateResultVars(((IfStatement)s).getElseBody(), vars); } else if( s instanceof FunctionStatement ) { rConsolidateResultVars(((FunctionStatement)s).getBody(), vars); } } } } /** * This method recursively checks a candidate against StatementBlocks for anti, data and output dependencies. * A LanguageException is raised if at least one dependency is found, where it is guaranteed that no false negatives * (undetected dependency) but potentially false positives (misdetected dependency) can appear. * * * @param c * @param cdt * @param asb * @param sCount * @param dep * @throws LanguageException */ private void rCheckCandidates(Candidate c, DataType cdt, ArrayList<StatementBlock> asb, Integer sCount, boolean[] dep) throws LanguageException { // check candidate only (output dependency if scalar or constant matrix subscript) if( cdt == DataType.SCALAR || cdt == DataType.OBJECT ) //dat2 checked for other candidate { //every write to a scalar or complete data object is an output dependency dep[0] = true; if( ABORT_ON_FIRST_DEPENDENCY ) return; } else if( cdt == DataType.MATRIX ) { if( runConstantCheck(c._dat) ) { if( LDEBUG ) System.out.println("PARFOR: Possible output dependency detected via constant self-check: var '"+c._var+"'."); dep[0] = true; if( ABORT_ON_FIRST_DEPENDENCY ) return; } } // check candidate against all statements for(StatementBlock sb : asb ) for( Statement s : sb._statements ) { sCount++; if( s instanceof ForStatement && !(s instanceof ParForStatement) ) { rCheckCandidates(c, cdt, ((ForStatement)s).getBody(), sCount, dep); } else if( s instanceof WhileStatement ) { rCheckCandidates(c, cdt, ((WhileStatement)s).getBody(), sCount, dep); } else if( s instanceof IfStatement ) { rCheckCandidates(c, cdt, ((IfStatement)s).getIfBody(), sCount, dep); rCheckCandidates(c, cdt, ((IfStatement)s).getElseBody(), sCount, dep); } else if( s instanceof FunctionStatement ) { rCheckCandidates(c, cdt, ((FunctionStatement)s).getBody(), sCount, dep); } else { //CHECK output dependencies Collection<DataIdentifier> datsUpdated = getDataIdentifiers(s, true); if( datsUpdated != null ) for(DataIdentifier write : datsUpdated) { String writeStr = write.getName(); if( c._var.equals( writeStr ) ) { DataIdentifier dat2 = write; if( cdt == DataType.MATRIX ) { if( c._dat != dat2 ) //omit self-check { if( runEqualsCheck(c._dat, dat2) ) { //intra-iteration output dependencies (same index function) are OK } else if(runBanerjeeGCDTest( c._dat, dat2 )) { if( LDEBUG ) System.out.println("PARFOR: Possible output dependency detected via GCD/Banerjee: var '"+write+"'."); dep[0] = true; if( ABORT_ON_FIRST_DEPENDENCY ) return; } } } else // at least one type UNKNOWN { //cannot infer type, need to exit (conservative approach) throw new LanguageException("PARFOR loop dependency analysis: cannot check for dependencies " + "due to unknown datatype of var '"+c._var+"'."); } } } Collection<DataIdentifier> datsRead = getDataIdentifiers(s, false); //check data and anti dependencies if( datsRead != null ) for(DataIdentifier read : datsRead) { String readStr = read.getName(); if( c._var.equals( readStr ) ) { DataIdentifier dat2 = read; DataType dat2dt = _vsParent.getVariables().get(readStr).getDataType(); //vs.getVariables().get(read).getDataType(); if( cdt == DataType.SCALAR || cdt == DataType.OBJECT || dat2dt == DataType.SCALAR || dat2dt == DataType.OBJECT ) { //every write, read combination involving a scalar is a data dependency dep[1] = true; if( ABORT_ON_FIRST_DEPENDENCY ) return; //if(!output) //no write before read in iteration body //data = true; } else if( cdt == DataType.MATRIX && dat2dt == DataType.MATRIX ) { if( /*c._pos < sCount &&*/ runEqualsCheck(c._dat, dat2) ) { //read after write on same index, and not constant (checked for output) //is OK } else if( runBanerjeeGCDTest( c._dat, dat2 ) ) { if( LDEBUG ) System.out.println("PARFOR: Possible data/anti dependency detected via GCD/Banerjee: var '"+read+"'."); dep[1] = true; dep[2] = true; if( ABORT_ON_FIRST_DEPENDENCY ) return; } } else //if( c._dat.getDataType() == DataType.UNKNOWN ) { //cannot infer type, need to exit (conservative approach) throw new LanguageException("PARFOR loop dependency analysis: cannot check for dependencies " + "due to unknown datatype of var '"+c._var+"'."); } } } } } } /** * Get all target/source DataIdentifiers of the given statement. * * @param s * @param target * @return */ private Collection<DataIdentifier> getDataIdentifiers(Statement s, boolean target) { Collection<DataIdentifier> ret = null; if( s instanceof AssignmentStatement ) { AssignmentStatement s2 = (AssignmentStatement)s; if(target) ret = s2.getTargetList(); else ret = rGetDataIdentifiers(s2.getSource()); } else if (s instanceof FunctionStatement) { FunctionStatement s2 = (FunctionStatement)s; if(target) ret = s2.getOutputParams(); else ret = s2.getInputParams(); } else if (s instanceof MultiAssignmentStatement) { MultiAssignmentStatement s2 = (MultiAssignmentStatement)s; if(target) ret = s2.getTargetList(); else ret = rGetDataIdentifiers(s2.getSource()); } //potentially extend this list with other Statements if required //(e.g., IOStatement, PrintStatement, RandStatement) return ret; } private boolean isRowIgnorable(IndexedIdentifier dat1, IndexedIdentifier dat2) { for( IndexedIdentifier dat : new IndexedIdentifier[]{dat1,dat2} ) { if( dat1.getRowLowerBound()!=null ) for( DataIdentifier datsub : rGetDataIdentifiers(dat.getRowLowerBound()) ) if( _bounds._lower.containsKey(datsub.getName()) && !datsub.getName().startsWith(INTERAL_FN_INDEX_ROW) ) return false; if( dat1.getRowUpperBound()!=null ) for( DataIdentifier datsub : rGetDataIdentifiers(dat.getRowUpperBound()) ) if( _bounds._lower.containsKey(datsub.getName()) && !datsub.getName().startsWith(INTERAL_FN_INDEX_ROW) ) return false; } return true; } private boolean isColumnIgnorable(IndexedIdentifier dat1, IndexedIdentifier dat2) { for( IndexedIdentifier dat : new IndexedIdentifier[]{dat1,dat2} ) { if( dat1.getColLowerBound()!=null ) for( DataIdentifier datsub : rGetDataIdentifiers(dat.getColLowerBound()) ) if( _bounds._lower.containsKey(datsub.getName()) && !datsub.getName().startsWith(INTERAL_FN_INDEX_COL) ) return false; if( dat1.getColUpperBound()!=null ) for( DataIdentifier datsub : rGetDataIdentifiers(dat.getColUpperBound()) ) if( _bounds._lower.containsKey(datsub.getName()) && !datsub.getName().startsWith(INTERAL_FN_INDEX_COL) ) return false; } return true; } private Collection<DataIdentifier> rGetDataIdentifiers(Expression e) { Collection<DataIdentifier> ret = new ArrayList<DataIdentifier>(); if( e instanceof DataIdentifier && !(e instanceof FunctionCallIdentifier || e instanceof BuiltinFunctionExpression || e instanceof ParameterizedBuiltinFunctionExpression) ) { ret.add( (DataIdentifier)e ); } else if( e instanceof FunctionCallIdentifier ) { FunctionCallIdentifier fci = (FunctionCallIdentifier)e; for( Expression ee : fci.getParamExpressions() ) ret.addAll(rGetDataIdentifiers( ee )); } else if(e instanceof BinaryExpression) { BinaryExpression be = (BinaryExpression) e; ret.addAll( rGetDataIdentifiers(be.getLeft()) ); ret.addAll( rGetDataIdentifiers(be.getRight()) ); } else if(e instanceof BooleanExpression) { BooleanExpression be = (BooleanExpression) e; ret.addAll( rGetDataIdentifiers(be.getLeft()) ); ret.addAll( rGetDataIdentifiers(be.getRight()) ); } else if(e instanceof BuiltinFunctionExpression) { BuiltinFunctionExpression be = (BuiltinFunctionExpression) e; ret.addAll( rGetDataIdentifiers(be.getFirstExpr()) ); ret.addAll( rGetDataIdentifiers(be.getSecondExpr()) ); ret.addAll( rGetDataIdentifiers(be.getThirdExpr()) ); } else if(e instanceof ParameterizedBuiltinFunctionExpression) { ParameterizedBuiltinFunctionExpression be = (ParameterizedBuiltinFunctionExpression) e; for( Expression ee : be.getVarParams().values() ) ret.addAll( rGetDataIdentifiers(ee) ); } else if(e instanceof RelationalExpression) { RelationalExpression re = (RelationalExpression) e; ret.addAll( rGetDataIdentifiers(re.getLeft()) ); ret.addAll( rGetDataIdentifiers(re.getRight()) ); } return ret; } /** * Determines the lower/upper bounds of all nested for/parfor indexes. * * @param sbs * @param flag indicates that method is already in subtree of THIS. * @return * @throws LanguageException */ private void rDetermineBounds( ArrayList<StatementBlock> sbs, boolean flag ) throws LanguageException { // catch all known for/ parfor bounds // (all unknown bounds are assumed to be +-infinity) for( StatementBlock sb : sbs ) for( Statement s : sb._statements ) { boolean lFlag = flag; if( s instanceof ParForStatement || (s instanceof ForStatement && CONSERVATIVE_CHECK) ) //incl. for if conservative { ForStatement fs = (ForStatement)s; IterablePredicate ip = fs._predicate; //checks for position in overall tree if( sb==this ) lFlag = true; if( lFlag || rIsParent(sb,this) ) //add only if in subtree of this { //check for internal names if( ip.getIterVar()._name.equals( INTERAL_FN_INDEX_ROW ) || ip.getIterVar()._name.equals( INTERAL_FN_INDEX_COL )) { throw new LanguageException(" The iteration variable must not use the " + "internal iteration variable name prefix '"+ip.getIterVar()._name+"'."); } long low = Integer.MIN_VALUE; long up = Integer.MAX_VALUE; long incr = -1; if( ip.getFromExpr()instanceof IntIdentifier) low = ((IntIdentifier)ip.getFromExpr()).getValue(); if( ip.getToExpr()instanceof IntIdentifier) up = ((IntIdentifier)ip.getToExpr()).getValue(); //NOTE: conservative approach: include all index variables (also from for) if( ip.getIncrementExpr() instanceof IntIdentifier ) incr = ((IntIdentifier)ip.getIncrementExpr()).getValue(); else throw new LanguageException("PARFOR loop dependency analysis: cannot check for dependencies " + "because increment expression '"+ip.getIncrementExpr().toString()+"' cannot be normalized."); _bounds._lower.put(ip.getIterVar()._name, low); _bounds._upper.put(ip.getIterVar()._name, up); _bounds._increment.put(ip.getIterVar()._name, incr); } //recursive invocation (but not for nested parfors due to constant check) if( !lFlag ) { ArrayList<StatementBlock> tmp = fs.getBody(); if( tmp != null ) rDetermineBounds(tmp, lFlag); } } else if( s instanceof ForStatement ) { //recursive invocation ArrayList<StatementBlock> tmp = ((ForStatement) s).getBody(); if( tmp != null ) rDetermineBounds(tmp, lFlag); } else if( s instanceof WhileStatement ) { //recursive invocation ArrayList<StatementBlock> tmp = ((WhileStatement) s).getBody(); if( tmp != null ) rDetermineBounds(tmp, lFlag); } else if( s instanceof IfStatement ) { //recursive invocation ArrayList<StatementBlock> tmp = ((IfStatement) s).getIfBody(); if( tmp != null ) rDetermineBounds(tmp, lFlag); ArrayList<StatementBlock> tmp2 = ((IfStatement) s).getElseBody(); if( tmp2 != null ) rDetermineBounds(tmp2, lFlag); } } } /** * * @param cParent * @param cChild * @return */ private boolean rIsParent( ArrayList<StatementBlock> cParent, StatementBlock cChild) { for( StatementBlock sb : cParent ) if( rIsParent(sb, cChild) ) return true; return false; } /** * * @param cParent * @param cChild * @return */ private boolean rIsParent( StatementBlock cParent, StatementBlock cChild) { boolean ret = false; if( cParent == cChild ) { ret = true; } else { for( Statement s : cParent.getStatements() ) { //check all the complex control flow constructs if( s instanceof ForStatement ) //for, parfor { ret = rIsParent( ((ForStatement) s).getBody(), cChild ); } else if( s instanceof WhileStatement ) { ret = rIsParent( ((WhileStatement) s).getBody(), cChild ); } else if( s instanceof IfStatement ) { ret = rIsParent( ((IfStatement) s).getIfBody(), cChild ); ret |= rIsParent( ((IfStatement) s).getElseBody(), cChild ); } //early return if already found if( ret ) break; } } return ret; } /** * Runs a combination of GCD and Banerjee test for a two potentially conflicting * data identifiers. See below for a detailed explanation. * * NOTE: simply enumerating all combinations of iteration variable values and probing for * duplicates is not applicable due to (1) arbitrary nested program blocks with potentially * dynamic lower, upper, and increment expressions, and (2) therefore potentially large * overheads in the general case. * * @param dat1 * @param dat2 * @return * @throws LanguageException */ private boolean runBanerjeeGCDTest(DataIdentifier dat1, DataIdentifier dat2) throws LanguageException { /* The GCD (greatest common denominator) and the Banerjee test are two commonly used tests * for determining loop-carried dependencies. Both rely on (1) linear index expressions of the * form y = a + bx, where x is the loop index variable, and (2) conservative approaches that * guarantee no false negatives (no missed dependencies) but possibly false positives. The GCD * test probes for integer solutions without bounds, while the Banerjee test probes for real * solutions with bounds. * * We use a combination of both: * - the GCD test checks if dependencies are possible * - the Banerjee test checks if those dependencies may arise within the given bounds * * NOTES: * - #1 possible false positives may arise if there is a real solution within the bounds * and an integer solution outside the bounds. This will lead to a detected dependencies * although no integer solution within the bounds exists. * - #2 for the sake of simplicity, we do not distinguish between anti and data dependencies, * although possible in general * - more advanced tests than GCD and Banerjee available (e.g., with symbolic checking for * non-linear functions) but this is a tradeoff between number of false positives and overhead */ if( LDEBUG ) System.out.println("PARFOR: runBanerjeeGCDCheck."); boolean ret = true; //anti or data dependency //Step 1: analyze index expressions and transform them into linear functions LinearFunction f1 = getLinearFunction(dat1); LinearFunction f2 = getLinearFunction(dat2); forceConsistency(f1,f2); if( LDEBUG ) { System.out.println("PARFOR: f1: "+f1.toString()); System.out.println("PARFOR: f2: "+f2.toString()); } //Step 2: run GCD Test long lgcd = f1._b[0]; for( int i=1; i<f1._b.length; i++ ) lgcd = determineGCD( lgcd, f1._b[i] ); for( int i=0; i<f2._b.length; i++ ) lgcd = determineGCD( lgcd, f2._b[i] ); if( (Math.abs(f1._a-f2._a) % lgcd) != 0 ) //if GCD divides the intercepts { //no integer solution exists -> no dependency ret = false; } if( LDEBUG ) System.out.println("PARFOR: GCD result: "+ret); if( !CONSERVATIVE_CHECK && ret ) //only if not already no dependency { //NOTE: cases both and none negligible already covered (constant check, general case) boolean ignoreRow = isRowIgnorable((IndexedIdentifier)dat1, (IndexedIdentifier)dat2); boolean ignoreCol = isColumnIgnorable((IndexedIdentifier)dat1, (IndexedIdentifier)dat2); LinearFunction f1p = null, f2p = null; if( ignoreRow ) { f1p = getColLinearFunction(dat1); f2p = getColLinearFunction(dat2); } if( ignoreCol ) { f1p = getRowLinearFunction(dat1); f2p = getRowLinearFunction(dat2); } if( LDEBUG ) { System.out.println("PARFOR: f1p: "+f1p.toString()); System.out.println("PARFOR: f2p: "+f2p.toString()); } if( f1p!=null && f2p!=null ) { forceConsistency(f1p, f2p); long lgcd2 = f1p._b[0]; for( int i=1; i<f1p._b.length; i++ ) lgcd2 = determineGCD( lgcd2, f1p._b[i] ); for( int i=0; i<f2p._b.length; i++ ) lgcd2 = determineGCD( lgcd2, f2p._b[i] ); if( (Math.abs(f1p._a-f2p._a) % lgcd2) != 0 ) //if GCD divides the intercepts { //no integer solution exists -> no dependency ret = false; } if( LDEBUG ) System.out.println("PARFOR: GCD result: "+ret); } } //Step 3: run Banerjee Test if( ret ) //only if GCD found possible dependencies { long lintercept = f2._a - f1._a; //determining anti/data dependencies long lmax=0; long lmin=0; //min/max bound int len = Math.max(f1._b.length, f2._b.length); for( int i=0; i<len; i++ ) { String var=(f1._b.length>i) ? f1._vars[i] : f2._vars[i]; //get lower and upper bound for specific var or internal var long lower = _bounds._lower.get(var); //bounds equal for f1 and f2 long upper = _bounds._upper.get(var); //max bound if( f1._b.length>i ) { if( f1._b[i]>0 ) lmax += f1._b[i]*upper; else lmax += f1._b[i]*lower; } if( f2._b.length>i ) { if( f2._b[i]>0 ) lmax -= f2._b[i]*lower; else lmax -= f2._b[i]*upper; } //min bound (unequal indexes) if( f1._b.length>i ) { if( f1._b[i]>0 ) lmin += f1._b[i]*lower; else lmin += f1._b[i]*upper; } if( f2._b.length>i ) { if( f2._b[i]>0 ) lmin -= f2._b[i]*upper; else lmin -= f2._b[i]*lower; } } if( LDEBUG ) { System.out.println("PARFOR: Banerjee lintercept "+lintercept); System.out.println("PARFOR: Banerjee lmax "+lmax); System.out.println("PARFOR: Banerjee lmin "+lmin); } if( !(lmin <= lintercept && lintercept <= lmax) || lmin==lmax ) { //dependency not within the bounds of the arrays ret = false; } if( LDEBUG ) System.out.println("PARFOR: Banerjee result: "+ret); } return ret; } /** * Runs a constant check for a single data identifier (target of assignment). If constant, then every * iteration writes to the same cell. * * @param dat1 * @return * @throws LanguageException */ private boolean runConstantCheck(DataIdentifier dat1) throws LanguageException { if( LDEBUG ) System.out.println("PARFOR: runConstantCheck."); boolean ret = true; //data dependency to itself LinearFunction f1 = getLinearFunction(dat1); if( LDEBUG ) System.out.println("PARFOR: f1: "+f1.toString()); // no output dependency to itself if no index access will happen twice // hence we check for: (all surrounding indexes are used by f1 and all intercepts != 0 ) boolean gcheck=true; for( String var : _bounds._lower.keySet() ) { if( var.startsWith(INTERAL_FN_INDEX_ROW) || var.startsWith(INTERAL_FN_INDEX_COL)) { continue; //skip internal vars for range indexing } boolean lcheck=false; for( int i=0; i<f1._vars.length; i++ ) if( var.equals(f1._vars[i]) ) if( f1._b[i] != 0 ) lcheck = true; if( !lcheck ) { gcheck=false; break; } } if( gcheck ) // output dependencies impossible ret = false; return ret; } /** * Runs an equality check for two data identifiers. If equal, there there are no * inter-iteration (loop-carried) but only intra-iteration dependencies. * * @param dat1 * @param dat2 * @return * @throws LanguageException */ private boolean runEqualsCheck(DataIdentifier dat1, DataIdentifier dat2) throws LanguageException { if( LDEBUG ) System.out.println("PARFOR: runEqualsCheck."); //general case function comparison boolean ret = true; //true if equal index functions LinearFunction f1 = getLinearFunction(dat1); LinearFunction f2 = getLinearFunction(dat2); forceConsistency(f1, f2); ret = f1.equals(f2); if( LDEBUG ) { System.out.println("PARFOR: f1: "+f1.toString()); System.out.println("PARFOR: f2: "+f2.toString()); System.out.println("PARFOR: (f1==f2) = "+ret); } //additional check if cols/rows could be ignored if( !CONSERVATIVE_CHECK && !ret ) //only if not already equal { //NOTE: cases both and none negligible already covered (constant check, general case) boolean ignoreRow = isRowIgnorable((IndexedIdentifier)dat1, (IndexedIdentifier)dat2); boolean ignoreCol = isColumnIgnorable((IndexedIdentifier)dat1, (IndexedIdentifier)dat2); LinearFunction f1p = null, f2p = null; if( ignoreRow ) { f1p = getColLinearFunction(dat1); f2p = getColLinearFunction(dat2); } if( ignoreCol ) { f1p = getRowLinearFunction(dat1); f2p = getRowLinearFunction(dat2); } if( f1p!=null && f2p!=null ) { forceConsistency(f1p, f2p); ret = f1p.equals(f2p); if( LDEBUG ) { System.out.println("PARFOR: f1p: "+f1p.toString()); System.out.println("PARFOR: f2p: "+f2p.toString()); System.out.println("PARFOR: (f1p==f2p) = "+ret); } } } return ret; } /** * This is the Euclid's algorithm for GCD (greatest common denominator), * required for the GCD test. * * @param a * @param b * @return */ private long determineGCD(long a, long b) { if (b==0) return a; else return determineGCD(b, a % b); } /** * Creates or reuses a linear function for a given data identifier, where identifiers with equal * names and matrix subscripts result in exactly the same linear function. * * @param dat * @return * @throws LanguageException */ private LinearFunction getLinearFunction(DataIdentifier dat) throws LanguageException { /* Notes: * - Currently, this function supports 2dim matrix subscripts with arbitrary linear functions * however, this could be extended to d-dim if necessary * - Trick for range indexing: introduce a pseudo index variable with lower and upper according to * the index range (e.g., [1:4,...]) or matrix dimensionality (e.g., [:,...]). This allows us to * apply existing tests even for range indexing (multi-value instead of single-value functions) */ LinearFunction out = null; if( ! (dat instanceof IndexedIdentifier ) ) //happens if matrix is now used as scalar return new LinearFunction(0,0,dat.getName()); IndexedIdentifier idat = (IndexedIdentifier) dat; if( USE_FN_CACHE ) { out = _fncache.get( getFunctionID(idat) ); if( out != null ) return out; } Expression sub1 = idat.getRowLowerBound(); Expression sub2 = idat.getColLowerBound(); //parse row expressions try { //loop index or constant (default case) if( idat.getRowLowerBound()!=null && idat.getRowUpperBound()!=null && idat.getRowLowerBound() == idat.getRowUpperBound() ) { if( sub1 instanceof IntIdentifier ) out = new LinearFunction((int)((IntIdentifier)sub1).getValue(), 0, null); else if( sub1 instanceof DataIdentifier ) out = new LinearFunction(0, 1, ((DataIdentifier)sub1)._name); else out = rParseBinaryExpression((BinaryExpression)sub1); if( !CONSERVATIVE_CHECK ) if(out.hasNonIndexVariables()) { String id = INTERAL_FN_INDEX_ROW+_idSeqfn.getNextID(); out = new LinearFunction(0, 1l, id); _bounds._lower.put(id, 1l); _bounds._upper.put(id, _vsParent.getVariable(idat._name).getDim1()); //row dim _bounds._increment.put(id, 1l); } } else //range indexing { Expression sub1a = sub1; Expression sub1b = idat.getRowUpperBound(); String id = INTERAL_FN_INDEX_ROW+_idSeqfn.getNextID(); out = new LinearFunction(0, 1l, id); if( sub1a == null && sub1b == null //: operator || !(sub1a instanceof IntIdentifier) || !(sub1b instanceof IntIdentifier) ) //for robustness { _bounds._lower.put(id, 1l); _bounds._upper.put(id, _vsParent.getVariable(idat._name).getDim1()); //row dim _bounds._increment.put(id, 1l); } else if( sub1a instanceof IntIdentifier && sub1b instanceof IntIdentifier ) { _bounds._lower.put(id, ((IntIdentifier)sub1a).getValue()); _bounds._upper.put(id, ((IntIdentifier)sub1b).getValue()); _bounds._increment.put(id, 1l); } else { out = null; } } //scale row function 'out' with col dimensionality long colDim = _vsParent.getVariable(idat._name).getDim2(); if( colDim > 0 ) { out.scale( colDim ); } else { //NOTE: we could mark sb for deferred validation and evaluate on execute (see ParForProgramBlock) System.out.println("PARFOR: WARNING - matrix dimensionality unknown, cannot scale linear functions."); } } catch(Exception ex) { if(LDEBUG) { System.out.println("PARFOR: Unable to parse MATRIX subscript expression for '"+String.valueOf(sub1)+"'."); //ex.printStackTrace(); } out = null; //let dependency analysis fail } //parse col expression and merge functions if( out!=null ) { try { LinearFunction tmpOut = null; //loop index or constant (default case) if( idat.getColLowerBound()!=null && idat.getColUpperBound()!=null && idat.getColLowerBound() == idat.getColUpperBound() ) { if( sub2 instanceof IntIdentifier ) out.addConstant( ((IntIdentifier)sub2).getValue() ); else if( sub2 instanceof DataIdentifier ) tmpOut = new LinearFunction(0, 1, ((DataIdentifier)sub2)._name) ; else tmpOut = rParseBinaryExpression((BinaryExpression)sub2); if( !CONSERVATIVE_CHECK ) if(tmpOut!=null && tmpOut.hasNonIndexVariables()) { String id = INTERAL_FN_INDEX_COL+_idSeqfn.getNextID(); tmpOut = new LinearFunction(0, 1l, id); _bounds._lower.put(id, 1l); _bounds._upper.put(id, _vsParent.getVariable(idat._name).getDim2()); //col dim _bounds._increment.put(id, 1l); } } else //range indexing { Expression sub2a = sub2; Expression sub2b = idat.getColUpperBound(); String id = INTERAL_FN_INDEX_COL+_idSeqfn.getNextID(); tmpOut = new LinearFunction(0, 1l, id); if( sub2a == null && sub2b == null //: operator || !(sub2a instanceof IntIdentifier) || !(sub2b instanceof IntIdentifier) ) //for robustness { _bounds._lower.put(id, 1l); _bounds._upper.put(id, _vsParent.getVariable(idat._name).getDim2()); //col dim _bounds._increment.put(id, 1l); } else if( sub2a instanceof IntIdentifier && sub2b instanceof IntIdentifier ) { _bounds._lower.put(id, ((IntIdentifier)sub2a).getValue()); _bounds._upper.put(id, ((IntIdentifier)sub2b).getValue()); _bounds._increment.put(id, 1l); } else { out = null; } } //final merge of row and col functions if( tmpOut != null ) out.addFunction(tmpOut); } catch(Exception ex) { if(LDEBUG) { System.out.println("PARFOR: Unable to parse MATRIX subscript expression for '"+String.valueOf(sub2)+"'."); //ex.printStackTrace(); } out = null; //let dependency analysis fail } } //post processing after creation if( out != null ) { //cleanup and verify created function; raise exceptions if needed cleanupFunction(out); verifyFunction(out); // pseudo loop normalization of functions (incr=1, from=1 not necessary due to Banerjee) // (precondition for GCD test) if( NORMALIZE ) { int index=0; for( String var : out._vars ) { long low = _bounds._lower.get(var); long up = _bounds._upper.get(var); long incr = _bounds._increment.get(var); if( incr < 0 || 1 < incr ) //does never apply to internal (artificial) vars { out.normalize(index,low,incr); // normalize linear functions _bounds._upper.put(var,(long)Math.ceil(((double)up)/incr)); // normalize upper bound } index++; } } //put into cache if( USE_FN_CACHE ) { _fncache.put( getFunctionID(idat), out ); } } return out; } private LinearFunction getRowLinearFunction(DataIdentifier dat) throws LanguageException { //NOTE: would require separate function cache, not realized due to inexpensive operations LinearFunction out = null; IndexedIdentifier idat = (IndexedIdentifier) dat; Expression sub1 = idat.getRowLowerBound(); try { //loop index or constant (default case) if( idat.getRowLowerBound()!=null && idat.getRowUpperBound()!=null && idat.getRowLowerBound() == idat.getRowUpperBound() ) { if( sub1 instanceof IntIdentifier ) out = new LinearFunction((int)((IntIdentifier)sub1).getValue(), 0, null); else if( sub1 instanceof DataIdentifier ) out = new LinearFunction(0, 1, ((DataIdentifier)sub1)._name); //never use public members else out = rParseBinaryExpression((BinaryExpression)sub1); } } catch(Exception ex) { if(LDEBUG) { System.out.println("PARFOR: Unable to parse MATRIX subscript expression for '"+String.valueOf(sub1)+"'."); } out = null; //let dependency analysis fail } //post processing after creation if( out != null ) { //cleanup and verify created function; raise exceptions if needed cleanupFunction(out); verifyFunction(out); } return out; } private LinearFunction getColLinearFunction(DataIdentifier dat) throws LanguageException { //NOTE: would require separate function cache, not realized due to inexpensive operations LinearFunction out = null; IndexedIdentifier idat = (IndexedIdentifier) dat; Expression sub1 = idat.getColLowerBound(); try { //loop index or constant (default case) if( idat.getColLowerBound()!=null && idat.getColUpperBound()!=null && idat.getColLowerBound() == idat.getColUpperBound() ) { if( sub1 instanceof IntIdentifier ) out = new LinearFunction((int)((IntIdentifier)sub1).getValue(), 0, null); else if( sub1 instanceof DataIdentifier ) out = new LinearFunction(0, 1, ((DataIdentifier)sub1)._name); //never use public members else out = rParseBinaryExpression((BinaryExpression)sub1); } } catch(Exception ex) { if(LDEBUG) { System.out.println("PARFOR: Unable to parse MATRIX subscript expression for '"+String.valueOf(sub1)+"'."); } out = null; //let dependency analysis fail } //post processing after creation if( out != null ) { //cleanup and verify created function; raise exceptions if needed cleanupFunction(out); verifyFunction(out); } return out; } /** * Creates a functionID for a given data identifier (mainly used for caching purposes), * where data identifiers with equal name and matrix subscripts results in equal * functionIDs. * * @param dat * @return */ private String getFunctionID( IndexedIdentifier dat ) { /* note: using dat.hashCode can be different for same functions, * hence, we use a custom String ID */ IndexedIdentifier idat = (IndexedIdentifier) dat; Expression ex1a = idat.getRowLowerBound(); Expression ex1b = idat.getRowUpperBound(); Expression ex2a = idat.getColLowerBound(); Expression ex2b = idat.getColUpperBound(); StringBuilder sb = new StringBuilder(); sb.append(String.valueOf(ex1a)); sb.append(','); sb.append(String.valueOf(ex1b)); sb.append(','); sb.append(String.valueOf(ex2a)); sb.append(','); sb.append(String.valueOf(ex2b)); return sb.toString(); } private void cleanupFunction( LinearFunction f1 ) { for( int i=0; i<f1._b.length; i++ ) { if( f1._vars[i]==null ) { f1.removeVar(i); i--; continue; } } } /** * Simply verification check of created linear functions, mainly used for * robustness purposes. * * @param f1 * @throws LanguageException */ private void verifyFunction(LinearFunction f1) throws LanguageException { //check for required form of linear functions if( f1 == null || f1._b.length != f1._vars.length ) { if( LDEBUG ) { if( f1!=null ) System.out.println("PARFOR: f1: "+f1.toString()); } throw new LanguageException("PARFOR loop dependency analysis: " + "MATRIX subscripts are not in linear form (a0 + a1*x)."); } //check all function variables to be index variables for( String var : f1._vars ) { if( !_bounds._lower.containsKey(var) ) { if( LDEBUG ) { System.out.println("PARFOR: not allowed variable in matrix subscript: "+var); } throw new LanguageException("PARFOR loop dependency analysis: " + "MATRIX subscripts use non-index variables."); } } } /** * Tries to obtain consistent linear functions by forcing the same variable ordering for * efficient comparison: f2 is modified in a way that it matches the sequence of variables in f1. * * @param f1 * @param f2 */ private void forceConsistency(LinearFunction f1, LinearFunction f2) { boolean warn = false; for( int i=0; i<f1._b.length; i++ ) { if( f2._b.length<(i+1) ) break; if( !f1._vars[i].equals(f2._vars[i]) &&!(f1._vars[i].startsWith(INTERAL_FN_INDEX_ROW) && f2._vars[i].startsWith(INTERAL_FN_INDEX_ROW)) &&!(f1._vars[i].startsWith(INTERAL_FN_INDEX_COL) && f2._vars[i].startsWith(INTERAL_FN_INDEX_COL))) { boolean exchange = false; //scan for( int j=i+1; j<f2._b.length; j++ ) if( f1._vars[i].equals(f2._vars[j]) ||(f1._vars[i].startsWith(INTERAL_FN_INDEX_ROW) && f2._vars[j].startsWith(INTERAL_FN_INDEX_ROW)) ||(f1._vars[i].startsWith(INTERAL_FN_INDEX_COL) && f2._vars[j].startsWith(INTERAL_FN_INDEX_COL)) ) { //exchange long btmp = f2._b[i]; String vartmp = f2._vars[i]; f2._b[i] = f2._b[j]; f2._vars[i] = f2._vars[j]; f2._b[j] = btmp; f2._vars[j] = vartmp; exchange = true; } if( !exchange ) warn = true; } } if( warn && LDEBUG ) System.out.println( "PARFOR: WARNING - index functions f1 and f2 cannot be made consistent." ); } /** * Recursively creates a linear function for a single BinaryExpression, where PLUS, MINUS, MULT * are allowed as operators. * * @param be * @return * @throws LanguageException */ private LinearFunction rParseBinaryExpression(BinaryExpression be) throws LanguageException { LinearFunction ret = null; Expression l = be.getLeft(); Expression r = be.getRight(); if( be.getOpCode() == BinaryOp.PLUS ) { //parse binary expressions if( l instanceof BinaryExpression) { ret = rParseBinaryExpression((BinaryExpression) l); ret.addConstant(((IntIdentifier) r).getValue()); } else if (r instanceof BinaryExpression) { ret = rParseBinaryExpression((BinaryExpression) r); ret.addConstant(((IntIdentifier) l).getValue()); } else // atomic case { if( l instanceof IntIdentifier ) ret = new LinearFunction(((IntIdentifier) l).getValue(),1,((DataIdentifier)r)._name); else if(r instanceof IntIdentifier) ret = new LinearFunction(((IntIdentifier) r).getValue(),1,((DataIdentifier)l)._name); else return null; //let dependency analysis fail } } else if( be.getOpCode() == BinaryOp.MINUS ) { //parse binary expressions if( l instanceof BinaryExpression) { ret = rParseBinaryExpression((BinaryExpression) l); //change to plus ret.addConstant(((IntIdentifier) r).getValue()*(-1)); } else if (r instanceof BinaryExpression) { ret = rParseBinaryExpression((BinaryExpression) r); //change to plus ret._a*=(-1); for( int i=0; i<ret._b.length; i++ ) ret._b[i]*=(-1); ret.addConstant(((IntIdentifier) l).getValue()); } else // atomic case { //change everything to plus if( l instanceof IntIdentifier ) ret = new LinearFunction(((IntIdentifier) l).getValue(),-1,((DataIdentifier)r)._name); else if(r instanceof IntIdentifier) ret = new LinearFunction(((IntIdentifier) r).getValue()*(-1),1,((DataIdentifier)l)._name); else return null; //let dependency analysis fail } } else if( be.getOpCode() == BinaryOp.MULT ) { //NOTE: no recursion for MULT expressions //atomic case if( l instanceof IntIdentifier ) ret = new LinearFunction(0, (int)((IntIdentifier) l).getValue(),((DataIdentifier)r)._name); else if(r instanceof IntIdentifier) ret = new LinearFunction(0, (int)((IntIdentifier) r).getValue(),((DataIdentifier)l)._name); else return null; //let dependency analysis fail } else return null; //let dependency analysis fail return ret; } /** * Helper class for representing a single candidate. * */ private class Candidate { String _var; // variable name //Integer _pos; // statement position in parfor (can be used for distinguishing anti/data dep) DataIdentifier _dat; // _var data identifier } /** * Helper class for representing all lower, upper bounds of (potentially nested) * loop constructs. * */ private class Bounds { HashMap<String, Long> _lower = new HashMap<String, Long>(); HashMap<String, Long> _upper = new HashMap<String, Long>(); HashMap<String, Long> _increment = new HashMap<String, Long>(); } /** * Helper class for representing linear functions of matrix subscripts. * The allowed form is 'y = a + b1x1 + ... = bnxn', which is required by * the applied GCD and Banerjee tests. * */ private class LinearFunction { long _a; // intercept long[] _b; // slopes String[] _vars; // b variable names LinearFunction( long a, long b, String name ) { _a = a; _b = new long[1]; _b[0] = b; _vars = new String[1]; _vars[0] = name; } public void addConstant(long value) { _a += value; } public void addFunction( LinearFunction f2) { _a = _a + f2._a; long[] tmpb = new long[_b.length+f2._b.length]; System.arraycopy( _b, 0, tmpb, 0, _b.length ); System.arraycopy( f2._b, 0, tmpb, _b.length, f2._b.length ); _b = tmpb; String[] tmpvars = new String[_vars.length+f2._vars.length]; System.arraycopy( _vars, 0, tmpvars, 0, _vars.length ); System.arraycopy( f2._vars, 0, tmpvars, _vars.length, f2._vars.length ); _vars = tmpvars; } public void removeVar( int i ) { long[] tmpb = new long[_b.length-1]; System.arraycopy( _b, 0, tmpb, 0, i ); System.arraycopy( _b, i+1, tmpb, i, _b.length-i-1 ); _b = tmpb; String[] tmpvars = new String[_vars.length-1]; System.arraycopy( _vars, 0, tmpvars, 0, i ); System.arraycopy( _vars, i+1, tmpvars, i, _vars.length-i-1 ); _vars = tmpvars; } public void scale( long scale ) { _a *= scale; //-1 because indexing starts at 1 for( int i=0; i<_b.length; i++ ) if( _b[i] != 0 ) _b[i] *= scale; } public void normalize(int index, long lower, long increment) { _a -= (_b[index] * lower); _b[index] *= increment; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("("); sb.append(_a); sb.append(") + "); sb.append("("); for( int i=0; i<_b.length; i++ ) { if( i>0 ) sb.append("+"); sb.append("("); sb.append(_b[i]); sb.append(" * "); sb.append(_vars[i]); sb.append(")"); } sb.append(")"); return sb.toString(); } @Override public boolean equals( Object o2 ) { boolean ret = true; LinearFunction f2; if( o2 == null) { ret = false; } else { f2 = (LinearFunction)o2; ret &= ( _a == f2._a ); ret &= ( _b.length == f2._b.length ); if( ret ) { for( int i=0; i<_b.length; i++ ) { ret &= (_b[i] == f2._b[i] ); ret &= (_vars[i].equals(f2._vars[i]) ||(_vars[i].startsWith(INTERAL_FN_INDEX_ROW) && f2._vars[i].startsWith(INTERAL_FN_INDEX_ROW)) ||(_vars[i].startsWith(INTERAL_FN_INDEX_COL) && f2._vars[i].startsWith(INTERAL_FN_INDEX_COL)) ) ; } } } return ret; } public boolean hasNonIndexVariables() { boolean ret = false; for( String var : _vars ) if( var!=null && !_bounds._lower.containsKey(var) ) { ret = true; break; } return ret; } } }
package com.dummies.tasks.provider; import android.content.ContentProvider; import android.content.ContentResolver; import android.content.ContentUris; import android.content.ContentValues; import android.content.Context; import android.content.UriMatcher; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.net.Uri; import android.os.Bundle; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.wearable.DataMap; import com.google.android.gms.wearable.PutDataMapRequest; import com.google.android.gms.wearable.PutDataRequest; import com.google.android.gms.wearable.Wearable; /** * A Content Provider that knows how to read and write tasks from our * tasks database. */ public class TaskProvider extends ContentProvider implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient .OnConnectionFailedListener { // Content Provider Uri and Authority public static final String AUTHORITY = "com.dummies" + ".tasks.provider.TaskProvider"; public static final Uri CONTENT_URI = Uri.parse("content: AUTHORITY + "/task"); // Database Columns public static final String COLUMN_TASKID = "_id"; public static final String COLUMN_DATE_TIME = "task_date_time"; public static final String COLUMN_NOTES = "notes"; public static final String COLUMN_TITLE = "title"; // MIME types used for searching words or looking up a single // definition private static final String TASKS_MIME_TYPE = ContentResolver .CURSOR_DIR_BASE_TYPE + "/vnd.com.dummies.tasks.task"; private static final String TASK_MIME_TYPE = ContentResolver .CURSOR_ITEM_BASE_TYPE + "/vnd.com.dummies.tasks.task"; // Database Related Constants private static final int DATABASE_VERSION = 1; private static final String DATABASE_NAME = "data"; private static final String DATABASE_TABLE = "tasks"; // Google Play Constants private static final String PLAY_BASE_URL = "/" + DATABASE_TABLE; // UriMatcher stuff private static final int LIST_TASK = 0; private static final int ITEM_TASK = 1; private static final UriMatcher URI_MATCHER = buildUriMatcher(); // The database SQLiteDatabase db; // The Google Play api client, used for Android Wearable syncing GoogleApiClient googleApiClient; /** * Builds up a UriMatcher for search suggestion and shortcut refresh * queries. */ private static UriMatcher buildUriMatcher() { UriMatcher matcher = new UriMatcher(UriMatcher.NO_MATCH); // to get definitions... matcher.addURI(AUTHORITY, "task", LIST_TASK); matcher.addURI(AUTHORITY, "task/#", ITEM_TASK); return matcher; } /** * This method is called when our ContentProvider is created */ @Override public boolean onCreate() { // Grab a connection to our database db = new DatabaseHelper(getContext()).getWritableDatabase(); googleApiClient = new GoogleApiClient.Builder(getContext()) .addApi(Wearable.API) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .build(); googleApiClient.connect(); // TODO there is no disconnect return true; } /** * This method is called when someone wants to read something from * our content provider. We'll turn around and ask our database * for the information, and then return it in a Cursor. */ @Override public Cursor query(Uri uri, String[] ignored1, String ignored2, String[] ignored3, String ignored4) { String[] projection = new String[]{ TaskProvider.COLUMN_TASKID, TaskProvider.COLUMN_TITLE, TaskProvider.COLUMN_NOTES, TaskProvider.COLUMN_DATE_TIME}; // Use the UriMatcher to see what kind of query we have and // format the db query accordingly Cursor c; switch (URI_MATCHER.match(uri)) { // We were asked to return a list of tasks case LIST_TASK: c = db.query(TaskProvider.DATABASE_TABLE, projection, null, null, null, null, null); break; // We were asked to return a specific task case ITEM_TASK: c = db.query(TaskProvider.DATABASE_TABLE, projection, TaskProvider.COLUMN_TASKID + "=?", new String[]{Long.toString(ContentUris.parseId (uri))}, null, null, null, null); if (c.getCount() > 0) { c.moveToFirst(); } break; default: throw new IllegalArgumentException("Unknown Uri: " + uri); } // Set the notification URI for this cursor. Our Loader will // use this URI to watch for any changes to our data, // and if the data changes the Loader will automatically refresh. c.setNotificationUri(getContext().getContentResolver(), uri); return c; } /** * This method is called when someone wants to insert something * into our content provider. */ @Override public Uri insert(Uri uri, ContentValues values) { // you can't insert and specify a row id, so remove it if present values.remove(TaskProvider.COLUMN_TASKID); long id = db.insertOrThrow(TaskProvider.DATABASE_TABLE, null, values); getContext().getContentResolver().notifyChange(uri, null); // Save to google Play for wearable support PutDataMapRequest dataMap = PutDataMapRequest.create( PLAY_BASE_URL + "/" + id); DataMap map = dataMap.getDataMap(); map.putLong(COLUMN_TASKID, values.getAsLong(COLUMN_TASKID)); map.putString(COLUMN_TITLE, values.getAsString(COLUMN_TITLE)); map.putLong(COLUMN_DATE_TIME, values.getAsLong(COLUMN_DATE_TIME)); map.putString(COLUMN_NOTES, values.getAsString(COLUMN_NOTES)); PutDataRequest request = dataMap.asPutDataRequest(); Wearable.DataApi.putDataItem(googleApiClient, request); return ContentUris.withAppendedId(uri, id); } /** * This method is called when someone wants to delete something * from our content provider. */ @Override public int delete(Uri uri, String ignored1, String[] ignored2) { // TODO delete from google play int count = db.delete(TaskProvider.DATABASE_TABLE, TaskProvider.COLUMN_TASKID + "=?", new String[]{Long.toString(ContentUris.parseId(uri))}); if (count > 0) getContext().getContentResolver().notifyChange(uri, null); return count; } /** * This method is called when someone wants to update something * in our content provider. */ @Override public int update(Uri uri, ContentValues values, String ignored1, String[] ignored2) { long id = ContentUris.parseId(uri); int count = db.update(TaskProvider.DATABASE_TABLE, values, COLUMN_TASKID + "=?", new String[]{Long.toString(id)}); if (count > 0) getContext().getContentResolver().notifyChange(uri, null); // Update to google Play for wearable support PutDataMapRequest dataMap = PutDataMapRequest.create( PLAY_BASE_URL + "/" + id); DataMap map = dataMap.getDataMap(); map.putLong(COLUMN_TASKID, values.getAsLong(COLUMN_TASKID)); map.putString(COLUMN_TITLE, values.getAsString(COLUMN_TITLE)); map.putLong(COLUMN_DATE_TIME, values.getAsLong(COLUMN_DATE_TIME)); map.putString(COLUMN_NOTES, values.getAsString(COLUMN_NOTES)); PutDataRequest request = dataMap.asPutDataRequest(); Wearable.DataApi.putDataItem(googleApiClient, request); return count; } /** * This method is required in order to query the supported types. * It's also useful in our own query() method to determine the type * of Uri received. */ @Override public String getType(Uri uri) { switch (URI_MATCHER.match(uri)) { case LIST_TASK: return TASKS_MIME_TYPE; case ITEM_TASK: return TASK_MIME_TYPE; default: throw new IllegalArgumentException("Unknown Uri: " + uri); } } @Override public void onConnected(Bundle bundle) { // TODO } @Override public void onConnectionSuspended(int i) { // TODO } @Override public void onConnectionFailed(ConnectionResult connectionResult) { // TODO } /** * A helper class which knows how to create and update our database. */ protected static class DatabaseHelper extends SQLiteOpenHelper { static final String DATABASE_CREATE = "create table " + DATABASE_TABLE + " (" + COLUMN_TASKID + " integer primary key autoincrement, " + COLUMN_TITLE + " text not null, " + COLUMN_NOTES + " text not null, " + COLUMN_DATE_TIME + " integer not null);"; DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } /** * This method is called when the app is first installed and no * database has yet been created. */ @Override public void onCreate(SQLiteDatabase db) { db.execSQL(DATABASE_CREATE); } /** * This method will be called in the future when we release * version 2.0 of our Tasks app, at which point we'll need to * upgrade our database from version 1.0 to version 2.0. * For now, there's nothing that needs to be done here. */ @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { throw new UnsupportedOperationException(); } } }
package fi.evident.dalesbred; import org.jetbrains.annotations.NotNull; import java.io.Serializable; import java.util.Iterator; import java.util.List; import static fi.evident.dalesbred.utils.Require.requireNonNull; import static java.util.Arrays.asList; import static java.util.Collections.unmodifiableList; /** * Represents an SQL query along all of its arguments. */ public final class SqlQuery implements Serializable { final String sql; final List<?> args; private static final long serialVersionUID = 1; private SqlQuery(@NotNull @SQL String sql, @NotNull List<?> args) { this.sql = requireNonNull(sql); this.args = unmodifiableList(args); } @NotNull public static SqlQuery query(@NotNull @SQL String sql, Object... args) { return new SqlQuery(sql, asList(args)); } @NotNull public static SqlQuery query(@NotNull @SQL String sql, @NotNull List<?> args) { return new SqlQuery(sql, args); } @NotNull public String getSql() { return sql; } @NotNull public List<?> getArguments() { return args; } @NotNull @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(sql); sb.append(" ["); for (Iterator<?> it = args.iterator(); it.hasNext(); ) { sb.append(it.next()); if (it.hasNext()) sb.append(", "); } sb.append(']'); return sb.toString(); } @Override public boolean equals(Object obj) { if (obj == this) return true; if (obj instanceof SqlQuery) { SqlQuery rhs = (SqlQuery) obj; return sql.equals(rhs.sql) && args.equals(rhs.args); } return false; } @Override public int hashCode() { return sql.hashCode() * 31 + args.hashCode(); } }
package com.google.maps.android.data.kml; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.AsyncTask; import android.util.Log; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.model.BitmapDescriptor; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.GroundOverlay; import com.google.android.gms.maps.model.GroundOverlayOptions; import com.google.android.gms.maps.model.Marker; import com.google.maps.android.data.Feature; import com.google.maps.android.data.Renderer; import com.google.maps.android.data.Geometry; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; /** * Renders all visible KmlPlacemark and KmlGroundOverlay objects onto the GoogleMap as Marker, * Polyline, Polygon, GroundOverlay objects. Also removes objects from the map. */ public class KmlRenderer extends Renderer { private static final String LOG_TAG = "KmlRenderer"; private final ArrayList<String> mGroundOverlayUrls; private boolean mMarkerIconsDownloaded; private boolean mGroundOverlayImagesDownloaded; private HashMap<KmlGroundOverlay, GroundOverlay> mGroundOverlays; private ArrayList<KmlContainer> mContainers; /* package */ KmlRenderer(GoogleMap map, Context context) { super(map, context); mGroundOverlayUrls = new ArrayList<>(); mMarkerIconsDownloaded = false; mGroundOverlayImagesDownloaded = false; } /** * Scales a Bitmap to a specified float. * * @param unscaledBitmap Unscaled bitmap image to scale. * @param scale Scale value. A "1.0" scale value corresponds to the original size of the Bitmap * @return A scaled bitmap image */ private static BitmapDescriptor scaleIcon(Bitmap unscaledBitmap, Double scale) { int width = (int) (unscaledBitmap.getWidth() * scale); int height = (int) (unscaledBitmap.getHeight() * scale); Bitmap scaledBitmap = Bitmap.createScaledBitmap(unscaledBitmap, width, height, false); return BitmapDescriptorFactory.fromBitmap(scaledBitmap); } /** * Removes all given KML placemarks from the map and clears all stored placemarks. * * @param placemarks placemarks to remove */ private void removePlacemarks(HashMap<? extends Feature, Object> placemarks) { // Remove map object from the map removeFeatures((HashMap<Feature, Object>) placemarks); } /** * Gets the visibility of the container * * @param kmlContainer container to check visibility of * @param isParentContainerVisible true if the parent container is visible, false otherwise * @return true if this container is visible, false otherwise */ static boolean getContainerVisibility(KmlContainer kmlContainer, boolean isParentContainerVisible) { boolean isChildContainerVisible = true; if (kmlContainer.hasProperty("visibility")) { String placemarkVisibility = kmlContainer.getProperty("visibility"); if (Integer.parseInt(placemarkVisibility) == 0) { isChildContainerVisible = false; } } return (isParentContainerVisible && isChildContainerVisible); } /** * Removes all ground overlays in the given hashmap * * @param groundOverlays hashmap of ground overlays to remove */ private void removeGroundOverlays(HashMap<KmlGroundOverlay, GroundOverlay> groundOverlays) { for (GroundOverlay groundOverlay : groundOverlays.values()) { groundOverlay.remove(); } } /** * Removes all the KML data from the map and clears all the stored placemarks of those which * are in a container. */ private void removeContainers(Iterable<KmlContainer> containers) { for (KmlContainer container : containers) { removePlacemarks(container.getPlacemarksHashMap()); removeGroundOverlays(container.getGroundOverlayHashMap()); removeContainers(container.getContainers()); } } public void addLayerToMap() { setLayerVisibility(true); mGroundOverlays = getGroundOverlayMap(); mContainers = getContainerList(); putStyles(); assignStyleMap(getStyleMaps(), getStylesRenderer()); addGroundOverlays(mGroundOverlays, mContainers); addContainerGroupToMap(mContainers, true); addPlacemarksToMap(getAllFeatures()); if (!mGroundOverlayImagesDownloaded) { downloadGroundOverlays(); } if (!mMarkerIconsDownloaded) { downloadMarkerIcons(); } } /*package*/ void storeKmlData(HashMap<String, KmlStyle> styles, HashMap<String, String> styleMaps, HashMap<KmlPlacemark, Object> features, ArrayList<KmlContainer> folders, HashMap<KmlGroundOverlay, GroundOverlay> groundOverlays) { storeData(styles, styleMaps, features, folders, groundOverlays); } /** * Sets the map that objects are being placed on * * @param map map to place placemark, container, style and ground overlays on */ public void setMap(GoogleMap map) { removeLayerFromMap(); super.setMap(map); addLayerToMap(); } /** * Checks if the layer contains placemarks * * @return true if there are placemarks, false otherwise */ /* package */ boolean hasKmlPlacemarks() { return hasFeatures(); } /** * Gets an iterable of KmlPlacemark objects * * @return iterable of KmlPlacemark objects */ /* package */ Iterable<? extends Feature> getKmlPlacemarks() { return (getFeatures()) ; } /** * Checks if the layer contains any KmlContainers * * @return true if there is at least 1 container within the KmlLayer, false otherwise */ public boolean hasNestedContainers() { return mContainers.size() > 0; } /** * Gets an iterable of KmlContainerInterface objects * * @return iterable of KmlContainerInterface objects */ public Iterable<KmlContainer> getNestedContainers() { return mContainers; } /** * Gets an iterable of KmlGroundOverlay objects * * @return iterable of KmlGroundOverlay objects */ public Iterable<KmlGroundOverlay> getGroundOverlays() { return mGroundOverlays.keySet(); } /** * Removes all the KML data from the map and clears all the stored placemarks */ public void removeLayerFromMap() { removePlacemarks(getAllFeatures()); removeGroundOverlays(mGroundOverlays); if (hasNestedContainers()) { removeContainers(getNestedContainers()); } setLayerVisibility(false); clearStylesRenderer(); } /** * Iterates over the placemarks, gets its style or assigns a default one and adds it to the map * @param placemarks */ private void addPlacemarksToMap(HashMap<? extends Feature, Object> placemarks) { for (Feature kmlPlacemark : placemarks.keySet()) { addFeature(kmlPlacemark); } } /** * Adds placemarks with their corresponding styles onto the map * * @param kmlContainers An arraylist of folders */ private void addContainerGroupToMap(Iterable<KmlContainer> kmlContainers, boolean containerVisibility) { for (KmlContainer container : kmlContainers) { boolean isContainerVisible = getContainerVisibility(container, containerVisibility); if (container.getStyles() != null) { // Stores all found styles from the container putStyles(container.getStyles()); } if (container.getStyleMap() != null) { // Stores all found style maps from the container super.assignStyleMap(container.getStyleMap(), getStylesRenderer()); } addContainerObjectToMap(container, isContainerVisible); if (container.hasContainers()) { addContainerGroupToMap(container.getContainers(), isContainerVisible); } } } /** * Goes through the every placemark, style and properties object within a <Folder> tag * * @param kmlContainer Folder to obtain placemark and styles from */ private void addContainerObjectToMap(KmlContainer kmlContainer, boolean isContainerVisible) { for (Feature placemark : kmlContainer.getPlacemarks()) { boolean isPlacemarkVisible = getPlacemarkVisibility(placemark); boolean isObjectVisible = isContainerVisible && isPlacemarkVisible; if (placemark.getGeometry() != null) { String placemarkId = placemark.getId(); Geometry geometry = placemark.getGeometry(); KmlStyle style = getPlacemarkStyle(placemarkId); KmlStyle inlineStyle = ((KmlPlacemark) placemark).getInlineStyle(); Object mapObject = addKmlPlacemarkToMap((KmlPlacemark) placemark, geometry, style, inlineStyle, isObjectVisible); kmlContainer.setPlacemark((KmlPlacemark) placemark, mapObject); putContainerFeature(mapObject, placemark); } } } /** * Determines if there are any icons to add to markers */ private void downloadMarkerIcons() { mMarkerIconsDownloaded = true; for (Iterator<String> iterator = getMarkerIconUrls().iterator(); iterator.hasNext(); ) { String markerIconUrl = iterator.next(); new MarkerIconImageDownload(markerIconUrl).execute(); iterator.remove(); } } /** * Adds the marker icon stored in mMarkerIconCache, to the {@link com.google.android.gms.maps.model.Marker} * * @param iconUrl icon url of icon to add to markers * @param placemarks */ private void addIconToMarkers(String iconUrl, HashMap<KmlPlacemark, Object> placemarks) { for (Feature placemark : placemarks.keySet()) { KmlStyle urlStyle = getStylesRenderer().get(placemark.getId()); KmlStyle inlineStyle = ((KmlPlacemark) placemark).getInlineStyle(); if ("Point".equals(placemark.getGeometry().getGeometryType())) { boolean isInlineStyleIcon = inlineStyle != null && iconUrl .equals(inlineStyle.getIconUrl()); boolean isPlacemarkStyleIcon = urlStyle != null && iconUrl .equals(urlStyle.getIconUrl()); if (isInlineStyleIcon) { scaleBitmap(inlineStyle, placemarks, (KmlPlacemark) placemark); } else if (isPlacemarkStyleIcon) { scaleBitmap(urlStyle, placemarks, (KmlPlacemark) placemark); } } } } /** * Enlarges or shrinks a bitmap image based on the scale provided * @param style Style to retrieve iconUrl and scale from * @param placemarks * @param placemark Placemark object to set the image to */ private void scaleBitmap(KmlStyle style, HashMap<KmlPlacemark, Object> placemarks, KmlPlacemark placemark) { double bitmapScale = style.getIconScale(); String bitmapUrl = style.getIconUrl(); Bitmap bitmapImage = getImagesCache().get(bitmapUrl); BitmapDescriptor scaledBitmap = scaleIcon(bitmapImage, bitmapScale); ((Marker) placemarks.get(placemark)).setIcon(scaledBitmap); } /** * Assigns icons to markers with a url if put in a placemark tag that is nested in a folder. * * @param iconUrl url to obtain marker image * @param kmlContainers kml container which contains the marker */ private void addContainerGroupIconsToMarkers(String iconUrl, Iterable<KmlContainer> kmlContainers) { for (KmlContainer container : kmlContainers) { addIconToMarkers(iconUrl, container.getPlacemarksHashMap()); if (container.hasContainers()) { addContainerGroupIconsToMarkers(iconUrl, container.getContainers()); } } } /** * Adds a ground overlay adds all the ground overlays onto the map and recursively adds all * ground overlays stored in the given containers * * @param groundOverlays ground overlays to add to the map * @param kmlContainers containers to check for ground overlays */ private void addGroundOverlays(HashMap<KmlGroundOverlay, GroundOverlay> groundOverlays, Iterable<KmlContainer> kmlContainers) { addGroundOverlays(groundOverlays); for (KmlContainer container : kmlContainers) { addGroundOverlays(container.getGroundOverlayHashMap(), container.getContainers()); } } /** * Adds all given ground overlays to the map * * @param groundOverlays hashmap of ground overlays to add to the map */ private void addGroundOverlays(HashMap<KmlGroundOverlay, GroundOverlay> groundOverlays) { for (KmlGroundOverlay groundOverlay : groundOverlays.keySet()) { String groundOverlayUrl = groundOverlay.getImageUrl(); if (groundOverlayUrl != null && groundOverlay.getLatLngBox() != null) { // Can't draw overlay if url and coordinates are missing if (getImagesCache().get(groundOverlayUrl) != null) { addGroundOverlayToMap(groundOverlayUrl, mGroundOverlays, true); } else if (!mGroundOverlayUrls.contains(groundOverlayUrl)) { mGroundOverlayUrls.add(groundOverlayUrl); } } } } /** * Downloads images of all ground overlays */ private void downloadGroundOverlays() { mGroundOverlayImagesDownloaded = true; for (Iterator<String> iterator = mGroundOverlayUrls.iterator(); iterator.hasNext(); ) { String groundOverlayUrl = iterator.next(); new GroundOverlayImageDownload(groundOverlayUrl).execute(); iterator.remove(); } } /** * Adds ground overlays from a given URL onto the map * * @param groundOverlayUrl url of ground overlay * @param groundOverlays hashmap of ground overlays to add to the map */ private void addGroundOverlayToMap(String groundOverlayUrl, HashMap<KmlGroundOverlay, GroundOverlay> groundOverlays, boolean containerVisibility) { BitmapDescriptor groundOverlayBitmap = BitmapDescriptorFactory .fromBitmap(getImagesCache().get(groundOverlayUrl)); for (KmlGroundOverlay kmlGroundOverlay : groundOverlays.keySet()) { if (kmlGroundOverlay.getImageUrl().equals(groundOverlayUrl)) { GroundOverlayOptions groundOverlayOptions = kmlGroundOverlay.getGroundOverlayOptions() .image(groundOverlayBitmap); GroundOverlay mapGroundOverlay = attachGroundOverlay(groundOverlayOptions); if (!containerVisibility) { mapGroundOverlay.setVisible(false); } groundOverlays.put(kmlGroundOverlay, mapGroundOverlay); } } } /** * Adds ground overlays in containers from a given URL onto the map * * @param groundOverlayUrl url of ground overlay * @param kmlContainers containers containing ground overlays to add to the map */ private void addGroundOverlayInContainerGroups(String groundOverlayUrl, Iterable<KmlContainer> kmlContainers, boolean containerVisibility) { for (KmlContainer container : kmlContainers) { boolean isContainerVisible = getContainerVisibility(container, containerVisibility); addGroundOverlayToMap(groundOverlayUrl, container.getGroundOverlayHashMap(), isContainerVisible); if (container.hasContainers()) { addGroundOverlayInContainerGroups(groundOverlayUrl, container.getContainers(), isContainerVisible); } } } /** * Downloads images for use as marker icons */ private class MarkerIconImageDownload extends AsyncTask<String, Void, Bitmap> { private final String mIconUrl; /** * Creates a new IconImageDownload object * * @param iconUrl URL of the marker icon to download */ public MarkerIconImageDownload(String iconUrl) { mIconUrl = iconUrl; } /** * Downloads the marker icon in another thread * * @param params String varargs not used * @return Bitmap object downloaded */ @Override protected Bitmap doInBackground(String... params) { try { return getBitmapFromUrl(mIconUrl); } catch (MalformedURLException e) { return BitmapFactory.decodeFile(mIconUrl); } catch (IOException e) { e.printStackTrace(); } return null; } /** * Adds the bitmap to the cache and adds the bitmap to the markers * * @param bitmap bitmap downloaded */ @Override protected void onPostExecute(Bitmap bitmap) { if (bitmap == null) { Log.e(LOG_TAG, "Image at this URL could not be found " + mIconUrl); } else { putImagesCache(mIconUrl, bitmap); if (isLayerOnMap()) { addIconToMarkers(mIconUrl, (HashMap<KmlPlacemark, Object>) getAllFeatures()); addContainerGroupIconsToMarkers(mIconUrl, mContainers); } } } } /** * Downloads images for use as ground overlays */ private class GroundOverlayImageDownload extends AsyncTask<String, Void, Bitmap> { private final String mGroundOverlayUrl; public GroundOverlayImageDownload(String groundOverlayUrl) { mGroundOverlayUrl = groundOverlayUrl; } /** * Downloads the ground overlay image in another thread * * @param params String varargs not used * @return Bitmap object downloaded */ @Override protected Bitmap doInBackground(String... params) { try { return getBitmapFromUrl(mGroundOverlayUrl); } catch (MalformedURLException e) { return BitmapFactory.decodeFile(mGroundOverlayUrl); } catch (IOException e) { Log.e(LOG_TAG, "Image [" + mGroundOverlayUrl + "] download issue", e); } return null; } /** * Adds the bitmap to the ground overlay and places it on a map * * @param bitmap bitmap downloaded */ @Override protected void onPostExecute(Bitmap bitmap) { if (bitmap == null) { Log.e(LOG_TAG, "Image at this URL could not be found " + mGroundOverlayUrl); } else { putImagesCache(mGroundOverlayUrl, bitmap); if (isLayerOnMap()) { addGroundOverlayToMap(mGroundOverlayUrl, mGroundOverlays, true); addGroundOverlayInContainerGroups(mGroundOverlayUrl, mContainers, true); } } } } /** * @param url internet address of the image. * @return the bitmap of that image, scaled according to screen density. */ private Bitmap getBitmapFromUrl(String url) throws MalformedURLException, IOException { return BitmapFactory.decodeStream(openConnectionCheckRedirects(new URL(url).openConnection())); } /** * opens a stream allowing redirects. */ private InputStream openConnectionCheckRedirects(URLConnection c) throws IOException { boolean redir; int redirects = 0; InputStream in; do { if (c instanceof HttpURLConnection) { ((HttpURLConnection) c).setInstanceFollowRedirects(false); } // We want to open the input stream before getting headers // because getHeaderField() et al swallow IOExceptions. in = c.getInputStream(); redir = false; if (c instanceof HttpURLConnection) { HttpURLConnection http = (HttpURLConnection) c; int stat = http.getResponseCode(); if (stat >= 300 && stat <= 307 && stat != 306 && stat != HttpURLConnection.HTTP_NOT_MODIFIED) { URL base = http.getURL(); String loc = http.getHeaderField("Location"); URL target = null; if (loc != null) { target = new URL(base, loc); } http.disconnect(); // Redirection should be allowed only for HTTP and HTTPS // and should be limited to 5 redirections at most. if (target == null || !(target.getProtocol().equals("http") || target.getProtocol().equals("https")) || redirects >= 5) { throw new SecurityException("illegal URL redirect"); } redir = true; c = target.openConnection(); redirects++; } } } while (redir); return in; } }
package no.agens.cassowarylayout; import org.pybee.cassowary.SimplexSolver; import org.pybee.cassowary.Constraint; import org.pybee.cassowary.Expression; import org.pybee.cassowary.Strength; import org.pybee.cassowary.Variable; public class ChildNode extends Node { private Node containerNode; public ChildNode(SimplexSolver solver, Node containerNode) { super(solver); this.containerNode = containerNode; } @Override protected void createImplicitConstraints(String variableName, Variable variable) { if (RIGHT.equals(variableName)) { solver.addConstraint(new Constraint(variable, Constraint.Operator.EQ, new Expression(getLeft()).plus(getWidth()), Strength.REQUIRED)); solver.addConstraint(new Constraint(variable, Constraint.Operator.LEQ, containerNode.getWidth())); } else if (BOTTOM.equals(variableName)) { solver.addConstraint(new Constraint(variable, Constraint.Operator.EQ, new Expression(getTop()).plus(getHeight()), Strength.REQUIRED)); solver.addConstraint(new Constraint(variable, Constraint.Operator.LEQ, containerNode.getHeight())); } else if (CENTERX.equals(variableName)) { solver.addConstraint(new Constraint(variable, Constraint.Operator.EQ, new Expression(getWidth()).divide(2).plus(getLeft()), Strength.REQUIRED)); } else if (CENTERY.equals(variableName)) { solver.addConstraint(new Constraint(variable, Constraint.Operator.EQ, new Expression(getHeight()).divide(2).plus(getTop()), Strength.REQUIRED)); } } }
package org.luban.common; import org.xerial.snappy.Snappy; import java.io.IOException; public class SnappyHelper { public static byte[] compressHtml(String html) { try { return Snappy.compress(html.getBytes("UTF-8")); } catch (IOException e) { e.printStackTrace(); return null; } } public static String decompressHtml(byte[] bytes) { try { return new String(Snappy.uncompress(bytes)); } catch (IOException e) { e.printStackTrace(); return null; } } }
package org.wildfly.clustering.web.undertow.session; import io.undertow.security.api.AuthenticatedSessionManager.AuthenticatedSession; import io.undertow.server.HttpServerExchange; import io.undertow.server.session.SessionConfig; import io.undertow.server.session.SessionListener.SessionDestroyedReason; import io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler; import java.time.Duration; import java.time.Instant; import java.util.AbstractMap.SimpleImmutableEntry; import java.util.Arrays; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.function.Consumer; import javax.servlet.http.HttpServletRequest; import org.wildfly.clustering.ee.Batch; import org.wildfly.clustering.ee.BatchContext; import org.wildfly.clustering.ee.Batcher; import org.wildfly.clustering.web.session.ImmutableSessionAttributes; import org.wildfly.clustering.web.session.Session; import org.wildfly.clustering.web.session.SessionManager; import org.wildfly.clustering.web.session.oob.OOBSession; import org.wildfly.clustering.web.undertow.logging.UndertowClusteringLogger; /** * Adapts a distributable {@link Session} to an Undertow {@link io.undertow.server.session.Session}. * @author Paul Ferraro */ public class DistributableSession implements io.undertow.server.session.Session { // These mechanisms can auto-reauthenticate and thus use local context (instead of replicating) private static final Set<String> AUTO_REAUTHENTICATING_MECHANISMS = new HashSet<>(Arrays.asList(HttpServletRequest.BASIC_AUTH, HttpServletRequest.DIGEST_AUTH, HttpServletRequest.CLIENT_CERT_AUTH)); static final String WEB_SOCKET_CHANNELS_ATTRIBUTE = "io.undertow.websocket.current-connections"; static final String IDENTITY_CONTAINER_ATTRIBUTE = "org.wildfly.elytron.web.undertow.server.servlet.ServletSecurityContextImpl$IdentityContainer"; private static final Set<String> LOCAL_CONTEXT_ATTRIBUTES = new HashSet<>(Arrays.asList(WEB_SOCKET_CHANNELS_ATTRIBUTE, IDENTITY_CONTAINER_ATTRIBUTE)); private final UndertowSessionManager manager; private final Batch batch; private final Consumer<HttpServerExchange> closeTask; private final Instant startTime; private volatile Map.Entry<Session<Map<String, Object>>, SessionConfig> entry; // The following references are only used to create an OOB session private volatile String id = null; private volatile Map<String, Object> localContext = null; public DistributableSession(UndertowSessionManager manager, Session<Map<String, Object>> session, SessionConfig config, Batch batch, Consumer<HttpServerExchange> closeTask) { this.manager = manager; this.id = session.getId(); this.entry = new SimpleImmutableEntry<>(session, config); this.batch = batch; this.closeTask = closeTask; this.startTime = session.getMetaData().isNew() ? session.getMetaData().getCreationTime() : Instant.now(); } private Map.Entry<Session<Map<String, Object>>, SessionConfig> getSessionEntry() { Map.Entry<Session<Map<String, Object>>, SessionConfig> entry = this.entry; // If entry is null, we are outside of the context of a request if (entry == null) { // Only allow a single thread to lazily create OOB session synchronized (this) { if (this.entry == null) { // N.B. If entry is null, id and localContext will already have been set this.entry = new SimpleImmutableEntry<>(new OOBSession<>(this.manager.getSessionManager(), this.id, this.localContext), new SimpleSessionConfig(this.id)); } entry = this.entry; } } return entry; } @Override public io.undertow.server.session.SessionManager getSessionManager() { return this.manager; } @Override public void requestDone(HttpServerExchange exchange) { try { Session<Map<String, Object>> session = this.getSessionEntry().getKey(); if (session.isValid()) { Batcher<Batch> batcher = this.manager.getSessionManager().getBatcher(); try (BatchContext context = batcher.resumeBatch(this.batch)) { // If batch was discarded, close it if (this.batch.getState() == Batch.State.DISCARDED) { this.batch.close(); } // If batch is closed, close session in a new batch try (Batch batch = (this.batch.getState() == Batch.State.CLOSED) ? batcher.createBatch() : this.batch) { // The session is considered to be accessed when a request that is part of the session is first handled by the servlet container. session.getMetaData().setLastAccess(this.startTime, Instant.now()); session.close(); } finally { // Deference the distributed session, but retain reference to session identifier and local context // If session is accessed after this method, getSessionEntry() will lazily create an OOB session this.id = session.getId(); this.localContext = session.getLocalContext(); this.entry = null; } } catch (Throwable e) { // Don't propagate exceptions at the stage, since response was already committed UndertowClusteringLogger.ROOT_LOGGER.warn(e.getLocalizedMessage(), e); } } else if (this.batch.getState() != Batch.State.CLOSED) { Batcher<Batch> batcher = this.manager.getSessionManager().getBatcher(); try (BatchContext context = batcher.resumeBatch(this.batch)) { // Ensure batch is closed. this.batch.close(); } } } finally { this.closeTask.accept(exchange); } } @Override public String getId() { Session<Map<String, Object>> session = this.getSessionEntry().getKey(); return session.getId(); } @Override public long getCreationTime() { Session<Map<String, Object>> session = this.getSessionEntry().getKey(); this.validate(session); try (BatchContext context = this.resumeBatch()) { return session.getMetaData().getCreationTime().toEpochMilli(); } } @Override public long getLastAccessedTime() { Session<Map<String, Object>> session = this.getSessionEntry().getKey(); this.validate(session); try (BatchContext context = this.resumeBatch()) { return session.getMetaData().getLastAccessStartTime().toEpochMilli(); } } @Override public int getMaxInactiveInterval() { Session<Map<String, Object>> session = this.getSessionEntry().getKey(); this.validate(session); try (BatchContext context = this.resumeBatch()) { return (int) session.getMetaData().getMaxInactiveInterval().getSeconds(); } } @Override public void setMaxInactiveInterval(int interval) { Session<Map<String, Object>> session = this.getSessionEntry().getKey(); this.validate(session); try (BatchContext context = this.resumeBatch()) { session.getMetaData().setMaxInactiveInterval(Duration.ofSeconds(interval)); } } @Override public Set<String> getAttributeNames() { Session<Map<String, Object>> session = this.getSessionEntry().getKey(); this.validate(session); try (BatchContext context = this.resumeBatch()) { return session.getAttributes().getAttributeNames(); } } @Override public Object getAttribute(String name) { Session<Map<String, Object>> session = this.getSessionEntry().getKey(); this.validate(session); try (BatchContext context = this.resumeBatch()) { if (CachedAuthenticatedSessionHandler.ATTRIBUTE_NAME.equals(name)) { AuthenticatedSession auth = (AuthenticatedSession) session.getAttributes().getAttribute(name); return (auth != null) ? auth : session.getLocalContext().get(name); } if (LOCAL_CONTEXT_ATTRIBUTES.contains(name)) { return session.getLocalContext().get(name); } return session.getAttributes().getAttribute(name); } } @Override public Object setAttribute(String name, Object value) { if (value == null) { return this.removeAttribute(name); } Session<Map<String, Object>> session = this.getSessionEntry().getKey(); this.validate(session); try (BatchContext context = this.resumeBatch()) { if (CachedAuthenticatedSessionHandler.ATTRIBUTE_NAME.equals(name)) { AuthenticatedSession auth = (AuthenticatedSession) value; return AUTO_REAUTHENTICATING_MECHANISMS.contains(auth.getMechanism()) ? session.getLocalContext().put(name, auth) : session.getAttributes().setAttribute(name, auth); } if (LOCAL_CONTEXT_ATTRIBUTES.contains(name)) { return session.getLocalContext().put(name, value); } Object old = session.getAttributes().setAttribute(name, value); if (old == null) { this.manager.getSessionListeners().attributeAdded(this, name, value); } else if (old != value) { this.manager.getSessionListeners().attributeUpdated(this, name, value, old); } return old; } } @Override public Object removeAttribute(String name) { Session<Map<String, Object>> session = this.getSessionEntry().getKey(); this.validate(session); try (BatchContext context = this.resumeBatch()) { if (CachedAuthenticatedSessionHandler.ATTRIBUTE_NAME.equals(name)) { AuthenticatedSession auth = (AuthenticatedSession) session.getAttributes().removeAttribute(name); return (auth != null) ? auth : session.getLocalContext().remove(name); } if (LOCAL_CONTEXT_ATTRIBUTES.contains(name)) { return session.getLocalContext().remove(name); } Object old = session.getAttributes().removeAttribute(name); if (old != null) { this.manager.getSessionListeners().attributeRemoved(this, name, old); } return old; } } @Override public void invalidate(HttpServerExchange exchange) { Map.Entry<Session<Map<String, Object>>, SessionConfig> entry = this.getSessionEntry(); Session<Map<String, Object>> session = entry.getKey(); this.validate(exchange, session); // Invoke listeners outside of the context of the batch associated with this session this.manager.getSessionListeners().sessionDestroyed(this, exchange, SessionDestroyedReason.INVALIDATED); try (BatchContext context = this.resumeBatch()) { // Trigger attribute listeners ImmutableSessionAttributes attributes = session.getAttributes(); for (String name : attributes.getAttributeNames()) { Object value = attributes.getAttribute(name); this.manager.getSessionListeners().attributeRemoved(this, name, value); } session.invalidate(); if (exchange != null) { String id = session.getId(); entry.getValue().clearSession(exchange, id); } // An OOB session has no batch if (this.batch != null) { this.batch.close(); } } finally { this.closeTask.accept(exchange); } } @Override public String changeSessionId(HttpServerExchange exchange, SessionConfig config) { Session<Map<String, Object>> oldSession = this.getSessionEntry().getKey(); this.validate(exchange, oldSession); SessionManager<Map<String, Object>, Batch> manager = this.manager.getSessionManager(); String id = manager.createIdentifier(); try (BatchContext context = this.resumeBatch()) { Session<Map<String, Object>> newSession = manager.createSession(id); for (String name: oldSession.getAttributes().getAttributeNames()) { newSession.getAttributes().setAttribute(name, oldSession.getAttributes().getAttribute(name)); } newSession.getMetaData().setMaxInactiveInterval(oldSession.getMetaData().getMaxInactiveInterval()); newSession.getMetaData().setLastAccess(oldSession.getMetaData().getLastAccessStartTime(), oldSession.getMetaData().getLastAccessEndTime()); newSession.getLocalContext().putAll(oldSession.getLocalContext()); config.setSessionId(exchange, id); this.entry = new SimpleImmutableEntry<>(newSession, config); oldSession.invalidate(); } // Invoke listeners outside of the context of the batch associated with this session this.manager.getSessionListeners().sessionIdChanged(this, oldSession.getId()); return id; } private void validate(Session<Map<String, Object>> session) { this.validate(null, session); } private void validate(HttpServerExchange exchange, Session<Map<String, Object>> session) { if (!session.isValid()) { // Workaround for UNDERTOW-1402 // Ensure close task is run before throwing exception this.closeTask.accept(exchange); throw UndertowClusteringLogger.ROOT_LOGGER.sessionIsInvalid(session.getId()); } } private BatchContext resumeBatch() { Batch batch = (this.batch != null) && (this.batch.getState() != Batch.State.CLOSED) ? this.batch : null; return this.manager.getSessionManager().getBatcher().resumeBatch(batch); } }
package com.sdl.dxa.modules.ish; import com.sdl.dxa.tridion.R2SpringConfiguration; import com.sdl.web.api.meta.WebBinaryMetaFactory; import com.sdl.web.api.meta.WebBinaryMetaFactoryImpl; import com.sdl.web.api.meta.WebPublicationMetaFactory; import com.sdl.web.api.meta.WebPublicationMetaFactoryImpl; import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; import org.springframework.web.filter.CharacterEncodingFilter; /** * Spring configuration. */ @Configuration @Import(R2SpringConfiguration.class) public class IshSpringContextConfiguration { @Bean public WebBinaryMetaFactory webBinaryMetaFactory() { return new WebBinaryMetaFactoryImpl(); } @Bean public WebPublicationMetaFactory publicationMetaFactory() { return new WebPublicationMetaFactoryImpl(); } @Bean public static PropertyPlaceholderConfigurer propertySourcesPlaceholderConfigurer() { PropertyPlaceholderConfigurer propertyPlaceholderConfigurer = new PropertyPlaceholderConfigurer(); Resource[] resources = new ClassPathResource[]{new ClassPathResource("ishconfig.properties")}; propertyPlaceholderConfigurer.setLocations(resources); propertyPlaceholderConfigurer.setIgnoreUnresolvablePlaceholders(true); return propertyPlaceholderConfigurer; } @Bean public CharacterEncodingFilter characterEncodingFilter() { final CharacterEncodingFilter characterEncodingFilter = new CharacterEncodingFilter(); characterEncodingFilter.setEncoding("UTF-8"); characterEncodingFilter.setForceEncoding(true); return characterEncodingFilter; } }
package charlie.mirror.server; import org.json.JSONArray; import org.json.JSONObject; import java.io.FileInputStream; import java.io.IOException; import java.net.URL; import java.nio.file.Path; import java.nio.file.Paths; import java.util.concurrent.FutureTask; import static charlie.mirror.server.MinecraftMirror.queue; public class MojangClient { public void update(){ try { DownloadTask versionManifest = new DownloadTask(new URL("https://launchermeta.mojang.com/mc/game/version_manifest.json"), Paths.get(MinecraftMirror.configManager.getHttpRoot(), "intlfile", "version_manifest.json").toFile(), "manifest"); FutureTask<Void> verTask = new FutureTask<>(versionManifest, null); MinecraftMirror.downloadPool.submit(verTask); //Don't add to queue while(!verTask.isDone()) ; if(versionManifest.getStatus() == DownloadTask.Status.ERROR){ MinecraftMirror.logger.warning("Update failed: Couldn't download version manifest:" + versionManifest.getMessage()); return; } JSONArray versions = new JSONObject(readAll(Paths.get(MinecraftMirror.configManager.getHttpRoot(), "intlfile", "version_manifest.json"))).getJSONArray("versions"); for (int i = 0; i < versions.length(); i++) { JSONObject obj = versions.getJSONObject(i); URL url = new URL(obj.getString("url")); if(!queue.containsKey(url)){ DownloadTask task = new DownloadTask(url, Paths.get(MinecraftMirror.configManager.getHttpRoot(), "intlfile", obj.getString("id") + ".json").toFile(), "mv"); queue.put(url, task); FutureTask<Void> thread = new FutureTask<>(task, null); MinecraftMirror.downloadPool.submit(thread); MinecraftMirror.processPool.submit(new MojangVersion(task, thread)); } } } catch (Exception e) { MinecraftMirror.logger.warning("Mojang updating exception:" + e.getClass().toString() + " " + e.getMessage()); //e.printStackTrace(); } } private String readAll(Path path) throws IOException { FileInputStream fileInputStream = new FileInputStream(path.toFile()); byte[] buf = new byte[fileInputStream.available()]; fileInputStream.read(buf); fileInputStream.close(); return new String(buf); } }
package org.bonej.ops; import static java.util.stream.Collectors.groupingBy; import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toSet; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.Stack; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.DoubleStream; import java.util.stream.IntStream; import java.util.stream.Stream; import net.imagej.ops.Op; import net.imagej.ops.special.function.AbstractBinaryFunctionOp; import net.imagej.ops.special.function.Functions; import net.imagej.ops.special.function.UnaryFunctionOp; import org.bonej.utilities.GraphUtil; import org.scijava.plugin.Parameter; import org.scijava.plugin.Plugin; import org.scijava.vecmath.Vector3d; import sc.fiji.analyzeSkeleton.AnalyzeSkeleton_; import sc.fiji.analyzeSkeleton.Edge; import sc.fiji.analyzeSkeleton.Graph; import sc.fiji.analyzeSkeleton.Point; import sc.fiji.analyzeSkeleton.Vertex; @Plugin(name = "cleanShortEdges", type = Op.class) public class CleanShortEdges extends AbstractBinaryFunctionOp<Graph, Double, Graph> { @Parameter(persist = false, required = false) private List<Double> calibration3d = Arrays.asList(1.0, 1.0, 1.0); @Parameter(persist = false, required = false) private boolean iterativePruning; @Parameter(persist = false, required = false) private boolean useClusters = true; private UnaryFunctionOp<List, Vector3d> centroidOp; private PercentagesOfCulledEdges percentages; /** Pre-match op to efficiently find centroids of vertices */ @Override public void initialize() { centroidOp = Functions.unary(ops(), CentroidLinAlg3d.class, Vector3d.class, List.class); percentages = new PercentagesOfCulledEdges(); } /** * Cleans short edges from an {@link AnalyzeSkeleton_} {@link Graph} * Distinguish between "dead end" short edges (defined by having exactly one * {@link Vertex} with just one branch) and "cluster" short edges (defined * by both ends having at least two branches) * * @param input * the graph to clean * @param tolerance * edges shorter than tolerance will be cleaned * @return a cleaned graph */ @Override public Graph calculate(final Graph input, final Double tolerance) { if (calibration3d == null || calibration3d.size() < 3) { calibration3d = Arrays.asList(1.0, 1.0, 1.0); } Graph graph = input.clone(); percentages.totalEdges = graph.getEdges().size(); percentages.setLoopPercentage(removeLoops(graph)); percentages.setParallelPercentage(removeParallelEdges(graph)); graph.getEdges().forEach(this::euclideanDistance); int deadEnds = 0; int clusterEdges = 0; while (true) { final int startSize = graph.getVertices().size(); deadEnds = deadEnds + pruneDeadEnds(graph, tolerance); final int edges = graph.getEdges().size(); final Graph cleanGraph; if (useClusters) { cleanGraph = cleaningStep(graph, tolerance); } else { cleanGraph = cleaningStepUsingEdges(graph, tolerance); } removeParallelEdges(cleanGraph); clusterEdges = clusterEdges + (edges - cleanGraph.getEdges().size()); final int cleanSize = cleanGraph.getVertices().size(); graph = cleanGraph; if (!iterativePruning || startSize == cleanSize) { break; } } percentages.setDeadEndPercentage(deadEnds); percentages.setClusterPercentage(clusterEdges); return graph; } public PercentagesOfCulledEdges getPercentages() { return percentages; } /** * Removes parallel edges from the graph, leaving at most one connection * between each vertex pair * <p> * An edge is parallel, if there's another edge between its endpoint vertices. * </p> * <p> * NB non-deterministic in choosing which of the parallel edges is kept. * </p> * * @param graph A {@link Graph} that's assumed undirected * @return Number of parallel edges removed */ public static int removeParallelEdges(final Graph graph) { final ArrayList<Vertex> vertices = graph.getVertices(); final Map<Vertex, Integer> idMap = mapVertexIds(vertices); final Collection<Long> connections = new HashSet<>(); final Collection<Edge> parallelEdges = new ArrayList<>(); graph.getEdges().forEach(edge -> { final long hash = connectionHash(edge, idMap); if (!connections.add(hash)) { parallelEdges.add(edge); } }); parallelEdges.forEach(CleanShortEdges::removeBranchFromEndpoints); graph.getEdges().removeAll(parallelEdges); return parallelEdges.size(); } private static Map<Vertex, Integer> mapVertexIds(final List<Vertex> vertices) { return IntStream.range(0, vertices.size()).boxed() .collect(Collectors.toMap(vertices::get, Function.identity())); } private static void removeBranchFromEndpoints(final Edge branch) { branch.getV1().getBranches().remove(branch); branch.getV2().getBranches().remove(branch); } private static long connectionHash(final Edge e, final Map<Vertex, Integer> idMap) { final long nVertices = idMap.size(); final long a = idMap.get(e.getV1()); final long b = idMap.get(e.getV2()); return a < b ? a * nVertices + b : b * nVertices + a; } private static int removeLoops(final Graph graph) { final List<Edge> loops = graph.getEdges().stream().filter(GraphUtil::isLoop).collect(toList()); loops.forEach(CleanShortEdges::removeBranchFromEndpoints); graph.getEdges().removeAll(loops); return loops.size(); } /** * Prunes clusters and changes the affected edges. Preserves topology not * directly connected to the clusters. * <p> * Clusters are pruned to single centroid vertices. The centroids connect * all the edges that lead outside their clusters. * </p> * * @see #findClusters(Graph, Double) * @see #mapReplacementEdges(Map, Collection, Vertex) * @see #findEdgesWithOneEndInCluster(Collection) * @see #getClusterCentre(Collection) */ private Graph cleaningStep(final Graph graph, final Double tolerance) { final List<Set<Vertex>> clusters = findClusters(graph, tolerance); final Map<Set<Vertex>, Vertex> clusterCentres = clusters.stream() .collect(Collectors.toMap(Function.identity(), this::getClusterCentre)); final Map<Edge, Edge> replacementMap = new HashMap<>(); clusterCentres.forEach((cluster, centre) -> mapReplacementEdges(replacementMap, cluster, centre)); final Collection<Edge> clusterConnectingEdges = replacementMap.values(); clusterConnectingEdges.forEach(this::euclideanDistance); final List<Edge> nonClusterEdges = graph.getEdges().stream() .filter(e -> !replacementMap.containsKey(e) && isNotClusterEdge(e, clusters)).collect(toList()); final Graph cleanGraph = new Graph(); final Collection<Edge> cleanEdges = new HashSet<>(); cleanEdges.addAll(nonClusterEdges); cleanEdges.addAll(clusterConnectingEdges); cleanGraph.getEdges().addAll(cleanEdges); clusterCentres.values().forEach(cleanGraph::addVertex); endpointStream(nonClusterEdges).forEach(cleanGraph::addVertex); endpointStream(clusterConnectingEdges).forEach(cleanGraph::addVertex); copyLonelyVertices(graph, cleanGraph); removeDanglingEdges(cleanGraph); return cleanGraph; } private Graph cleaningStepUsingEdges(final Graph graph, final Double tolerance) { Graph currentGraph = graph.clone(); final List<Edge> shortInnerEdges = currentGraph.getEdges().stream() .filter(e -> isShortEdge(e, tolerance) && !isDeadEndEdge(e)).collect(toList()); for (int i = 0; i < shortInnerEdges.size(); i++) { final Edge currentShortEdge = shortInnerEdges.get(i); final Collection<Set<Vertex>> clusters = new ArrayList<>(); final Set<Vertex> currentCluster = new HashSet<>(); currentCluster.add(currentShortEdge.getV1()); currentCluster.add(currentShortEdge.getV2()); clusters.add(currentCluster); final Map<Set<Vertex>, Vertex> clusterCentres = clusters.stream() .collect(Collectors.toMap(Function.identity(), this::getClusterCentre)); final Map<Edge, Edge> replacementMap = new HashMap<>(); clusterCentres.forEach((cluster, centre) -> mapReplacementEdges(replacementMap, cluster, centre)); final Collection<Edge> clusterConnectingEdges = replacementMap.values(); clusterConnectingEdges.forEach(this::euclideanDistance); final List<Edge> nonClusterEdges = currentGraph.getEdges().stream() .filter(e -> !replacementMap.containsKey(e) && isNotClusterEdge(e, clusters)).collect(toList()); final Graph cleanGraph = new Graph(); final Collection<Edge> cleanEdges = new HashSet<>(); cleanEdges.addAll(nonClusterEdges); cleanEdges.addAll(clusterConnectingEdges); cleanGraph.getEdges().addAll(cleanEdges); clusterCentres.values().forEach(cleanGraph::addVertex); endpointStream(nonClusterEdges).forEach(cleanGraph::addVertex); endpointStream(clusterConnectingEdges).forEach(cleanGraph::addVertex); copyLonelyVertices(currentGraph, cleanGraph); removeDanglingEdges(cleanGraph); shortInnerEdges.forEach(e -> { if (replacementMap.containsKey(e)) { final int index = shortInnerEdges.indexOf(e); shortInnerEdges.set(index, replacementMap.get(e)); } }); currentGraph = cleanGraph; } return currentGraph; } private static Stream<Vertex> endpointStream(final Collection<Edge> edges) { return edges.stream().flatMap(e -> Stream.of(e.getV1(), e.getV2())).distinct(); } /** Removes edges that connect to vertices no longer in the given graph */ private static void removeDanglingEdges(final Graph graph) { graph.getVertices().forEach(v -> v.getBranches().removeIf(e -> !graph.getEdges().contains(e))); } /** * Maps new replacement edges for the cluster centroid * <p> * When a cluster is pruned, that is, condensed to a single centroid vertex, * all the edges that the cluster vertices had need to be connected to the * new centroid. Instead of altering the edges, we create new ones to * replace them, because {@link Edge} objects are immutable. * <p> * The method creates a map from old edges to their new replacements. Note * that both endpoints of an edge in the mapping can change, when it's an * edge connecting two clusters to each other. * </p> */ private static void mapReplacementEdges(final Map<Edge, Edge> replacementMapping, final Collection<Vertex> cluster, final Vertex centroid) { final Set<Edge> outerEdges = findEdgesWithOneEndInCluster(cluster); outerEdges.forEach(outerEdge -> { final Edge oldEdge = replacementMapping.getOrDefault(outerEdge, outerEdge); final Edge replacement = replaceEdge(oldEdge, cluster, centroid); replacementMapping.put(outerEdge, replacement); }); } private static Edge replaceEdge(final Edge edge, final Collection<Vertex> cluster, final Vertex centre) { final Vertex v1 = edge.getV1(); final Vertex v2 = edge.getV2(); final Edge replacement; if (cluster.contains(v1)) { replacement = new Edge(centre, v2, null, 0.0); replacement.getV1().setBranch(replacement); replacement.getV2().setBranch(replacement); } else if (cluster.contains(v2)) { replacement = new Edge(v1, centre, null, 0.0); replacement.getV1().setBranch(replacement); replacement.getV2().setBranch(replacement); } else { return null; } return replacement; } /** * Sets the length of the {@link Edge} to the calibrated euclidean distance * between its endpoints */ private void euclideanDistance(final Edge e) { final Vector3d centre1 = centroidOp.calculate(GraphUtil.toVector3d(e.getV1().getPoints())); final Vector3d centre2 = centroidOp.calculate(GraphUtil.toVector3d(e.getV2().getPoints())); centre1.sub(centre2); final double length = calibratedLength(centre1); e.setLength(length); } private double calibratedLength(final Vector3d centre1) { final double calX = centre1.x * calibration3d.get(0); final double calY = centre1.y * calibration3d.get(1); final double calZ = centre1.z * calibration3d.get(2); final double sqSum = DoubleStream.of(calX, calY, calZ).map(d -> d * d).sum(); return Math.sqrt(sqSum); } private static boolean isNotClusterEdge(final Edge e, final Collection<Set<Vertex>> clusters) { return clusters.stream().noneMatch(c -> c.contains(e.getV1()) && c.contains(e.getV2())); } /** * Creates a centroid vertex of all the vertices in a cluster. * * @param cluster a collection of directly connected vertices. * @return A vertex at the geometric center of the cluster. */ public Vertex getClusterCentre(final Collection<Vertex> cluster) { final List<Vector3d> clusterVectors = getClusterVectors(cluster); final Vector3d clusterCentroid = centroidOp.calculate(clusterVectors); return GraphUtil.vectorToVertex(clusterCentroid); } private static List<Vector3d> getClusterVectors(final Collection<Vertex> cluster) { final Stream<Point> clusterPoints = cluster.stream().flatMap(v -> v.getPoints().stream()); return clusterPoints.map(GraphUtil::toVector3d).collect(toList()); } private static int pruneDeadEnds(final Graph graph, final Double tolerance) { final List<Edge> deadEnds = graph.getEdges().stream().filter(e -> isDeadEndEdge(e) && isShortEdge(e, tolerance)) .collect(toList()); final List<Vertex> terminals = deadEnds.stream().flatMap(e -> Stream.of(e.getV1(), e.getV2())) .filter(v -> v.getBranches().size() == 1).collect(toList()); graph.getVertices().removeAll(terminals); deadEnds.forEach(CleanShortEdges::removeBranchFromEndpoints); graph.getEdges().removeAll(deadEnds); return deadEnds.size(); } public static boolean isShortEdge(final Edge e, final Double tolerance) { return (e.getLength() < tolerance); } private static boolean isDeadEndEdge(final Edge e) { return Stream.of(e.getV1(), e.getV2()).filter(v -> v.getBranches().size() == 1).count() == 1; } /** * Finds all the vertices in the cluster that has the given vertex * <p> * A vertex is in the cluster if its connected to the start directly or * indirectly via edges that have length less than the given tolerance * </p> */ private static Set<Vertex> fillCluster(final Vertex start, final Double tolerance) { final Set<Vertex> cluster = new HashSet<>(); final Stack<Vertex> stack = new Stack<>(); stack.push(start); while (!stack.isEmpty()) { final Vertex vertex = stack.pop(); cluster.add(vertex); final Set<Vertex> freeNeighbours = vertex.getBranches().stream().filter(e -> isShortEdge(e, tolerance)) .map(e -> e.getOppositeVertex(vertex)).filter(v -> !cluster.contains(v)).collect(toSet()); stack.addAll(freeNeighbours); } return cluster; } /** * Find all the vertex clusters in the graph * <p> * A cluster is a set of vertices connected to each other by edges whose * length is less than tolerance * </p> * * @param graph * An undirectioned graph * @param tolerance * Maximum length for cluster edges * @return A set of all the clusters found */ public static List<Set<Vertex>> findClusters(final Graph graph, final Double tolerance) { final List<Set<Vertex>> clusters = new ArrayList<>(); final List<Vertex> clusterVertices = findClusterVertices(graph, tolerance); while (!clusterVertices.isEmpty()) { final Vertex start = clusterVertices.get(0); final Set<Vertex> cluster = fillCluster(start, tolerance); clusters.add(cluster); clusterVertices.removeAll(cluster); } return clusters; } /** Finds all the vertices that are in one of the graph's clusters */ private static List<Vertex> findClusterVertices(final Graph graph, final Double tolerance) { return graph.getEdges().stream().filter(e -> isShortEdge(e, tolerance)) .flatMap(e -> Stream.of(e.getV1(), e.getV2())).distinct().collect(toList()); } private static void copyLonelyVertices(final Graph originalGraph, final Graph targetGraph) { final Set<Vertex> lonelyVertices = originalGraph.getVertices().stream().filter(v -> v.getBranches().isEmpty()) .collect(toSet()); targetGraph.getVertices().addAll(lonelyVertices); } /** * Finds the edges that connect the cluster vertices to outside the cluster. * * @param cluster a collection of directly connected vertices. * @return the edges that originate from the cluster but terminate outside it. */ public static Set<Edge> findEdgesWithOneEndInCluster(final Collection<Vertex> cluster) { final Map<Edge, Long> edgeCounts = cluster.stream().flatMap(v -> v.getBranches().stream()) .collect(groupingBy(Function.identity(), Collectors.counting())); return edgeCounts.keySet().stream().filter(e -> edgeCounts.get(e) == 1).collect(toSet()); } public static final class PercentagesOfCulledEdges { private double percentageDeadEnds = Double.NaN; private double percentageParallelEdges = Double.NaN; private double percentageLoopEdges = Double.NaN; private double percentageClusterEdges = Double.NaN; private long totalEdges = -1; public double getPercentageDeadEnds() { return percentageDeadEnds; } public double getPercentageParallelEdges() { return percentageParallelEdges; } public double getPercentageLoopEdges() { return percentageLoopEdges; } public double getPercentageClusterEdges() { return percentageClusterEdges; } public long getTotalEdges() { return totalEdges; } private void setClusterPercentage(final int clusterEdges) { percentageClusterEdges = clusterEdges / ((double) totalEdges) * 100.0; } private void setDeadEndPercentage(final int deadEndEdges) { percentageDeadEnds = deadEndEdges / ((double) totalEdges) * 100.0; } private void setParallelPercentage(final int parallelEdges) { percentageParallelEdges = parallelEdges / ((double) totalEdges) * 100.0; } private void setLoopPercentage(final int loopEdges) { percentageLoopEdges = loopEdges / ((double) totalEdges) * 100.0; } } }
package com.yahoo.messagebus; import com.yahoo.concurrent.CopyOnWriteHashMap; import com.yahoo.concurrent.SystemTimer; import com.yahoo.log.LogLevel; import com.yahoo.messagebus.metrics.MessageBusMetricSet; import com.yahoo.messagebus.network.Network; import com.yahoo.messagebus.network.NetworkOwner; import com.yahoo.messagebus.routing.*; import com.yahoo.text.Utf8Array; import com.yahoo.text.Utf8String; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; import java.util.logging.Logger; /** * <p>A message bus contains the factory for creating sessions to send, receive * and forward messages.</p> * * <p>There are three types of sessions:</p> * <ul> * <li>{@link SourceSession Source sessions} sends messages and receives replies</li> * <li>{@link IntermediateSession Intermediate sessions} receives messages on * their way to their final destination, and may decide to forward the messages or reply directly. * <li>{@link DestinationSession Destination sessions} are the final recipient * of messages, and are expected to reply to every one of them, but may not forward messages. * </ul> * * <p>A message bus is configured with a {@link Protocol protocol}. This table * enumerates the permissible routes from intermediates to destinations and the * messaging semantics of each hop.</p> * * The responsibilities of a message bus are: * <ul> * <li>Assign a route to every send message from its routing table * <li>Deliver every message it <i>accepts</i> to the next hop on its route * <i>or</i> deliver a <i>failure reply</i>. * <li>Deliver replies back to message sources through all the intermediate hops. * </ul> * * A runtime will typically * <ul> * <li>Create a message bus implementation and set properties on this implementation once. * <li>Create sessions using that message bus many places.</li> * </ul> * * @author bratseth * @author Simon Thoresen Hult */ public class MessageBus implements ConfigHandler, NetworkOwner, MessageHandler, ReplyHandler { private static Logger log = Logger.getLogger(MessageBus.class.getName()); private final AtomicBoolean destroyed = new AtomicBoolean(false); private final ProtocolRepository protocolRepository = new ProtocolRepository(); private final AtomicReference<Map<String, RoutingTable>> tablesRef = new AtomicReference<>(null); private final CopyOnWriteHashMap<String, MessageHandler> sessions = new CopyOnWriteHashMap<>(); private final Network net; private final Messenger msn; private final Resender resender; private int maxPendingCount; private int maxPendingSize; private int pendingCount = 0; private int pendingSize = 0; private final Thread careTaker = new Thread(this::sendBlockedMessages); private final ConcurrentHashMap<SendBlockedMessages, Long> blockedSenders = new ConcurrentHashMap<>(); private MessageBusMetricSet metrics = new MessageBusMetricSet(); public interface SendBlockedMessages { /** * Do what you want, but dont block. * You will be called regularly until you signal you are done * @return true unless you are done */ boolean trySend(); } public void register(SendBlockedMessages sender) { blockedSenders.put(sender, SystemTimer.INSTANCE.milliTime()); } private void sendBlockedMessages() { while (! destroyed.get()) { for (SendBlockedMessages sender : blockedSenders.keySet()) { if (!sender.trySend()) { blockedSenders.remove(sender); } } try { Thread.sleep(10); } catch (InterruptedException e) { return; } } } /** * <p>Convenience constructor that proxies {@link #MessageBus(Network, * MessageBusParams)} by adding the given protocols to a default {@link * MessageBusParams} object.</p> * * @param net The network to associate with. * @param protocols An array of protocols to register. */ public MessageBus(Network net, List<Protocol> protocols) { this(net, new MessageBusParams().addProtocols(protocols)); } /** * <p>Constructs an instance of message bus. This requires a network object * that it will associate with. This assignment may not change during the * lifetime of this message bus.</p> * * @param net The network to associate with. * @param params The parameters that controls this bus. */ public MessageBus(Network net, MessageBusParams params) { // Add all known protocols to the repository. maxPendingCount = params.getMaxPendingCount(); maxPendingSize = params.getMaxPendingSize(); for (int i = 0, len = params.getNumProtocols(); i < len; ++i) { protocolRepository.putProtocol(params.getProtocol(i)); if (params.getProtocol(i).getMetrics() != null) { metrics.protocols.addMetric(params.getProtocol(i).getMetrics()); } } // Attach and start network. this.net = net; net.attach(this); if ( ! net.waitUntilReady(120)) throw new IllegalStateException("Network failed to become ready in time."); // Start messenger. msn = new Messenger(); RetryPolicy retryPolicy = params.getRetryPolicy(); if (retryPolicy != null) { resender = new Resender(retryPolicy); msn.addRecurrentTask(new ResenderTask(resender)); } else { resender = null; } careTaker.setDaemon(true); careTaker.start(); msn.start(); } /** * <p>Returns the metrics used by this messagebus.</p> * * @return The metric set. */ public MessageBusMetricSet getMetrics() { return metrics; } /** * <p>Sets the destroyed flag to true. The very first time this method is * called, it cleans up all its dependencies. Even if you retain a reference * to this object, all of its content is allowed to be garbage * collected.</p> * * @return True if content existed and was destroyed. */ public boolean destroy() { if (!destroyed.getAndSet(true)) { try { careTaker.join(); } catch (InterruptedException e) { } protocolRepository.clearPolicyCache(); net.shutdown(); msn.destroy(); if (resender != null) { resender.destroy(); } return true; } return false; } /** * <p>Synchronize with internal threads. This method will handshake with all * internal threads. This has the implicit effect of waiting for all active * callbacks. Note that this method should never be invoked from a callback * since that would make the thread wait for itself... forever. This method * is typically used to untangle during session shutdown.</p> */ public void sync() { msn.sync(); net.sync(); } /** * <p>This is a convenience method to call {@link * #createSourceSession(SourceSessionParams)} with default values for the * {@link SourceSessionParams} object.</p> * * @param handler The reply handler to receive the replies for the session. * @return The created session. */ public SourceSession createSourceSession(ReplyHandler handler) { return createSourceSession(new SourceSessionParams().setReplyHandler(handler)); } /** * <p>This is a convenience method to call {@link * #createSourceSession(SourceSessionParams)} by first assigning the reply * handler to the parameter object.</p> * * @param handler The reply handler to receive the replies for the session. * @param params The parameters to control the session. * @return The created session. */ public SourceSession createSourceSession(ReplyHandler handler, SourceSessionParams params) { return createSourceSession(new SourceSessionParams(params).setReplyHandler(handler)); } /** * <p>Creates a source session on top of this message bus.</p> * * @param params The parameters to control the session. * @return The created session. */ public SourceSession createSourceSession(SourceSessionParams params) { if (destroyed.get()) { throw new IllegalStateException("Object is destroyed."); } return new SourceSession(this, params); } /** * <p>This is a convenience method to call {@link * #createIntermediateSession(IntermediateSessionParams)} with default * values for the {@link IntermediateSessionParams} object.</p> * * @param name The local unique name for the created session. * @param broadcastName Whether or not to broadcast this session's name on * the network. * @param msgHandler The handler to receive the messages for the session. * @param replyHandler The handler to received the replies for the session. * @return The created session. */ public IntermediateSession createIntermediateSession(String name, boolean broadcastName, MessageHandler msgHandler, ReplyHandler replyHandler) { return createIntermediateSession( new IntermediateSessionParams() .setName(name) .setBroadcastName(broadcastName) .setMessageHandler(msgHandler) .setReplyHandler(replyHandler)); } /** * <p>Creates an intermediate session on top of this message bus using the * given handlers and parameter object.</p> * * @param params The parameters to control the session. * @return The created session. */ public synchronized IntermediateSession createIntermediateSession(IntermediateSessionParams params) { if (destroyed.get()) { throw new IllegalStateException("Object is destroyed."); } if (sessions.containsKey(params.getName())) { throw new IllegalArgumentException("Name '" + params.getName() + "' is not unique."); } IntermediateSession session = new IntermediateSession(this, params); sessions.put(params.getName(), session); if (params.getBroadcastName()) { net.registerSession(params.getName()); } return session; } /** * <p>This is a convenience method to call {@link * #createDestinationSession(DestinationSessionParams)} with default values * for the {@link DestinationSessionParams} object.</p> * * @param name The local unique name for the created session. * @param broadcastName Whether or not to broadcast this session's name on * the network. * @param handler The handler to receive the messages for the session. * @return The created session. */ public DestinationSession createDestinationSession(String name, boolean broadcastName, MessageHandler handler) { return createDestinationSession( new DestinationSessionParams() .setName(name) .setBroadcastName(broadcastName) .setMessageHandler(handler)); } /** * <p>Creates a destination session on top of this message bus using the * given handlers and parameter object.</p> * * @param params The parameters to control the session. * @return The created session. */ public synchronized DestinationSession createDestinationSession(DestinationSessionParams params) { if (destroyed.get()) { throw new IllegalStateException("Object is destroyed."); } if (sessions.containsKey(params.getName())) { throw new IllegalArgumentException("Name '" + params.getName() + "' is not unique."); } DestinationSession session = new DestinationSession(this, params); sessions.put(params.getName(), session); if (params.getBroadcastName()) { net.registerSession(params.getName()); } return session; } /** * <p>This method is invoked by the {@link * com.yahoo.messagebus.IntermediateSession#destroy()} to unregister * sessions from receiving data from message bus.</p> * * @param name The name of the session to remove. * @param broadcastName Whether or not session name was broadcast. */ public synchronized void unregisterSession(String name, boolean broadcastName) { if (broadcastName) { net.unregisterSession(name); } sessions.remove(name); } private boolean doAccounting() { return (maxPendingCount > 0 || maxPendingSize > 0); } /** * <p>This method handles choking input data so that message bus does not * blindly accept everything. This prevents an application running * out-of-memory in case it fail to choke input data itself. If this method * returns false, it means that it should be rejected.</p> * * @param msg The message to count. * @return True if the message was accepted. */ private boolean checkPending(Message msg) { boolean busy = false; int size = msg.getApproxSize(); if (doAccounting()) { synchronized (this) { busy = ((maxPendingCount > 0 && pendingCount >= maxPendingCount) || (maxPendingSize > 0 && pendingSize >= maxPendingSize)); if (!busy) { pendingCount++; pendingSize += size; } } } if (busy) { return false; } msg.setContext(size); msg.pushHandler(this); return true; } @Override public void handleMessage(Message msg) { if (resender != null && msg.hasBucketSequence()) { deliverError(msg, ErrorCode.SEQUENCE_ERROR, "Bucket sequences not supported when resender is enabled."); return; } SendProxy proxy = new SendProxy(this, net, resender); msn.deliverMessage(msg, proxy); } @Override public void handleReply(Reply reply) { if (destroyed.get()) { reply.discard(); return; } if (doAccounting()) { synchronized (this) { --pendingCount; pendingSize -= (Integer)reply.getContext(); } } deliverReply(reply, reply.popHandler()); } @Override public void deliverMessage(Message msg, String session) { MessageHandler msgHandler = sessions.get(session); if (msgHandler == null) { deliverError(msg, ErrorCode.UNKNOWN_SESSION, "Session '" + session + "' does not exist."); } else if (!checkPending(msg)) { deliverError(msg, ErrorCode.SESSION_BUSY, "Session '" + net.getConnectionSpec() + "/" + session + "' is busy, try again later."); } else { msn.deliverMessage(msg, msgHandler); } } /** * <p>Adds a protocol to the internal repository of protocols, replacing any * previous instance of the protocol and clearing the associated routing * policy cache.</p> * * @param protocol The protocol to add. */ public void putProtocol(Protocol protocol) { protocolRepository.putProtocol(protocol); } @Override public Protocol getProtocol(Utf8Array name) { return protocolRepository.getProtocol(name.toString()); } public Protocol getProtocol(Utf8String name) { return getProtocol((Utf8Array)name); } @Override public void deliverReply(Reply reply, ReplyHandler handler) { msn.deliverReply(reply, handler); } @Override public void setupRouting(RoutingSpec spec) { Map<String, RoutingTable> tables = new HashMap<>(); for (int i = 0, len = spec.getNumTables(); i < len; ++i) { RoutingTableSpec table = spec.getTable(i); String name = table.getProtocol(); if (!protocolRepository.hasProtocol(name)) { log.log(LogLevel.INFO, "Protocol '" + name + "' is not supported, ignoring routing table."); continue; } tables.put(name, new RoutingTable(table)); } tablesRef.set(tables); protocolRepository.clearPolicyCache(); } /** * <p>Returns the resender that is running within this message bus.</p> * * @return The resender. */ public Resender getResender() { return resender; } /** * <p>Returns the number of messages received that have not been replied to * yet.</p> * * @return The pending count. */ public synchronized int getPendingCount() { return pendingCount; } /** * <p>Returns the size of messages received that have not been replied to * yet.</p> * * @return The pending size. */ public synchronized int getPendingSize() { return pendingSize; } /** * <p>Sets the maximum number of messages that can be received without being * replied to yet.</p> * * @param maxCount The max count. */ public void setMaxPendingCount(int maxCount) { maxPendingCount = maxCount; } /** * Gets maximum number of messages that can be received without being * replied to yet. */ public int getMaxPendingCount() { return maxPendingCount; } /** * <p>Sets the maximum size of messages that can be received without being * replied to yet.</p> * * @param maxSize The max size. */ public void setMaxPendingSize(int maxSize) { maxPendingSize = maxSize; } /** * Gets maximum combined size of messages that can be received without * being replied to yet. */ public int getMaxPendingSize() { return maxPendingSize; } /** * <p>Returns a named routing table, may return null.</p> * * @param name The name of the routing table to return. * @return The routing table object. */ public RoutingTable getRoutingTable(String name) { Map<String, RoutingTable> tables = tablesRef.get(); if (tables == null) { return null; } return tables.get(name); } /** * <p>Returns a named routing table, may return null.</p> * * @param name The name of the routing table to return. * @return The routing table object. */ public RoutingTable getRoutingTable(Utf8String name) { return getRoutingTable(name.toString()); } /** * <p>Returns a routing policy that corresponds to the argument protocol * name, policy name and policy parameter. This will cache reuse all * policies as soon as they are first requested.</p> * * @param protocolName The name of the protocol to invoke {@link Protocol#createPolicy(String,String)} on. * @param policyName The name of the routing policy to retrieve. * @param policyParam The parameter for the routing policy to retrieve. * @return A corresponding routing policy, or null. */ public RoutingPolicy getRoutingPolicy(String protocolName, String policyName, String policyParam) { return protocolRepository.getRoutingPolicy(protocolName, policyName, policyParam); } /** * <p>Returns a routing policy that corresponds to the argument protocol * name, policy name and policy parameter. This will cache reuse all * policies as soon as they are first requested.</p> * * @param protocolName The name of the protocol to invoke {@link Protocol#createPolicy(String,String)} on. * @param policyName The name of the routing policy to retrieve. * @param policyParam The parameter for the routing policy to retrieve. * @return A corresponding routing policy, or null. */ public RoutingPolicy getRoutingPolicy(Utf8String protocolName, String policyName, String policyParam) { return protocolRepository.getRoutingPolicy(protocolName.toString(), policyName, policyParam); } /** * <p>Returns the connection spec string for the network layer of this * message bus. This is merely a proxy of the same function in the network * layer.</p> * * @return The connection string. */ public String getConnectionSpec() { return net.getConnectionSpec(); } /** * <p>Constructs and schedules a Reply containing an error to the handler of the given Message.</p> * * @param msg The message to reply to. * @param errCode The code of the error to set. * @param errMsg The message of the error to set. */ private void deliverError(Message msg, int errCode, String errMsg) { Reply reply = new EmptyReply(); reply.swapState(msg); reply.addError(new Error(errCode, errMsg)); deliverReply(reply, reply.popHandler()); } /** * <p>Implements a task for running the resender in the messenger * thread. This task acts as a proxy for the resender, allowing the task to * be deleted without affecting the resender itself.</p> */ private static class ResenderTask implements Messenger.Task { final Resender resender; ResenderTask(Resender resender) { this.resender = resender; } public void destroy() { // empty } public void run() { resender.resendScheduled(); } } }
package eu.freme.bservices.controllers.xsltconverter; import eu.freme.common.conversion.SerializationFormatMapper; import eu.freme.common.exception.BadRequestException; import eu.freme.common.exception.FREMEHttpException; import eu.freme.common.exception.OwnedResourceNotFoundException; import eu.freme.common.persistence.dao.OwnedResourceDAO; import eu.freme.common.persistence.model.XsltConverter; import eu.freme.common.rest.NIFParameterSet; import eu.freme.common.rest.RestHelper; import net.sf.saxon.s9api.*; import nu.validator.htmlparser.sax.HtmlParser; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.access.AccessDeniedException; import org.springframework.security.access.annotation.Secured; import org.springframework.web.bind.annotation.*; import org.xml.sax.InputSource; import javax.annotation.PostConstruct; import javax.xml.transform.ErrorListener; import javax.xml.transform.SourceLocator; import javax.xml.transform.TransformerException; import javax.xml.transform.sax.SAXSource; import javax.xml.transform.stream.StreamSource; import java.io.ByteArrayOutputStream; import java.io.StringReader; import java.util.Map; @RestController @RequestMapping("/toolbox/xslt-converter/documents") public class XsltConverterController { Logger logger = Logger.getLogger(XsltConverterController.class); public static final String XML = "text/xml"; public static final String HTML = "text/html"; private ErrorListener saxonListener = new ErrorListener() { public void error(TransformerException exception) throws TransformerException { logger.error(exception.getMessageAndLocation()); } public void fatalError(TransformerException exception) throws TransformerException { logger.error(exception.getMessageAndLocation()); throw exception; } public void warning(TransformerException exception) throws TransformerException { logger.warn(exception); } }; @Autowired SerializationFormatMapper serializationFormatMapper; @Autowired RestHelper rest; @Autowired OwnedResourceDAO<XsltConverter> entityDAO; @PostConstruct public void init(){ // add required mimeTypes and in-/outformat values serializationFormatMapper.put(XML, XML); serializationFormatMapper.put("xml", XML); serializationFormatMapper.put(HTML, HTML); serializationFormatMapper.put("html", HTML); } @RequestMapping(value = "/{identifier}", method = RequestMethod.POST) @Secured({"ROLE_USER", "ROLE_ADMIN"}) public ResponseEntity<String> filter( @PathVariable("identifier") String identifier, @RequestHeader(value = "Accept", required = false) String acceptHeader, @RequestHeader(value = "Content-Type", required = false) String contentTypeHeader, @RequestBody String postBody ) { try { // check access rights and get plain stylesheet String stylesheet = entityDAO.findOneByIdentifier(identifier).getStylesheet(); Processor processor = new Processor(false); XsltCompiler compiler = processor.newXsltCompiler(); compiler.setErrorListener(saxonListener); Xslt30Transformer transformer = compiler.compile(new StreamSource(new StringReader(stylesheet))).load30(); transformer.setErrorListener(saxonListener); // configure input SAXSource source; String inFormat = serializationFormatMapper.get(contentTypeHeader); if(inFormat == null) inFormat = XML; if(inFormat.equals(HTML)) { //// convert html to xml HtmlParser parser = new HtmlParser(); source = new SAXSource(parser, new InputSource(new StringReader(postBody))); }else{ source = new SAXSource(new InputSource(new StringReader(postBody))); } // configure output String outFormat = serializationFormatMapper.get(acceptHeader); Serializer serializer = processor.newSerializer(); if(outFormat == null) outFormat = XML; if(outFormat.equals(HTML)){ serializer.setOutputProperty(Serializer.Property.METHOD, "html"); }else{ outFormat = XML; serializer.setOutputProperty(Serializer.Property.METHOD, "xml"); } serializer.setOutputProperty(Serializer.Property.INDENT, "yes"); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); serializer.setOutputStream(outputStream); // do transformation XdmValue transformed = transformer.applyTemplates(source); // serialize the result serializer.serializeXdmValue(transformed); String serialization = outputStream.toString("UTF-8"); HttpHeaders responseHeaders = new HttpHeaders(); responseHeaders.add("Content-Type", outFormat); return new ResponseEntity<>(serialization, responseHeaders, HttpStatus.OK); } catch (AccessDeniedException ex){ logger.error(ex.getMessage()); throw new eu.freme.common.exception.AccessDeniedException(ex.getMessage()); } catch (OwnedResourceNotFoundException | BadRequestException ex){ logger.error(ex.getMessage()); throw ex; } catch(Exception ex){ logger.error(ex.getMessage()); throw new FREMEHttpException(ex.getMessage()); } } }
package org.pm4j.core.pm.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.pm4j.core.pm.PmAttr; import org.pm4j.core.pm.impl.PmAttrBase; /** * Specification of an attribute option set. * * @author olaf boede */ @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.TYPE, ElementType.FIELD, ElementType.METHOD }) public @interface PmOptionCfg { /** * Specification of an EL expression that defines the set of objects to build * the options from. * <p * If not specified, the method {@link PmAttrBase#getOptionValues()} will * be used to get the option objects. * * @return Path to the set of objects that is used to build the options.<br> * Example: 'pmBean.allDefinedValues'. */ String values() default ""; /** * Expression for the path from an item object to its value that provides the option identifier.<br> * Example: 'id'. * * @return The id value expression. */ String id() default ""; /** * Path from an item object to the value that provides the option title.<br> * Example: 'name'. * * @return The title value expression. */ String title() default ""; /** * Path from an item object to the value that provides the option value.<br> * Examples:<br> * '' - specifies the found object itself;<br> * 'mySubfield.anotherField' - specifies some related content to use. * * @return The value expression. */ String value() default ""; /** Internal identifier string for no sort-by definition. */ static final String NO_SORT_SPEC = "- No sortBy specified. -"; /** * An expression that defines a value to sort the options by.<br> * In not specified, the options will be shown as they are * provides by the getOptionValues method. * <p> * Sorts specific to the type of the object returned by the * <code>sortBy</code> expression: * <p> * Examples: Assume <code>getOptionValues()</code> provides a set of <code>User</code> objects. * <ul> * <li><code>sortBy=""</code> - sorts by comparing the users.</li> * <li><code>sortBy="title"</code> - sorts by comparing the title of the option.</li> * <li><code>sortBy="id"</code> - sorts by comparing the id of the option.</li> * <li><code>sortBy="value.name"</code> - sorts by comparing the 'name' attribute of the user object behind the option.</li> * <li><code>sortBy="value.name desc"</code> - sorts descending by comparing the 'name' attribute of the users.</li> * <li><code>sortBy="value.address.street"</code> - sorts by comparing the street which is part of address of the provided users.</li> * <li><code>sortBy="value.name desc, value.address.street"</code> - sorts by comparing the street which is part of address of the provided users.</li> * </pre> * * @return The expression to sort the option by. */ String sortBy() default NO_SORT_SPEC; /** * Defines if a <code>null</code> option should be generated or not. */ static enum NullOption { /** * A <code>null</code>-option will be provided if the attribute value is * optional ({@link PmAttr#isRequired()} returns <code>false</code>). */ FOR_OPTIONAL_ATTR, /** * A <code>null</code>-option will always be provided. */ YES, /** * A <code>null</code>-option will not be provided. */ NO, /** * Defines that the attribute type specific <code>null</code>-option default * definition should be used.<br> * The default for non-list attribute types is {@link #FOR_OPTIONAL_ATTR}.<br> * the default for list attribute types is {@link #NO}. * <p> * You may define the attribute specific default value by overriding * {@link PmAttrImplIf#getNullOptionDefault()}. */ DEFAULT }; /** * Defines if a <code>null</code>-option should be generated. * * @return The <code>null</code>-option definition. */ NullOption nullOption() default NullOption.DEFAULT; /** * This resource key allows provide a default title for the <code>null</code> * option of all option sets. * <p> * The default may be defined for a specific domain package or for the whole * application if it is defined within the topmost package of the application. */ static final String NULL_OPTION_DEFAULT_RESKEY = "nullOptionTitle"; /** * @return The resource key for the title to display for the <code>null</code> * option. */ String nullOptionResKey() default NULL_OPTION_DEFAULT_RESKEY; }
package org.opennms.reporting.core.svclayer.support; import java.io.BufferedOutputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.Date; import java.util.List; import java.util.Map; import org.exolab.castor.xml.MarshalException; import org.exolab.castor.xml.ValidationException; import org.opennms.api.reporting.ReportException; import org.opennms.api.reporting.ReportFormat; import org.opennms.api.reporting.ReportMode; import org.opennms.api.reporting.ReportService; import org.opennms.api.reporting.parameter.ReportParameters; import org.opennms.core.utils.ThreadCategory; import org.opennms.javamail.JavaMailer; import org.opennms.javamail.JavaMailerException; import org.opennms.netmgt.config.UserFactory; import org.opennms.netmgt.config.UserManager; import org.opennms.netmgt.model.ReportCatalogEntry; import org.opennms.reporting.core.DeliveryOptions; import org.opennms.reporting.core.svclayer.ReportServiceLocator; import org.opennms.reporting.core.svclayer.ReportStoreService; import org.opennms.reporting.core.svclayer.ReportWrapperService; /** * <p>DefaultReportWrapperService class.</p> * * @author ranger * @version $Id: $ */ public class DefaultReportWrapperService implements ReportWrapperService { private ReportServiceLocator m_reportServiceLocator; private final ThreadCategory log; private ReportStoreService m_reportStoreService; private static final String LOG4J_CATEGORY = "OpenNMS.Report"; /** * <p>Constructor for DefaultReportWrapperService.</p> */ public DefaultReportWrapperService() { String oldPrefix = ThreadCategory.getPrefix(); ThreadCategory.setPrefix(LOG4J_CATEGORY); log = ThreadCategory.getInstance(DefaultReportWrapperService.class); ThreadCategory.setPrefix(oldPrefix); } /** {@inheritDoc} */ public DeliveryOptions getDeliveryOptions(String reportId, String userId) { DeliveryOptions options = new DeliveryOptions(); options.setFormat(ReportFormat.HTML); options.setPersist(true); options.setSendMail(false); UserManager userFactory = UserFactory.getInstance(); try { String emailAddress = userFactory.getEmail(userId); if (emailAddress != null) { options.setMailTo(emailAddress); } } catch (MarshalException e) { log.error( "marshal exception trying to set destination email address", e); } catch (ValidationException e) { log.error( "validation exception trying to set destination email address", e); } catch (IOException e) { log.error("IO exception trying to set destination email address", e); } catch (NullPointerException e) { options.setMailTo(""); // See NMS-5111 for more details. } options.setInstanceId(reportId + " " + userId); return options; } /** {@inheritDoc} */ public List<ReportFormat> getFormats(String reportId) { return getReportService(reportId).getFormats(reportId); } /** {@inheritDoc} */ public ReportParameters getParameters(String reportId) { try { return getReportService(reportId).getParameters(reportId); } catch (ReportException e) { log.error("Report Exception when retrieving report parameters", e); } return null; } /** {@inheritDoc} */ public Boolean hasParameters(String reportId) { Map<String, Object> reportParms = getParameters(reportId).getReportParms(); if ((reportParms == null)||(reportParms.isEmpty())) { return false; } else { return true; } } /** {@inheritDoc} */ public void render(String reportId, String location, ReportFormat format, OutputStream outputStream) { try { getReportService(reportId).render(reportId, location, format, outputStream); } catch (ReportException e) { log.error("failed to render report", e); } } /** {@inheritDoc} */ public void run(ReportParameters parameters, ReportMode mode, DeliveryOptions deliveryOptions, String reportId) { if (!deliveryOptions.getPersist()) { ByteArrayOutputStream out = new ByteArrayOutputStream(); BufferedOutputStream bout = new BufferedOutputStream(out); try { getReportService(reportId).runAndRender( parameters.getReportParms(mode), reportId, deliveryOptions.getFormat(), bout); } catch (ReportException reportException) { log.error("failed to run or render report: " + reportId, reportException); } mailReport(deliveryOptions, out); } else { String outputPath; try { outputPath = getReportService(reportId).run( parameters.getReportParms(mode), reportId); ReportCatalogEntry catalogEntry = new ReportCatalogEntry(); catalogEntry.setReportId(reportId); catalogEntry.setTitle(deliveryOptions.getInstanceId()); catalogEntry.setLocation(outputPath); catalogEntry.setDate(new Date()); m_reportStoreService.save(catalogEntry); if (deliveryOptions.getMailTo().length() != 0) { ByteArrayOutputStream out = new ByteArrayOutputStream(); BufferedOutputStream bout = new BufferedOutputStream(out); getReportService(reportId).render( reportId, outputPath, deliveryOptions.getFormat(), bout); mailReport(deliveryOptions, out); } } catch (ReportException reportException) { log.error("failed to run or render report: " + reportId, reportException); } } } private void mailReport(DeliveryOptions deliveryOptions, ByteArrayOutputStream outputStream) { try { JavaMailer jm = new JavaMailer(); jm.setTo(deliveryOptions.getMailTo()); jm.setSubject(deliveryOptions.getInstanceId()); jm.setMessageText("Here is your report from the OpenNMS report service."); jm.setInputStream(new ByteArrayInputStream( outputStream.toByteArray())); switch (deliveryOptions.getFormat()) { case HTML: jm.setInputStreamName(deliveryOptions.getInstanceId() + ".htm"); jm.setInputStreamContentType("text/html"); break; case PDF: jm.setInputStreamName(deliveryOptions.getInstanceId() + ".pdf"); jm.setInputStreamContentType("application/pdf"); break; case SVG: jm.setInputStreamName(deliveryOptions.getInstanceId()+ ".pdf"); jm.setInputStreamContentType("application/pdf"); break; default: jm.setInputStreamName(deliveryOptions.getInstanceId() + ".htm"); jm.setInputStreamContentType("text/html"); } jm.mailSend(); } catch (JavaMailerException e) { log.error("Caught JavaMailer exception sending report", e); } } /** {@inheritDoc} */ public boolean validate(ReportParameters parameters, String reportId) { return getReportService(reportId).validate( parameters.getReportParms(), reportId); } private ReportService getReportService(String reportId) { return m_reportServiceLocator.getReportServiceForId(reportId); } /** * <p>setReportServiceLocator</p> * * @param reportServiceLocator a {@link org.opennms.reporting.core.svclayer.ReportServiceLocator} object. */ public void setReportServiceLocator( ReportServiceLocator reportServiceLocator) { m_reportServiceLocator = reportServiceLocator; } /** * <p>setReportStoreService</p> * * @param reportStoreService a {@link org.opennms.reporting.core.svclayer.ReportStoreService} object. */ public void setReportStoreService(ReportStoreService reportStoreService) { m_reportStoreService = reportStoreService; } /** {@inheritDoc} */ public void runAndRender(ReportParameters parameters, ReportMode mode, OutputStream outputStream) { // TODO remove this debug code Map<String, Object> reportParms = parameters.getReportParms(mode); for (String key : reportParms.keySet()) { String value; if (reportParms.get(key) == null) { value = "NULL"; } else { value = reportParms.get(key).toString(); } log.debug("param " + key + " set " + value); } try { getReportService(parameters.getReportId()).runAndRender( parameters.getReportParms(mode), parameters.getReportId(), parameters.getFormat(), outputStream); } catch (ReportException reportException) { log.error("failed to run or render report: " + parameters.getReportId(), reportException); } } }
package com.almoturg.sprog.data; import android.util.JsonReader; import android.util.JsonToken; import com.almoturg.sprog.model.ParentComment; import com.almoturg.sprog.model.Poem; import com.almoturg.sprog.model.SprogDbHelper; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; class PoemParser { private JsonReader reader; private HashMap<String, Poem> mainpoem_links; private HashSet<String> read_poems; private HashSet<String> favorite_poems; private MarkdownConverter markdownConverter; PoemParser(InputStream in, SprogDbHelper dbHelper, MarkdownConverter markdownConverter) throws IOException { this.markdownConverter = markdownConverter; read_poems = dbHelper.getReadPoems(); favorite_poems = dbHelper.getFavoritePoems(); reader = new JsonReader(new InputStreamReader(in, "UTF-8")); mainpoem_links = new HashMap<>(); reader.beginArray(); } List<Poem> getPoems(int n) throws IOException { if (reader == null) { return null; } List<Poem> poems = new ArrayList<>(); for (int i = 0; i < n; i++) { if (!reader.hasNext()) { reader.close(); reader = null; break; } poems.add(readPoem()); } return poems; } private Poem readPoem() throws IOException { int gold = -1; int score = -1; String content = null; double timestamp = -1; String post_title = null; String post_author = null; String post_content = null; String post_url = null; List<ParentComment> parents = null; String link = null; Poem main_poem = null; boolean read = false; boolean favorite = false; reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); JsonToken check = reader.peek(); if (check == JsonToken.NULL) { reader.skipValue(); continue; } switch (name) { case "gold": gold = reader.nextInt(); break; case "score": score = reader.nextInt(); break; case "link": link = reader.nextString(); main_poem = mainpoem_links.get(link); break; case "orig_content": content = reader.nextString().replace("^", ""); break; case "timestamp": timestamp = reader.nextDouble(); break; case "submission_title": post_title = reader.nextString(); break; case "submission_url": post_url = reader.nextString(); break; case "submission_user": post_author = formatUsername(reader.nextString()); break; case "orig_submission_content": post_content = reader.nextString().replace("^", ""); break; case "parents": parents = readParentCommentArray(); break; default: reader.skipValue(); break; } } reader.endObject(); CharSequence first_line; first_line = markdownConverter.convertMarkdown( content.trim().split("\n", 2)[0].trim() + "..."); if (read_poems.contains(link)) { read = true; } if (favorite_poems.contains(link)) { favorite = true; } Poem poem = new Poem(gold, score, content, first_line, timestamp, post_title, post_author, post_content, post_url, parents, link, main_poem, read, favorite); if (main_poem == null) { // add parent comments of this poem which are poems to mainpoem_links for (ParentComment p : poem.parents) { if (p.author.equalsIgnoreCase("/u/poem_for_your_sprog")) { mainpoem_links.put(p.link, poem); } } } else { // if this poem is the parent of another one put it into the corresponding ParentComment for (ParentComment p : main_poem.parents) { if (p.link.equals(poem.link)) { p.is_poem = poem; } } } return poem; } private List<ParentComment> readParentCommentArray() throws IOException { List<ParentComment> parents = new ArrayList<>(); reader.beginArray(); while (reader.hasNext()) { parents.add(readParentComment()); } reader.endArray(); return parents; } private ParentComment readParentComment() throws IOException { String content = null; String author = null; String link = null; reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); JsonToken check = reader.peek(); if (check == JsonToken.NULL) { reader.skipValue(); continue; } switch (name) { case "author": author = formatUsername(reader.nextString()); break; case "orig_body": content = reader.nextString().replace("^", ""); break; case "link": link = reader.nextString(); break; default: reader.skipValue(); break; } } reader.endObject(); return new ParentComment(content, author, link); } private static String formatUsername(String username) { username = username.replace("\\_", "_"); if (username.equals("(deleted user)")) { return username; } else { return "/u/" + username; } } }
package org.spine3.base; import com.google.common.primitives.Ints; import com.google.common.primitives.Longs; import java.lang.reflect.Type; import java.util.List; import java.util.Map; import static com.google.common.base.Preconditions.checkNotNull; import static org.spine3.base.StringifierRegistry.getStringifier; /** * Utility class for working with {@code Stringifier}s. * * @author Alexander Yevsyukov * @author Illia Shepilov */ public class Stringifiers { private Stringifiers() { // Disable instantiation of this utility class. } /** * Converts the passed value to the string representation. * * <p>Use this method for converting non-generic objects. For generic objects, * please use {@link #toString(Object, Type)}. * * @param object the object to convert * @param <T> the type of the object * @return the string representation of the passed object */ public static <T> String toString(T object) { checkNotNull(object); return toString(object, object.getClass()); } /** * Converts the passed value to the string representation. * * <p>This method must be used of the passed object is a generic type. * * @param object to object to convert * @param typeOfT the type of the passed object * @param <T> the type of the object to convert * @return the string representation of the passed object * @throws MissingStringifierException if passed value cannot be converted */ public static <T> String toString(T object, Type typeOfT) { checkNotNull(object); checkNotNull(typeOfT); final Stringifier<T> stringifier = getStringifier(typeOfT); final String result = stringifier.convert(object); return result; } /** * Converts string value to the specified type. * * @param str the string to convert * @param typeOfT the type into which to convert the string * @param <T> the type of the value to return * @return the parsed value from string * @throws MissingStringifierException if passed value cannot be converted */ public static <T> T fromString(String str, Type typeOfT) { checkNotNull(str); checkNotNull(typeOfT); final Stringifier<T> stringifier = getStringifier(typeOfT); final T result = stringifier.reverse() .convert(str); return result; } /** * Obtains {@code Stringifier} for the map with default delimiter for the passed map elements. * * @param keyClass the class of keys are maintained by this map * @param valueClass the class of mapped values * @param <K> the type of keys are maintained by this map * @param <V> the type of the values stored in this map * @return the stringifier for the map */ public static <K, V> Stringifier<Map<K, V>> mapStringifier(Class<K> keyClass, Class<V> valueClass) { checkNotNull(keyClass); checkNotNull(valueClass); final Stringifier<Map<K, V>> mapStringifier = new MapStringifier<>(keyClass, valueClass); return mapStringifier; } /** * Obtains {@code Stringifier} for the map with custom delimiter for the passed map elements. * * @param keyClass the class of keys are maintained by this map * @param valueClass the class of mapped values * @param delimiter the delimiter for the passed map elements via string * @param <K> the type of keys are maintained by this map * @param <V> the type of mapped values * @return the stringifier for the map */ public static <K, V> Stringifier<Map<K, V>> mapStringifier(Class<K> keyClass, Class<V> valueClass, String delimiter) { checkNotNull(keyClass); checkNotNull(valueClass); checkNotNull(delimiter); final Stringifier<Map<K, V>> mapStringifier = new MapStringifier<>(keyClass, valueClass, delimiter); return mapStringifier; } /** * Obtains {@code Stringifier} for list with default delimiter for the passed list elements. * * @param elementClass the class of the list elements * @param <T> the type of the elements in this list * @return the stringifier for the list */ public static <T> Stringifier<List<T>> listStringifier(Class<T> elementClass) { checkNotNull(elementClass); final Stringifier<List<T>> listStringifier = new ListStringifier<>(elementClass); return listStringifier; } /** * Obtains {@code Stringifier} for list with custom delimiter for the passed list elements. * * @param elementClass the class of the list elements * @param delimiter the delimiter or the list elements passed via string * @param <T> the type of the elements in this list * @return the stringifier for the list */ public static <T> Stringifier<List<T>> listStringifier(Class<T> elementClass, String delimiter) { checkNotNull(elementClass); checkNotNull(delimiter); final Stringifier<List<T>> listStringifier = new ListStringifier<>(elementClass, delimiter); return listStringifier; } /** * Converts from string to the specified type. * * @param elementToConvert string to convert * @param elementClass the class of the converted element * @param <I> the class type of the converted element * @return the converted string */ @SuppressWarnings("unchecked") // It is OK because class is verified. static <I> I convert(String elementToConvert, Class<I> elementClass) { checkNotNull(elementToConvert); checkNotNull(elementClass); if (isInteger(elementClass)) { return (I) Ints.stringConverter() .convert(elementToConvert); } if (isLong(elementClass)) { return (I) Longs.stringConverter() .convert(elementToConvert); } if (isString(elementClass)) { return (I) elementToConvert; } final I convertedValue = fromString(elementToConvert, elementClass); return convertedValue; } private static boolean isString(Class<?> aClass) { return String.class.equals(aClass); } private static boolean isLong(Class<?> aClass) { return Long.class.equals(aClass); } private static boolean isInteger(Class<?> aClass) { return Integer.class.equals(aClass); } }
package com.bitfire.postprocessing; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.Pixmap.Format; import com.badlogic.gdx.graphics.Texture.TextureWrap; import com.badlogic.gdx.graphics.glutils.FrameBuffer; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Disposable; import com.bitfire.utils.ItemsManager; /** Provides a way to capture the rendered scene to an off-screen buffer * and to apply a chain of effects on it before rendering to screen. * * Effects can be added or removed via {@link #addEffect(PostProcessorEffect)} * and {@link #removeEffect(PostProcessorEffect)}. * * @author bmanuel */ public final class PostProcessor implements Disposable { private static Format fbFormat; private final PingPongBuffer composite; private TextureWrap compositeWrapU; private TextureWrap compositeWrapV; private final ItemsManager<PostProcessorEffect> effectsManager = new ItemsManager<PostProcessorEffect>(); private final Array<PingPongBuffer> buffers = new Array<PingPongBuffer>( 5 ); private final Color clearColor = Color.CLEAR; private int clearBits = GL10.GL_COLOR_BUFFER_BIT; private float clearDepth = 1f; private boolean enabled = true; private boolean capturing = false; private boolean hasCaptured = false; // maintains a per-frame updated list of enabled effects private Array<PostProcessorEffect> enabledEffects = new Array<PostProcessorEffect>( 5 ); /** Construct a new PostProcessor with FBO dimensions set to the size of the * screen */ public PostProcessor( boolean useDepth, boolean useAlphaChannel, boolean use32Bits ) { this( Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), useDepth, useAlphaChannel, use32Bits ); } /** Construct a new PostProcessor with the given parameters. */ public PostProcessor( int fboWidth, int fboHeight, boolean useDepth, boolean useAlphaChannel, boolean use32Bits ) { this( fboWidth, fboHeight, useDepth, useAlphaChannel, use32Bits, TextureWrap.ClampToEdge, TextureWrap.ClampToEdge ); } public PostProcessor( int fboWidth, int fboHeight, boolean useDepth, boolean useAlphaChannel, boolean use32Bits, TextureWrap u, TextureWrap v ) { if( use32Bits ) { if( useAlphaChannel ) { fbFormat = Format.RGBA8888; } else { fbFormat = Format.RGB888; } } else { if( useAlphaChannel ) { fbFormat = Format.RGBA4444; } else { fbFormat = Format.RGB565; } } composite = newPingPongBuffer( fboWidth, fboHeight, fbFormat, useDepth ); setBufferTextureWrap( u, v ); capturing = false; hasCaptured = false; } /** Creates and returns a managed PingPongBuffer buffer, just create and * forget. * This is a drop-in replacement for the same-signature PingPongBuffer's * constructor. */ public PingPongBuffer newPingPongBuffer( int width, int height, Format frameBufferFormat, boolean hasDepth ) { PingPongBuffer buffer = new PingPongBuffer( width, height, frameBufferFormat, hasDepth ); buffers.add( buffer ); return buffer; } /** Frees owned resources. */ @Override public void dispose() { effectsManager.dispose(); // cleanup managed buffers, if any for( int i = 0; i < buffers.size; i++ ) { buffers.get( i ).dispose(); } buffers.clear(); if( enabledEffects != null ) { enabledEffects.clear(); } } /** Whether or not the post-processor is enabled */ public boolean isEnabled() { return enabled; } /** Sets whether or not the post-processor should be enabled */ public void setEnabled( boolean enabled ) { this.enabled = enabled; } /** Returns the number of the currently enabled effects */ public int getEnabledEffectsCount() { return enabledEffects.size; } /** Adds the specified effect to the effect chain and transfer ownership * to the PostProcessor, it will manage cleaning it up for you. * The order of the inserted effects IS important, since effects will be * applied in a FIFO fashion, the first added * is the first being applied. */ public void addEffect( PostProcessorEffect effect ) { effectsManager.add( effect ); } /** Removes the specified effect from the effect chain. */ public void removeEffect( PostProcessorEffect effect ) { effectsManager.remove( effect ); } /** Returns the internal framebuffer format, computed from the * parameters specified during construction. * NOTE: the returned Format will be valid after construction and NOT early! */ public static Format getFramebufferFormat() { return fbFormat; } /** Sets the color that will be used to clear the buffer. */ public void setClearColor( Color color ) { clearColor.set( color ); } /** Sets the color that will be used to clear the buffer. */ public void setClearColor( float r, float g, float b, float a ) { clearColor.set( r, g, b, a ); } /** Sets the clear bit for when glClear is invoked. */ public void setClearBits( int bits ) { clearBits = bits; } /** Sets the depth value with which to clear the depth buffer when needed. */ public void setClearDepth( float depth ) { clearDepth = depth; } public void setBufferTextureWrap( TextureWrap u, TextureWrap v ) { compositeWrapU = u; compositeWrapV = v; composite.texture1.setWrap( compositeWrapU, compositeWrapV ); composite.texture2.setWrap( compositeWrapU, compositeWrapV ); } /** Starts capturing the scene, clears the buffer with the clear * color specified by {@link #setClearColor(Color)} or * {@link #setClearColor(float r, float g, float b, float a)}. * * @return true or false, whether or not capturing has been initiated. * Capturing will fail in case there are no enabled effects in the * chain or * this instance is not enabled or capturing is already started. */ public boolean capture() { hasCaptured = false; if( enabled && !capturing ) { if( buildEnabledEffectsList() == 0 ) { // no enabled effects // Gdx.app.log( "PostProcessor::capture()", // "No post-processor effects enabled" ); return false; } capturing = true; composite.begin(); composite.capture(); Gdx.gl.glClearColor( clearColor.r, clearColor.g, clearColor.b, clearColor.a ); Gdx.gl.glClearDepthf( clearDepth ); Gdx.gl.glClear( clearBits ); return true; } return false; } /** Starts capturing the scene as {@link #capture()}, but * <strong>without</strong> clearing the screen. * * @return true or false, whether or not capturing has been initiated. */ public boolean captureNoClear() { hasCaptured = false; if( enabled && !capturing ) { if( buildEnabledEffectsList() == 0 ) { // no enabled effects // Gdx.app.log( "PostProcessor::captureNoClear", // "No post-processor effects enabled" ); return false; } capturing = true; composite.begin(); composite.capture(); return true; } return false; } /** Stops capturing the scene and returns the result, or null if nothing was * captured. */ public FrameBuffer captureEnd() { if( enabled && capturing ) { capturing = false; hasCaptured = true; composite.end(); return composite.getResultBuffer(); } return null; } /** After a capture/captureEnd action, returns the just captured buffer */ public FrameBuffer captured() { if( enabled && hasCaptured ) { return composite.getResultBuffer(); } return null; } /** Regenerates and/or rebinds owned resources when needed, eg. when * the OpenGL context is lost. */ public void rebind() { composite.texture1.setWrap( compositeWrapU, compositeWrapV ); composite.texture2.setWrap( compositeWrapU, compositeWrapV ); for( int i = 0; i < buffers.size; i++ ) { buffers.get( i ).rebind(); } Array<PostProcessorEffect> items = effectsManager.items; for( int i = 0; i < items.size; i++ ) { items.get( i ).rebind(); } } /** Stops capturing the scene and apply the effect chain, if there is one. * If the specified output framebuffer is NULL, then the rendering will be * performed to screen. */ public void render( FrameBuffer dest ) { captureEnd(); if( !hasCaptured ) { return; } // Array<PostProcessorEffect> items = manager.items; Array<PostProcessorEffect> items = enabledEffects; int count = items.size; if( count > 0 ) { // render effects chain, [0,n-1] if( count > 1 ) { for( int i = 0; i < count - 1; i++ ) { PostProcessorEffect e = items.get( i ); composite.capture(); { e.render( composite.getSourceBuffer(), composite.getResultBuffer() ); } } // complete composite.end(); } // render with null dest (to screen) items.get( count - 1 ).render( composite.getResultBuffer(), dest ); } else { Gdx.app.log( "PostProcessor", "No post-processor effects enabled, aborting render" ); } } private int buildEnabledEffectsList() { enabledEffects.clear(); Array<PostProcessorEffect> items = effectsManager.items; for( int i = 0; i < items.size; i++ ) { PostProcessorEffect effect = items.get( i ); if( effect.isEnabled() ) { enabledEffects.add( effect ); } } return enabledEffects.size; } }
package com.honu.giftwise; import android.content.ContentValues; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.NavUtils; import android.text.TextUtils; import android.util.Log; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.AutoCompleteTextView; import android.widget.EditText; import android.widget.Toast; import com.honu.giftwise.data.GiftwiseContract; import com.honu.giftwise.data.Size; import butterknife.Bind; import butterknife.ButterKnife; public class EditSizeFragment extends Fragment { private static final String LOG_TAG = EditSizeFragment.class.getSimpleName(); private Size size; @Bind(R.id.size_notes) EditText mNotesEdit; @Bind(R.id.item_spinner) AutoCompleteTextView mItemAutocomplete; @Bind(R.id.size_spinner) AutoCompleteTextView mSizeAutocomplete; public static EditSizeFragment getInstance(Size size) { EditSizeFragment fragment = new EditSizeFragment(); // Attach some data needed to populate our fragment layouts Bundle args = new Bundle(); args.putParcelable("size", size); // Set the arguments on the fragment that will be fetched by the edit activity fragment.setArguments(args); return fragment; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_edit_size, container, false); ButterKnife.bind(this, rootView); // Get the Id of the raw contact Bundle args = getArguments(); size = args.getParcelable("size"); // Populate fields from parcelable if (!TextUtils.isEmpty(size.getItem())) mItemAutocomplete.setText(size.getItem()); if (!TextUtils.isEmpty(size.getSize())) mSizeAutocomplete.setText(size.getSize()); if (!TextUtils.isEmpty(size.getNotes())) mNotesEdit.setText(size.getNotes()); // initialize the auto-complete textviews initItemView(rootView); initSizeView(rootView); // repopulate form fields from state: if (savedInstanceState != null) { mItemAutocomplete.setText(savedInstanceState.getString("size_item")); mSizeAutocomplete.setText(savedInstanceState.getString("size_size")); mNotesEdit.setText(savedInstanceState.getString("size_notes")); } // show options menu setHasOptionsMenu(true); return rootView; } @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); // save values to bundle outState.putString("size_item", mItemAutocomplete.getText().toString()); outState.putString("size_size", mSizeAutocomplete.getText().toString()); outState.putString("size_notes", mNotesEdit.getText().toString()); } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == android.R.id.home) { Log.i(LOG_TAG, "navigation icon clicked"); if (createOrSaveSize()) { Intent intent = NavUtils.getParentActivityIntent(getActivity()); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); NavUtils.navigateUpTo(getActivity(), intent); } return true; } return super.onOptionsItemSelected(item); } private void initItemView(View rootView) { ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(getActivity(), R.array.clothing_choices, android.R.layout.simple_dropdown_item_1line); mItemAutocomplete.setAdapter(adapter); } private void initSizeView(View rootView) { ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(getActivity(), R.array.size_choices, android.R.layout.simple_dropdown_item_1line); mSizeAutocomplete.setAdapter(adapter); } private boolean createOrSaveSize() { ContentValues values = new ContentValues(); String itemName = mItemAutocomplete.getText().toString(); String sizeName = mSizeAutocomplete.getText().toString(); if (TextUtils.isEmpty(itemName)) { Toast.makeText(getActivity(), "Item name is required", Toast.LENGTH_LONG).show(); mItemAutocomplete.requestFocus(); return false; } if (TextUtils.isEmpty(sizeName)) { Toast.makeText(getActivity(), "Size is required", Toast.LENGTH_LONG).show(); mSizeAutocomplete.requestFocus(); return false; } values.put(GiftwiseContract.SizeEntry.COLUMN_SIZE_GIFTWISE_ID, size.getGiftwiseId()); values.put(GiftwiseContract.SizeEntry.COLUMN_SIZE_ITEM_NAME, itemName); values.put(GiftwiseContract.SizeEntry.COLUMN_SIZE_NAME, sizeName); values.put(GiftwiseContract.SizeEntry.COLUMN_SIZE_NOTES, mNotesEdit.getText().toString()); Uri uri = GiftwiseContract.SizeEntry.buildSizesForGiftwiseIdUri(size.getGiftwiseId()); // insert or update the database if (size.getSizeId() == -1) { getActivity().getContentResolver().insert(uri, values); } else { String selection = GiftwiseContract.GiftEntry._ID + " = ?"; String[] selectionArgs = new String[]{size.getSizeId() + ""}; getActivity().getContentResolver().update(uri, values, selection, selectionArgs); } return true; } }
package com.nokia.mid.ui; import android.util.Log; import javax.microedition.lcdui.Graphics; import javax.microedition.lcdui.Image; import javax.microedition.lcdui.game.Sprite; public class DirectGraphicsImp implements DirectGraphics { private static String TAG = DirectGraphicsImp.class.getName(); private Graphics graphics; private int alphaComponent; public DirectGraphicsImp(Graphics g) { graphics = g; } @Override public void drawImage(Image img, int x, int y, int anchor, int manipulation) { if (img == null) { throw new NullPointerException(); } int transform = getTransformation(manipulation); if (anchor >= 64 || transform == -1) { throw new IllegalArgumentException(); } else { graphics.drawRegion(img, 0, 0, img.getWidth(), img.getHeight(), transform, x, y, anchor); } } @Override public void setARGBColor(int argb) { alphaComponent = (argb >> 24 & 0xff); graphics.setColorAlpha(argb); } @Override public int getAlphaComponent() { return alphaComponent; } @Override public int getNativePixelFormat() { return TYPE_INT_8888_ARGB; } @Override public void drawPolygon(int xPoints[], int xOffset, int yPoints[], int yOffset, int nPoints, int argbColor) { setARGBColor(argbColor); graphics.drawPolygon(xPoints, xOffset, yPoints, yOffset, nPoints); } @Override public void drawTriangle(int x1, int y1, int x2, int y2, int x3, int y3, int argbColor) { drawPolygon(new int[]{x1, x2, x3}, 0, new int[]{y1, y2, y3}, 0, 3, argbColor); } @Override public void fillPolygon(int xPoints[], int xOffset, int yPoints[], int yOffset, int nPoints, int argbColor) { setARGBColor(argbColor); graphics.fillPolygon(xPoints, xOffset, yPoints, yOffset, nPoints); } @Override public void fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3, int argbColor) { fillPolygon(new int[]{x1, x2, x3}, 0, new int[]{y1, y2, y3}, 0, 3, argbColor); } @Override public void drawPixels(byte[] pix, byte[] alpha, int off, int scanlen, int x, int y, int width, int height, int manipulation, int format) { if (pix == null) { throw new NullPointerException(); } if (width < 0 || height < 0) { throw new IllegalArgumentException(); } if (width == 0 || height == 0) { return; } int transform = getTransformation(manipulation); int[] pixres = new int[height * width]; switch (format) { case TYPE_BYTE_1_GRAY: { int b = 7; for (int yj = 0; yj < height; yj++) { int line = off + yj * scanlen; int ypos = yj * width; for (int xj = 0; xj < width; xj++) { int c = doAlpha(pix, alpha, (line + xj) / 8, b); if (!isTransparent(c)) { //alpha pixres[ypos + xj] = c; } b if (b < 0) b = 7; } } break; } case TYPE_BYTE_1_GRAY_VERTICAL: { int ods = off / scanlen; int oms = off % scanlen; int b = ods % 8; for (int yj = 0; yj < height; yj++) { int ypos = yj * width; int tmp = (ods + yj) / 8 * scanlen + oms; for (int xj = 0; xj < width; xj++) { int c = doAlpha(pix, alpha, tmp + xj, b); if (!isTransparent(c)) { //alpha pixres[ypos + xj] = c; } } b++; if (b > 7) b = 0; } break; } default: throw new IllegalArgumentException("Illegal format: " + format); } Image image = Image.createRGBImage(pixres, width, height, true); graphics.drawRegion(image, 0, 0, width, height, transform, x, y, 0); } @Override public void drawPixels(short pix[], boolean trans, int off, int scanlen, int x, int y, int width, int height, int manipulation, int format) { if (pix == null) { throw new NullPointerException(); } if (format != TYPE_USHORT_4444_ARGB && format != TYPE_USHORT_444_RGB) { throw new IllegalArgumentException("Illegal format: " + format); } if (width < 0 || height < 0) { throw new IllegalArgumentException(); } if (width == 0 || height == 0) { return; } int transform = getTransformation(manipulation); int[] pixres = new int[height * width]; for (int iy = 0; iy < height; iy++) { for (int ix = 0; ix < width; ix++) { int c = toARGB32(pix[off + ix + iy * scanlen], format); if (format == TYPE_USHORT_444_RGB) { c |= (0xFF << 24); } pixres[iy * width + ix] = c; } } Image image = Image.createRGBImage(pixres, width, height, true); graphics.drawRegion(image, 0, 0, width, height, transform, x, y, 0); } @Override public void drawPixels(int pix[], boolean trans, int off, int scanlen, int x, int y, int width, int height, int manipulation, int format) { if (pix == null) { throw new NullPointerException(); } if (format != TYPE_INT_888_RGB && format != TYPE_INT_8888_ARGB) { throw new IllegalArgumentException("Illegal format: " + format); } if (width < 0 || height < 0) { throw new IllegalArgumentException(); } if (width == 0 || height == 0) { return; } int transform = getTransformation(manipulation); int[] pixres = new int[height * width]; for (int iy = 0; iy < height; iy++) { for (int ix = 0; ix < width; ix++) { int c = pix[off + ix + iy * scanlen]; if (format == TYPE_INT_888_RGB) { c |= (0xFF << 24); } pixres[iy * width + ix] = c; } } Image image = Image.createRGBImage(pixres, width, height, true); graphics.drawRegion(image, 0, 0, width, height, transform, x, y, 0); } @Override public void getPixels(byte pix[], byte alpha[], int offset, int scanlen, int x, int y, int width, int height, int format) { Log.e(TAG, "public void getPixels(byte pix[], byte alpha[], int offset, int scanlen, int x, int y, int width, int height, int format)"); } @Override public void getPixels(short pix[], int offset, int scanlen, int x, int y, int width, int height, int format) { if (pix == null) { throw new NullPointerException(); } if (format != TYPE_USHORT_444_RGB && format != TYPE_USHORT_4444_ARGB) { throw new IllegalArgumentException("Illegal format: " + format); } if (width < 0 || height < 0) { throw new IllegalArgumentException(); } if (width == 0 || height == 0) { return; } int[] pixres = new int[offset + scanlen * height]; graphics.getPixels(pixres, offset, scanlen, x, y, width, height); for (int iy = 0; iy < height; iy++) { for (int ix = 0; ix < width; ix++) { short c = toARGB16(pixres[offset + ix + iy * scanlen], format); if (format == TYPE_USHORT_444_RGB) { c |= (0xF << 12); } pix[offset + iy * scanlen + ix] = c; } } } @Override public void getPixels(int pix[], int offset, int scanlen, int x, int y, int width, int height, int format) { if (pix == null) { throw new NullPointerException(); } if (format != TYPE_INT_888_RGB && format != TYPE_INT_8888_ARGB) { throw new IllegalArgumentException("Illegal format: " + format); } if (width < 0 || height < 0) { throw new IllegalArgumentException(); } if (width == 0 || height == 0) { return; } int[] pixres = new int[offset + scanlen * height]; graphics.getPixels(pixres, offset, scanlen, x, y, width, height); for (int iy = 0; iy < height; iy++) { for (int ix = 0; ix < width; ix++) { int c = pixres[offset + ix + iy * scanlen]; if (format == TYPE_INT_888_RGB) { c |= (0xFF << 24); } pix[offset + iy * scanlen + ix] = c; } } } private static int doAlpha(byte[] pix, byte[] alpha, int pos, int shift) { int p; int a; if (isBitSet(pix[pos], shift)) p = 0; else p = 0x00FFFFFF; if (alpha == null || isBitSet(alpha[pos], shift)) a = 0xFF000000; else a = 0; return p | a; } private static boolean isBitSet(byte b, int pos) { return ((b & (byte) (1 << pos)) != 0); } private static int toARGB32(short s, int type) { int result = 0; switch (type) { case TYPE_USHORT_4444_ARGB: { int a = ((s) & 0xF000) >>> 12; int r = ((s) & 0x0F00) >>> 8; int g = ((s) & 0x00F0) >>> 4; int b = ((s) & 0x000F); result = (a << 28) | (r << 20) | (g << 12) | (b << 4); break; } case TYPE_USHORT_444_RGB: { int r = ((s) & 0x0F00) >>> 8; int g = ((s) & 0x00F0) >>> 4; int b = ((s) & 0x000F); result = (r << 20) | (g << 12) | (b << 4); break; } } return result; } private static short toARGB16(int s, int type) { short result = 0; switch (type) { case TYPE_USHORT_4444_ARGB: { int a = ((s) & 0xFF000000) >>> 28; int r = ((s) & 0x00FF0000) >>> 20; int g = ((s) & 0x0000FF00) >>> 12; int b = ((s) & 0x000000FF) >>> 4; result = (short) ((a << 12) | (r << 8) | (g << 4) | b); break; } case TYPE_USHORT_444_RGB: { int r = ((s) & 0x00FF0000) >>> 20; int g = ((s) & 0x0000FF00) >>> 12; int b = ((s) & 0x000000FF) >>> 4; result = (short) ((r << 8) | (g << 4) | b); break; } } return result; } private static boolean isTransparent(int s) { return (s & 0xFF000000) == 0; } private static int getTransformation(int manipulation) { // manipulations are C-CW and sprite rotations are CW int ret = -1; int rotation = manipulation & 0x0FFF; if ((manipulation & FLIP_HORIZONTAL) != 0) { if ((manipulation & FLIP_VERTICAL) != 0) { // horiz and vertical flipping switch (rotation) { case 0: ret = Sprite.TRANS_ROT180; break; case ROTATE_90: ret = Sprite.TRANS_ROT90; break; case ROTATE_180: ret = Sprite.TRANS_NONE; break; case ROTATE_270: ret = Sprite.TRANS_ROT270; break; default: } } else { // horizontal flipping switch (rotation) { case 0: ret = Sprite.TRANS_MIRROR; break; case ROTATE_90: ret = Sprite.TRANS_MIRROR_ROT90; break; case ROTATE_180: ret = Sprite.TRANS_MIRROR_ROT180; break; case ROTATE_270: ret = Sprite.TRANS_MIRROR_ROT270; break; default: } } } else { if ((manipulation & FLIP_VERTICAL) != 0) { // vertical flipping switch (rotation) { case 0: ret = Sprite.TRANS_MIRROR_ROT180; break; case ROTATE_90: ret = Sprite.TRANS_MIRROR_ROT270; break; case ROTATE_180: ret = Sprite.TRANS_MIRROR; break; case ROTATE_270: ret = Sprite.TRANS_MIRROR_ROT90; break; default: } } else { // no flipping switch (rotation) { case 0: ret = Sprite.TRANS_NONE; break; case ROTATE_90: ret = Sprite.TRANS_ROT270; break; case ROTATE_180: ret = Sprite.TRANS_ROT180; break; case ROTATE_270: ret = Sprite.TRANS_ROT90; break; default: } } } return ret; } }
package org.eclipse.mylyn.internal.tasks.core.externalization; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.ISafeRunnable; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.MultiStatus; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.SafeRunner; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.core.runtime.jobs.ISchedulingRule; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.mylyn.commons.core.CoreUtil; import org.eclipse.mylyn.commons.core.StatusHandler; import org.eclipse.mylyn.commons.net.Policy; import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants; import org.eclipse.mylyn.internal.tasks.core.externalization.IExternalizationContext.Kind; /** * @author Rob Elves * @since 3.0 */ public class ExternalizationManager { private static final int LAZY_SAVE_DELAY = 1000 * 60; private static final int SAVE_DELAY = 3000; private final ExternalizationJob saveJob; private IStatus loadStatus; private String rootFolderPath; private static volatile boolean saveDisabled = false; private final List<IExternalizationParticipant> externalizationParticipants; private boolean forceSave = false; public ExternalizationManager(String rootFolderPath) { Assert.isNotNull(rootFolderPath); this.externalizationParticipants = new CopyOnWriteArrayList<IExternalizationParticipant>(); this.forceSave = false; this.saveJob = createJob(); setRootFolderPath(rootFolderPath); } private ExternalizationJob createJob() { ExternalizationJob job = new ExternalizationJob("Task List Save Job"); job.setUser(false); job.setSystem(true); return job; } public void addParticipant(IExternalizationParticipant participant) { Assert.isNotNull(participant); externalizationParticipants.add(participant); } public IStatus load() { try { saveDisabled = true; loadStatus = null; List<IStatus> statusList = new ArrayList<IStatus>(); IProgressMonitor monitor = Policy.monitorFor(null); for (IExternalizationParticipant participant : externalizationParticipants) { IStatus status = load(participant, monitor); if (status != null) { statusList.add(status); } } if (statusList.size() > 0) { loadStatus = new MultiStatus(ITasksCoreConstants.ID_PLUGIN, IStatus.ERROR, statusList.toArray(new IStatus[0]), "Failed to load Task List", null); } return loadStatus; } finally { saveDisabled = false; } } private IStatus load(final IExternalizationParticipant participant, final IProgressMonitor monitor) { final IStatus[] result = new IStatus[1]; final ExternalizationContext context = new ExternalizationContext(Kind.LOAD, rootFolderPath); ISchedulingRule rule = participant.getSchedulingRule(); try { Job.getJobManager().beginRule(rule, monitor); SafeRunner.run(new ISafeRunnable() { public void handleException(Throwable e) { if (e instanceof CoreException) { result[0] = ((CoreException) e).getStatus(); } else { result[0] = new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Load participant failed", e); } } public void run() throws Exception { participant.execute(context, monitor); } }); } finally { Job.getJobManager().endRule(rule); } return result[0]; } public void setRootFolderPath(String rootFolderPath) { Assert.isNotNull(rootFolderPath); this.rootFolderPath = rootFolderPath; saveJob.setContext(new ExternalizationContext(Kind.SAVE, rootFolderPath)); } public void requestSave() { if (!saveDisabled) { if (!CoreUtil.TEST_MODE) { saveJob.schedule(SAVE_DELAY); } else { saveJob.run(new NullProgressMonitor()); } } } public void stop() { try { saveDisabled = true; // run save job as early as possible saveJob.wakeUp(); saveJob.join(); } catch (InterruptedException e) { StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Task List save on shutdown canceled.", e)); } } public void requestSaveAndWait(boolean force) throws InterruptedException { try { forceSave = force; saveJob.schedule(); saveJob.join(); } finally { forceSave = false; } } public IStatus getLoadStatus() { return loadStatus; } private class ExternalizationJob extends Job { private volatile IExternalizationContext context; public ExternalizationJob(String jobTitle) { super(jobTitle); } public IExternalizationContext getContext() { return context; } public void setContext(IExternalizationContext saveContext) { this.context = saveContext; } @Override protected IStatus run(IProgressMonitor monitor) { IExternalizationContext context = this.context; switch (context.getKind()) { case SAVE: try { monitor.beginTask("Saving...", externalizationParticipants.size()); for (IExternalizationParticipant participant : externalizationParticipants) { ISchedulingRule rule = participant.getSchedulingRule(); if (forceSave || participant.isDirty()) { try { Job.getJobManager().beginRule(rule, monitor); monitor.setTaskName("Saving " + participant.getDescription()); participant.execute(context, new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN)); } catch (CoreException e) { StatusHandler.log(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, "Save failed for " + participant.getDescription(), e)); } finally { Job.getJobManager().endRule(rule); } } monitor.worked(1); } } finally { monitor.done(); } break; default: StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Unsupported externalization kind: " + context.getKind())); } return Status.OK_STATUS; } } private class ExternalizationContext implements IExternalizationContext { private final Kind kind; private final String rootPath; public ExternalizationContext(IExternalizationContext.Kind kind, String rootPath) { this.kind = kind; this.rootPath = rootPath; } public Kind getKind() { return kind; } public String getRootPath() { return rootPath; } } }
package me.devsaki.hentoid.core; import android.app.NotificationManager; import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.os.Build; import android.os.Handler; import android.os.Looper; import android.webkit.WebView; import androidx.annotation.NonNull; import com.google.firebase.analytics.FirebaseAnalytics; import com.google.firebase.crashlytics.FirebaseCrashlytics; import com.thin.downloadmanager.util.Log; import org.greenrobot.eventbus.EventBus; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import java.util.Map; import io.reactivex.Observable; import io.reactivex.ObservableEmitter; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.Disposable; import io.reactivex.functions.BiConsumer; import io.reactivex.functions.Consumer; import io.reactivex.schedulers.Schedulers; import me.devsaki.hentoid.BuildConfig; import me.devsaki.hentoid.R; import me.devsaki.hentoid.database.DatabaseMaintenance; import me.devsaki.hentoid.enums.Site; import me.devsaki.hentoid.events.AppUpdatedEvent; import me.devsaki.hentoid.json.JsonSiteSettings; import me.devsaki.hentoid.notification.download.DownloadNotificationChannel; import me.devsaki.hentoid.notification.update.UpdateNotificationChannel; import me.devsaki.hentoid.services.UpdateCheckService; import me.devsaki.hentoid.util.FileHelper; import me.devsaki.hentoid.util.Helper; import me.devsaki.hentoid.util.JsonHelper; import me.devsaki.hentoid.util.Preferences; import me.devsaki.hentoid.util.network.HttpHelper; import me.devsaki.hentoid.views.NestedScrollWebView; import timber.log.Timber; public class AppStartup { private List<Observable<Float>> launchTasks; private Disposable launchDisposable = null; private static boolean isInitialized = false; public void initApp( @NonNull final Context context, @NonNull Consumer<Float> onMainProgress, @NonNull Consumer<Float> onSecondaryProgress, @NonNull Runnable onComplete ) { if (isInitialized) onComplete.run(); // Wait until launch tasks are completed launchTasks = getPreLaunchTasks(context); launchTasks.addAll(DatabaseMaintenance.getPreLaunchCleanupTasks(context)); // TODO execute post-launch tasks in another runner (background worker ?) launchTasks.addAll(getPostLaunchTasks(context)); launchTasks.addAll(DatabaseMaintenance.getPostLaunchCleanupTasks(context)); // TODO switch from a recursive function to a full RxJava-powered chain + clear the disposable elsewhere (as the chain will finish in a worker) doRunTask(0, onMainProgress, onSecondaryProgress, onComplete); } private void doRunTask( int taskIndex, @NonNull Consumer<Float> onMainProgress, @NonNull Consumer<Float> onSecondaryProgress, @NonNull Runnable onComplete ) { if (launchDisposable != null) launchDisposable.dispose(); try { onMainProgress.accept(taskIndex * 1f / launchTasks.size()); } catch (Exception e) { Timber.w(e); } // Continue executing launch tasks if (taskIndex < launchTasks.size()) { Timber.i("Splash / Launch task %s/%s", taskIndex + 1, launchTasks.size()); launchDisposable = launchTasks.get(taskIndex) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe( onSecondaryProgress, Timber::e, () -> doRunTask(taskIndex + 1, onMainProgress, onSecondaryProgress, onComplete) ); } else { if (launchDisposable != null) launchDisposable.dispose(); isInitialized = true; onComplete.run(); } } /** * Application initialization tasks * NB : Heavy operations; must be performed in the background to avoid ANR at startup */ public static List<Observable<Float>> getPreLaunchTasks(@NonNull final Context context) { List<Observable<Float>> result = new ArrayList<>(); result.add(createObservableFrom(context, AppStartup::processAppUpdate)); result.add(createObservableFrom(context, AppStartup::loadSiteProperties)); result.add(createObservableFrom(context, AppStartup::initUtils)); return result; } public static List<Observable<Float>> getPostLaunchTasks(@NonNull final Context context) { List<Observable<Float>> result = new ArrayList<>(); result.add(createObservableFrom(context, AppStartup::searchForUpdates)); result.add(createObservableFrom(context, AppStartup::sendFirebaseStats)); return result; } private static Observable<Float> createObservableFrom(@NonNull final Context context, BiConsumer<Context, ObservableEmitter<Float>> function) { return Observable.create(emitter -> function.accept(context, emitter)); } private static void loadSiteProperties(@NonNull final Context context, ObservableEmitter<Float> emitter) { try (InputStream is = context.getResources().openRawResource(R.raw.sites)) { String siteSettingsStr = FileHelper.readStreamAsString(is); JsonSiteSettings siteSettings = JsonHelper.jsonToObject(siteSettingsStr, JsonSiteSettings.class); for (Map.Entry<String, JsonSiteSettings.JsonSite> entry : siteSettings.sites.entrySet()) { for (Site site : Site.values()) { if (site.name().equalsIgnoreCase(entry.getKey())) { site.updateFrom(entry.getValue()); break; } } } } catch (IOException e) { Timber.e(e); } finally { emitter.onComplete(); } } private static void initUtils(@NonNull final Context context, ObservableEmitter<Float> emitter) { try { Timber.i("Init user agents : start"); HttpHelper.initUserAgents(context); Timber.i("Init user agents : done"); Timber.i("Init notifications : start"); // Init notification channels UpdateNotificationChannel.init(context); DownloadNotificationChannel.init(context); // Clears all previous notifications NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); if (manager != null) manager.cancelAll(); Timber.i("Init notifications : done"); } finally { emitter.onComplete(); } } private static void processAppUpdate(@NonNull final Context context, ObservableEmitter<Float> emitter) { Timber.i("Process app update : start"); try { if (Preferences.getLastKnownAppVersionCode() < BuildConfig.VERSION_CODE) { Timber.d("Process app update : update detected from %s to %s", Preferences.getLastKnownAppVersionCode(), BuildConfig.VERSION_CODE); // Clear webview cache (needs to execute inside the activity's Looper) Timber.d("Process app update : Clearing webview cache"); Handler h = new Handler(Looper.getMainLooper()); h.post(() -> { WebView webView; try { webView = new NestedScrollWebView(context); } catch (Resources.NotFoundException e) { // Some older devices can crash when instantiating a WebView, due to a Resources$NotFoundException // Creating with the application Context fixes this, but is not generally recommended for view creation webView = new NestedScrollWebView(Helper.getFixedContext(context)); } webView.clearCache(true); }); // Clear app cache Timber.d("Process app update : Clearing app cache"); try { File dir = context.getCacheDir(); FileHelper.removeFile(dir); } catch (Exception e) { Timber.e(e, "Error when clearing app cache upon update"); } EventBus.getDefault().postSticky(new AppUpdatedEvent()); Preferences.setLastKnownAppVersionCode(BuildConfig.VERSION_CODE); } } finally { emitter.onComplete(); } Timber.i("Process app update : done"); } private static void searchForUpdates(@NonNull final Context context, ObservableEmitter<Float> emitter) { Timber.i("Run app update : start"); try { if (Preferences.isAutomaticUpdateEnabled()) { Timber.i("Run app update : auto-check is enabled"); Intent intent = UpdateCheckService.makeIntent(context, false); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { context.startForegroundService(intent); } else { context.startService(intent); } } } finally { emitter.onComplete(); } Timber.i("Run app update : done"); } private static void sendFirebaseStats(@NonNull final Context context, ObservableEmitter<Float> emitter) { Timber.i("Send Firebase stats : start"); try { FirebaseAnalytics.getInstance(context).setUserProperty("color_theme", Integer.toString(Preferences.getColorTheme())); FirebaseAnalytics.getInstance(context).setUserProperty("endless", Boolean.toString(Preferences.getEndlessScroll())); FirebaseCrashlytics.getInstance().setCustomKey("Library display mode", Preferences.getEndlessScroll() ? "endless" : "paged"); } catch (IllegalStateException e) { // Happens during unit tests Log.e("fail@init Crashlytics", e); } finally { emitter.onComplete(); } Timber.i("Send Firebase stats : done"); } }
package moe.yukisora.shitake.api; import android.app.Activity; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothServerSocket; import android.bluetooth.BluetoothSocket; import android.content.Intent; import android.util.Log; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util.UUID; public class Bluetooth { private static final int REQUEST_ENABLE_BLUETOOTH = 1; private static final String UUID_VALUE = "859f02dd-e6f5-4d56-826c-40f1e1bceea8"; private static Bluetooth bluetooth; private BluetoothAdapter bluetoothAdapter; private BluetoothClient client; private BluetoothServer server; private Bluetooth() { bluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); } public static Bluetooth getInstance() { if (bluetooth == null) bluetooth = new Bluetooth(); return bluetooth; } public boolean isAvailable() { return bluetoothAdapter != null; } public boolean isEnabled() { return isAvailable() && bluetoothAdapter.isEnabled(); } public void enableBluetooth(Activity activity) { if (isAvailable()) activity.startActivityForResult(new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE), REQUEST_ENABLE_BLUETOOTH); } public void setDiscoverable(Activity activity) { if (bluetoothAdapter.getScanMode() != BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE) { Intent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE); intent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 0); activity.startActivity(intent); } } public void startDiscovery() { bluetoothAdapter.startDiscovery(); } public void stopDiscovery() { bluetoothAdapter.cancelDiscovery(); } public BluetoothServer newBluetoothServer() { server = new BluetoothServer(); server.start(); return server; } public BluetoothClient newBluetoothClient(String address) { client = new BluetoothClient(address); client.start(); return client; } public BluetoothClient getClient() { return client; } public BluetoothServer getServer() { return server; } public class BluetoothServer extends Thread { private ArrayList<Client> clients; BluetoothServer() { clients = new ArrayList<>(); } public void run() { while (true) { try (BluetoothServerSocket server = bluetoothAdapter.listenUsingRfcommWithServiceRecord("shitake", UUID.fromString(UUID_VALUE))) { BluetoothSocket client; while ((client = server.accept()) == null) ; clients.add(new Client(client)); } catch (IOException ignore) { } } } public void write(String s) { for (Client client : clients) { try { client.out.write(s + "\n"); client.out.flush(); } catch (IOException ignore) { } } } private class Client { private BluetoothSocket client; private BufferedReader in; private OutputStreamWriter out; Client(BluetoothSocket client) { this.client = client; try { in = new BufferedReader(new InputStreamReader(client.getInputStream())); out = new OutputStreamWriter(client.getOutputStream()); } catch (IOException ignore) { } new Thread(new Runnable() { @Override public void run() { try { while (true) { Log.i("poi", "read: " + in.readLine()); } } catch (IOException ignore) { } } }).start(); } } } public class BluetoothClient extends Thread { private BluetoothSocket server; private BufferedReader in; private OutputStreamWriter out; private boolean isConnected; BluetoothClient(String address) { BluetoothDevice device = bluetoothAdapter.getRemoteDevice(address); try { server = device.createRfcommSocketToServiceRecord(UUID.fromString(UUID_VALUE)); } catch (IOException ignore) { } } public void run() { try { server.connect(); in = new BufferedReader(new InputStreamReader(server.getInputStream())); out = new OutputStreamWriter(server.getOutputStream()); isConnected = true; new Thread(new Runnable() { @Override public void run() { try { while (true) { Log.i("poi", "read: " + in.readLine()); } } catch (IOException ignore) { } } }).start(); } catch (IOException ignore) { } } public void write(String s) { if (isConnected) { try { out.write(s + "\n"); out.flush(); } catch (IOException ignore) { } } } } }
package org.wikipedia.feed; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.StringRes; import org.wikipedia.Constants.InvokeSource; import org.wikipedia.R; import org.wikipedia.WikipediaApp; import org.wikipedia.auth.AccountUtil; import org.wikipedia.feed.aggregated.AggregatedFeedContentClient; import org.wikipedia.feed.becauseyouread.BecauseYouReadClient; import org.wikipedia.feed.dataclient.FeedClient; import org.wikipedia.feed.mainpage.MainPageClient; import org.wikipedia.feed.random.RandomClient; import org.wikipedia.feed.suggestededits.SuggestedEditsFeedClient; import org.wikipedia.model.EnumCode; import org.wikipedia.model.EnumCodeMap; import org.wikipedia.settings.Prefs; import org.wikipedia.util.ReleaseUtil; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import static org.wikipedia.Constants.InvokeSource.FEED_CARD_SUGGESTED_EDITS_ADD_DESC; import static org.wikipedia.Constants.InvokeSource.FEED_CARD_SUGGESTED_EDITS_IMAGE_CAPTION; import static org.wikipedia.Constants.InvokeSource.FEED_CARD_SUGGESTED_EDITS_TRANSLATE_DESC; import static org.wikipedia.Constants.InvokeSource.FEED_CARD_SUGGESTED_EDITS_TRANSLATE_IMAGE_CAPTION; public enum FeedContentType implements EnumCode { NEWS(0, R.string.view_card_news_title, R.string.feed_item_type_news, true) { @Nullable @Override public FeedClient newClient(AggregatedFeedContentClient aggregatedClient, int age) { return isEnabled() && age == 0 ? new AggregatedFeedContentClient.InTheNews(aggregatedClient) : null; } }, ON_THIS_DAY(1, R.string.on_this_day_card_title, R.string.feed_item_type_on_this_day, true) { @Nullable @Override public FeedClient newClient(AggregatedFeedContentClient aggregatedClient, int age) { return isEnabled() ? new AggregatedFeedContentClient.OnThisDayFeed(aggregatedClient) : null; } }, TRENDING_ARTICLES(3, R.string.most_read_list_card_title, R.string.feed_item_type_trending, true) { @Nullable @Override public FeedClient newClient(AggregatedFeedContentClient aggregatedClient, int age) { return isEnabled() ? new AggregatedFeedContentClient.TrendingArticles(aggregatedClient) : null; } }, MAIN_PAGE(4, R.string.view_main_page_card_title, R.string.feed_item_type_main_page, false) { @Nullable @Override public FeedClient newClient(AggregatedFeedContentClient aggregatedClient, int age) { return isEnabled() && age == 0 ? new MainPageClient() : null; } }, RANDOM(5, R.string.view_random_card_title, R.string.feed_item_type_randomizer, false) { @Nullable @Override public FeedClient newClient(AggregatedFeedContentClient aggregatedClient, int age) { return isEnabled() && age % 2 == 0 ? new RandomClient() : null; } }, FEATURED_ARTICLE(6, R.string.view_featured_article_card_title, R.string.feed_item_type_featured_article, true) { @Nullable @Override public FeedClient newClient(AggregatedFeedContentClient aggregatedClient, int age) { return isEnabled() ? new AggregatedFeedContentClient.FeaturedArticle(aggregatedClient) : null; } }, FEATURED_IMAGE(7, R.string.view_featured_image_card_title, R.string.feed_item_type_featured_image, false) { @Nullable @Override public FeedClient newClient(AggregatedFeedContentClient aggregatedClient, int age) { return isEnabled() ? new AggregatedFeedContentClient.FeaturedImage(aggregatedClient) : null; } }, BECAUSE_YOU_READ(8, R.string.view_because_you_read_card_title, R.string.feed_item_type_because_you_read, false) { @Nullable @Override public FeedClient newClient(AggregatedFeedContentClient aggregatedClient, int age) { return isEnabled() ? new BecauseYouReadClient() : null; } }, SUGGESTED_EDITS(9, R.string.suggested_edits_feed_card_title, R.string.feed_item_type_suggested_edits, false, ReleaseUtil.isPreBetaRelease()) { @Nullable @Override public FeedClient newClient(AggregatedFeedContentClient aggregatedClient, int age) { if (ReleaseUtil.isPreBetaRelease() && isEnabled() && AccountUtil.isLoggedIn() && WikipediaApp.getInstance().isOnline()) { List<InvokeSource> unlockedTypes = getUnlockedEditingPrivileges(); if (unlockedTypes.size() > 0) { return new SuggestedEditsFeedClient(unlockedTypes.get(age % unlockedTypes.size())); } } return null; } }; List<InvokeSource> getUnlockedEditingPrivileges() { List<InvokeSource> unlockedTypes = new ArrayList<>(); if (Prefs.isSuggestedEditsAddDescriptionsUnlocked()) { unlockedTypes.add(FEED_CARD_SUGGESTED_EDITS_ADD_DESC); } if (Prefs.isSuggestedEditsTranslateDescriptionsUnlocked()) { unlockedTypes.add(FEED_CARD_SUGGESTED_EDITS_TRANSLATE_DESC); } if (Prefs.isSuggestedEditsAddCaptionsUnlocked()) { unlockedTypes.add(FEED_CARD_SUGGESTED_EDITS_IMAGE_CAPTION); } if (Prefs.isSuggestedEditsTranslateCaptionsUnlocked()) { unlockedTypes.add(FEED_CARD_SUGGESTED_EDITS_TRANSLATE_IMAGE_CAPTION); } return unlockedTypes; } private static final EnumCodeMap<FeedContentType> MAP = new EnumCodeMap<>(FeedContentType.class); private final int code; @StringRes private final int titleId; @StringRes private final int subtitleId; private int order; private boolean enabled = true; private boolean perLanguage; private boolean showInConfig = true; private List<String> langCodesSupported = new ArrayList<>(); private List<String> langCodesDisabled = new ArrayList<>(); @NonNull public static FeedContentType of(int code) { return MAP.get(code); } @Nullable public abstract FeedClient newClient(AggregatedFeedContentClient aggregatedClient, int age); @Override public int code() { return code; } @StringRes public int titleId() { return titleId; } @StringRes public int subtitleId() { return subtitleId; } public boolean isEnabled() { return enabled; } public boolean showInConfig() { return showInConfig; } public void setEnabled(boolean enabled) { this.enabled = enabled; } public Integer getOrder() { return order; } public void setOrder(int order) { this.order = order; } public boolean isPerLanguage() { return perLanguage; } public List<String> getLangCodesSupported() { return langCodesSupported; } public List<String> getLangCodesDisabled() { return langCodesDisabled; } FeedContentType(int code, @StringRes int titleId, @StringRes int subtitleId, boolean perLanguage) { this.code = code; this.order = code; this.titleId = titleId; this.subtitleId = subtitleId; this.perLanguage = perLanguage; } FeedContentType(int code, @StringRes int titleId, @StringRes int subtitleId, boolean perLanguage, boolean showInConfig) { this(code, titleId, subtitleId, perLanguage); this.showInConfig = showInConfig; } public static List<String> getAggregatedLanguages() { List<String> appLangCodes = WikipediaApp.getInstance().language().getAppLanguageCodes(); List<String> list = new ArrayList<>(); for (int i = 0; i < FeedContentType.values().length; i++) { FeedContentType type = FeedContentType.values()[i]; if (!type.isEnabled()) { continue; } for (String appLangCode : appLangCodes) { if ((type.getLangCodesSupported().isEmpty() || type.getLangCodesSupported().contains(appLangCode)) && !type.getLangCodesDisabled().contains(appLangCode) && !list.contains(appLangCode)) { list.add(appLangCode); } } } return list; } public static void saveState() { List<Boolean> enabledList = new ArrayList<>(); List<Integer> orderList = new ArrayList<>(); Map<Integer, List<String>> langSupportedMap = new HashMap<>(); Map<Integer, List<String>> langDisabledMap = new HashMap<>(); for (int i = 0; i < FeedContentType.values().length; i++) { FeedContentType type = FeedContentType.values()[i]; enabledList.add(type.isEnabled()); orderList.add(type.getOrder()); langSupportedMap.put(type.code, type.langCodesSupported); langDisabledMap.put(type.code, type.langCodesDisabled); } Prefs.setFeedCardsEnabled(enabledList); Prefs.setFeedCardsOrder(orderList); Prefs.setFeedCardsLangSupported(langSupportedMap); Prefs.setFeedCardsLangDisabled(langDisabledMap); } public static void restoreState() { List<Boolean> enabledList = Prefs.getFeedCardsEnabled(); List<Integer> orderList = Prefs.getFeedCardsOrder(); Map<Integer, List<String>> langSupportedMap = Prefs.getFeedCardsLangSupported(); Map<Integer, List<String>> langDisabledMap = Prefs.getFeedCardsLangDisabled(); for (int i = 0; i < FeedContentType.values().length; i++) { FeedContentType type = FeedContentType.values()[i]; type.setEnabled(i < enabledList.size() ? enabledList.get(i) : true); type.setOrder(i < orderList.size() ? orderList.get(i) : i); type.langCodesSupported.clear(); if (langSupportedMap.containsKey(type.code)) { type.langCodesSupported.addAll(langSupportedMap.get(type.code)); } type.langCodesDisabled.clear(); if (langDisabledMap.containsKey(type.code)) { type.langCodesDisabled.addAll(langDisabledMap.get(type.code)); } } } }