Android Open Source - GoCats Libcats






From Project

Back to project page GoCats.

License

The source code is released under:

Apache License

If you think the Android project GoCats listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

// Java Package libcats is a proxy for talking to a Go program.
//   gobind -lang=java github.com/ChrisSmith/libcats
////w  w  w .  java 2  s .  co m
// File is generated by gobind. Do not edit.
package go.libcats;

import go.Seq;

public abstract class Libcats {
    private Libcats() {} // uninstantiable
    
    public static final class CallbackToken implements go.Seq.Object {
        private static final String DESCRIPTOR = "go.libcats.CallbackToken";
        private static final int CALL_Close = 0x00c;
        private static final int CALL_LoadNextBatch = 0x10c;
        
        private go.Seq.Ref ref;
        
        private CallbackToken(go.Seq.Ref ref) { this.ref = ref; }
        
        public go.Seq.Ref ref() { return ref; }
        
        public void call(int code, go.Seq in, go.Seq out) {
            throw new RuntimeException("internal error: cycle: cannot call concrete proxy");
        }
        
        
        public void Close() {
            go.Seq _in = new go.Seq();
            go.Seq _out = new go.Seq();
            _in.writeRef(ref);
            Seq.send(DESCRIPTOR, CALL_Close, _in, _out);
        }
        
        public void LoadNextBatch() {
            go.Seq _in = new go.Seq();
            go.Seq _out = new go.Seq();
            _in.writeRef(ref);
            Seq.send(DESCRIPTOR, CALL_LoadNextBatch, _in, _out);
        }
        
        @Override public boolean equals(Object o) {
            if (o == null || !(o instanceof CallbackToken)) {
                return false;
            }
            CallbackToken that = (CallbackToken)o;
            return true;
        }
        
        @Override public int hashCode() {
            return java.util.Arrays.hashCode(new Object[] {});
        }
        
        @Override public String toString() {
            StringBuilder b = new StringBuilder();
            b.append("CallbackToken").append("{");
            return b.append("}").toString();
        }
        
    }
    
    public static ImageCallbackToken CreateImageCallback(ImageCallback callback, long width, long height, String id, String url) {
        go.Seq _in = new go.Seq();
        go.Seq _out = new go.Seq();
        ImageCallbackToken _result;
        _in.writeRef(callback.ref());
        _in.writeInt(width);
        _in.writeInt(height);
        _in.writeUTF16(id);
        _in.writeUTF16(url);
        Seq.send(DESCRIPTOR, CALL_CreateImageCallback, _in, _out);
        _result = new ImageCallbackToken(_out.readRef());
        return _result;
    }
    
    public static CallbackToken CreateMetaDataCallback(MetaDataCallback callback, String lastPost) {
        go.Seq _in = new go.Seq();
        go.Seq _out = new go.Seq();
        CallbackToken _result;
        _in.writeRef(callback.ref());
        _in.writeUTF16(lastPost);
        Seq.send(DESCRIPTOR, CALL_CreateMetaDataCallback, _in, _out);
        _result = new CallbackToken(_out.readRef());
        return _result;
    }
    
    public static void DisableDebugLogging() {
        go.Seq _in = new go.Seq();
        go.Seq _out = new go.Seq();
        Seq.send(DESCRIPTOR, CALL_DisableDebugLogging, _in, _out);
    }
    
    public static void DisableImageDecoding() {
        go.Seq _in = new go.Seq();
        go.Seq _out = new go.Seq();
        Seq.send(DESCRIPTOR, CALL_DisableImageDecoding, _in, _out);
    }
    
    public interface ImageCallback extends go.Seq.Object {
        public void ImageFailed(String id);
        
        public void ImageReceived(byte[] image, String id);
        
        public void RawImageReceived(byte[] image, String id);
        
        public static abstract class Stub implements ImageCallback {
            static final String DESCRIPTOR = "go.libcats.ImageCallback";
            
            private final go.Seq.Ref ref;
            public Stub() {
                ref = go.Seq.createRef(this);
            }
            
            public go.Seq.Ref ref() { return ref; }
            
            public void call(int code, go.Seq in, go.Seq out) {
                switch (code) {
                case Proxy.CALL_ImageFailed: {
                    String param_id = in.readUTF16();
                    this.ImageFailed(param_id);
                    return;
                }
                case Proxy.CALL_ImageReceived: {
                    byte[] param_image = in.readByteArray();
                    String param_id = in.readUTF16();
                    this.ImageReceived(param_image, param_id);
                    return;
                }
                case Proxy.CALL_RawImageReceived: {
                    byte[] param_image = in.readByteArray();
                    String param_id = in.readUTF16();
                    this.RawImageReceived(param_image, param_id);
                    return;
                }
                default:
                    throw new RuntimeException("unknown code: "+ code);
                }
            }
        }
        
