Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// This Source Code is in the Public Domain per: http://litesoft.org/License.txt
package org.litesoft.servlets.iphone;

import org.litesoft.commonfoundation.typeutils.*;

import java.util.*;

public final class TableFilters
{
    private String mNotOfTypesCombined = "";
    private Set<String> mNotOfTypesSet = new HashSet<String>();

    public TableFilters( String pNotOfTypesCombined )
    {
        String s = Strings.deNull( pNotOfTypesCombined ).trim();
        for ( int at; -1 != (at = s.lastIndexOf( '!' )); )
        {
            String zFilter = s.substring( at + 1 ).trim();
            if ( zFilter.length() != 0 )
            {
                if ( mNotOfTypesSet.add( zFilter ) )
                {
                    mNotOfTypesCombined = "!" + zFilter + mNotOfTypesCombined;
                }
            }
            s = s.substring( 0, at ).trim();
        }
    }

    public String getNotOfTypesCombined()
    {
        return mNotOfTypesCombined;
    }

    public boolean allowType( String pType )
    {
        return !mNotOfTypesSet.contains( pType );
    }

    @Override
    public boolean equals( Object o )
    {
        return (this == o) || ((o instanceof TableFilters) && equals( (TableFilters) o ));
    }

    public boolean equals( TableFilters them )
    {
        return (this == them) || this.mNotOfTypesSet.equals( them.mNotOfTypesSet );
    }

    @Override
    public int hashCode()
    {
        return mNotOfTypesSet.hashCode();
    }
}

Commits for litesoft/trunk/Java/core/Server/src/org/litesoft/servlets/iphone/TableFilters.java

Diff revisions: vs.
Revision Author Commited Message
939 Diff Diff GeorgeS picture GeorgeS Mon 02 Jun, 2014 21:30:31 +0000

Extracting commonfoundation

802 Diff Diff GeorgeS picture GeorgeS Wed 15 Aug, 2012 04:04:47 +0000
151 Diff Diff GeorgeS picture GeorgeS Thu 17 Mar, 2011 04:16:22 +0000
49 Diff Diff GeorgeS picture GeorgeS Mon 12 Apr, 2010 02:59:10 +0000

License Text

2 GeorgeS picture GeorgeS Sun 07 Feb, 2010 12:50:58 +0000