X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.impl%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fimpl%2Fquery%2FListenerEntry.java;h=9668c0d1dfc47af0ca57dec06d5e464ef5ec44c2;hp=31621291a6c08f625579a459c399692cf18e12d8;hb=ae2e31aa5eb35410e5b2ce222d42421154f3fecc;hpb=969bd23cab98a79ca9101af33334000879fb60c5 diff --git a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/ListenerEntry.java b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/ListenerEntry.java index 31621291a..9668c0d1d 100644 --- a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/ListenerEntry.java +++ b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/ListenerEntry.java @@ -1,76 +1,76 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.db.impl.query; - -import org.simantics.db.procedure.ListenerBase; - -class ListenerEntry { - - public static final Object NO_VALUE = new Object() { - - public String toString() { return "NO_VALUE"; }; - - }; - public static final Object NOT_CHANGED = new Object() { - - public String toString() { return "NOT_CHANGED"; }; - - }; - - public ListenerBase base; - public Object procedure; - public CacheEntry entry; - - private Object lastKnownResult; - - public ListenerEntry(CacheEntry entry, ListenerBase base, Object procedure) { - this.entry = entry; - this.base = base; - this.procedure = procedure; - if(entry.isReady()) { - this.lastKnownResult = entry.getResult(); - } else { - this.lastKnownResult = NO_VALUE; - } - } - - public void setLastKnown(Object object) { - lastKnownResult = object; - } - - public Object getLastKnown() { - return lastKnownResult; - } - - @Override - public String toString() { -// return "[ListenerEntry last = " + lastKnownResult + ", procedure = " + procedure + "]"; - return "[ListenerEntry " + ", procedure = " + procedure + " base=" + base + "]"; - } - - @Override - public int hashCode() { - return base.hashCode(); - } - - @Override - public boolean equals(Object obj) { - - if(obj == this) return true; - if(obj == null) return false; - if(obj.getClass() != this.getClass()) return false; - ListenerEntry other = (ListenerEntry)obj; - return base.equals(other.base); - - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.db.impl.query; + +import org.simantics.db.procedure.ListenerBase; + +class ListenerEntry { + + public static final Object NO_VALUE = new Object() { + + public String toString() { return "NO_VALUE"; }; + + }; + public static final Object NOT_CHANGED = new Object() { + + public String toString() { return "NOT_CHANGED"; }; + + }; + + public ListenerBase base; + public Object procedure; + public CacheEntry entry; + + private Object lastKnownResult; + + public ListenerEntry(CacheEntry entry, ListenerBase base, Object procedure) { + this.entry = entry; + this.base = base; + this.procedure = procedure; + if(entry.isReady()) { + this.lastKnownResult = entry.getResult(); + } else { + this.lastKnownResult = NO_VALUE; + } + } + + public void setLastKnown(Object object) { + lastKnownResult = object; + } + + public Object getLastKnown() { + return lastKnownResult; + } + + @Override + public String toString() { +// return "[ListenerEntry last = " + lastKnownResult + ", procedure = " + procedure + "]"; + return "[ListenerEntry " + ", procedure = " + procedure + " base=" + base + "]"; + } + + @Override + public int hashCode() { + return base.hashCode(); + } + + @Override + public boolean equals(Object obj) { + + if(obj == this) return true; + if(obj == null) return false; + if(obj.getClass() != this.getClass()) return false; + ListenerEntry other = (ListenerEntry)obj; + return base.equals(other.base); + + } + +}