        static final class Proxy implements ImageCallback {
            static final String DESCRIPTOR = Stub.DESCRIPTOR;
        
            private go.Seq.Ref ref;
        
            Proxy(go.Seq.Ref ref) { this.ref = ref; }
        
            public go.Seq.Ref ref() { return ref; }
        
            public void call(int code, go.Seq in, go.Seq out) {
                throw new RuntimeException("cycle: cannot call proxy");
            }
        
            public void ImageFailed(String id) {
                go.Seq _in = new go.Seq();
                go.Seq _out = new go.Seq();
                _in.writeRef(ref);
                _in.writeUTF16(id);
                Seq.send(DESCRIPTOR, CALL_ImageFailed, _in, _out);
            }
            
            public void ImageReceived(byte[] image, String id) {
                go.Seq _in = new go.Seq();
                go.Seq _out = new go.Seq();
                _in.writeRef(ref);
                _in.writeByteArray(image);
                _in.writeUTF16(id);
                Seq.send(DESCRIPTOR, CALL_ImageReceived, _in, _out);
            }
            
            public void RawImageReceived(byte[] image, String id) {
                go.Seq _in = new go.Seq();
                go.Seq _out = new go.Seq();
                _in.writeRef(ref);
                _in.writeByteArray(image);
                _in.writeUTF16(id);
                Seq.send(DESCRIPTOR, CALL_RawImageReceived, _in, _out);
            }
            
            static final int CALL_ImageFailed = 0x10a;
            static final int CALL_ImageReceived = 0x20a;
            static final int CALL_RawImageReceived = 0x30a;
        }
    }
    
    public static final class ImageCallbackToken implements go.Seq.Object {
        private static final String DESCRIPTOR = "go.libcats.ImageCallbackToken";
        private static final int CALL_Close = 0x00c;
        
        private go.Seq.Ref ref;
        
        private ImageCallbackToken(go.Seq.Ref ref) { this.ref = ref; }
        
        public go.Seq.Ref ref() { return ref; }
        
        public void call(int code, go.Seq in, go.Seq out) {
            throw new RuntimeException("internal error: cycle: cannot call concrete proxy");
        }
        
        
        public void Close() {
            go.Seq _in = new go.Seq();
            go.Seq _out = new go.Seq();
            _in.writeRef(ref);
            Seq.send(DESCRIPTOR, CALL_Close, _in, _out);
        }
        
        @Override public boolean equals(Object o) {
            if (o == null || !(o instanceof ImageCallbackToken)) {
                return false;
            }
            ImageCallbackToken that = (ImageCallbackToken)o;
            return true;
        }
        
        @Override public int hashCode() {
            return java.util.Arrays.hashCode(new Object[] {});
        }
        
        @Override public String toString() {
            StringBuilder b = new StringBuilder();
            b.append("ImageCallbackToken").append("{");
            return b.append("}").toString();
        }
        
    }
    
    public static final class ImageInfo implements go.Seq.Object {
        private static final String DESCRIPTOR = "go.libcats.ImageInfo";
        private static final int FIELD_Id_GET = 0x00f;
        private static final int FIELD_Id_SET = 0x01f;
        private static final int FIELD_Image_GET = 0x10f;
        private static final int FIELD_Image_SET = 0x11f;
        
        private go.Seq.Ref ref;
        
        private ImageInfo(go.Seq.Ref ref) { this.ref = ref; }
        
        public go.Seq.Ref ref() { return ref; }
        
        public void call(int code, go.Seq in, go.Seq out) {
            throw new RuntimeException("internal error: cycle: cannot call concrete proxy");
        }
        
        public String getId() {
            Seq in = new Seq();
            Seq out = new Seq();
            in.writeRef(ref);
            Seq.send(DESCRIPTOR, FIELD_Id_GET, in, out);
            return out.readUTF16();
        }
        
        public void setId(String v) {
            Seq in = new Seq();
            Seq out = new Seq();
            in.writeRef(ref);
            in.writeUTF16(v);
            Seq.send(DESCRIPTOR, FIELD_Id_SET, in, out);
        }
        public byte[] getImage() {
            Seq in = new Seq();
            Seq out = new Seq();
            in.writeRef(ref);
            Seq.send(DESCRIPTOR, FIELD_Image_GET, in, out);
            return out.readByteArray();
        }
        
        public void setImage(byte[] v) {
            Seq in = new Seq();
            Seq out = new Seq();
            in.writeRef(ref);
            in.writeByteArray(v);
            Seq.send(DESCRIPTOR, FIELD_Image_SET, in, out);
        }
        
        @Override public boolean equals(Object o) {
            if (o == null || !(o instanceof ImageInfo)) {
                return false;
            }
            ImageInfo that = (ImageInfo)o;
            String thisId = getId();
            String thatId = that.getId();
            if (thisId == null) {
                if (thatId != null) {
                    return false;
                }
            } else if (!thisId.equals(thatId)) {
                return false;
            }
            byte[] thisImage = getImage();
            byte[] thatImage = that.getImage();
            if (thisImage == null) {
                if (thatImage != null) {
                    return false;
                }
            } else if (!thisImage.equals(thatImage)) {
                return false;
            }
            return true;
        }
        
        @Override public int hashCode() {
            return java.util.Arrays.hashCode(new Object[] {getId(), getImage()});
        }
        
        @Override public String toString() {
            StringBuilder b = new StringBuilder();
            b.append("ImageInfo").append("{");
            b.append("Id:").append(getId()).append(",");
            b.append("Image:").append(getImage()).append(",");
            return b.append("}").toString();
        }
        
    }
    
    public static final class ImageMetaData implements go.Seq.Object {
        private static final String DESCRIPTOR = "go.libcats.ImageMetaData";
        private static final int FIELD_Url_GET = 0x00f;
        private static final int FIELD_Url_SET = 0x01f;
        private static final int FIELD_Title_GET = 0x10f;
        private static final int FIELD_Title_SET = 0x11f;
        private static final int FIELD_Author_GET = 0x20f;
        private static final int FIELD_Author_SET = 0x21f;
        private static final int FIELD_Permalink_GET = 0x30f;
        private static final int FIELD_Permalink_SET = 0x31f;
        private static final int FIELD_Id_GET = 0x40f;
        private static final int FIELD_Id_SET = 0x41f;
        
        private go.Seq.Ref ref;
        
        private ImageMetaData(go.Seq.Ref ref) { this.ref = ref; }
        
        public go.Seq.Ref ref() { return ref; }
        
        public void call(int code, go.Seq in, go.Seq out) {
            throw new RuntimeException("internal error: cycle: cannot call concrete proxy");
        }
        
        public String getUrl() {
            Seq in = new Seq();
            Seq out = new Seq();
            in.writeRef(ref);
            Seq.send(DESCRIPTOR, FIELD_Url_GET, in, out);
            return out.readUTF16();
        }
        
        public void setUrl(String v) {
            Seq in = new Seq();
            Seq out = new Seq();
            in.writeRef(ref);
            in.writeUTF16(v);
            Seq.send(DESCRIPTOR, FIELD_Url_SET, in, out);
        }
        public String getTitle() {
            Seq in = new Seq();
            Seq out = new Seq();
            in.writeRef(ref);
            Seq.send(DESCRIPTOR, FIELD_Title_GET, in, out);
            return out.readUTF16();
        }
        
        public void setTitle(String v) {
            Seq in = new Seq();
            Seq out = new Seq();
            in.writeRef(ref);
            in.writeUTF16(v);
            Seq.send(DESCRIPTOR, FIELD_Title_SET, in, out);
        }
        public String getAuthor() {
            Seq in = new Seq();
            Seq out = new Seq();
            in.writeRef(ref);
            Seq.send(DESCRIPTOR, FIELD_Author_GET, in, out);
            return out.readUTF16();
        }
        
        public void setAuthor(String v) {
            Seq in = new Seq();
            Seq out = new Seq();
            in.writeRef(ref);
            in.writeUTF16(v);
            Seq.send(DESCRIPTOR, FIELD_Author_SET, in, out);
        }
        public String getPermalink() {
            Seq in = new Seq();
            Seq out = new Seq();
            in.writeRef(ref);
            Seq.send(DESCRIPTOR, FIELD_Permalink_GET, in, out);
            return out.readUTF16();
        }
        
        public void setPermalink(String v) {
            Seq in = new Seq();
            Seq out = new Seq();
            in.writeRef(ref);
            in.writeUTF16(v);
            Seq.send(DESCRIPTOR, FIELD_Permalink_SET, in, out);
        }
        public String getId() {
            Seq in = new Seq();
            Seq out = new Seq();
            in.writeRef(ref);
            Seq.send(DESCRIPTOR, FIELD_Id_GET, in, out);
            return out.readUTF16();
        }
        
        public void setId(String v) {
            Seq in = new Seq();
            Seq out = new Seq();
            in.writeRef(ref);
            in.writeUTF16(v);
            Seq.send(DESCRIPTOR, FIELD_Id_SET, in, out);
        }
        
        @Override public boolean equals(Object o) {
            if (o == null || !(o instanceof ImageMetaData)) {
                return false;
            }
            ImageMetaData that = (ImageMetaData)o;
            String thisUrl = getUrl();
            String thatUrl = that.getUrl();
            if (thisUrl == null) {
                if (thatUrl != null) {
                    return false;
                }
            } else if (!thisUrl.equals(thatUrl)) {
                return false;
            }
            String thisTitle = getTitle();
            String thatTitle = that.getTitle();
            if (thisTitle == null) {
                if (thatTitle != null) {
                    return false;
                }
            } else if (!thisTitle.equals(thatTitle)) {
                return false;
            }
            String thisAuthor = getAuthor();
            String thatAuthor = that.getAuthor();
            if (thisAuthor == null) {
                if (thatAuthor != null) {
                    return false;
                }
            } else if (!thisAuthor.equals(thatAuthor)) {
                return false;
            }
            String thisPermalink = getPermalink();
            String thatPermalink = that.getPermalink();
            if (thisPermalink == null) {
                if (thatPermalink != null) {
                    return false;
                }
            } else if (!thisPermalink.equals(thatPermalink)) {
                return false;
            }
            String thisId = getId();
            String thatId = that.getId();
            if (thisId == null) {
                if (thatId != null) {
                    return false;
                }
            } else if (!thisId.equals(thatId)) {
                return false;
            }
            return true;
        }
        
        @Override public int hashCode() {
            return java.util.Arrays.hashCode(new Object[] {getUrl(), getTitle(), getAuthor(), getPermalink(), getId()});
        }
        
        @Override public String toString() {
            StringBuilder b = new StringBuilder();
            b.append("ImageMetaData").append("{");
            b.append("Url:").append(getUrl()).append(",");
            b.append("Title:").append(getTitle()).append(",");
            b.append("Author:").append(getAuthor()).append(",");
            b.append("Permalink:").append(getPermalink()).append(",");
            b.append("Id:").append(getId()).append(",");
            return b.append("}").toString();
        }
        
    }
    
    public static void Init(String cachePath) {
        go.Seq _in = new go.Seq();
        go.Seq _out = new go.Seq();
        _in.writeUTF16(cachePath);
        Seq.send(DESCRIPTOR, CALL_Init, _in, _out);
    }
    
    public interface MetaDataCallback extends go.Seq.Object {
        public void MetaDataReceived(String url, String title, String author, String permalink, String id);
        
        public static abstract class Stub implements MetaDataCallback {
            static final String DESCRIPTOR = "go.libcats.MetaDataCallback";
            
            private final go.Seq.Ref ref;
            public Stub() {
                ref = go.Seq.createRef(this);
            }
            
            public go.Seq.Ref ref() { return ref; }
            
            public void call(int code, go.Seq in, go.Seq out) {
                switch (code) {
                case Proxy.CALL_MetaDataReceived: {
                    String param_url = in.readUTF16();
                    String param_title = in.readUTF16();
                    String param_author = in.readUTF16();
                    String param_permalink = in.readUTF16();
                    String param_id = in.readUTF16();
                    this.MetaDataReceived(param_url, param_title, param_author, param_permalink, param_id);
                    return;
                }
                default:
                    throw new RuntimeException("unknown code: "+ code);
                }
            }
        }
        
        static final class Proxy implements MetaDataCallback {
            static final String DESCRIPTOR = Stub.DESCRIPTOR;
        
            private go.Seq.Ref ref;
        
            Proxy(go.Seq.Ref ref) { this.ref = ref; }
        
            public go.Seq.Ref ref() { return ref; }
        
            public void call(int code, go.Seq in, go.Seq out) {
                throw new RuntimeException("cycle: cannot call proxy");
            }
        
            public void MetaDataReceived(String url, String title, String author, String permalink, String id) {
                go.Seq _in = new go.Seq();
                go.Seq _out = new go.Seq();
                _in.writeRef(ref);
                _in.writeUTF16(url);
                _in.writeUTF16(title);
                _in.writeUTF16(author);
                _in.writeUTF16(permalink);
                _in.writeUTF16(id);
                Seq.send(DESCRIPTOR, CALL_MetaDataReceived, _in, _out);
            }
            
            static final int CALL_MetaDataReceived = 0x10a;
        }
    }
    
    private static final int CALL_CreateImageCallback = 1;
    private static final int CALL_CreateMetaDataCallback = 2;
    private static final int CALL_DisableDebugLogging = 3;
    private static final int CALL_DisableImageDecoding = 4;
    private static final int CALL_Init = 5;
    private static final String DESCRIPTOR = "libcats";
}




Java Source Code List

com.jakewharton.salvage.RecycleBin.java
com.jakewharton.salvage.RecyclingPagerAdapter.java
go.Go.java
go.Seq.java
go.libcats.Libcats.java
org.collegelabs.gocats.app.ApplicationTest.java
org.collegelabs.gocats.app.BaseApplication.java
org.collegelabs.gocats.app.CatPagerAdapter.java
org.collegelabs.gocats.app.CatView.java
org.collegelabs.gocats.app.ImageInfo.java
org.collegelabs.gocats.app.ImageMetaData.java
org.collegelabs.gocats.app.MainActivity.java
org.collegelabs.gocats.app.SampleActivity.java